Ejemplo n.º 1
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: BufferView.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((697, 584))
        self.text_buffer_length = wx.TextCtrl(self, wx.ID_ANY, "")
        self.text_buffer_info = wx.TextCtrl(self,
                                            wx.ID_ANY,
                                            "",
                                            style=wx.TE_CHARWRAP
                                            | wx.TE_MULTILINE)

        # Menu Bar
        self.BufferView_menubar = wx.MenuBar()
        wxglade_tmp_menu = wx.Menu()
        item = wxglade_tmp_menu.Append(wx.ID_ANY, "Export EGV",
                                       "Export Engrave Data")
        self.Bind(wx.EVT_MENU, self.on_menu_export, id=item.GetId())
        item = wxglade_tmp_menu.Append(wx.ID_ANY, "Import EGV",
                                       "Import Engrave Data")
        self.Bind(wx.EVT_MENU, self.on_menu_import, id=item.GetId())
        self.BufferView_menubar.Append(wxglade_tmp_menu, "File")
        self.SetMenuBar(self.BufferView_menubar)
        # Menu Bar end

        self.__set_properties()
        self.__do_layout()
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
Ejemplo n.º 2
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: Terminal.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((581, 410))
        self.text_main = wx.TextCtrl(self,
                                     wx.ID_ANY,
                                     "",
                                     style=wx.TE_BESTWRAP | wx.TE_MULTILINE
                                     | wx.TE_READONLY)
        self.text_entry = wx.TextCtrl(self,
                                      wx.ID_ANY,
                                      "",
                                      style=wx.TE_PROCESS_ENTER
                                      | wx.TE_PROCESS_TAB)

        self.__set_properties()
        self.__do_layout()
        # self.Bind(wx.EVT_TEXT, self.on_key_down, self.text_entry))
        self.Bind(wx.EVT_CHAR_HOOK, self.on_key_down, self.text_entry)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_entry, self.text_entry)
        self.Bind(wx.EVT_CHAR_HOOK, self.on_key_down_main, self.text_main)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
        self.pipe = None
        self.command_log = []
        self.command_position = 0
Ejemplo n.º 3
0
 def __init__(self):
     Module.__init__(self)
     self.home_adjust = None
     self.flip_x = 1  # Assumes the GCode is flip_x, -1 is flip, 1 is normal
     self.flip_y = 1  # Assumes the Gcode is flip_y,  -1 is flip, 1 is normal
     self.scale = MILS_PER_MM  # Initially assume mm mode 39.4 mils in an mm. G20 DEFAULT
     self.feed_convert = None
     self.feed_invert = None
     self.g94_feedrate()  # G94 DEFAULT, mm mode
     self.move_mode = 0
     self.home = None
     self.home2 = None
     self.on_mode = 1
     self.power = 0
     self.speed = 0
     self.used_speed = 0
     self.buffer = ''
     self.grbl_set_re = re.compile(r'\$(\d+)=([-+]?[0-9]*\.?[0-9]*)')
     self.code_re = re.compile(r'([A-Za-z])')
     self.float_re = re.compile(r'[-+]?[0-9]*\.?[0-9]*')
     self.settings = {
         0: 10,  # step pulse microseconds
         1: 25,  # step idle delay
         2: 0,  # step pulse invert
         3: 0,  # step direction invert
         4: 0,  # invert step enable pin, boolean
         5: 0,  # invert limit pins, boolean
         6: 0,  # invert probe pin
         10: 255,  # status report options
         11: 0.010,  # Junction deviation, mm
         12: 0.002,  # arc tolerance, mm
         13: 0,  # Report in inches
         20: 0,  # Soft limits enabled.
         21: 0,  # hard limits enabled
         22: 0,  # Homing cycle enable
         23: 0,  # Homing direction invert
         24: 25.000,  # Homing locate feed rate, mm/min
         25: 500.000,  # Homing search seek rate, mm/min
         26: 250,  # Homing switch debounce delay, ms
         27: 1.000,  # Homing switch pull-off distance, mm
         30: 1000,  # Maximum spindle speed, RPM
         31: 0,  # Minimum spindle speed, RPM
         32: 1,  # Laser mode enable, boolean
         100: 250.000,  # X-axis steps per millimeter
         101: 250.000,  # Y-axis steps per millimeter
         102: 250.000,  # Z-axis steps per millimeter
         110: 500.000,  # X-axis max rate mm/min
         111: 500.000,  # Y-axis max rate mm/min
         112: 500.000,  # Z-axis max rate mm/min
         120: 10.000,  # X-axis acceleration, mm/s^2
         121: 10.000,  # Y-axis acceleration, mm/s^2
         122: 10.000,  # Z-axis acceleration, mm/s^2
         130: 200.000,  # X-axis max travel mm.
         131: 200.000,  # Y-axis max travel mm
         132: 200.000  # Z-axis max travel mm.
     }
     self.grbl_channel = None
     self.reply = None
     self.channel = None
     self.elements = None
Ejemplo n.º 4
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: Notes.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((730, 621))
        self.check_auto_open_notes = wx.CheckBox(self, wx.ID_ANY,
                                                 _("Automatically Open Notes"))
        self.text_notes = wx.TextCtrl(self,
                                      wx.ID_ANY,
                                      "",
                                      style=wx.TE_BESTWRAP | wx.TE_MULTILINE
                                      | wx.TE_WORDWRAP)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_CHECKBOX, self.on_check_auto_note_open,
                  self.check_auto_open_notes)
        self.Bind(wx.EVT_TEXT, self.on_text_notes, self.text_notes)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_notes, self.text_notes)
        # end wxGlade

        self.Bind(wx.EVT_CLOSE, self.on_close, self)
Ejemplo n.º 5
0
    def __init__(self, parent, element, *args, **kwds):
        # begin wxGlade: ImageProperty.__init__
        wx.Frame.__init__(self, parent, -1, "",
                          style=wx.DEFAULT_FRAME_STYLE | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((276, 218))
        self.spin_step_size = wx.SpinCtrl(self, wx.ID_ANY, "1", min=1, max=63)
        self.combo_dpi = wx.ComboBox(self, wx.ID_ANY,
                                     choices=["1000", "500", "333", "250", "200", "166", "142", "125", "111", "100"],
                                     style=wx.CB_DROPDOWN)
        self.text_x = wx.TextCtrl(self, wx.ID_ANY, "")
        self.text_y = wx.TextCtrl(self, wx.ID_ANY, "")
        self.text_width = wx.TextCtrl(self, wx.ID_ANY, "")
        self.text_height = wx.TextCtrl(self, wx.ID_ANY, "")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_SPINCTRL, self.on_spin_step, self.spin_step_size)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_step, self.spin_step_size)
        self.Bind(wx.EVT_COMBOBOX, self.on_combo_dpi, self.combo_dpi)
        self.Bind(wx.EVT_TEXT, self.on_text_x, self.text_x)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_x, self.text_x)
        self.Bind(wx.EVT_TEXT, self.on_text_y, self.text_y)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_y, self.text_y)
        self.Bind(wx.EVT_TEXT, self.on_text_width, self.text_width)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_width, self.text_width)
        self.Bind(wx.EVT_TEXT, self.on_text_height, self.text_height)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_height, self.text_height)
        # end wxGlade
        self.image_element = element
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
Ejemplo n.º 6
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: Keymap.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((500, 530))
        self.list_keymap = wx.ListCtrl(self,
                                       wx.ID_ANY,
                                       style=wx.LC_HRULES | wx.LC_REPORT
                                       | wx.LC_VRULES)
        self.button_add = wx.Button(self, wx.ID_ANY, _("Add Hotkey"))
        self.text_key_name = wx.TextCtrl(self, wx.ID_ANY, "")
        self.text_command_name = wx.TextCtrl(self, wx.ID_ANY, "")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.on_button_add_hotkey, self.button_add)
        # end wxGlade
        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.on_item_rightclick,
                  self.list_keymap)
        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.on_item_activated,
                  self.list_keymap)
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
        self.text_key_name.Bind(wx.EVT_KEY_DOWN, self.on_key_press)
        self.SetFocus()
