コード例 #1
0
    def __init__(self, *args, **kwds):
        super().__init__(374, 734, *args, **kwds)
        self.context = self.context.device
        _icon = wx.NullIcon
        _icon.CopyFromBitmap(icons8_administrative_tools_50.GetBitmap())
        self.SetIcon(_icon)
        self.SetTitle(_("GRBL-Configuration"))

        self.notebook_main = wx.aui.AuiNotebook(
            self,
            -1,
            style=wx.aui.AUI_NB_TAB_EXTERNAL_MOVE
            | wx.aui.AUI_NB_SCROLL_BUTTONS
            | wx.aui.AUI_NB_TAB_SPLIT
            | wx.aui.AUI_NB_TAB_MOVE,
        )

        self.panel_main = ChoicePropertyPanel(self,
                                              wx.ID_ANY,
                                              context=self.context,
                                              choices="grbl-connection")
        self.panel_global = ChoicePropertyPanel(self,
                                                wx.ID_ANY,
                                                context=self.context,
                                                choices="grbl-global")
        self.panel_dim = ChoicePropertyPanel(self,
                                             wx.ID_ANY,
                                             context=self.context,
                                             choices="bed_dim")
        self.notebook_main.AddPage(self.panel_main, _("GRBL-connection"))
        self.notebook_main.AddPage(self.panel_dim, _("Bed Dim"))
        self.notebook_main.AddPage(self.panel_global, _("Global Settings"))
        self.Layout()
        self.add_module_delegate(self.panel_main)
        self.add_module_delegate(self.panel_global)
コード例 #2
0
ファイル: outputproperty.py プロジェクト: meerk40t/meerk40t
    def __init__(self, *args, context=None, node=None, **kwds):
        kwds["style"] = kwds.get("style", 0)
        wx.Panel.__init__(self, *args, **kwds)
        self.context = context
        self.operation = node

        choices = [
            {
                "attr": "value",
                "mask": "mask",
                "object": self.operation,
                "default": 0,
                "type": int,
                "style": "binary",
                "bits": 16,
                "label": _("Value Bits"),
                "tip": _("Input bits for given value"),
            },
        ]
        self.panel = ChoicePropertyPanel(self,
                                         wx.ID_ANY,
                                         context=self.context,
                                         choices=choices)
        main_sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(main_sizer)
        self.Layout()
コード例 #3
0
ファイル: balorconfig.py プロジェクト: meerk40t/meerk40t
    def __init__(self, *args, **kwds):
        super().__init__(374, 734, *args, **kwds)
        self.context = self.context.device
        _icon = wx.NullIcon
        _icon.CopyFromBitmap(icons8_administrative_tools_50.GetBitmap())
        self.SetIcon(_icon)
        self.SetTitle(_(_("Balor-Configuration")))

        self.notebook_main = wx.aui.AuiNotebook(
            self,
            -1,
            style=wx.aui.AUI_NB_TAB_EXTERNAL_MOVE
            | wx.aui.AUI_NB_SCROLL_BUTTONS
            | wx.aui.AUI_NB_TAB_SPLIT
            | wx.aui.AUI_NB_TAB_MOVE,
        )

        self.panel_main = ChoicePropertyPanel(self,
                                              wx.ID_ANY,
                                              context=self.context,
                                              choices="balor")
        self.panel_red = ChoicePropertyPanel(self,
                                             wx.ID_ANY,
                                             context=self.context,
                                             choices="balor-redlight")
        self.panel_global = ChoicePropertyPanel(self,
                                                wx.ID_ANY,
                                                context=self.context,
                                                choices="balor-global")
        self.panel_timing = ChoicePropertyPanel(self,
                                                wx.ID_ANY,
                                                context=self.context,
                                                choices="balor-global-timing")
        self.panel_extra = ChoicePropertyPanel(self,
                                               wx.ID_ANY,
                                               context=self.context,
                                               choices="balor-extra")
        self.notebook_main.AddPage(self.panel_main, _("Balor"))
        self.notebook_main.AddPage(self.panel_red, _("Redlight"))
        self.notebook_main.AddPage(self.panel_global, _("Global"))
        self.notebook_main.AddPage(self.panel_timing, _("Timings"))
        self.notebook_main.AddPage(self.panel_extra, _("Extras"))
        self.Layout()

        self.add_module_delegate(self.panel_main)
        self.add_module_delegate(self.panel_red)
        self.add_module_delegate(self.panel_global)
        self.add_module_delegate(self.panel_timing)
        self.add_module_delegate(self.panel_extra)
