Beispiel #1
0
    def __init__(self, *args, **kwds):
        # begin wxGlade: JobInfo.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
        wx.Frame.__init__(self, *args, **kwds)
        self.SetSize((500, 584))
        self.elements_listbox = wx.ListBox(self, wx.ID_ANY, choices=[], style=wx.LB_ALWAYS_SB | wx.LB_SINGLE)
        self.checkbox_autostart = wx.CheckBox(self, wx.ID_ANY, "Automatically Start")
        self.checkbox_autohome = wx.CheckBox(self, wx.ID_ANY, "Home After")
        self.checkbox_autobeep = wx.CheckBox(self, wx.ID_ANY, "Beep After")
        self.button_writer_control = wx.Button(self, wx.ID_ANY, "Start Job")
        self.button_job_spooler = wx.BitmapButton(self, wx.ID_ANY, icons8_route_50.GetBitmap())

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_LISTBOX, self.on_listbox_click, self.elements_listbox)
        self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_listbox_dclick, self.elements_listbox)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_auto_start_controller, self.checkbox_autostart)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_home_after, self.checkbox_autohome)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_beep_after, self.checkbox_autobeep)
        self.Bind(wx.EVT_BUTTON, self.on_button_start_job, self.button_writer_control)
        self.Bind(wx.EVT_BUTTON, self.on_button_job_spooler, self.button_job_spooler)
        # end wxGlade
        self.project = None

        self.Bind(wx.EVT_CLOSE, self.on_close, self)
        self.elements = None
Beispiel #2
0
 def __set_properties(self):
     _icon = wx.NullIcon
     _icon.CopyFromBitmap(icons8_route_50.GetBitmap())
     self.SetIcon(_icon)
     # begin wxGlade: JobSpooler.__set_properties
     self.SetTitle("Spooler")
     self.list_job_spool.SetToolTip(
         _("List and modify the queued operations"))
     self.list_job_spool.AppendColumn("#",
                                      format=wx.LIST_FORMAT_LEFT,
                                      width=29)
     self.list_job_spool.AppendColumn(_("Name"),
                                      format=wx.LIST_FORMAT_LEFT,
                                      width=90)
     self.list_job_spool.AppendColumn(_("Status"),
                                      format=wx.LIST_FORMAT_LEFT,
                                      width=73)
     self.list_job_spool.AppendColumn(_("Device"),
                                      format=wx.LIST_FORMAT_LEFT,
                                      width=53)
     self.list_job_spool.AppendColumn(_("Type"),
                                      format=wx.LIST_FORMAT_LEFT,
                                      width=41)
     self.list_job_spool.AppendColumn(_("Speed"),
                                      format=wx.LIST_FORMAT_LEFT,
                                      width=77)
     self.list_job_spool.AppendColumn(_("Settings"),
                                      format=wx.LIST_FORMAT_LEFT,
                                      width=82 + 70)
     self.list_job_spool.AppendColumn(_("Time Estimate"),
                                      format=wx.LIST_FORMAT_LEFT,
                                      width=123)
