Esempio n. 1
0
 def __set_properties(self):
     # begin wxGlade: Controller.__set_properties
     self.SetTitle(_("TCP-Controller"))
     _icon = wx.NullIcon
     _icon.CopyFromBitmap(icons8_connected_50.GetBitmap())
     self.SetIcon(_icon)
     self.button_device_connect.SetBackgroundColour(wx.Colour(
         102, 255, 102))
     self.button_device_connect.SetForegroundColour(wx.BLACK)
     self.button_device_connect.SetFont(
         wx.Font(
             12,
             wx.FONTFAMILY_DEFAULT,
             wx.FONTSTYLE_NORMAL,
             wx.FONTWEIGHT_NORMAL,
             0,
             "Segoe UI",
         ))
     self.button_device_connect.SetToolTip(
         _("Force connection/disconnection from the device."))
     self.button_device_connect.SetBitmap(
         icons8_disconnected_50.GetBitmap(use_theme=False))
     self.text_status.SetToolTip(_("Connection status"))
     self.text_ip_host.SetToolTip(_("IP/Host if the server computer"))
     self.text_port.SetToolTip(
         _("Port for tcp connection on the server computer"))
     self.text_buffer_length.SetMinSize((165, 23))
     self.text_buffer_length.SetToolTip(
         _("Current number of bytes in the write buffer."))
     self.text_buffer_max.SetMinSize((165, 23))
     self.text_buffer_max.SetToolTip(
         _("Current number of bytes in the write buffer."))