Ejemplo n.º 7
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: DeviceManager.__init__
        if parent is None:
            wx.Frame.__init__(self, parent, -1, "", style=wx.DEFAULT_FRAME_STYLE)
        else:
            wx.Frame.__init__(self, parent, -1, "",
                              style=wx.DEFAULT_FRAME_STYLE | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((707, 337))
        self.devices_list = wx.ListCtrl(self, wx.ID_ANY, style=wx.LC_HRULES | wx.LC_REPORT | wx.LC_VRULES)
        self.new_device_button = wx.BitmapButton(self, wx.ID_ANY, icons8_plus_50.GetBitmap())
        self.remove_device_button = wx.BitmapButton(self, wx.ID_ANY, icons8_trash_50.GetBitmap())
        self.device_properties_button = wx.BitmapButton(self, wx.ID_ANY, icons8_administrative_tools_50.GetBitmap())
        # self.move_item_up_button = wx.BitmapButton(self, wx.ID_ANY, icons8up.GetBitmap())
        # self.move_item_down_button = wx.BitmapButton(self, wx.ID_ANY, icons8_down.GetBitmap())

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.on_list_drag, self.devices_list)
        self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.on_list_item_activated, self.devices_list)
        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.on_list_right_click, self.devices_list)
        self.Bind(wx.EVT_BUTTON, self.on_button_new, self.new_device_button)
        self.Bind(wx.EVT_BUTTON, self.on_button_remove, self.remove_device_button)
        self.Bind(wx.EVT_BUTTON, self.on_button_properties, self.device_properties_button)
        # self.Bind(wx.EVT_BUTTON, self.on_button_up, self.move_item_up_button)
        # self.Bind(wx.EVT_BUTTON, self.on_button_down, self.move_item_down_button)
        # end wxGlade

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

        # OSX Window close
        if parent is not None:
            parent.accelerator_table(self)
Ejemplo n.º 8
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: Terminal.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((915, 424))
        self.text_main = wx.TextCtrl(self,
                                     wx.ID_ANY,
                                     "",
                                     style=wx.TE_BESTWRAP | wx.TE_MULTILINE
                                     | wx.TE_READONLY)
        self.text_entry = wx.TextCtrl(self,
                                      wx.ID_ANY,
                                      "",
                                      style=wx.TE_PROCESS_ENTER
                                      | wx.TE_PROCESS_TAB)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_TEXT_ENTER, self.on_entry, self.text_entry)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
        self.pipe = None

        # OSX Window close
        if parent is not None:
            parent.accelerator_table(self)
Ejemplo n.º 9
0
 def __init__(self):
     Module.__init__(self)
     self.hittable_elements = list()
     self.hit_chain = list()
     self.widget_root = SceneSpaceWidget(self)
     self.matrix_root = Matrix()
     self.process = self.animate_tick
     self.interval = 1.0 / 60.0  # 60fps
     self.last_position = None
     self.time = None
     self.distance = None
Ejemplo n.º 10
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: Preferences.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((412, 183))

        self.checklist_options = wx.CheckListBox(
            self,
            wx.ID_ANY,
            choices=[
                _("Invert Mouse Wheel Zoom"),
                _("Print Shutdown"),
                _("SVG Uniform Save"),
                _("Image DPI Scaling"),
                _("Show Negative Guide"),
                _("Launch Spooler JobStart"),
            ])

        self.radio_units = wx.RadioBox(
            self,
            wx.ID_ANY,
            _("Units"),
            choices=[_("mm"), _("cm"), _("inch"),
                     _("mils")],
            majorDimension=1,
            style=wx.RA_SPECIFY_ROWS)

        from wxMeerK40t import supported_languages
        choices = [
            language_name for language_code, language_name, language_index in
            supported_languages
        ]
        self.combo_language = wx.ComboBox(self,
                                          wx.ID_ANY,
                                          choices=choices,
                                          style=wx.CB_DROPDOWN)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_RADIOBOX, self.on_radio_units, self.radio_units)
        self.Bind(wx.EVT_COMBOBOX, self.on_combo_language, self.combo_language)
        self.Bind(wx.EVT_CHECKLISTBOX, self.on_checklist_settings,
                  self.checklist_options)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
Ejemplo n.º 11
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: RotarySettings.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((222, 347))
        self.checkbox_rotary = wx.CheckBox(self, wx.ID_ANY, _("Rotary"))

        self.text_rotary_scaley = wx.TextCtrl(self, wx.ID_ANY, "1.0")
        self.text_rotary_scalex = wx.TextCtrl(self, wx.ID_ANY, "1.0")
        self.checkbox_rotary_loop = wx.CheckBox(self, wx.ID_ANY,
                                                _("Field Loop"))
        self.text_rotary_rotation = wx.TextCtrl(self, wx.ID_ANY, "360.0")
        self.checkbox_rotary_roller = wx.CheckBox(self, wx.ID_ANY,
                                                  _("Uses Roller"))
        self.text_rotary_roller_circumference = wx.TextCtrl(
            self, wx.ID_ANY, "50.0")
        self.text_rotary_object_circumference = wx.TextCtrl(
            self, wx.ID_ANY, "50.0")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_CHECKBOX, self.on_check_rotary, self.checkbox_rotary)
        self.Bind(wx.EVT_TEXT, self.on_text_rotary_scale_y,
                  self.text_rotary_scaley)
        self.Bind(wx.EVT_TEXT, self.on_text_rotary_scale_x,
                  self.text_rotary_scalex)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_rotary_loop,
                  self.checkbox_rotary_loop)
        self.Bind(wx.EVT_TEXT, self.on_spin_rotation,
                  self.text_rotary_rotation)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_rotary_roller,
                  self.checkbox_rotary_roller)
        self.Bind(wx.EVT_TEXT, self.on_spin_rotary_roller_circumference,
                  self.text_rotary_roller_circumference)
        self.Bind(wx.EVT_TEXT, self.on_spin_rotary_object_circumference,
                  self.text_rotary_object_circumference)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)

        # OSX Window close
        if parent is not None:
            parent.accelerator_table(self)
Ejemplo n.º 12
0
    def __init__(self):
        Module.__init__(self)
        # Pipe.__init__(self)
        self.flip_x = 1  # Assumes the GCode is flip_x, -1 is flip, 1 is normal
        self.flip_y = 1  # Assumes the Gcode is flip_y,  -1 is flip, 1 is normal
        self.scale = MILS_PER_MM  # Initially assume mm mode 39.4 mils in an mm. G20 DEFAULT
        self.feed_scale = (self.scale / MILS_PER_MM) * (
            1.0 / 60.0)  # G94 DEFAULT, mm mode
        self.move_mode = 0
        self.on_mode = 1
        self.read_info = b"Grbl 1.1e ['$' for help]\r\n"

        self.comment = None
        self.code = ""
        self.value = ""
        self.command_map = {}
Ejemplo n.º 13
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: About.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((699, 442))
        self.bitmap_button_1 = wx.BitmapButton(self, wx.ID_ANY,
                                               icon_meerk40t.GetBitmap())

        self.__set_properties()
        self.__do_layout()
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
Ejemplo n.º 14
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: BufferView.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((697, 584))
        self.text_buffer_length = wx.TextCtrl(self, wx.ID_ANY, "")
        self.text_buffer_info = wx.TextCtrl(self,
                                            wx.ID_ANY,
                                            "",
                                            style=wx.TE_CHARWRAP
                                            | wx.TE_MULTILINE)

        self.__set_properties()
        self.__do_layout()
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
Ejemplo n.º 15
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: CameraURI.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        if 'param' in kwds:
            self.set_name, self.set_uri = kwds['param']
        else:
            self.set_name = None
            self.set_uri = ''
        Module.__init__(self)
        self.SetSize((437, 530))
        self.list_uri = wx.ListCtrl(self,
                                    wx.ID_ANY,
                                    style=wx.LC_HRULES | wx.LC_REPORT
                                    | wx.LC_VRULES)
        self.button_add = wx.Button(self, wx.ID_ANY, "Add URI")
        self.text_uri = wx.TextCtrl(self, wx.ID_ANY, self.set_uri)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.on_list_activated,
                  self.list_uri)
        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.on_list_right_clicked,
                  self.list_uri)
        self.Bind(wx.EVT_BUTTON, self.on_button_add_uri, self.button_add)
        self.Bind(wx.EVT_TEXT, self.on_text_uri, self.text_uri)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
        self.camera_setting = None
        self.camera_dict = dict()
        self.changed = False