Beispiel #3
0
    def __init__(self, parent, ops, *args, **kwds):
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((659, 612))
        self.operations_listbox = wx.ListBox(self,
                                             wx.ID_ANY,
                                             choices=[],
                                             style=wx.LB_ALWAYS_SB
                                             | wx.LB_SINGLE)
        self.commands_listbox = wx.ListBox(self,
                                           wx.ID_ANY,
                                           choices=[],
                                           style=wx.LB_ALWAYS_SB
                                           | wx.LB_SINGLE)
        self.button_job_spooler = wx.BitmapButton(self, wx.ID_ANY,
                                                  icons8_route_50.GetBitmap())
        self.button_writer_control = wx.Button(self, wx.ID_ANY, _("Start Job"))
        self.button_writer_control.SetBitmap(icons8_laser_beam_52.GetBitmap())
        self.button_writer_control.SetFont(
            wx.Font(15, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL,
                    wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))

        # Menu Bar
        self.JobInfo_menubar = wx.MenuBar()
        wxglade_tmp_menu = wx.Menu()
        self.menu_prehome = wxglade_tmp_menu.Append(wx.ID_ANY,
                                                    _("Home Before"), "",
                                                    wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU,
                  self.on_check_home_before,
                  id=self.menu_prehome.GetId())
        self.menu_autohome = wxglade_tmp_menu.Append(wx.ID_ANY,
                                                     _("Home After"), "",
                                                     wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU,
                  self.on_check_home_after,
                  id=self.menu_autohome.GetId())

        self.menu_prephysicalhome = wxglade_tmp_menu.Append(
            wx.ID_ANY, _("Physical Home Before"), "", wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU,
                  self.on_check_physicalhome_before,
                  id=self.menu_prephysicalhome.GetId())
        self.menu_autophysicalhome = wxglade_tmp_menu.Append(
            wx.ID_ANY, _("Physical Home After"), "", wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU,
                  self.on_check_physicalhome_after,
                  id=self.menu_autophysicalhome.GetId())

        self.menu_autoorigin = wxglade_tmp_menu.Append(
            wx.ID_ANY, _("Return to Origin After"), "", wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU,
                  self.on_check_origin_after,
                  id=self.menu_autoorigin.GetId())

        self.menu_autobeep = wxglade_tmp_menu.Append(wx.ID_ANY,
                                                     _("Beep After"), "",
                                                     wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU,
                  self.on_check_beep_after,
                  id=self.menu_autobeep.GetId())
        self.JobInfo_menubar.Append(wxglade_tmp_menu, _("Automatic"))

        wxglade_tmp_menu = wx.Menu()
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Home"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_home, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Physical Home"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_physicalhome, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Wait"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_wait, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Beep"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_beep, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Interrupt"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_interrupt, id=t.GetId())
        self.JobInfo_menubar.Append(wxglade_tmp_menu, _("Add"))

        wxglade_tmp_menu = wx.Menu()
        self.menu_rapid = wxglade_tmp_menu.Append(wx.ID_ANY,
                                                  _("Rapid Between"), "",
                                                  wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU, self.on_check_rapid, id=self.menu_rapid.GetId())
        wxglade_tmp_menu.AppendSeparator()
        self.menu_jog = wxglade_tmp_menu.Append(wx.ID_ANY, _("Jog Standard"),
                                                "", wx.ITEM_RADIO)
        self.Bind(wx.EVT_MENU, self.on_check_jog, id=self.menu_jog.GetId())
        # self.menu_jog2 = wxglade_tmp_menu.Append(wx.ID_ANY, _("Jog Switch"), "", wx.ITEM_RADIO)
        # self.Bind(wx.EVT_MENU, self.on_check_jog2, id=self.menu_jog2.GetId())
        self.menu_jog3 = wxglade_tmp_menu.Append(wx.ID_ANY, _("Jog Finish"),
                                                 "", wx.ITEM_RADIO)
        self.Bind(wx.EVT_MENU, self.on_check_jog3, id=self.menu_jog3.GetId())
        self.JobInfo_menubar.Append(wxglade_tmp_menu, _("Settings"))

        wxglade_tmp_menu = wx.Menu()
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Step and Repeat"))
        self.Bind(wx.EVT_MENU, self.jobchange_step_repeat, id=t.GetId())
        self.JobInfo_menubar.Append(wxglade_tmp_menu, _("Tools"))

        self.SetMenuBar(self.JobInfo_menubar)
        # Menu Bar end

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_LISTBOX, self.on_listbox_operation_click,
                  self.operations_listbox)
        self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_listbox_operation_dclick,
                  self.operations_listbox)
        self.Bind(wx.EVT_LISTBOX, self.on_listbox_commands_click,
                  self.commands_listbox)
        self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_listbox_commands_dclick,
                  self.commands_listbox)
        self.Bind(wx.EVT_BUTTON, self.on_button_start_job,
                  self.button_writer_control)
        self.Bind(wx.EVT_BUTTON, self.on_button_job_spooler,
                  self.button_job_spooler)
        # end wxGlade

        self.Bind(wx.EVT_CLOSE, self.on_close, self)
        # OSX Window close
        if parent is not None:
            parent.accelerator_table(self)

        # Moved to elements in 0.7.0
        self.preprocessor = OperationPreprocessor()
        if not isinstance(ops, list):
            ops = [ops]
        self.operations = ops
        self._original_ops = list(ops)