Esempio n. 2
0
 def __set_properties(self):
     self.SetFont(wx.Font(9, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Segoe UI"))
     self.button_device_connect.SetBackgroundColour(wx.Colour(102, 255, 102))
     self.button_device_connect.SetForegroundColour(wx.BLACK)
     self.button_device_connect.SetBitmap(
         icons8_disconnected_50.GetBitmap(use_theme=False)
     )
     self.button_device_connect.SetFont(
         wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Segoe UI")
     )
     self.button_device_connect.SetToolTip(
         _("Force connection/disconnection from the device.")
     )
     self.text_connection_status.SetToolTip(_("Connection status"))
     self.checkbox_mock_usb.SetToolTip(
         _(
             "DEBUG. Without a K40 connected continue to process things as if there was one."
         )
     )
     self.text_device_index.SetMinSize((55, 23))
     self.spin_device_index.SetMinSize((40, 23))
     self.spin_device_index.SetToolTip(
         _(
             "Optional: Distinguish between different lasers using the match criteria below.\n"
             "-1 match anything. 0+ match exactly that value."
         )
     )
     self.text_device_address.SetMinSize((55, 23))
     self.spin_device_address.SetMinSize((40, 23))
     self.spin_device_address.SetToolTip(
         _(
             "Optional: Distinguish between different lasers using the match criteria below.\n"
             "-1 match anything. 0+ match exactly that value."
         )
     )
     self.text_device_bus.SetMinSize((55, 23))
     self.spin_device_bus.SetMinSize((40, 23))
     self.spin_device_bus.SetToolTip(
         _(
             "Optional: Distinguish between different lasers using the match criteria below.\n"
             "-1 match anything. 0+ match exactly that value."
         )
     )
     self.text_device_version.SetMinSize((55, 23))
     self.spin_device_version.SetMinSize((40, 23))
     self.spin_device_version.SetToolTip(
         _(
             "Optional: Distinguish between different lasers using the match criteria below.\n"
             "-1 match anything. 0+ match exactly that value."
         )
     )
     self.text_byte_0.SetMinSize((77, 23))
     self.text_byte_1.SetMinSize((77, 23))
     self.text_desc.SetMinSize((75, 23))
     self.text_desc.SetToolTip(_("The meaning of Byte 1"))
     self.text_byte_2.SetMinSize((77, 23))
     self.text_byte_3.SetMinSize((77, 23))
     self.text_byte_4.SetMinSize((77, 23))
     self.text_byte_5.SetMinSize((77, 23))
     self.checkbox_show_usb_log.SetValue(1)
Esempio n. 3
0
 def on_connection_state_change(self, origin, state):
     if state == "STATE_CONNECTION_FAILED" or state == "STATE_DRIVER_NO_BACKEND":
         self.button_device_connect.SetBackgroundColour("#dfdf00")
         origin, usb_status = self.context.last_signal("pipe;usb_status")
         if usb_status is not None:
             self.button_device_connect.SetLabel(str(usb_status[0]))
         self.button_device_connect.SetBitmap(
             icons8_disconnected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Enable()
     elif state == "STATE_UNINITIALIZED" or state == "STATE_USB_DISCONNECTED":
         self.button_device_connect.SetBackgroundColour("#ffff00")
         self.button_device_connect.SetLabel(_("Connect"))
         self.button_device_connect.SetBitmap(
             icons8_connected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Enable()
     elif state == "STATE_USB_SET_DISCONNECTING":
         self.button_device_connect.SetBackgroundColour("#ffff00")
         self.button_device_connect.SetLabel(_("Disconnecting..."))
         self.button_device_connect.SetBitmap(
             icons8_disconnected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Disable()
     elif state == "STATE_USB_CONNECTED" or state == "STATE_CONNECTED":
         self.button_device_connect.SetBackgroundColour("#00ff00")
         self.button_device_connect.SetLabel(_("Disconnect"))
         self.button_device_connect.SetBitmap(
             icons8_connected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Enable()
     elif state == "STATE_CONNECTING":
         self.button_device_connect.SetBackgroundColour("#ffff00")
         self.button_device_connect.SetLabel(_("Connecting..."))
         self.button_device_connect.SetBitmap(
             icons8_connected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Disable()
Esempio n. 4
0
 def on_serial_status(self, origin, state):
     self.state = state
     if state == "uninitialized" or state == "disconnected":
         self.button_device_connect.SetBackgroundColour("#ffff00")
         self.button_device_connect.SetLabel(_("Connect"))
         self.button_device_connect.SetBitmap(
             icons8_disconnected_50.GetBitmap(use_theme=False))
         self.button_device_connect.Enable()
     elif state == "connected":
         self.button_device_connect.SetBackgroundColour("#00ff00")
         self.button_device_connect.SetLabel(_("Disconnect"))
         self.button_device_connect.SetBitmap(
             icons8_connected_50.GetBitmap(use_theme=False))
         self.button_device_connect.Enable()
Esempio n. 5
0
 def __set_properties(self):
     self.button_device_connect.SetBackgroundColour(wx.Colour(
         102, 255, 102))
     self.button_device_connect.SetForegroundColour(wx.BLACK)
     self.button_device_connect.SetFont(
         wx.Font(
             12,
             wx.FONTFAMILY_DEFAULT,
             wx.FONTSTYLE_NORMAL,
             wx.FONTWEIGHT_NORMAL,
             0,
             "Segoe UI",
         ))
     self.button_device_connect.SetToolTip(
         _("Force connection/disconnection from the device."))
     self.button_device_connect.SetBitmap(
         icons8_disconnected_50.GetBitmap(use_theme=False))
Esempio n. 6
0
    def __set_properties(self):
        self.SetFont(wx.Font(9, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Segoe UI"))
        self.button_device_connect.SetBackgroundColour(wx.Colour(102, 255, 102))
        self.button_device_connect.SetForegroundColour(wx.BLACK)
        self.button_device_connect.SetFont(
            wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Segoe UI")
        )
        self.button_device_connect.SetToolTip(
            _("Force connection/disconnection from the device.")
        )
        self.text_connection_status.SetToolTip(_("Connection status"))

        self.button_controller_control.SetBackgroundColour(wx.Colour(102, 255, 102))
        self.button_controller_control.SetForegroundColour(wx.BLACK)
        self.button_controller_control.SetFont(
            wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Segoe UI")
        )
        self.button_controller_control.SetToolTip(
            _("Change the currently performed operation.")
        )
        self.text_controller_status.SetToolTip(
            _("Displays the controller's current process.")
        )
        self.packet_count_text.SetMinSize((77, 23))
        self.packet_count_text.SetToolTip(_("Total number of packets sent"))
        self.rejected_packet_count_text.SetMinSize((77, 23))
        self.rejected_packet_count_text.SetToolTip(
            _("Total number of packets rejected")
        )
        self.packet_text_text.SetToolTip(_("Last packet information sent"))
        self.text_byte_0.SetMinSize((77, 23))
        self.text_byte_1.SetMinSize((77, 23))
        self.text_desc.SetMinSize((75, 23))
        self.text_desc.SetToolTip(_("The meaning of Byte 1"))
        self.text_byte_2.SetMinSize((77, 23))
        self.text_byte_3.SetMinSize((77, 23))
        self.text_byte_4.SetMinSize((77, 23))
        self.text_byte_5.SetMinSize((77, 23))
        self.checkbox_show_usb_log.SetValue(1)
        self.button_device_connect.SetBitmap(
            icons8_disconnected_50.GetBitmap(use_theme=False)
        )
        self.button_controller_control.SetBitmap(
            icons8_play_50.GetBitmap(use_theme=False)
        )
Esempio n. 7
0
 def on_connection_state_change(self, origin, state):
     if origin != self.context._path:
         return
     if state == "STATE_CONNECTION_FAILED":
         self.button_device_connect.SetBackgroundColour("#dfdf00")
         origin, usb_status = self.context.last_signal("pipe;usb_status")
         self.button_device_connect.SetLabel(_("Connect Failed"))
         self.button_device_connect.SetBitmap(
             icons8_disconnected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Enable()
     elif state == "STATE_FAILED_RETRYING":
         self.button_device_connect.SetBackgroundColour("#df0000")
         origin, usb_status = self.context.last_signal("pipe;usb_status")
         self.button_device_connect.SetLabel(_("Retrying..."))
         self.button_device_connect.SetBitmap(
             icons8_disconnected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Enable()
     elif state == "STATE_FAILED_SUSPENDED":
         self.button_device_connect.SetBackgroundColour("#0000df")
         origin, usb_status = self.context.last_signal("pipe;usb_status")
         self.button_device_connect.SetLabel(_("Suspended Retrying"))
         self.button_device_connect.SetBitmap(
             icons8_disconnected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Enable()
     elif state == "STATE_DRIVER_NO_BACKEND":
         self.button_device_connect.SetBackgroundColour("#dfdf00")
         origin, usb_status = self.context.last_signal("pipe;usb_status")
         self.button_device_connect.SetLabel(_("No Backend"))
         self.button_device_connect.SetBitmap(
             icons8_disconnected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Enable()
     elif state == "STATE_UNINITIALIZED" or state == "STATE_USB_DISCONNECTED":
         self.button_device_connect.SetBackgroundColour("#ffff00")
         self.button_device_connect.SetLabel(_("Connect"))
         self.button_device_connect.SetBitmap(
             icons8_connected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Enable()
     elif state == "STATE_USB_SET_DISCONNECTING":
         self.button_device_connect.SetBackgroundColour("#ffff00")
         self.button_device_connect.SetLabel(_("Disconnecting..."))
         self.button_device_connect.SetBitmap(
             icons8_disconnected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Disable()
     elif state == "STATE_USB_CONNECTED" or state == "STATE_CONNECTED":
         self.button_device_connect.SetBackgroundColour("#00ff00")
         self.button_device_connect.SetLabel(_("Disconnect"))
         self.button_device_connect.SetBitmap(
             icons8_connected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Enable()
     elif state == "STATE_CONNECTING":
         self.button_device_connect.SetBackgroundColour("#ffff00")
         self.button_device_connect.SetLabel(_("Connecting..."))
         self.button_device_connect.SetBitmap(
             icons8_connected_50.GetBitmap(use_theme=False)
         )
         self.button_device_connect.Disable()
Esempio n. 8
0
 def set_button_disconnected(self):
     self.button_device_connect.SetBackgroundColour("#dfdf00")
     self.button_device_connect.SetBitmap(
         icons8_disconnected_50.GetBitmap(use_theme=False))
     self.button_device_connect.Enable()