Ejemplo n.º 16
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: RotarySettings.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((222, 347))
        self.checkbox_rotary = wx.CheckBox(self, wx.ID_ANY, _("Rotary"))
        self.spin_rotary_scaley = wx.SpinCtrlDouble(self,
                                                    wx.ID_ANY,
                                                    "1.0",
                                                    min=0.0,
                                                    max=5.0)
        self.spin_rotary_scalex = wx.SpinCtrlDouble(self,
                                                    wx.ID_ANY,
                                                    "1.0",
                                                    min=0.0,
                                                    max=5.0)
        self.checkbox_rotary_loop = wx.CheckBox(self, wx.ID_ANY,
                                                _("Field Loop"))
        self.spin_rotary_rotation = wx.SpinCtrlDouble(self,
                                                      wx.ID_ANY,
                                                      "360.0",
                                                      min=0.0,
                                                      max=20000.0)
        self.checkbox_rotary_roller = wx.CheckBox(self, wx.ID_ANY,
                                                  _("Uses Roller"))
        self.spin_rotary_roller_circumference = wx.SpinCtrlDouble(self,
                                                                  wx.ID_ANY,
                                                                  "50.0",
                                                                  min=0.0,
                                                                  max=800.0)
        self.spin_rotary_object_circumference = wx.SpinCtrlDouble(self,
                                                                  wx.ID_ANY,
                                                                  "50.0",
                                                                  min=0.0,
                                                                  max=800.0)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_CHECKBOX, self.on_check_rotary, self.checkbox_rotary)
        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_rotary_scale_y,
                  self.spin_rotary_scaley)
        self.Bind(wx.EVT_TEXT, self.on_spin_rotary_scale_y,
                  self.spin_rotary_scaley)
        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_rotary_scale_x,
                  self.spin_rotary_scalex)
        self.Bind(wx.EVT_TEXT, self.on_spin_rotary_scale_x,
                  self.spin_rotary_scalex)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_rotary_loop,
                  self.checkbox_rotary_loop)
        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_rotation,
                  self.spin_rotary_rotation)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_rotation,
                  self.spin_rotary_rotation)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_rotary_roller,
                  self.checkbox_rotary_roller)
        self.Bind(wx.EVT_SPINCTRLDOUBLE,
                  self.on_spin_rotary_roller_circumference,
                  self.spin_rotary_roller_circumference)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_rotary_roller_circumference,
                  self.spin_rotary_roller_circumference)
        self.Bind(wx.EVT_SPINCTRLDOUBLE,
                  self.on_spin_rotary_object_circumference,
                  self.spin_rotary_object_circumference)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_rotary_object_circumference,
                  self.spin_rotary_object_circumference)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
Ejemplo n.º 17
0
 def __init__(self):
     Module.__init__(self)
     Backend.__init__(self, uid='K40Stock')
     self.autolock = True
     self.mock = True
Ejemplo n.º 18
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: Settings.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((490, 280))
        self.radio_units = wx.RadioBox(self,
                                       wx.ID_ANY,
                                       _("Units"),
                                       choices=["mm", "cm", "inch", "mils"],
                                       majorDimension=1,
                                       style=wx.RA_SPECIFY_ROWS)
        self.combo_svg_ppi = wx.ComboBox(self,
                                         wx.ID_ANY,
                                         choices=[
                                             _("96 px/in Inkscape"),
                                             _("72 px/in Illustrator"),
                                             _("90 px/in Old Inkscape"),
                                             _("Custom")
                                         ],
                                         style=wx.CB_DROPDOWN)
        # self.text_svg_ppi = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
        self.text_svg_ppi = wx.TextCtrl(self, wx.ID_ANY, "")
        self.choices = [
            (_("Print Shutdown"), "print_shutdown", False),
            (_("SVG Uniform Save"), "uniform_svg", False),
            (_("Image DPI Scaling"), 'image_dpi', True),
            (_("DXF Centering"), 'dxf_center', True),
            (_("Show Negative Guide"), "show_negative_guide", True),
            (_("Launch Spooler JobStart"), "auto_spooler", True),
            (_("MouseWheel Pan"), "mouse_wheel_pan", False),
            (_("Invert MouseWheel Pan"), 'mouse_pan_invert', False),
            (_("Invert MouseWheel Zoom"), 'mouse_zoom_invert', False),
        ]
        self.checklist_options = wx.CheckListBox(
            self, wx.ID_ANY, choices=[c[0] for c in self.choices])

        from wxMeerK40t import supported_languages
        choices = [
            language_name for language_code, language_name, language_index in
            supported_languages
        ]
        self.combo_language = wx.ComboBox(self,
                                          wx.ID_ANY,
                                          choices=choices,
                                          style=wx.CB_DROPDOWN)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_RADIOBOX, self.on_radio_units, self.radio_units)
        self.Bind(wx.EVT_COMBOBOX, self.on_combo_language, self.combo_language)
        self.Bind(wx.EVT_COMBOBOX, self.on_combo_svg_ppi, self.combo_svg_ppi)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_svg_ppi, self.text_svg_ppi)
        self.Bind(wx.EVT_TEXT, self.on_text_svg_ppi, self.text_svg_ppi)
        self.Bind(wx.EVT_CHECKLISTBOX, self.on_checklist_settings,
                  self.checklist_options)

        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
