printrun-src/printrun/gui/controls.py

changeset 48
3c27b4ee6fec
parent 46
cce0af6351f0
equal deleted inserted replaced
47:dcc64b767b64 48:3c27b4ee6fec
1 # FILE MODIFIED BY NEOSOFT - MALTE DI DONATO
2 # Embed Lasercut controls
3
1 # This file is part of the Printrun suite. 4 # This file is part of the Printrun suite.
2 # 5 #
3 # Printrun is free software: you can redistribute it and/or modify 6 # Printrun is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by 7 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or 8 # the Free Software Foundation, either version 3 of the License, or
47 tempdisp_line = gauges_base_line + (2 if root.display_gauges else 0) 50 tempdisp_line = gauges_base_line + (2 if root.display_gauges else 0)
48 if mini_mode and root.display_graph: 51 if mini_mode and root.display_graph:
49 e_base_line = base_line + 3 52 e_base_line = base_line + 3
50 else: 53 else:
51 e_base_line = base_line + 2 54 e_base_line = base_line + 2
55
56 lasercut_base_line = 11
52 57
53 pos_mapping = { 58 pos_mapping = {
54 "htemp_label": (base_line + 0, 0), 59 "htemp_label": (base_line + 0, 0),
55 "htemp_off": (base_line + 0, 2), 60 "htemp_off": (base_line + 0, 2),
56 "htemp_val": (base_line + 0, 3), 61 "htemp_val": (base_line + 0, 3),
66 "htemp_gauge": (gauges_base_line + 0, 0), 71 "htemp_gauge": (gauges_base_line + 0, 0),
67 "btemp_gauge": (gauges_base_line + 1, 0), 72 "btemp_gauge": (gauges_base_line + 1, 0),
68 "tempdisp": (tempdisp_line, 0), 73 "tempdisp": (tempdisp_line, 0),
69 "extrude": (3, 0), 74 "extrude": (3, 0),
70 "reverse": (3, 2), 75 "reverse": (3, 2),
76 "lasercut_optionsbtn": (lasercut_base_line, 0),
77 "lasercut_printbtn": (lasercut_base_line, 2),
78 "lasercut_material_thickness": (lasercut_base_line+1, 4),
79 "lasercut_material_thickness_label": (lasercut_base_line+1, 0),
80 "lasercut_pass_count": (lasercut_base_line+2, 4),
81 "lasercut_pass_count_label": (lasercut_base_line+2, 0),
82 "lasercut_pass_zdiff": (lasercut_base_line+3, 4),
83 "lasercut_pass_zdiff_label": (lasercut_base_line+3, 0),
71 } 84 }
72 85
73 span_mapping = { 86 span_mapping = {
74 "htemp_label": (1, 2), 87 "htemp_label": (1, 2),
75 "htemp_off": (1, 1), 88 "htemp_off": (1, 1),
122 container = kwargs["container"] 135 container = kwargs["container"]
123 del kwargs["container"] 136 del kwargs["container"]
124 else: 137 else:
125 container = self 138 container = self
126 container.Add(widget, *args, **kwargs) 139 container.Add(widget, *args, **kwargs)
140
141 # Lasercutter quick controls #
142
143 root.lc_optionsbtn = make_button(parentpanel, _("Lasercutter options"), lambda e: PronterOptions(root, "Laser"), _("Open Lasercutter options"), style = wx.BU_EXACTFIT)
144 root.printerControls.append(root.lc_optionsbtn)
145 add("lasercut_optionsbtn", root.lc_optionsbtn, flag = wx.EXPAND)
146
147 root.lc_printbtn = make_button(parentpanel, _("Start cutting"), root.on_lc_printfile, _("Start printjob with lasercutting features"), style = wx.BU_EXACTFIT)
148 root.printerControls.append(root.lc_printbtn)
149 add("lasercut_printbtn", root.lc_printbtn, flag = wx.EXPAND)
150
151
152 root.lc_pass_count = speed_spin = FloatSpin(parentpanel, -1, value = root.settings.lc_pass_count, min_val = 1, max_val = 10, digits = 0, style = wx.ALIGN_LEFT, size = (80, -1))
153 add("lasercut_pass_count", root.lc_pass_count)
154 add("lasercut_pass_count_label", wx.StaticText(parentpanel, -1, _("Number of cutting passes:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT)
155
156 root.lc_pass_zdiff = speed_spin = FloatSpin(parentpanel, -1, increment = 0.1, value = root.settings.lc_pass_zdiff, min_val = -2, max_val = 2, digits = 1, style = wx.ALIGN_LEFT, size = (80, -1))
157 add("lasercut_pass_zdiff", root.lc_pass_zdiff)
158 add("lasercut_pass_zdiff_label", wx.StaticText(parentpanel, -1, _("Z movement after each cut:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT)
159
160 root.lc_material_thickness = speed_spin = FloatSpin(parentpanel, -1, increment = 0.1, value = root.settings.lc_material_thickness, min_val = 0, max_val = 75, digits = 1, style = wx.ALIGN_LEFT, size = (80, -1))
161 add("lasercut_material_thickness", root.lc_material_thickness)
162 add("lasercut_material_thickness_label", wx.StaticText(parentpanel, -1, _("Material Thickness:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT)
163
127 164
128 # Hotend & bed temperatures # 165 # Hotend & bed temperatures #
129 166
130 # Hotend temp 167 # Hotend temp
131 add("htemp_label", wx.StaticText(parentpanel, -1, _("Heat:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) 168 add("htemp_label", wx.StaticText(parentpanel, -1, _("Heat:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT)

mercurial