コード例 #4
0
ファイル: outputproperty.py プロジェクト: meerk40t/meerk40t
class OutputPropertyPanel(wx.Panel):
    name = "Output"

    def __init__(self, *args, context=None, node=None, **kwds):
        kwds["style"] = kwds.get("style", 0)
        wx.Panel.__init__(self, *args, **kwds)
        self.context = context
        self.operation = node

        choices = [
            {
                "attr": "value",
                "mask": "mask",
                "object": self.operation,
                "default": 0,
                "type": int,
                "style": "binary",
                "bits": 16,
                "label": _("Value Bits"),
                "tip": _("Input bits for given value"),
            },
        ]
        self.panel = ChoicePropertyPanel(self,
                                         wx.ID_ANY,
                                         context=self.context,
                                         choices=choices)
        main_sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(main_sizer)
        self.Layout()

    @signal_listener("mask")
    @signal_listener("value")
    def wait_changed(self, *args):
        self.context.elements.signal("element_property_update", self.operation)

    def pane_hide(self):
        self.panel.pane_hide()

    def pane_show(self):
        self.panel.pane_show()

    def set_widgets(self, node):
        self.operation = node
コード例 #5
0
class WaitPropertyPanel(wx.Panel):
    name = "Wait"

    def __init__(self, *args, context=None, node=None, **kwds):
        kwds["style"] = kwds.get("style", 0)
        wx.Panel.__init__(self, *args, **kwds)
        self.context = context
        self.operation = node

        choices = [
            {
                "attr": "wait",
                "object": self.operation,
                "default": 1.0,
                "type": float,
                "label": _("Wait time for pause in execution (in seconds)"),
                "tip": _("Set the wait time for pausing the laser execution."),
            },
        ]
        self.panel = ChoicePropertyPanel(self,
                                         wx.ID_ANY,
                                         context=self.context,
                                         choices=choices)
        main_sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(main_sizer)
        self.Layout()

    @signal_listener("wait")
    def wait_changed(self, *args):
        self.context.elements.signal("element_property_update", self.operation)

    def pane_hide(self):
        self.panel.pane_hide()

    def pane_show(self):
        self.panel.pane_show()

    def set_widgets(self, node):
        self.operation = node
コード例 #6
0
    def __init__(self, *args, context=None, node=None, **kwds):
        kwds["style"] = kwds.get("style", 0)
        wx.Panel.__init__(self, *args, **kwds)
        self.context = context
        self.operation = node

        choices = [
            {
                "attr": "wait",
                "object": self.operation,
                "default": 1.0,
                "type": float,
                "label": _("Wait time for pause in execution (in seconds)"),
                "tip": _("Set the wait time for pausing the laser execution."),
            },
        ]
        self.panel = ChoicePropertyPanel(self,
                                         wx.ID_ANY,
                                         context=self.context,
                                         choices=choices)
        main_sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(main_sizer)
        self.Layout()
コード例 #7
0
def register_panel_laser(window, context):
    laser_panel = LaserPanel(window, wx.ID_ANY, context=context)
    optimize_panel = ChoicePropertyPanel(window,
                                         wx.ID_ANY,
                                         context=context,
                                         choices="optimize")
    notebook = wx.aui.AuiNotebook(
        window,
        -1,
        style=wx.aui.AUI_NB_TAB_EXTERNAL_MOVE
        | wx.aui.AUI_NB_SCROLL_BUTTONS
        | wx.aui.AUI_NB_TAB_SPLIT
        | wx.aui.AUI_NB_TAB_MOVE
        | wx.aui.AUI_NB_BOTTOM,
    )
    pane = (aui.AuiPaneInfo().Left().MinSize(150, 210).FloatingSize(
        400, 200).MaxSize(500, 300).Caption(
            _("Laser")).CaptionVisible(not context.pane_lock).Name("laser"))
    pane.control = notebook
    pane.dock_proportion = 150
    notebook.AddPage(laser_panel, _("Laser"))
    notebook.AddPage(optimize_panel, _("Optimize"))

    window.on_pane_add(pane)
    window.context.register("pane/laser", pane)
    choices = [
        {
            "attr": "laserpane_arm",
            "object": context.root,
            "default": False,
            "type": bool,
            "label": _("Enable Laser Arm"),
            "tip": _("Enable Laser Panel Arm/Disarm feature."),
            "page": "Laser",
            "section": "General",
        },
    ]
    context.kernel.register_choices("preferences", choices)