Ejemplo n.º 19
0
    def __init__(self, parent, *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((424, 417))
        self.check_speed_override = wx.CheckBox(self, wx.ID_ANY, "")
        self.slider_speed_override = wx.Slider(self, wx.ID_ANY, 100, 0, 500,
                                               style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL | wx.SL_LABELS)
        self.check_power_override = wx.CheckBox(self, wx.ID_ANY, "")
        self.slider_power_override = wx.Slider(self, wx.ID_ANY, 1000, 0, 1000,
                                               style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL | wx.SL_LABELS)
        self.check_overscan_override = wx.CheckBox(self, wx.ID_ANY, "")
        self.slider_overscan_override = wx.Slider(self, wx.ID_ANY, 0, 0, 2000,
                                                  style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL | wx.SL_LABELS)
        self.check_speed_ratio = wx.CheckBox(self, wx.ID_ANY, "")
        self.slider_speed_ratio = wx.Slider(self, wx.ID_ANY, 100, 0, 500,
                                            style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL | wx.SL_LABELS)
        self.check_power_ratio = wx.CheckBox(self, wx.ID_ANY, "")
        self.slider_power_ratio = wx.Slider(self, wx.ID_ANY, 100, 0, 200,
                                            style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL | wx.SL_LABELS)
        self.checkbox_pattern_group = wx.CheckBox(self, wx.ID_ANY, _("Group Pulses"))
        self.button_up = wx.BitmapButton(self, wx.ID_ANY, icons8up.GetBitmap())
        self.button_left = wx.BitmapButton(self, wx.ID_ANY, icons8_left.GetBitmap())
        self.button_origin = wx.BitmapButton(self, wx.ID_ANY, icons8_center_of_gravity_50.GetBitmap())
        self.button_right = wx.BitmapButton(self, wx.ID_ANY, icons8_right.GetBitmap())
        self.button_down = wx.BitmapButton(self, wx.ID_ANY, icons8_down.GetBitmap())
        self.bitmap_flush_buffer = wx.BitmapButton(self, wx.ID_ANY, icons8_goal_50.GetBitmap())
        self.bitmap_cancel = wx.BitmapButton(self, wx.ID_ANY, icons8_delete_50.GetBitmap())
        self.bitmap_stop = wx.BitmapButton(self, wx.ID_ANY, icons8_end_50.GetBitmap())
        self.text_status_information = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_CHECKBOX, lambda e: self.slider_speed_override.Enable(self.check_speed_override.GetValue()),
                  self.check_speed_override)
        self.Bind(wx.EVT_SLIDER, self.on_slider_speed_override, self.slider_speed_override)
        self.Bind(wx.EVT_CHECKBOX, lambda e: self.slider_power_override.Enable(self.check_power_override.GetValue()),
                  self.check_power_override)
        self.Bind(wx.EVT_SLIDER, self.on_slider_power_override, self.slider_power_override)
        self.Bind(wx.EVT_CHECKBOX,
                  lambda e: self.slider_overscan_override.Enable(self.check_overscan_override.GetValue()),
                  self.check_overscan_override)
        self.Bind(wx.EVT_SLIDER, self.on_slider_overscan_override, self.slider_overscan_override)
        self.Bind(wx.EVT_CHECKBOX, lambda e: self.slider_speed_ratio.Enable(self.check_speed_ratio.GetValue()),
                  self.check_speed_ratio)
        self.Bind(wx.EVT_SLIDER, self.on_slider_speed_ratio, self.slider_speed_ratio)
        self.Bind(wx.EVT_CHECKBOX, lambda e: self.slider_power_ratio.Enable(self.check_power_ratio.GetValue()),
                  self.check_power_ratio)
        self.Bind(wx.EVT_SLIDER, self.on_slider_power_ratio, self.slider_power_ratio)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_pattern_group, self.checkbox_pattern_group)
        self.Bind(wx.EVT_BUTTON, self.on_button_adjust_top, self.button_up)
        self.Bind(wx.EVT_BUTTON, self.on_button_adjust_left, self.button_left)
        self.Bind(wx.EVT_BUTTON, self.on_button_adjust_origin, self.button_origin)
        self.Bind(wx.EVT_BUTTON, self.on_button_adjust_right, self.button_right)
        self.Bind(wx.EVT_BUTTON, self.on_button_adjust_bottom, self.button_down)
        self.Bind(wx.EVT_BUTTON, self.on_button_flush_buffer, self.bitmap_flush_buffer)
        self.Bind(wx.EVT_BUTTON, self.on_button_safe_quit, self.bitmap_cancel)
        self.Bind(wx.EVT_BUTTON, self.on_button_emergency_exit, self.bitmap_stop)
        self.Bind(wx.EVT_KEY_DOWN, self.on_key_press)
        self.SetFocus()
Ejemplo n.º 20
0
    def __init__(self, *args, **kwds):
        # begin wxGlade: CameraInterface.__init__
        kwds["style"] = kwds.get(
            "style", 0
        ) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL
        wx.Frame.__init__(self, *args, **kwds)
        Module.__init__(self)
        self.SetSize((608, 549))
        self.CameraInterface_menubar = wx.MenuBar()
        wxglade_tmp_menu = wx.Menu()
        item = wxglade_tmp_menu.Append(wx.ID_ANY, _("Reset Perspective"), "")
        self.Bind(wx.EVT_MENU, self.reset_perspective, id=item.GetId())
        item = wxglade_tmp_menu.Append(wx.ID_ANY, _("Reset Fisheye"), "")
        self.Bind(wx.EVT_MENU, self.reset_fisheye, id=item.GetId())
        wxglade_tmp_menu.AppendSeparator()

        item = wxglade_tmp_menu.Append(wx.ID_ANY, _("Set IP Camera 1"), "",
                                       wx.ITEM_RADIO)
        self.camera_ip_menu1 = item
        self.Bind(wx.EVT_MENU, lambda e: self.swap_camera(-1), id=item.GetId())
        item = wxglade_tmp_menu.Append(wx.ID_ANY, _("Set IP Camera 2"), "",
                                       wx.ITEM_RADIO)
        self.camera_ip_menu2 = item
        self.Bind(wx.EVT_MENU, lambda e: self.swap_camera(-2), id=item.GetId())
        item = wxglade_tmp_menu.Append(wx.ID_ANY, _("Set IP Camera 3"), "",
                                       wx.ITEM_RADIO)
        self.camera_ip_menu3 = item
        self.Bind(wx.EVT_MENU, lambda e: self.swap_camera(-3), id=item.GetId())
        item = wxglade_tmp_menu.Append(wx.ID_ANY, _("Set Camera 0"), "",
                                       wx.ITEM_RADIO)
        self.camera_0_menu = item
        self.Bind(wx.EVT_MENU, lambda e: self.swap_camera(0), id=item.GetId())
        item = wxglade_tmp_menu.Append(wx.ID_ANY, _("Set Camera 1"), "",
                                       wx.ITEM_RADIO)
        self.camera_1_menu = item
        self.Bind(wx.EVT_MENU, lambda e: self.swap_camera(1), id=item.GetId())
        item = wxglade_tmp_menu.Append(wx.ID_ANY, _("Set Camera 2"), "",
                                       wx.ITEM_RADIO)
        self.camera_2_menu = item
        self.Bind(wx.EVT_MENU, lambda e: self.swap_camera(2), id=item.GetId())
        item = wxglade_tmp_menu.Append(wx.ID_ANY, _("Set Camera 3"), "",
                                       wx.ITEM_RADIO)
        self.camera_3_menu = item
        self.Bind(wx.EVT_MENU, lambda e: self.swap_camera(3), id=item.GetId())
        item = wxglade_tmp_menu.Append(wx.ID_ANY, _("Set Camera 4"), "",
                                       wx.ITEM_RADIO)
        self.camera_4_menu = item
        self.Bind(wx.EVT_MENU, lambda e: self.swap_camera(4), id=item.GetId())
        self.CameraInterface_menubar.Append(wxglade_tmp_menu, _("Camera"))
        self.SetMenuBar(self.CameraInterface_menubar)
        # Menu Bar

        self.button_update = wx.BitmapButton(self, wx.ID_ANY,
                                             icons8_camera_50.GetBitmap())
        self.button_export = wx.BitmapButton(
            self, wx.ID_ANY,
            icons8_picture_in_picture_alternative_50.GetBitmap())
        self.check_fisheye = wx.CheckBox(self, wx.ID_ANY, _("Correct Fisheye"))
        self.check_perspective = wx.CheckBox(self, wx.ID_ANY,
                                             _("Correct Perspective"))
        self.slider_fps = wx.Slider(self,
                                    wx.ID_ANY,
                                    1,
                                    0,
                                    24,
                                    style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL
                                    | wx.SL_LABELS)
        self.button_detect = wx.BitmapButton(self, wx.ID_ANY,
                                             icons8_detective_50.GetBitmap())
        self.display_camera = wx.Panel(self, wx.ID_ANY)
        self.__set_properties()
        self.__do_layout()

        self.capture = None
        self.image_width = -1
        self.image_height = -1
        self._Buffer = None

        self.frame_bitmap = None

        self.fisheye_k = None
        self.fisheye_d = None

        # Used during calibration.
        self.objpoints = []  # 3d point in real world space
        self.imgpoints = []  # 2d points in image plane.

        # Perspective Points
        self.perspective = None

        self.previous_window_position = None
        self.previous_scene_position = None

        self.corner_drag = None

        self.matrix = Matrix()

        self.Bind(wx.EVT_BUTTON, self.on_button_update, self.button_update)
        self.Bind(wx.EVT_BUTTON, self.on_button_export, self.button_export)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_fisheye, self.check_fisheye)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_perspective,
                  self.check_perspective)
        self.Bind(wx.EVT_SLIDER, self.on_slider_fps, self.slider_fps)
        self.Bind(wx.EVT_BUTTON, self.on_button_detect, self.button_detect)
        self.SetDoubleBuffered(True)
        # end wxGlade

        self.display_camera.Bind(wx.EVT_PAINT, self.on_paint)
        self.display_camera.Bind(wx.EVT_ERASE_BACKGROUND, self.on_erase)
        self.display_camera.Bind(wx.EVT_MOTION, self.on_mouse_move)
        self.display_camera.Bind(wx.EVT_MOUSEWHEEL, self.on_mousewheel)
        self.display_camera.Bind(wx.EVT_MIDDLE_UP, self.on_mouse_middle_up)
        self.display_camera.Bind(wx.EVT_MIDDLE_DOWN, self.on_mouse_middle_down)

        self.display_camera.Bind(wx.EVT_LEFT_DOWN, self.on_mouse_left_down)
        self.display_camera.Bind(wx.EVT_LEFT_UP, self.on_mouse_left_up)
        self.display_camera.Bind(wx.EVT_ENTER_WINDOW,
                                 lambda event: self.display_camera.SetFocus(
                                 ))  # Focus follows mouse.
        self.Bind(wx.EVT_CLOSE, self.on_close, self)

        self.on_size(None)
        self.Bind(wx.EVT_SIZE, self.on_size, self)
        self.camera_lock = threading.Lock()
        self.process = self.fetch_image
        self.camera_job = None
        self.fetch_job = None