Beispiel #4
0
    def __init__(self, *args, **kwds):
        # begin wxGlade: JobInfo.__init__
        kwds["style"] = kwds.get(
            "style",
            0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
        wx.Frame.__init__(self, *args, **kwds)

        self.SetSize((659, 612))
        self.operations_listbox = wx.ListBox(self,
                                             wx.ID_ANY,
                                             choices=[],
                                             style=wx.LB_ALWAYS_SB
                                             | wx.LB_SINGLE)
        self.commands_listbox = wx.ListBox(self,
                                           wx.ID_ANY,
                                           choices=[],
                                           style=wx.LB_ALWAYS_SB
                                           | wx.LB_SINGLE)
        self.button_job_spooler = wx.BitmapButton(self, wx.ID_ANY,
                                                  icons8_route_50.GetBitmap())
        self.button_writer_control = wx.Button(self, wx.ID_ANY, _("Start Job"))
        self.button_writer_control.SetBitmap(icons8_laser_beam_52.GetBitmap())
        self.button_writer_control.SetFont(
            wx.Font(15, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL,
                    wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))

        # Menu Bar
        self.JobInfo_menubar = wx.MenuBar()
        wxglade_tmp_menu = wx.Menu()
        self.menu_autostart = wxglade_tmp_menu.Append(wx.ID_ANY,
                                                      _("Start Spooler"), "",
                                                      wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU,
                  self.on_check_auto_start_controller,
                  id=self.menu_autostart.GetId())
        self.menu_autohome = wxglade_tmp_menu.Append(wx.ID_ANY,
                                                     _("Home After"), "",
                                                     wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU,
                  self.on_check_home_after,
                  id=self.menu_autohome.GetId())
        self.menu_autobeep = wxglade_tmp_menu.Append(wx.ID_ANY,
                                                     _("Beep After"), "",
                                                     wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU,
                  self.on_check_beep_after,
                  id=self.menu_autobeep.GetId())
        self.JobInfo_menubar.Append(wxglade_tmp_menu, _("Automatic"))

        wxglade_tmp_menu = wx.Menu()
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Home"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_home, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Wait"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_wait, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Beep"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_beep, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Interrupt"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_interrupt, id=t.GetId())
        self.JobInfo_menubar.Append(wxglade_tmp_menu, _("Add"))
        self.SetMenuBar(self.JobInfo_menubar)
        # Menu Bar end

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_LISTBOX, self.on_listbox_operation_click,
                  self.operations_listbox)
        self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_listbox_operation_dclick,
                  self.operations_listbox)
        self.Bind(wx.EVT_LISTBOX, self.on_listbox_commands_click,
                  self.commands_listbox)
        self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_listbox_commands_dclick,
                  self.commands_listbox)
        self.Bind(wx.EVT_BUTTON, self.on_button_start_job,
                  self.button_writer_control)
        self.Bind(wx.EVT_BUTTON, self.on_button_job_spooler,
                  self.button_job_spooler)
        # end wxGlade

        self.Bind(wx.EVT_CLOSE, self.on_close, self)

        self.preprocessor = OperationPreprocessor()
        self.kernel = None
        self.device = None
        self.operations = []