Пример #1
0
    def __init__(self, ui):
        CommonPanel.__init__(self, ui)
        log.debug("ControlPanel created")
        # Default to 2 rows of buttons
        self.panelH = 2
        cCount = 0

        for c in controls:
            btn = self.createControlButton(c, c['icon'])
            self.addButton(btn)
            cCount += 1

        for c in self.getCustomControls():
            if cCount >= 11:
                log.warning("More than 11 commands. Skipping...")
                break
            btn = self.createControlButton(c, "custom-script")
            self.addButton(btn)
            cCount += 1

        for c in self.getCommands():
            if cCount >= 10:
                log.warning("More than 11 commands. Skipping...")
                break
            btn = self.createCommandButton(c, "custom-script")
            self.addButton(btn)
            cCount += 1

        if cCount > 7:
            self.panelH = 3

        self.arrangeButtons()
Пример #2
0
    def __init__(self, ui):
        CommonPanel.__init__(self, ui)
        log.debug("ExtrudePanel created")
        self.panelH = 2

        self.toolImages = {}
        self.ttempData = {}
        self.last = ''
        self.bkgnd = BackgroundTask("extruder_update", 5, self.updateTemp, ui)

        self.g.attach(self.createExtrudeButton("Extrude", "extrude", 1), 0, 0,
                      1, 1)
        self.g.attach(self.createExtrudeButton("Retract", "retract", -1), 3, 0,
                      1, 1)

        self.toolData = Gtk.Box(orientation=Gtk.Orientation.VERTICAL,
                                spacing=5)
        self.toolData.set_valign(Gtk.Align.CENTER)
        self.toolData.set_halign(Gtk.Align.CENTER)
        self.g.attach(self.toolData, 1, 0, 2, 1)

        self.amount = createStepButton("move-step.svg", [("1mm", 1),
                                                         ("5mm", 5),
                                                         ("10mm", 10)])
        self.g.attach(self.amount.b, 1, 1, 1, 1)
        txt = getTemperatureText(self.ui.config.width)
        self.g.attach(
            ButtonImageScaled(txt, "heat-up.svg", IMAGE_SIZE_NORMAL,
                              self.showTemperature), 2, 1, 1, 1)
        self.g.attach(self.createToolButton(), 0, 1, 1, 1)

        self.arrangeButtons()
Пример #3
0
    def __init__(self, ui):
        CommonPanel.__init__(self, ui)
        log.debug("TemperaturePanel created")
        self.panelH = 2
        self.bkgnd = BackgroundTask("tools_update", 1, self.updateToolData, ui)

        self.g.attach(self.createChangeButton("Increase", "increase.svg", 1),
                      0, 0, 1, 1)
        self.g.attach(self.createChangeButton("Decrease", "decrease.svg", -1),
                      3, 0, 1, 1)

        self.toolImages = {}
        self.ttempData = {}
        self.g.attach(self.createToolButton(), 0, 1, 1, 1)

        self.load = ButtonImageScaled("Load", "extrude.svg", IMAGE_SIZE_NORMAL,
                                      self.doLoadFilament)
        self.g.attach(self.load, 1, 1, 1, 1)
        self.unload = ButtonImageScaled("Unload", "retract.svg",
                                        IMAGE_SIZE_NORMAL,
                                        self.doUnloadFilament)
        self.g.attach(self.unload, 2, 1, 1, 1)

        self.amount = createStepButton("move-step.svg", [("10°C", 10.0),
                                                         ("5°C", 5.0),
                                                         ("1°C", 1.0)])
        self.g.attach(self.amount.b, 1, 0, 1, 1)
        self.g.attach(
            ButtonImageScaled("Presets", "heat-up.svg", IMAGE_SIZE_NORMAL,
                              self.showProfile), 2, 0, 1, 1)

        self.arrangeButtons()
Пример #4
0
 def __init__(self, ui, tempPanel):
     CommonPanel.__init__(self, ui)
     log.debug("ProfilePanel created")
     self.tp = tempPanel
     self.panelH = 2
     self.loadProfiles()
     self.arrangeButtons()
Пример #5
0
    def __init__(self, ui):
        CommonPanel.__init__(self, ui)
        log.debug("HomePanel created")
        self.panelH = 2

        self.addButton(
            self.createMoveButton("Home All", "home.svg", {"x", "y", "z"}))
        self.addButton(self.createMoveButton("Home X", "home-x.svg", "x"))
        self.addButton(self.createMoveButton("Home Y", "home-y.svg", "y"))
        self.addButton(self.createMoveButton("Home Z", "home-z.svg", "z"))

        self.arrangeButtons()
Пример #6
0
    def __init__(self, ui):
        CommonPanel.__init__(self, ui)
        log.debug("FanPanel created")

        self.panelH = 2

        self.g.attach(self.createFanButton(100), 0, 0, 1, 1)
        self.g.attach(self.createFanButton(75), 1, 0, 1, 1)
        self.g.attach(self.createFanButton(50), 2, 0, 1, 1)
        self.g.attach(self.createFanButton(25), 3, 0, 1, 1)
        self.g.attach(self.createFanButton(0), 0, 1, 1, 1)

        self.arrangeButtons()