Ejemplo n.º 21
0
    def __init__(self, parent, element=None, *args, **kwds):
        # begin wxGlade: PathProperty.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((288, 303))
        self.text_name = wx.TextCtrl(self, wx.ID_ANY, "")
        self.button_stroke_none = wx.Button(self, wx.ID_ANY, _("None"))
        self.button_stroke_none.name = "stroke none"
        self.button_stroke_F00 = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_F00.name = "stroke #F00"
        self.button_stroke_0F0 = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_0F0.name = "stroke #0F0"
        self.button_stroke_00F = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_00F.name = "stroke #00F"
        self.button_stroke_F0F = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_F0F.name = "stroke #F0F"
        self.button_stroke_0FF = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_0FF.name = "stroke #0FF"
        self.button_stroke_FF0 = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_FF0.name = "stroke #FF0"
        self.button_stroke_000 = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_000.name = "stroke #000"

        self.button_fill_none = wx.Button(self, wx.ID_ANY, _("None"))
        self.button_fill_none.name = "fill none"
        self.button_fill_F00 = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_F00.name = "fill #F00"
        self.button_fill_0F0 = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_0F0.name = "fill #0F0"
        self.button_fill_00F = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_00F.name = "fill #00F"
        self.button_fill_F0F = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_F0F.name = "fill #F0F"
        self.button_fill_0FF = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_0FF.name = "fill #0FF"
        self.button_fill_FF0 = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_FF0.name = "fill #FF0"
        self.button_fill_000 = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_000.name = "fill #000"

        self.__set_properties()
        self.__do_layout()
        try:
            if element.id is not None:
                self.text_name.SetValue(str(element.id))
        except AttributeError:
            pass
        self.Bind(wx.EVT_TEXT, self.on_text_name_change, self.text_name)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_name_change, self.text_name)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_none)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_F00)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_0F0)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_00F)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_F0F)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_0FF)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_FF0)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_000)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_none)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_F00)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_0F0)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_00F)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_F0F)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_0FF)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_FF0)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_000)
        # end wxGlade
        self.path_element = element
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
Ejemplo n.º 22
0
    def __init__(self, parent, element, *args, **kwds):
        # begin wxGlade: TextProperty.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((317, 360))
        self.text_text = wx.TextCtrl(self, wx.ID_ANY, "")
        self.element = element
        self.label_fonttest = wx.StaticText(self, wx.ID_ANY, "")
        self.label_fonttest.SetFont(
            wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL,
                    wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))
        self.button_choose_font = wx.BitmapButton(
            self, wx.ID_ANY, icons8_choose_font_50.GetBitmap())
        self.button_stroke_none = wx.Button(self, wx.ID_ANY, "None")
        self.button_stroke_none.name = "stroke none"
        self.button_stroke_F00 = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_F00.name = "stroke #F00"
        self.button_stroke_0F0 = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_0F0.name = "stroke #0F0"
        self.button_stroke_00F = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_00F.name = "stroke #00F"
        self.button_stroke_F0F = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_F0F.name = "stroke #F0F"
        self.button_stroke_0FF = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_0FF.name = "stroke #0FF"
        self.button_stroke_FF0 = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_FF0.name = "stroke #FF0"
        self.button_stroke_000 = wx.Button(self, wx.ID_ANY, "")
        self.button_stroke_000.name = "stroke #000"

        self.button_fill_none = wx.Button(self, wx.ID_ANY, "None")
        self.button_fill_none.name = "fill none"
        self.button_fill_F00 = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_F00.name = "fill #F00"
        self.button_fill_0F0 = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_0F0.name = "fill #0F0"
        self.button_fill_00F = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_00F.name = "fill #00F"
        self.button_fill_F0F = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_F0F.name = "fill #F0F"
        self.button_fill_0FF = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_0FF.name = "fill #0FF"
        self.button_fill_FF0 = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_FF0.name = "fill #FF0"
        self.button_fill_000 = wx.Button(self, wx.ID_ANY, "")
        self.button_fill_000.name = "fill #000"

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_TEXT, self.on_text_name_change, self.text_text)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_name_change, self.text_text)
        self.Bind(wx.EVT_BUTTON, self.on_button_choose_font,
                  self.button_choose_font)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_none)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_F00)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_0F0)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_00F)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_F0F)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_0FF)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_FF0)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_stroke_000)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_none)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_F00)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_0F0)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_00F)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_F0F)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_0FF)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_FF0)
        self.Bind(wx.EVT_BUTTON, self.on_button_color, self.button_fill_000)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