コード例 #8
0
    def __init__(self, *args, context=None, node=None, **kwds):
        kwds["style"] = kwds.get("style", 0)
        wx.Panel.__init__(self, *args, **kwds)
        self.context = context
        self.operation = node
        params = Parameters(self.operation.settings)
        params.validate()

        choices = [
            {
                "attr": "rapid_enabled",
                "object": params,
                "default": False,
                "type": bool,
                "label": _("Enable Custom Rapid-Speed"),
                "tip": _("Enable custom jump speed for this operation"),
            },
            {
                "attr": "rapid_speed",
                "object": params,
                "default": 2000.0,
                "type": float,
                "conditional": (params, "rapid_enabled"),
                "label": _("Travel Speed"),
                "tip": _("How fast do we travel when not cutting?"),
            },
            {
                "attr": "pulse_width_enabled",
                "object": params,
                "default": False,
                "type": bool,
                "conditional": (self.context.device, "pulse_width_enabled"),
                "label": _("Enable Custom Pulse Width"),
                "tip": _("Override the global pulse width setting (MOPA)"),
            },
            {
                "attr": "pulse_width",
                "object": params,
                "default": self.context.device.default_pulse_width,
                "type": int,
                "conditional": (params, "pulse_width_enabled"),
                "label": _("Set Pulse Width (ns)"),
                "tip": _("Set the MOPA pulse width setting"),
            },
            {
                "attr": "timing_enabled",
                "object": params,
                "default": False,
                "type": bool,
                "label": _("Enable Custom Timings"),
                "tip": _("Enable custom timings for this operation"),
            },
            {
                "attr": "delay_laser_on",
                "object": params,
                "default": 100.0,
                "type": float,
                "conditional": (params, "timing_enabled"),
                "label": _("Laser On Delay"),
                "tip": _("Delay for the start of the laser"),
            },
            {
                "attr": "delay_laser_off",
                "object": params,
                "default": 100.0,
                "type": float,
                "conditional": (params, "timing_enabled"),
                "label": _("Laser Off Delay"),
                "tip": _("Delay amount for the end of the laser"),
            },
            {
                "attr":
                "delay_polygon",
                "object":
                params,
                "default":
                100.0,
                "type":
                float,
                "conditional": (params, "timing_enabled"),
                "label":
                _("Polygon Delay"),
                "tip":
                _("Delay amount between different points in the path travel."),
            },
            {
                "attr": "wobble_enabled",
                "object": params,
                "default": False,
                "type": bool,
                "label": _("Enable Wobble"),
                "tip": _("Enable wobble for this particular cut"),
            },
            {
                "attr":
                "wobble_radius",
                "object":
                params,
                "default":
                "1.5mm",
                "type":
                Length,
                "conditional": (params, "wobble_enabled"),
                "label":
                _("Radius of wobble"),
                "tip":
                _("Radius of the wobble for this cut, if wobble is enabled."),
            },
            {
                "attr": "wobble_interval",
                "object": params,
                "default": "0.2mm",
                "type": Length,
                "conditional": (params, "wobble_enabled"),
                "label": _("Wobble Sampling Interval"),
                "tip": _("Sample interval for the wobble of this cut"),
            },
            {
                "attr": "wobble_speed",
                "object": params,
                "default": 50.0,
                "type": float,
                "conditional": (params, "wobble_enabled"),
                "label": _("Wobble Speed Multiplier"),
                "tip": _("Wobble rotation speed multiplier"),
            },
            {
                "attr": "wobble_type",
                "object": params,
                "default": "circle",
                "type": str,
                "style": "combo",
                "choices": list(self.context.match("wobble", suffix=True)),
                "conditional": (params, "wobble_enabled"),
                "label": _("Wobble Pattern Type"),
                "tip": _("Pattern type for the given wobble."),
            },
        ]

        self.panel = ChoicePropertyPanel(self,
                                         wx.ID_ANY,
                                         context=self.context,
                                         choices=choices,
                                         scrolling=False)

        main_sizer = wx.BoxSizer(wx.VERTICAL)
        main_sizer.Add(self.panel, 1, wx.EXPAND, 0)

        self.SetSizer(main_sizer)

        self.Layout()