Пример #7
0
    def __init__(self, ui):
        CommonPanel.__init__(self, ui)
        log.debug("SystemPanel created")

        g = Gtk.Grid()
        g.set_column_homogeneous(True)

        g.attach(self.createOctoPrintInfo(), 0, 0, 2, 1)
        g.attach(self.createVersionInfo(), 2, 0, 2, 1)
        if self.ui.config.width >= 480:
            g.attach(self.createSystemInfo(), 0, 1, 4, 1)

        box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
        box.add(g)
        box.add(self.createActionBar())

        self.g.add(box)
Пример #8
0
    def __init__(self, ui):
        CommonPanel.__init__(self, ui)
        log.debug("PrintStatusPanel created")

        self.bkgnd = BackgroundTask("print_status", 1, self.update, ui)

        self.g.attach(self.createInfoBox(), 1, 0, 3, 1)
        self.g.attach(self.createProgressBar(), 1, 1, 3, 1)
        self.g.attach(self.createPauseButton(), 1, 2, 1, 1)
        self.g.attach(self.createStopButton(), 2, 2, 1, 1)
        self.g.attach(self.createMenuButton(), 3, 2, 1, 1)
        self.g.attach(self.createCompleteButton(), 1, 2, 3, 1)

        self.showTools()

        self.arrangeButtons(False)
        self.printerStatus = None
Пример #9
0
    def __init__(self, ui):
        CommonPanel.__init__(self, ui)
        log.debug("FilesPanel created")

        self.location = locationHistory(['local'])
        self.list = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
        self.list.set_vexpand(True)

        sw = Gtk.ScrolledWindow()
        sw.add(self.list)

        box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
        box.add(sw)
        box.add(self.createActionBar())
        self.g.add(box)

        self.doLoadFiles()
Пример #10
0
    def __init__(self, ui):
        CommonPanel.__init__(self, ui)
        log.debug("MovePanel created")

        self.g.attach(self.createMoveButton("X-", "move-x-.svg", 'x', -1), 0, 1, 1, 1)
        self.g.attach(self.createMoveButton("X+", "move-x+.svg", 'x', 1), 2, 1, 1, 1)
        self.g.attach(self.createMoveButton("Y+", "move-y+.svg", 'y', 1), 1, 0, 1, 1)
        self.g.attach(self.createMoveButton("Y-", "move-y-.svg", 'y', -1), 1, 2, 1, 1)

        self.g.attach(self.createMoveButton("Z+", "move-z-.svg", 'z', 1), 3, 0, 1, 1)
        self.g.attach(self.createMoveButton("Z-", "move-z+.svg", 'z', -1), 3, 1, 1, 1)

        self.step = createStepButton("move-step.svg",
                               [("10mm", 10.0), ("1mm", 1.0), ("0.1mm", 0.1), ("0.02mm", 0.02)])

        self.g.attach(self.step.b, 2, 2, 1, 1)
        self.g.attach(self.createHomeButton(), 0, 2, 1, 1)

        self.arrangeButtons()
Пример #11
0
    def __init__(self, ui):
        CommonPanel.__init__(self, ui)
        log.debug("PrintMenuPanel created")
        self.panelH = 2

        self.g.attach(ButtonImageStyle("Fan", "fan.svg", "color2", self.showFan), 0, 0, 1, 1)
        self.frb = createStepButton("speed-step.svg",
                                    [("Slow", 75), ("Normal", 100), ("Fast", 125)], self.changeFlowrate)
        ctx = self.frb.b.get_style_context()
        ctx.add_class("color1")

        self.g.attach(self.frb.b, 1, 0, 1, 1)

        txt = getTemperatureText(self.ui.config.width)
        self.g.attach(ButtonImageStyle(txt, "heat-up.svg", "color4", self.showTemperature), 2, 0, 1, 1)
        self.g.attach(ButtonImageStyle("Extrude", "filament.svg", "color3", self.showExtrude), 3, 0, 1, 1)
        self.g.attach(ButtonImageStyle("Move", "move.svg", "color4", self.showMove), 0, 1, 1, 1)

        self.arrangeButtons()
Пример #12
0
    def __init__(self, ui):
        CommonPanel.__init__(self, ui)
        logo = ImageFromFileScaled("logo-octoprint.png")

        self.label = FmtLabel("...")
        self.label.set_hexpand(True)
        self.label.set_line_wrap_mode(True)
        self.label.set_max_width_chars(30)
        self.label.set_text("Initializing printer...")

        main = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=15)
        main.set_valign(Gtk.Align.END)
        main.set_vexpand(True)
        main.set_hexpand(True)

        main.add(logo)
        main.add(self.label)

        box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
        box.add(main)
        box.add(self.createActionBar())

        self.g.add(box)
Пример #13
0
    def __init__(self, ui, items):
        CommonPanel.__init__(self, ui)
        self.panelH = int(1 + len(items) / 4)

        self.arrangeMenuItems(self.g, items, 4)
        self.arrangeButtons()