Ejemplo n.º 23
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: Preferences.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((395, 424))
        self.combobox_board = wx.ComboBox(
            self,
            wx.ID_ANY,
            choices=["M2", "B2", "M", "M1", "A", "B", "B1"],
            style=wx.CB_DROPDOWN)
        self.checkbox_flip_x = wx.CheckBox(self, wx.ID_ANY, _("Flip X"))
        self.checkbox_home_right = wx.CheckBox(self, wx.ID_ANY,
                                               _("Homes Right"))
        self.checkbox_flip_y = wx.CheckBox(self, wx.ID_ANY, _("Flip Y"))
        self.checkbox_home_bottom = wx.CheckBox(self, wx.ID_ANY,
                                                _("Homes Bottom"))
        self.checkbox_swap_xy = wx.CheckBox(self, wx.ID_ANY, _("Swap X and Y"))
        self.checkbox_mock_usb = wx.CheckBox(self, wx.ID_ANY,
                                             _("Mock USB Connection Mode"))
        self.spin_device_index = wx.SpinCtrl(self,
                                             wx.ID_ANY,
                                             "-1",
                                             min=-1,
                                             max=5)
        self.spin_device_address = wx.SpinCtrl(self,
                                               wx.ID_ANY,
                                               "-1",
                                               min=-1,
                                               max=5)
        self.spin_device_bus = wx.SpinCtrl(self,
                                           wx.ID_ANY,
                                           "-1",
                                           min=-1,
                                           max=5)
        self.spin_device_version = wx.SpinCtrl(self,
                                               wx.ID_ANY,
                                               "-1",
                                               min=-1,
                                               max=255)
        self.spin_home_x = wx.SpinCtrlDouble(self,
                                             wx.ID_ANY,
                                             "0.0",
                                             min=-50000.0,
                                             max=50000.0)
        self.spin_home_y = wx.SpinCtrlDouble(self,
                                             wx.ID_ANY,
                                             "0.0",
                                             min=-50000.0,
                                             max=50000.0)
        self.button_home_by_current = wx.Button(self, wx.ID_ANY,
                                                _("Set Current"))
        self.spin_bedwidth = wx.SpinCtrlDouble(self,
                                               wx.ID_ANY,
                                               "330.0",
                                               min=1.0,
                                               max=1000.0)
        self.spin_bedheight = wx.SpinCtrlDouble(self,
                                                wx.ID_ANY,
                                                "230.0",
                                                min=1.0,
                                                max=1000.0)
        self.checkbox_autolock = wx.CheckBox(self, wx.ID_ANY,
                                             _("Automatically lock rail"))
        self.checkbox_autohome = wx.CheckBox(self, wx.ID_ANY,
                                             _("Home after job complete"))
        self.checkbox_autobeep = wx.CheckBox(self, wx.ID_ANY,
                                             _("Beep after job complete"))

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_COMBOBOX, self.on_combobox_boardtype,
                  self.combobox_board)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_swap_xy,
                  self.checkbox_swap_xy)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_flip_x, self.checkbox_flip_x)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_home_right,
                  self.checkbox_home_right)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_flip_y, self.checkbox_flip_y)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_home_bottom,
                  self.checkbox_home_bottom)
        self.Bind(wx.EVT_CHECKBOX, self.on_checkbox_mock_usb,
                  self.checkbox_mock_usb)
        self.Bind(wx.EVT_SPINCTRL, self.spin_on_device_index,
                  self.spin_device_index)
        self.Bind(wx.EVT_TEXT, self.spin_on_device_index,
                  self.spin_device_index)
        self.Bind(wx.EVT_TEXT_ENTER, self.spin_on_device_index,
                  self.spin_device_index)
        self.Bind(wx.EVT_SPINCTRL, self.spin_on_device_address,
                  self.spin_device_address)
        self.Bind(wx.EVT_TEXT, self.spin_on_device_address,
                  self.spin_device_address)
        self.Bind(wx.EVT_TEXT_ENTER, self.spin_on_device_address,
                  self.spin_device_address)
        self.Bind(wx.EVT_SPINCTRL, self.spin_on_device_bus,
                  self.spin_device_bus)
        self.Bind(wx.EVT_TEXT, self.spin_on_device_bus, self.spin_device_bus)
        self.Bind(wx.EVT_TEXT_ENTER, self.spin_on_device_bus,
                  self.spin_device_bus)
        self.Bind(wx.EVT_SPINCTRL, self.spin_on_device_version,
                  self.spin_device_version)
        self.Bind(wx.EVT_TEXT, self.spin_on_device_version,
                  self.spin_device_version)
        self.Bind(wx.EVT_TEXT_ENTER, self.spin_on_device_version,
                  self.spin_device_version)
        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.spin_on_home_x, self.spin_home_x)
        self.Bind(wx.EVT_TEXT, self.spin_on_home_x, self.spin_home_x)
        self.Bind(wx.EVT_TEXT_ENTER, self.spin_on_home_x, self.spin_home_x)
        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.spin_on_home_y, self.spin_home_y)
        self.Bind(wx.EVT_TEXT, self.spin_on_home_y, self.spin_home_y)
        self.Bind(wx.EVT_TEXT_ENTER, self.spin_on_home_y, self.spin_home_y)
        self.Bind(wx.EVT_BUTTON, self.on_button_set_home_current,
                  self.button_home_by_current)
        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.spin_on_bedwidth,
                  self.spin_bedwidth)
        self.Bind(wx.EVT_TEXT, self.spin_on_bedwidth, self.spin_bedwidth)
        self.Bind(wx.EVT_TEXT_ENTER, self.spin_on_bedwidth, self.spin_bedwidth)
        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.spin_on_bedheight,
                  self.spin_bedheight)
        self.Bind(wx.EVT_TEXT, self.spin_on_bedheight, self.spin_bedheight)
        self.Bind(wx.EVT_TEXT_ENTER, self.spin_on_bedheight,
                  self.spin_bedheight)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_autolock,
                  self.checkbox_autolock)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_autohome,
                  self.checkbox_autohome)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_autobeep,
                  self.checkbox_autobeep)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
Ejemplo n.º 24
0
    def __init__(self, parent, operation, *args, **kwds):
        # begin wxGlade: OperationProperty.__init__
        wx.Frame.__init__(self, parent, -1, "",
                          style=wx.DEFAULT_FRAME_STYLE | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((_simple_width, 500))

        self.main_panel = wx.Panel(self, wx.ID_ANY)
        self.button_add_layer = wx.BitmapButton(self.main_panel, wx.ID_ANY, icons8_plus_50.GetBitmap())
        self.listbox_layer = wx.ListBox(self.main_panel, wx.ID_ANY, choices=[], style=wx.LB_ALWAYS_SB | wx.LB_SINGLE)
        self.button_remove_layer = wx.BitmapButton(self.main_panel, wx.ID_ANY, icons8_delete_50.GetBitmap())
        self.button_layer_color = wx.Button(self.main_panel, wx.ID_ANY, "")
        self.combo_type = wx.ComboBox(self.main_panel, wx.ID_ANY, choices=[_("Engrave"), _("Cut"), _("Raster"), _("Image")],
                                      style=wx.CB_DROPDOWN)
        self.checkbox_output = wx.CheckBox(self.main_panel, wx.ID_ANY, _("Output"))
        self.checkbox_show = wx.CheckBox(self.main_panel, wx.ID_ANY, _("Show"))
        self.text_speed = wx.TextCtrl(self.main_panel, wx.ID_ANY, "20.0")
        self.text_power = wx.TextCtrl(self.main_panel, wx.ID_ANY, "1000.0")
        self.raster_panel = wx.Panel(self.main_panel, wx.ID_ANY)
        self.text_raster_step = wx.TextCtrl(self.raster_panel, wx.ID_ANY, "1")
        self.text_overscan = wx.TextCtrl(self.raster_panel, wx.ID_ANY, "20")
        self.combo_raster_direction = wx.ComboBox(self.raster_panel, wx.ID_ANY,
                                                  choices=[_("Top To Bottom"), _("Bottom To Top"), _("Right To Left"),
                                                           _("Left To Right"), _("Crosshatch")], style=wx.CB_DROPDOWN)
        self.radio_directional_raster = wx.RadioBox(self.raster_panel, wx.ID_ANY, _("Directional Raster"),
                                                    choices=[_("Bidirectional"), _("Unidirectional")], majorDimension=1,
                                                    style=wx.RA_SPECIFY_ROWS)
        self.slider_top = wx.Slider(self.raster_panel, wx.ID_ANY, 1, 0, 2)
        self.slider_left = wx.Slider(self.raster_panel, wx.ID_ANY, 1, 0, 2, style=wx.SL_VERTICAL)
        self.display_panel = wx.Panel(self.raster_panel, wx.ID_ANY)
        self.slider_right = wx.Slider(self.raster_panel, wx.ID_ANY, 1, 0, 2, style=wx.SL_VERTICAL)
        self.slider_bottom = wx.Slider(self.raster_panel, wx.ID_ANY, 1, 0, 2)
        self.checkbox_advanced = wx.CheckBox(self.main_panel, wx.ID_ANY, _("Advanced"))
        self.advanced_panel = wx.Panel(self.main_panel, wx.ID_ANY)
        self.check_dratio_custom = wx.CheckBox(self.advanced_panel, wx.ID_ANY, _("Custom D-Ratio"))
        self.text_dratio = wx.TextCtrl(self.advanced_panel, wx.ID_ANY, "0.261")
        self.checkbox_custom_accel = wx.CheckBox(self.advanced_panel, wx.ID_ANY, _("Acceleration"))
        self.slider_accel = wx.Slider(self.advanced_panel, wx.ID_ANY, 1, 1, 4, style=wx.SL_AUTOTICKS | wx.SL_LABELS)
        self.check_dot_length_custom = wx.CheckBox(self.advanced_panel, wx.ID_ANY, _("Dot Length (mils)"))
        self.text_dot_length = wx.TextCtrl(self.advanced_panel, wx.ID_ANY, "1")
        self.check_group_pulse = wx.CheckBox(self.advanced_panel, wx.ID_ANY, _("Group Pulses"))
        self.check_passes = wx.CheckBox(self.advanced_panel, wx.ID_ANY, _("Passes"))
        self.text_passes = wx.TextCtrl(self.advanced_panel, wx.ID_ANY, "1")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_CLOSE, self.on_close, self)
        self.combo_type.SetFocus()
        self.operation = operation

        self.raster_pen = wx.Pen()
        self.raster_pen.SetColour(wx.BLACK)
        self.raster_pen.SetWidth(2)

        self.travel_pen = wx.Pen()
        self.travel_pen.SetColour(wx.Colour(255, 127, 255, 64))
        self.travel_pen.SetWidth(1)

        self.raster_lines = None
        self.travel_lines = None
