示例#1
0
 def do_kill(self):
     if self.status == 'Alarm':
         self.app.comms.write('$X\n')
     else:
         # are you sure?
         mb = MessageBox(text='KILL - Are you Sure?', cb=self._do_kill)
         mb.open()
示例#2
0
 def ask_exit(self, restart=False):
     # are you sure?
     if restart:
         mb = MessageBox(text='Restart - Are you Sure?',
                         cb=self._do_restart)
     else:
         mb = MessageBox(text='Exit - Are you Sure?', cb=self._do_exit)
     mb.open()
    def _loaded(self, path):
        if self.failed:
            mb = MessageBox(text='File Chooser {} failed - try a different one'.format(NativeFileChooser.type_name))
            mb.open()
            return

        if path:
            dr= os.path.dirname(path)
            if self.cb:
                self.cb(path, dr)
示例#4
0
    def _load_file(self, ll):
        self._loaded_ok = False
        try:
            self.parse_gcode_file(self.app.gcode_file, ll, True)
        except Exception:
            print(traceback.format_exc())
            mb = MessageBox(
                text='File not found: {}'.format(self.app.gcode_file))
            mb.open()

        self._loaded()
示例#5
0
    def connect(self):
        if self.app.is_connected:
            if self.is_printing:
                mb = MessageBox(
                    text=
                    'Cannot Disconnect while printing - Abort first, then wait'
                )
                mb.open()
            else:
                self._disconnect()

        else:
            port = self.config.get(
                'General', 'serial_port'
            ) if not self.app.use_com_port else self.app.use_com_port
            self.add_line_to_log("Connecting to {}...".format(port))
            self.app.comms.connect(port)
示例#6
0
 def abort_print(self):
     # are you sure?
     mb = MessageBox(text='Abort - Are you Sure?',
                     cb=lambda b: self._abort_print(b))
     mb.open()
示例#7
0
 def ask_shutdown(self):
     # are you sure?
     mb = MessageBox(text='Shutdown - Are you Sure?',
                     cb=lambda b: self._do_shutdown(b))
     mb.open()
示例#8
0
 def ask_exit(self):
     # are you sure?
     mb = MessageBox(text='Exit - Are you Sure?',
                     cb=lambda b: self._do_exit(b))
     mb.open()
示例#9
0
 def reprint(self):
     # are you sure?
     mb = MessageBox(text='ReRun {}?'.format(self.app.gcode_file),
                     cb=self._reprint)
     mb.open()