Beispiel #1
0
 def __set_properties(self):
     # begin wxGlade: JobInfo.__set_properties
     self.SetTitle("Job")
     self.elements_listbox.Enable(False)
     self.checkbox_autostart.SetValue(1)
     self.checkbox_autobeep.SetValue(1)
     self.button_writer_control.SetBackgroundColour(wx.Colour(102, 255, 102))
     self.button_writer_control.SetFont(
         wx.Font(15, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))
     self.button_writer_control.SetBitmap(icons8_laser_beam_52.GetBitmap())
     self.button_job_spooler.SetSize(self.button_job_spooler.GetBestSize())
Beispiel #2
0
    def __set_properties(self):
        _icon = wx.NullIcon
        _icon.CopyFromBitmap(icons8_laser_beam_52.GetBitmap())
        self.SetIcon(_icon)
        # begin wxGlade: JobInfo.__set_properties
        self.SetTitle("Job")
        self.operations_listbox.SetToolTip(_("operation List"))
        self.commands_listbox.SetToolTip(_("Command List"))
        self.button_writer_control.SetToolTip(_("Start the Job"))

        self.button_job_spooler.SetMinSize((50, 50))
        self.button_job_spooler.SetToolTip(_("View Spooler"))
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 = []