Ejemplo n.º 25
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)
Ejemplo n.º 26
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: Alignment.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((631, 365))

        self.spin_vertical_distance = wx.SpinCtrl(self,
                                                  wx.ID_ANY,
                                                  "180",
                                                  min=10,
                                                  max=400)
        self.spin_vertical_power = wx.SpinCtrl(self,
                                               wx.ID_ANY,
                                               "180",
                                               min=10,
                                               max=500)
        self.check_vertical_done = wx.CheckBox(
            self, wx.ID_ANY, _("Vertical Alignment Finished"))
        self.spin_horizontal_distance = wx.SpinCtrl(self,
                                                    wx.ID_ANY,
                                                    "220",
                                                    min=10,
                                                    max=400)
        self.spin_horizontal_power = wx.SpinCtrl(self,
                                                 wx.ID_ANY,
                                                 "180",
                                                 min=10,
                                                 max=500)
        self.check_horizontal_done = wx.CheckBox(
            self, wx.ID_ANY, _("Horizontal Alignment Finished"))
        self.slider_square_power = wx.Slider(self,
                                             wx.ID_ANY,
                                             200,
                                             0,
                                             1000,
                                             style=wx.SL_HORIZONTAL
                                             | wx.SL_LABELS)

        self.button_vertical_align_nearfar = wx.BitmapButton(
            self, wx.ID_ANY, icons8_resize_vertical_50.GetBitmap())
        self.button_horizontal_align_nearfar = wx.BitmapButton(
            self, wx.ID_ANY, icons8_resize_horizontal_50.GetBitmap())
        self.button_vertical_align = wx.BitmapButton(
            self, wx.ID_ANY, icons8_resize_vertical_50.GetBitmap())
        self.button_horizontal_align = wx.BitmapButton(
            self, wx.ID_ANY, icons8_resize_horizontal_50.GetBitmap())
        self.button_square_align_4_corner = wx.BitmapButton(
            self, wx.ID_ANY, icons8_stop_50.GetBitmap())
        self.button_square_align = wx.BitmapButton(self, wx.ID_ANY,
                                                   icons8_stop_50.GetBitmap())

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.on_button_vertical_align_nearfar,
                  self.button_vertical_align_nearfar)
        self.Bind(wx.EVT_BUTTON, self.on_button_vertical_align,
                  self.button_vertical_align)
        self.Bind(wx.EVT_SPINCTRL, self.on_spin_vertical_distance,
                  self.spin_vertical_distance)
        self.Bind(wx.EVT_TEXT, self.on_spin_vertical_distance,
                  self.spin_vertical_distance)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_vertical_distance,
                  self.spin_vertical_distance)
        self.Bind(wx.EVT_SPINCTRL, self.on_spin_vertical_power,
                  self.spin_vertical_power)
        self.Bind(wx.EVT_TEXT, self.on_spin_vertical_power,
                  self.spin_vertical_power)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_vertical_power,
                  self.spin_vertical_power)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_vertical_done,
                  self.check_vertical_done)
        self.Bind(wx.EVT_BUTTON, self.on_button_horizontal_align_nearfar,
                  self.button_horizontal_align_nearfar)
        self.Bind(wx.EVT_BUTTON, self.on_button_horizontal_align,
                  self.button_horizontal_align)
        self.Bind(wx.EVT_SPINCTRL, self.on_spin_horizontal_distance,
                  self.spin_horizontal_distance)
        self.Bind(wx.EVT_TEXT, self.on_spin_horizontal_distance,
                  self.spin_horizontal_distance)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_horizontal_distance,
                  self.spin_horizontal_distance)
        self.Bind(wx.EVT_SPINCTRL, self.on_spin_horizontal_power,
                  self.spin_horizontal_power)
        self.Bind(wx.EVT_TEXT, self.on_spin_horizontal_power,
                  self.spin_horizontal_power)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_horizontal_power,
                  self.spin_horizontal_power)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_horizontal_done,
                  self.check_horizontal_done)
        self.Bind(wx.EVT_BUTTON, self.on_button_square_align_4_corners,
                  self.button_square_align_4_corner)
        self.Bind(wx.EVT_BUTTON, self.on_button_square_align,
                  self.button_square_align)
        self.Bind(wx.EVT_COMMAND_SCROLL, self.on_slider_square_power_change,
                  self.slider_square_power)
        self.Bind(wx.EVT_COMMAND_SCROLL_CHANGED,
                  self.on_slider_square_power_change, self.slider_square_power)

        self.Bind(wx.EVT_CLOSE, self.on_close, self)
