コード例 #1
0
    def __init__(self, parent):
        super(TemperatureMenu, self).__init__(parent)

        self.setObjectName(self.name)
        self.setFixedSize(Settings.WINDOW_SIZE[0], Settings.WINDOW_SIZE[1])

        self.parameterTool0 = DefaultParameter(self, "Tool0", 0, 0, 100, 100,
                                               "Back")
        self.parameterBed = DefaultParameter(self, "Bed", 100, 0, 100, 100,
                                             "Back")
        # self.parameterChamber = DefaultParameter(self, "Chamber", 200, 0, 100, 100, "Back")

        self.menu = DefaultButton(self, "Back", 300, 100, 100, 100, "Back",
                                  lambda: parent.ChangeMenu("MainPage"))

        self.tool0Plus = DefaultButton(
            self, "t0plus", 0, 100, 100, 100, "T0+",
            lambda: OctoPrintAPI.SetToolTemperature(
                OctoPrintAPI, OctoPrintAPI.TOOLS["tool0"].target + 5, None,
                False))
        self.tool0Minus = DefaultButton(
            self, "t0minus", 0, 200, 100, 100, "T0-",
            lambda: OctoPrintAPI.SetToolTemperature(
                OctoPrintAPI, OctoPrintAPI.TOOLS["tool0"].target - 5, None,
                False))
        self.Update()
コード例 #2
0
    def Start(self):
        OctoPrintAPI.Login(OctoPrintAPI)
        OctoPrintAPI.GetProfiles(OctoPrintAPI)
        OctoPrintAPI.LoadPresets(OctoPrintAPI)

        # OctoPrintAPI.GetSettings(OctoPrintAPI)
        self.UpdateState()
コード例 #3
0
    def UpdateState(self):
        if (not OctoPrintAPI.CheckConnection(OctoPrintAPI)
                in ["Connecting", "Close"]):
            OctoPrintAPI.GetJob(OctoPrintAPI)
        else:
            pass

        # OctoPrintAPI.GetSettings(OctoPrintAPI)
        OctoPrintAPI.GetAllFiles(OctoPrintAPI)
        OctoPrintAPI.GetProfiles(OctoPrintAPI)
        OctoPrintAPI.GetTemperaturePrinterState(OctoPrintAPI)
コード例 #4
0
    def __init__(self, parent):
        super(MovingMenu, self).__init__(parent)

        self.setObjectName(self.name)
        self.setFixedSize(Settings.WINDOW_SIZE[0], Settings.WINDOW_SIZE[1])

        self.menu = DefaultButton(self, "Back", 300, 200, 100, 100, "Back",
                                  lambda: parent.ChangeMenu("MainPage"))

        self.zPlus = DefaultButton(
            self, "Z", 300, 0, 100, 100, "Z+",
            lambda: OctoPrintAPI.SetJogPrintHead(OctoPrintAPI, 0, 0, +10))
        self.zMinus = DefaultButton(
            self, "Z", 300, 100, 100, 100, "Z-",
            lambda: OctoPrintAPI.SetJogPrintHead(OctoPrintAPI, 0, 0, -10))

        self.xMinus = DefaultButton(
            self, "X", 0, 100, 100, 100, "X-",
            lambda: OctoPrintAPI.SetJogPrintHead(OctoPrintAPI, -10, 0, 0))
        self.xPlus = DefaultButton(
            self, "X", 200, 100, 100, 100, "X+",
            lambda: OctoPrintAPI.SetJogPrintHead(OctoPrintAPI, +10, 0, 0))

        self.yPlus = DefaultButton(
            self, "Y", 100, 0, 100, 100, "Y+",
            lambda: OctoPrintAPI.SetJogPrintHead(OctoPrintAPI, 0, +10, 0))
        self.yMinus = DefaultButton(
            self, "Y", 100, 200, 100, 100, "Y-",
            lambda: OctoPrintAPI.SetJogPrintHead(OctoPrintAPI, 0, -10, 0))

        self.axesHome = DefaultButton(
            self, "H", 100, 100, 100, 100, "HOME",
            lambda: OctoPrintAPI.SetHomePrintHead(OctoPrintAPI))

        self.Update()
コード例 #5
0
    def SavePreset(self):
        try:
            t_name = self.i_name.label.text()
            t_tempBed = None if (self.i_temperatureBed.label.text() == "") else float(self.i_temperatureBed.label.text())
            t_tempT0 = None if (self.i_temperatureT0.label.text() == "") else float(self.i_temperatureT0.label.text())
            t_tempT1 = None if (self.i_temperatureT1.label.text() == "") else float(self.i_temperatureT1.label.text())

            OctoPrintAPI.CreatePreset(OctoPrintAPI, t_name, t_tempBed, t_tempT0, t_tempT1)
        except Exception as exception: print(exception)
コード例 #6
0
    def __init__(self, parent):
        super(PrintingMenu, self).__init__(parent)

        self.setObjectName(self.name)
        self.setFixedSize(Settings.WINDOW_SIZE[0], Settings.WINDOW_SIZE[1])

        self.statusBar = StaticText(
            self, 75, 200, 250, 50,
            f"[STATUS] {Settings.DYNAMIC_VARIABLES.JobStatus}")

        self.parameterTool0 = DefaultParameter(self, "Tool0", 0, 0, 100, 100,
                                               "Back")
        self.parameterBed = DefaultParameter(self, "Bed", 100, 0, 100, 100,
                                             "Back")
        self.parameterChamber = DefaultParameter(self, "Chamber", 200, 0, 100,
                                                 100, "Back")
        self.parameterProgress = DefaultParameter(self, "Progress", 200, 0,
                                                  100, 100, "Back")

        # self.progressBar = QtWidgets.QProgressBar(self)
        # self.progressBar.setGeometry(0, 260, 450, 30)

        self.menu = DefaultButton(self, "Back", 300, 100, 100, 100, "Back",
                                  lambda: parent.ChangeMenu("MainPage"))
        self.resume = DefaultButton(
            self, "Resume", 0, 100,
            100, 100, "Resume", lambda: OctoPrintAPI.SetJob(
                OctoPrintAPI, COMMANDS.PAUSE, COMMANDS.ACTION.RESUME))
        self.pause = DefaultButton(
            self, "Pause", 100, 100,
            100, 100, "Pause", lambda: OctoPrintAPI.SetJob(
                OctoPrintAPI, COMMANDS.PAUSE, COMMANDS.ACTION.PAUSE))

        self.pause = DefaultButton(
            self, "Cancel", 200, 100,
            100, 100, "Cancel", lambda: OctoPrintAPI.SetJob(
                OctoPrintAPI, COMMANDS.CANCEL, COMMANDS.ACTION.EMPTY))

        self.Update()
コード例 #7
0
 def SetPreset(self, signal):
     key = self.files.model.itemFromIndex(signal).text()
     OctoPrintAPI.SetToolTemperature(OctoPrintAPI, OctoPrintAPI.PRESETS[key].temperatureT0, OctoPrintAPI.PRESETS[key].temperatureT1, False)
コード例 #8
0
 def UpdatePreset(self):
     OctoPrintAPI.LoadPresets(OctoPrintAPI)
     self.files.SetItems(OctoPrintAPI.PRESETS.keys())
コード例 #9
0
 def GetFile(self, signal):
     file_path = self.files.model.itemFromIndex(signal).text()
     if (file_path[-5:] == "gcode"):
         OctoPrintAPI.SelectFile(OctoPrintAPI, file_path)
         self.parent().ChangeMenu("MainPage")