Ejemplo n.º 27
0
    def __init__(self, parent, *args, **kwds):
        # begin wxGlade: Navigation.__init__
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "",
                          style=wx.DEFAULT_FRAME_STYLE
                          | wx.FRAME_FLOAT_ON_PARENT | wx.TAB_TRAVERSAL)
        Module.__init__(self)
        self.SetSize((598, 429))
        self.spin_jog_mils = wx.SpinCtrlDouble(self,
                                               wx.ID_ANY,
                                               "394.0",
                                               min=0.0,
                                               max=10000.0)
        self.spin_jog_mm = wx.SpinCtrlDouble(self,
                                             wx.ID_ANY,
                                             "10.0",
                                             min=0.0,
                                             max=254.0)
        self.spin_jog_cm = wx.SpinCtrlDouble(self,
                                             wx.ID_ANY,
                                             "1.0",
                                             min=0.0,
                                             max=25.4)
        self.spin_jog_inch = wx.SpinCtrlDouble(self,
                                               wx.ID_ANY,
                                               "0.394",
                                               min=0.0,
                                               max=10.0)
        self.button_navigate_up_left = wx.BitmapButton(
            self, wx.ID_ANY, icons8_up_left_50.GetBitmap())
        self.button_navigate_up = wx.BitmapButton(self, wx.ID_ANY,
                                                  icons8_up_50.GetBitmap())
        self.button_navigate_up_right = wx.BitmapButton(
            self, wx.ID_ANY, icons8_up_right_50.GetBitmap())
        self.button_navigate_left = wx.BitmapButton(self, wx.ID_ANY,
                                                    icons8_left_50.GetBitmap())
        self.button_navigate_home = wx.BitmapButton(
            self, wx.ID_ANY, icons8_home_filled_50.GetBitmap())
        self.button_navigate_right = wx.BitmapButton(
            self, wx.ID_ANY, icons8_right_50.GetBitmap())
        self.button_navigate_down_left = wx.BitmapButton(
            self, wx.ID_ANY, icons8_down_left_50.GetBitmap())
        self.button_navigate_down = wx.BitmapButton(self, wx.ID_ANY,
                                                    icons8_down_50.GetBitmap())
        self.button_navigate_down_right = wx.BitmapButton(
            self, wx.ID_ANY, icons8_down_right_50.GetBitmap())
        self.button_navigate_unlock = wx.BitmapButton(
            self, wx.ID_ANY, icons8_padlock_50.GetBitmap())
        self.button_navigate_lock = wx.BitmapButton(self, wx.ID_ANY,
                                                    icons8_lock_50.GetBitmap())
        self.button_align_corner_top_left = wx.BitmapButton(
            self, wx.ID_ANY, icon_corner1.GetBitmap())
        self.button_align_drag_up = wx.BitmapButton(self, wx.ID_ANY,
                                                    icons8up.GetBitmap())
        self.button_align_corner_top_right = wx.BitmapButton(
            self, wx.ID_ANY, icon_corner2.GetBitmap())
        self.button_align_drag_left = wx.BitmapButton(self, wx.ID_ANY,
                                                      icons8_left.GetBitmap())
        self.button_align_center = wx.BitmapButton(
            self, wx.ID_ANY, icons8_square_border_50.GetBitmap())
        self.button_align_drag_right = wx.BitmapButton(
            self, wx.ID_ANY, icons8_right.GetBitmap())
        self.button_align_corner_bottom_left = wx.BitmapButton(
            self, wx.ID_ANY, icon_corner4.GetBitmap())
        self.button_align_drag_down = wx.BitmapButton(self, wx.ID_ANY,
                                                      icons8_down.GetBitmap())
        self.button_align_corner_bottom_right = wx.BitmapButton(
            self, wx.ID_ANY, icon_corner3.GetBitmap())
        self.button_align_first_position = wx.BitmapButton(
            self, wx.ID_ANY, icons8_level_1_50.GetBitmap())
        self.button_align_trace_hull = wx.BitmapButton(
            self, wx.ID_ANY, icons8_pentagon_50.GetBitmap())
        self.button_align_trace_quick = wx.BitmapButton(
            self, wx.ID_ANY, icons8_pentagon_square_50.GetBitmap())
        self.button_scale_down = wx.BitmapButton(
            self, wx.ID_ANY, icons8_compress_50.GetBitmap())
        self.button_translate_up = wx.BitmapButton(self, wx.ID_ANY,
                                                   icons8_up_50.GetBitmap())
        self.button_scale_up = wx.BitmapButton(self, wx.ID_ANY,
                                               icons8_enlarge_50.GetBitmap())
        self.button_translate_left = wx.BitmapButton(
            self, wx.ID_ANY, icons8_left_50.GetBitmap())
        self.button_reset = wx.BitmapButton(self, wx.ID_ANY,
                                            icons8_delete_50.GetBitmap())
        self.button_translate_right = wx.BitmapButton(
            self, wx.ID_ANY, icons8_right_50.GetBitmap())
        self.button_rotate_ccw = wx.BitmapButton(
            self, wx.ID_ANY, icons8_rotate_left_50.GetBitmap())
        self.button_translate_down = wx.BitmapButton(
            self, wx.ID_ANY, icons8_down_50.GetBitmap())
        self.button_rotate_cw = wx.BitmapButton(
            self, wx.ID_ANY, icons8_rotate_right_50.GetBitmap())
        self.text_a = wx.TextCtrl(self, wx.ID_ANY, "1.000000")
        self.text_c = wx.TextCtrl(self, wx.ID_ANY, "0.000000")
        self.text_d = wx.TextCtrl(self, wx.ID_ANY, "1.000000")
        self.text_b = wx.TextCtrl(self, wx.ID_ANY, "0.000000")
        self.text_e = wx.TextCtrl(self, wx.ID_ANY, "0.000000")
        self.text_f = wx.TextCtrl(self, wx.ID_ANY, "0.000000")

        self.button_navigate_pulse = wx.BitmapButton(
            self, wx.ID_ANY, icons8_laser_beam_52.GetBitmap())
        self.spin_pulse_duration = wx.SpinCtrl(self,
                                               wx.ID_ANY,
                                               "50",
                                               min=1,
                                               max=1000)
        self.button_navigate_move_to = wx.BitmapButton(
            self, wx.ID_ANY, icons8_center_of_gravity_50.GetBitmap())
        self.text_position_x = wx.TextCtrl(self, wx.ID_ANY, "0")
        self.text_position_y = wx.TextCtrl(self, wx.ID_ANY, "0")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_jog_distance,
                  self.spin_jog_mils)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_jog_distance,
                  self.spin_jog_mils)
        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_jog_distance,
                  self.spin_jog_mm)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_jog_distance,
                  self.spin_jog_mm)
        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_jog_distance,
                  self.spin_jog_cm)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_jog_distance,
                  self.spin_jog_cm)
        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_jog_distance,
                  self.spin_jog_inch)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_jog_distance,
                  self.spin_jog_inch)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_home,
                  self.button_navigate_home)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_ul,
                  self.button_navigate_up_left)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_u,
                  self.button_navigate_up)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_ur,
                  self.button_navigate_up_right)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_l,
                  self.button_navigate_left)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_r,
                  self.button_navigate_right)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_dl,
                  self.button_navigate_down_left)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_d,
                  self.button_navigate_down)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_dr,
                  self.button_navigate_down_right)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_unlock,
                  self.button_navigate_unlock)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_lock,
                  self.button_navigate_lock)
        self.Bind(wx.EVT_BUTTON, self.on_button_align_corner_tl,
                  self.button_align_corner_top_left)
        self.Bind(wx.EVT_BUTTON, self.on_button_align_drag_up,
                  self.button_align_drag_up)
        self.Bind(wx.EVT_BUTTON, self.on_button_align_corner_tr,
                  self.button_align_corner_top_right)
        self.Bind(wx.EVT_BUTTON, self.on_button_align_drag_left,
                  self.button_align_drag_left)
        self.Bind(wx.EVT_BUTTON, self.on_button_align_center,
                  self.button_align_center)
        self.Bind(wx.EVT_BUTTON, self.on_button_align_drag_right,
                  self.button_align_drag_right)
        self.Bind(wx.EVT_BUTTON, self.on_button_align_corner_bl,
                  self.button_align_corner_bottom_left)
        self.Bind(wx.EVT_BUTTON, self.on_button_align_drag_down,
                  self.button_align_drag_down)
        self.Bind(wx.EVT_BUTTON, self.on_button_align_corner_br,
                  self.button_align_corner_bottom_right)
        self.Bind(wx.EVT_BUTTON, self.on_button_align_first_position,
                  self.button_align_first_position)
        self.Bind(wx.EVT_BUTTON, self.on_button_align_trace_hull,
                  self.button_align_trace_hull)
        self.Bind(wx.EVT_BUTTON, self.on_button_align_trace_quick,
                  self.button_align_trace_quick)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_pulse,
                  self.button_navigate_pulse)

        self.Bind(wx.EVT_BUTTON, self.on_scale_down, self.button_scale_down)
        self.Bind(wx.EVT_BUTTON, self.on_translate_up,
                  self.button_translate_up)
        self.Bind(wx.EVT_BUTTON, self.on_scale_up, self.button_scale_up)
        self.Bind(wx.EVT_BUTTON, self.on_translate_left,
                  self.button_translate_left)
        self.Bind(wx.EVT_BUTTON, self.on_reset, self.button_reset)
        self.Bind(wx.EVT_BUTTON, self.on_translate_right,
                  self.button_translate_right)
        self.Bind(wx.EVT_BUTTON, self.on_rotate_ccw, self.button_rotate_ccw)
        self.Bind(wx.EVT_BUTTON, self.on_translate_down,
                  self.button_translate_down)
        self.Bind(wx.EVT_BUTTON, self.on_rotate_cw, self.button_rotate_cw)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_matrix, self.text_a)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_matrix, self.text_c)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_matrix, self.text_e)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_matrix, self.text_b)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_matrix, self.text_d)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_text_matrix, self.text_f)

        self.Bind(wx.EVT_SPINCTRL, self.on_spin_pulse_duration,
                  self.spin_pulse_duration)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_pulse_duration,
                  self.spin_pulse_duration)
        self.Bind(wx.EVT_BUTTON, self.on_button_navigate_move_to,
                  self.button_navigate_move_to)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
        self.elements = None
        self.console = None
        self.design_locked = False
        self.drag_ready(False)
        self.select_ready(False)

        # OSX Window close
        if parent is not None:
            parent.accelerator_table(self)