24 from .widgets import TempGauge |
21 from .widgets import TempGauge |
25 from wx.lib.agw.floatspin import FloatSpin |
22 from wx.lib.agw.floatspin import FloatSpin |
26 |
23 |
27 from .utils import make_button, make_custom_button |
24 from .utils import make_button, make_custom_button |
28 |
25 |
29 from .widgets import PronterOptions |
|
30 |
|
31 class XYZControlsSizer(wx.GridBagSizer): |
26 class XYZControlsSizer(wx.GridBagSizer): |
32 |
27 |
33 def __init__(self, root, parentpanel = None): |
28 def __init__(self, root, parentpanel = None): |
34 super(XYZControlsSizer, self).__init__() |
29 super(XYZControlsSizer, self).__init__() |
35 if not parentpanel: parentpanel = root.panel |
30 if not parentpanel: parentpanel = root.panel |
36 root.xyb = XYButtons(parentpanel, root.moveXY, root.homeButtonClicked, root.spacebarAction, root.bgcolor, zcallback=root.moveZ) |
31 root.xyb = XYButtons(parentpanel, root.moveXY, root.homeButtonClicked, root.spacebarAction, root.bgcolor, zcallback=root.moveZ) |
|
32 root.xyb.SetToolTip(_('[J]og controls. (Shift)+TAB ESC Shift/Ctrl+(arrows PgUp/PgDn)')) |
37 self.Add(root.xyb, pos = (0, 1), flag = wx.ALIGN_CENTER) |
33 self.Add(root.xyb, pos = (0, 1), flag = wx.ALIGN_CENTER) |
38 root.zb = ZButtons(parentpanel, root.moveZ, root.bgcolor) |
34 root.zb = ZButtons(parentpanel, root.moveZ, root.bgcolor) |
39 self.Add(root.zb, pos = (0, 2), flag = wx.ALIGN_CENTER) |
35 self.Add(root.zb, pos = (0, 2), flag = wx.ALIGN_CENTER) |
40 wx.CallAfter(root.xyb.SetFocus) |
|
41 |
36 |
42 def add_extra_controls(self, root, parentpanel, extra_buttons = None, mini_mode = False): |
37 def add_extra_controls(self, root, parentpanel, extra_buttons = None, mini_mode = False): |
43 standalone_mode = extra_buttons is not None |
38 standalone_mode = extra_buttons is not None |
44 base_line = 1 if standalone_mode else 2 |
39 base_line = 1 if standalone_mode else 2 |
45 |
40 |
138 del kwargs["container"] |
123 del kwargs["container"] |
139 else: |
124 else: |
140 container = self |
125 container = self |
141 container.Add(widget, *args, **kwargs) |
126 container.Add(widget, *args, **kwargs) |
142 |
127 |
143 # Lasercutter quick controls # |
|
144 |
|
145 root.lc_optionsbtn = make_button(parentpanel, _("Lasercutter options"), lambda e: PronterOptions(root, "Laser"), _("Open Lasercutter options"), style = wx.BU_EXACTFIT) |
|
146 root.printerControls.append(root.lc_optionsbtn) |
|
147 add("lasercut_optionsbtn", root.lc_optionsbtn, flag = wx.EXPAND) |
|
148 |
|
149 root.lc_printbtn = make_button(parentpanel, _("Start cutting"), root.on_lc_printfile, _("Start printjob with lasercutting features"), style = wx.BU_EXACTFIT) |
|
150 root.printerControls.append(root.lc_printbtn) |
|
151 add("lasercut_printbtn", root.lc_printbtn, flag = wx.EXPAND) |
|
152 |
|
153 |
|
154 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)) |
|
155 add("lasercut_pass_count", root.lc_pass_count) |
|
156 add("lasercut_pass_count_label", wx.StaticText(parentpanel, -1, _("Number of cutting passes:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT) |
|
157 |
|
158 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)) |
|
159 add("lasercut_pass_zdiff", root.lc_pass_zdiff) |
|
160 add("lasercut_pass_zdiff_label", wx.StaticText(parentpanel, -1, _("Z movement after each cut:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT) |
|
161 |
|
162 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)) |
|
163 add("lasercut_material_thickness", root.lc_material_thickness) |
|
164 add("lasercut_material_thickness_label", wx.StaticText(parentpanel, -1, _("Material Thickness:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT) |
|
165 |
|
166 |
|
167 |
|
168 # Hotend & bed temperatures # |
128 # Hotend & bed temperatures # |
169 |
129 |
170 # Hotend temp |
130 # Hotend temp |
171 add("htemp_label", wx.StaticText(parentpanel, -1, _("Heat:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) |
131 add("htemp_label", wx.StaticText(parentpanel, -1, _("Heat:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) |
172 htemp_choices = [root.temps[i] + " (" + i + ")" for i in sorted(root.temps.keys(), key = lambda x:root.temps[x])] |
|
173 |
132 |
174 root.settoff = make_button(parentpanel, _("Off"), lambda e: root.do_settemp("off"), _("Switch Hotend Off"), size = (38, -1), style = wx.BU_EXACTFIT) |
133 root.settoff = make_button(parentpanel, _("Off"), lambda e: root.do_settemp("off"), _("Switch Hotend Off"), size = (38, -1), style = wx.BU_EXACTFIT) |
175 root.printerControls.append(root.settoff) |
134 root.printerControls.append(root.settoff) |
176 add("htemp_off", root.settoff) |
135 add("htemp_off", root.settoff) |
177 |
136 |
178 if root.settings.last_temperature not in map(float, root.temps.values()): |
137 root.htemp = wx.ComboBox(parentpanel, style = wx.CB_DROPDOWN, size = (115, -1)) |
179 htemp_choices = [str(root.settings.last_temperature)] + htemp_choices |
138 root.htemp.SetToolTip(wx.ToolTip(_("Select Temperature for [H]otend"))) |
180 root.htemp = wx.ComboBox(parentpanel, -1, choices = htemp_choices, |
|
181 style = wx.CB_DROPDOWN, size = (80, -1)) |
|
182 root.htemp.SetToolTip(wx.ToolTip(_("Select Temperature for Hotend"))) |
|
183 root.htemp.Bind(wx.EVT_COMBOBOX, root.htemp_change) |
139 root.htemp.Bind(wx.EVT_COMBOBOX, root.htemp_change) |
184 |
140 |
185 add("htemp_val", root.htemp) |
141 add("htemp_val", root.htemp) |
186 root.settbtn = make_button(parentpanel, _("Set"), root.do_settemp, _("Switch Hotend On"), size = (38, -1), style = wx.BU_EXACTFIT) |
142 root.settbtn = make_button(parentpanel, _("Set"), root.do_settemp, _("Switch Hotend On"), size = (38, -1), style = wx.BU_EXACTFIT) |
187 root.printerControls.append(root.settbtn) |
143 root.printerControls.append(root.settbtn) |
188 add("htemp_set", root.settbtn, flag = wx.EXPAND) |
144 add("htemp_set", root.settbtn, flag = wx.EXPAND) |
189 |
145 |
190 # Bed temp |
146 # Bed temp |
191 add("btemp_label", wx.StaticText(parentpanel, -1, _("Bed:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) |
147 add("btemp_label", wx.StaticText(parentpanel, -1, _("Bed:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) |
192 btemp_choices = [root.bedtemps[i] + " (" + i + ")" for i in sorted(root.bedtemps.keys(), key = lambda x:root.temps[x])] |
|
193 |
148 |
194 root.setboff = make_button(parentpanel, _("Off"), lambda e: root.do_bedtemp("off"), _("Switch Heated Bed Off"), size = (38, -1), style = wx.BU_EXACTFIT) |
149 root.setboff = make_button(parentpanel, _("Off"), lambda e: root.do_bedtemp("off"), _("Switch Heated Bed Off"), size = (38, -1), style = wx.BU_EXACTFIT) |
195 root.printerControls.append(root.setboff) |
150 root.printerControls.append(root.setboff) |
196 add("btemp_off", root.setboff) |
151 add("btemp_off", root.setboff) |
197 |
152 |
198 if root.settings.last_bed_temperature not in map(float, root.bedtemps.values()): |
153 root.btemp = wx.ComboBox(parentpanel, style = wx.CB_DROPDOWN, size = (115, -1)) |
199 btemp_choices = [str(root.settings.last_bed_temperature)] + btemp_choices |
154 root.btemp.SetToolTip(wx.ToolTip(_("Select Temperature for Heated [B]ed"))) |
200 root.btemp = wx.ComboBox(parentpanel, -1, choices = btemp_choices, |
|
201 style = wx.CB_DROPDOWN, size = (80, -1)) |
|
202 root.btemp.SetToolTip(wx.ToolTip(_("Select Temperature for Heated Bed"))) |
|
203 root.btemp.Bind(wx.EVT_COMBOBOX, root.btemp_change) |
155 root.btemp.Bind(wx.EVT_COMBOBOX, root.btemp_change) |
204 add("btemp_val", root.btemp) |
156 add("btemp_val", root.btemp) |
205 |
157 |
206 root.setbbtn = make_button(parentpanel, _("Set"), root.do_bedtemp, _("Switch Heated Bed On"), size = (38, -1), style = wx.BU_EXACTFIT) |
158 root.setbbtn = make_button(parentpanel, _("Set"), root.do_bedtemp, _("Switch Heated Bed On"), size = (38, -1), style = wx.BU_EXACTFIT) |
207 root.printerControls.append(root.setbbtn) |
159 root.printerControls.append(root.setbbtn) |
208 add("btemp_set", root.setbbtn, flag = wx.EXPAND) |
160 add("btemp_set", root.setbbtn, flag = wx.EXPAND) |
209 |
161 |
210 root.btemp.SetValue(str(root.settings.last_bed_temperature)) |
162 def set_labeled(temp, choices, widget): |
211 root.htemp.SetValue(str(root.settings.last_temperature)) |
163 choices = [(float(p[1]), p[0]) for p in choices.items()] |
212 |
164 if not next((1 for p in choices if p[0] == temp), False): |
213 # added for an error where only the bed would get (pla) or (abs). |
165 choices.append((temp, 'user')) |
214 # This ensures, if last temp is a default pla or abs, it will be marked so. |
166 |
215 # if it is not, then a (user) remark is added. This denotes a manual entry |
167 choices = sorted(choices) |
216 |
168 widget.Items = ['%s (%s)'%tl for tl in choices] |
217 for i in btemp_choices: |
169 widget.Selection = next((i for i, tl in enumerate(choices) if tl[0] == temp), -1) |
218 if i.split()[0] == str(root.settings.last_bed_temperature).split('.')[0] or i.split()[0] == str(root.settings.last_bed_temperature): |
170 |
219 root.btemp.SetValue(i) |
171 set_labeled(root.settings.last_bed_temperature, root.bedtemps, root.btemp) |
220 for i in htemp_choices: |
172 set_labeled(root.settings.last_temperature, root.temps, root.htemp) |
221 if i.split()[0] == str(root.settings.last_temperature).split('.')[0] or i.split()[0] == str(root.settings.last_temperature): |
|
222 root.htemp.SetValue(i) |
|
223 |
|
224 if '(' not in root.btemp.Value: |
|
225 root.btemp.SetValue(root.btemp.Value + ' (user)') |
|
226 if '(' not in root.htemp.Value: |
|
227 root.htemp.SetValue(root.htemp.Value + ' (user)') |
|
228 |
173 |
229 # Speed control # |
174 # Speed control # |
230 speedpanel = root.newPanel(parentpanel) |
175 speedpanel = root.newPanel(parentpanel) |
231 speedsizer = wx.BoxSizer(wx.HORIZONTAL) |
176 speedsizer = wx.BoxSizer(wx.HORIZONTAL) |
232 speedsizer.Add(wx.StaticText(speedpanel, -1, _("Print speed:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) |
177 speedsizer.Add(wx.StaticText(speedpanel, -1, _("Print speed:")), flag = wx.ALIGN_CENTER_VERTICAL) |
233 |
178 |
234 root.speed_slider = wx.Slider(speedpanel, -1, 100, 1, 300) |
179 root.speed_slider = wx.Slider(speedpanel, -1, 100, 1, 300) |
235 speedsizer.Add(root.speed_slider, 1, flag = wx.EXPAND) |
180 speedsizer.Add(root.speed_slider, 1, flag = wx.EXPAND) |
236 |
181 |
237 root.speed_spin = FloatSpin(speedpanel, -1, value = 100, min_val = 1, max_val = 300, digits = 0, style = wx.ALIGN_LEFT, size = (80, -1)) |
182 root.speed_spin = wx.SpinCtrlDouble(speedpanel, -1, initial = 100, min = 1, max = 300, style = wx.ALIGN_LEFT, size = (115, -1)) |
|
183 root.speed_spin.SetDigits(0) |
238 speedsizer.Add(root.speed_spin, 0, flag = wx.ALIGN_CENTER_VERTICAL) |
184 speedsizer.Add(root.speed_spin, 0, flag = wx.ALIGN_CENTER_VERTICAL) |
239 root.speed_label = wx.StaticText(speedpanel, -1, _("%")) |
185 root.speed_label = wx.StaticText(speedpanel, -1, _("%")) |
240 speedsizer.Add(root.speed_label, flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) |
186 speedsizer.Add(root.speed_label, flag = wx.ALIGN_CENTER_VERTICAL) |
241 |
187 |
242 def speedslider_set(event): |
188 def speedslider_set(event): |
243 root.do_setspeed() |
189 root.do_setspeed() |
244 root.speed_setbtn.SetBackgroundColour(wx.NullColour) |
190 root.speed_setbtn.SetBackgroundColour(wx.NullColour) |
245 root.speed_setbtn = make_button(speedpanel, _("Set"), speedslider_set, _("Set print speed factor"), size = (38, -1), style = wx.BU_EXACTFIT) |
191 root.speed_setbtn = make_button(speedpanel, _("Set"), speedslider_set, _("Set print speed factor"), size = (38, -1), style = wx.BU_EXACTFIT) |
250 |
196 |
251 def speedslider_spin(event): |
197 def speedslider_spin(event): |
252 value = root.speed_spin.GetValue() |
198 value = root.speed_spin.GetValue() |
253 root.speed_setbtn.SetBackgroundColour("red") |
199 root.speed_setbtn.SetBackgroundColour("red") |
254 root.speed_slider.SetValue(value) |
200 root.speed_slider.SetValue(value) |
255 root.speed_spin.Bind(wx.EVT_SPINCTRL, speedslider_spin) |
201 root.speed_spin.Bind(wx.EVT_SPINCTRLDOUBLE, speedslider_spin) |
256 |
202 |
257 def speedslider_scroll(event): |
203 def speedslider_scroll(event): |
258 value = root.speed_slider.GetValue() |
204 value = root.speed_slider.GetValue() |
259 root.speed_setbtn.SetBackgroundColour("red") |
205 root.speed_setbtn.SetBackgroundColour("red") |
260 root.speed_spin.SetValue(value) |
206 root.speed_spin.SetValue(value) |
261 root.speed_slider.Bind(wx.EVT_SCROLL, speedslider_scroll) |
207 root.speed_slider.Bind(wx.EVT_SCROLL, speedslider_scroll) |
262 |
208 |
263 # Flow control # |
209 # Flow control # |
264 flowpanel = root.newPanel(parentpanel) |
210 flowpanel = root.newPanel(parentpanel) |
265 flowsizer = wx.BoxSizer(wx.HORIZONTAL) |
211 flowsizer = wx.BoxSizer(wx.HORIZONTAL) |
266 flowsizer.Add(wx.StaticText(flowpanel, -1, _("Print flow:")), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) |
212 flowsizer.Add(wx.StaticText(flowpanel, -1, _("Print flow:")), flag = wx.ALIGN_CENTER_VERTICAL) |
267 |
213 |
268 root.flow_slider = wx.Slider(flowpanel, -1, 100, 1, 300) |
214 root.flow_slider = wx.Slider(flowpanel, -1, 100, 1, 300) |
269 flowsizer.Add(root.flow_slider, 1, flag = wx.EXPAND) |
215 flowsizer.Add(root.flow_slider, 1, flag = wx.EXPAND) |
270 |
216 |
271 root.flow_spin = FloatSpin(flowpanel, -1, value = 100, min_val = 1, max_val = 300, digits = 0, style = wx.ALIGN_LEFT, size = (60, -1)) |
217 root.flow_spin = wx.SpinCtrlDouble(flowpanel, -1, initial = 100, min = 1, max = 300, style = wx.ALIGN_LEFT, size = (115, -1)) |
272 flowsizer.Add(root.flow_spin, 0, flag = wx.ALIGN_CENTER_VERTICAL) |
218 flowsizer.Add(root.flow_spin, 0, flag = wx.ALIGN_CENTER_VERTICAL) |
273 root.flow_label = wx.StaticText(flowpanel, -1, _("%")) |
219 root.flow_label = wx.StaticText(flowpanel, -1, _("%")) |
274 flowsizer.Add(root.flow_label, flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) |
220 flowsizer.Add(root.flow_label, flag = wx.ALIGN_CENTER_VERTICAL) |
275 |
221 |
276 def flowslider_set(event): |
222 def flowslider_set(event): |
277 root.do_setflow() |
223 root.do_setflow() |
278 root.flow_setbtn.SetBackgroundColour(wx.NullColour) |
224 root.flow_setbtn.SetBackgroundColour(wx.NullColour) |
279 root.flow_setbtn = make_button(flowpanel, _("Set"), flowslider_set, _("Set print flow factor"), size = (38, -1), style = wx.BU_EXACTFIT) |
225 root.flow_setbtn = make_button(flowpanel, _("Set"), flowslider_set, _("Set print flow factor"), size = (38, -1), style = wx.BU_EXACTFIT) |
296 |
242 |
297 # Temperature gauges # |
243 # Temperature gauges # |
298 |
244 |
299 if root.display_gauges: |
245 if root.display_gauges: |
300 root.hottgauge = TempGauge(parentpanel, size = (-1, 24), title = _("Heater:"), maxval = 300, bgcolor = root.bgcolor) |
246 root.hottgauge = TempGauge(parentpanel, size = (-1, 24), title = _("Heater:"), maxval = 300, bgcolor = root.bgcolor) |
|
247 root.hottgauge.SetTarget(root.settings.last_temperature) |
|
248 # root.hsetpoint = root.settings.last_temperature |
301 add("htemp_gauge", root.hottgauge, flag = wx.EXPAND) |
249 add("htemp_gauge", root.hottgauge, flag = wx.EXPAND) |
302 root.bedtgauge = TempGauge(parentpanel, size = (-1, 24), title = _("Bed:"), maxval = 150, bgcolor = root.bgcolor) |
250 root.bedtgauge = TempGauge(parentpanel, size = (-1, 24), title = _("Bed:"), maxval = 150, bgcolor = root.bgcolor) |
|
251 root.bedtgauge.SetTarget(root.settings.last_bed_temperature) |
|
252 # root.bsetpoint = root.settings.last_bed_temperature |
303 add("btemp_gauge", root.bedtgauge, flag = wx.EXPAND) |
253 add("btemp_gauge", root.bedtgauge, flag = wx.EXPAND) |
304 |
254 |
305 def hotendgauge_scroll_setpoint(e): |
255 def scroll_gauge(rot, cmd, setpoint): |
306 rot = e.GetWheelRotation() |
256 if rot: |
307 if rot > 0: |
257 temp = setpoint + (1 if rot > 0 else -1) |
308 root.do_settemp(str(root.hsetpoint + 1)) |
258 cmd(str(max(0, temp))) |
309 elif rot < 0: |
259 |
310 root.do_settemp(str(max(0, root.hsetpoint - 1))) |
260 def hotend_handler(e): |
311 |
261 scroll_gauge(e.WheelRotation, root.do_settemp, root.hsetpoint) |
312 def bedgauge_scroll_setpoint(e): |
262 |
313 rot = e.GetWheelRotation() |
263 def bed_handler(e): |
314 if rot > 0: |
264 scroll_gauge(e.WheelRotation, root.do_bedtemp, root.bsetpoint) |
315 root.do_settemp(str(root.bsetpoint + 1)) |
265 root.hottgauge.Bind(wx.EVT_MOUSEWHEEL, hotend_handler) |
316 elif rot < 0: |
266 root.bedtgauge.Bind(wx.EVT_MOUSEWHEEL, bed_handler) |
317 root.do_settemp(str(max(0, root.bsetpoint - 1))) |
267 |
318 root.hottgauge.Bind(wx.EVT_MOUSEWHEEL, hotendgauge_scroll_setpoint) |
268 def updateGauge(e, gauge): |
319 root.bedtgauge.Bind(wx.EVT_MOUSEWHEEL, bedgauge_scroll_setpoint) |
269 gauge.SetTarget(float(e.String.split()[0])) |
|
270 |
|
271 root.htemp.Bind(wx.EVT_TEXT, lambda e: updateGauge(e, root.hottgauge)) |
|
272 root.btemp.Bind(wx.EVT_TEXT, lambda e: updateGauge(e, root.bedtgauge)) |
320 |
273 |
321 # Temperature (M105) feedback display # |
274 # Temperature (M105) feedback display # |
322 root.tempdisp = wx.StaticText(parentpanel, -1, "", style = wx.ST_NO_AUTORESIZE) |
275 root.tempdisp = wx.StaticText(parentpanel, -1, "", style = wx.ST_NO_AUTORESIZE) |
323 |
276 |
324 def on_tempdisp_size(evt): |
277 def on_tempdisp_size(evt): |
343 |
296 |
344 # Extrusion settings |
297 # Extrusion settings |
345 esettingspanel = root.newPanel(parentpanel) |
298 esettingspanel = root.newPanel(parentpanel) |
346 esettingssizer = wx.GridBagSizer() |
299 esettingssizer = wx.GridBagSizer() |
347 esettingssizer.SetEmptyCellSize((0, 0)) |
300 esettingssizer.SetEmptyCellSize((0, 0)) |
348 root.edist = FloatSpin(esettingspanel, -1, value = root.settings.last_extrusion, min_val = 0, max_val = 1000, size = (90, -1), digits = 1) |
301 root.edist = wx.SpinCtrlDouble(esettingspanel, -1, initial = root.settings.last_extrusion, min = 0, max = 1000, size = (135, -1)) |
|
302 root.edist.SetDigits(1) |
|
303 root.edist.Bind(wx.EVT_SPINCTRLDOUBLE, root.setfeeds) |
349 root.edist.SetBackgroundColour((225, 200, 200)) |
304 root.edist.SetBackgroundColour((225, 200, 200)) |
350 root.edist.SetForegroundColour("black") |
305 root.edist.SetForegroundColour("black") |
351 root.edist.Bind(wx.EVT_SPINCTRL, root.setfeeds) |
|
352 root.edist.Bind(wx.EVT_TEXT, root.setfeeds) |
306 root.edist.Bind(wx.EVT_TEXT, root.setfeeds) |
353 add("edist_label", wx.StaticText(esettingspanel, -1, _("Length:")), container = esettingssizer, flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT | wx.RIGHT | wx.LEFT, border = 5) |
307 add("edist_label", wx.StaticText(esettingspanel, -1, _("Length:")), container = esettingssizer, flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT | wx.RIGHT | wx.LEFT, border = 5) |
354 add("edist_val", root.edist, container = esettingssizer, flag = wx.ALIGN_CENTER | wx.RIGHT, border = 5) |
308 add("edist_val", root.edist, container = esettingssizer, flag = wx.ALIGN_CENTER | wx.RIGHT, border = 5) |
355 unit_label = _("mm") if mini_mode else _("mm @") |
309 unit_label = _("mm") if mini_mode else _("mm @") |
356 add("edist_unit", wx.StaticText(esettingspanel, -1, unit_label), container = esettingssizer, flag = wx.ALIGN_CENTER | wx.RIGHT, border = 5) |
310 add("edist_unit", wx.StaticText(esettingspanel, -1, unit_label), container = esettingssizer, flag = wx.ALIGN_CENTER | wx.RIGHT, border = 5) |
357 root.edist.SetToolTip(wx.ToolTip(_("Amount to Extrude or Retract (mm)"))) |
311 root.edist.SetToolTip(wx.ToolTip(_("Amount to Extrude or Retract (mm)"))) |
358 if not mini_mode: |
312 if not mini_mode: |
359 root.efeedc = FloatSpin(esettingspanel, -1, value = root.settings.e_feedrate, min_val = 0, max_val = 50000, size = (90, -1), digits = 1) |
313 root.efeedc = wx.SpinCtrlDouble(esettingspanel, -1, initial = root.settings.e_feedrate, min = 0, max = 50000, size = (145, -1)) |
|
314 root.efeedc.SetDigits(1) |
|
315 root.efeedc.Bind(wx.EVT_SPINCTRLDOUBLE, root.setfeeds) |
360 root.efeedc.SetToolTip(wx.ToolTip(_("Extrude / Retract speed (mm/min)"))) |
316 root.efeedc.SetToolTip(wx.ToolTip(_("Extrude / Retract speed (mm/min)"))) |
361 root.efeedc.SetBackgroundColour((225, 200, 200)) |
317 root.efeedc.SetBackgroundColour((225, 200, 200)) |
362 root.efeedc.SetForegroundColour("black") |
318 root.efeedc.SetForegroundColour("black") |
363 root.efeedc.Bind(wx.EVT_SPINCTRL, root.setfeeds) |
|
364 root.efeedc.Bind(wx.EVT_TEXT, root.setfeeds) |
319 root.efeedc.Bind(wx.EVT_TEXT, root.setfeeds) |
365 add("efeed_val", root.efeedc, container = esettingssizer, flag = wx.ALIGN_CENTER | wx.RIGHT, border = 5) |
320 add("efeed_val", root.efeedc, container = esettingssizer, flag = wx.ALIGN_CENTER | wx.RIGHT, border = 5) |
366 add("efeed_label", wx.StaticText(esettingspanel, -1, _("Speed:")), container = esettingssizer, flag = wx.ALIGN_LEFT) |
321 add("efeed_label", wx.StaticText(esettingspanel, -1, _("Speed:")), container = esettingssizer, flag = wx.ALIGN_LEFT) |
367 add("efeed_unit", wx.StaticText(esettingspanel, -1, _("mm/\nmin")), container = esettingssizer, flag = wx.ALIGN_CENTER) |
322 add("efeed_unit", wx.StaticText(esettingspanel, -1, _("mm/\nmin")), container = esettingssizer, flag = wx.ALIGN_CENTER) |
368 else: |
323 else: |
453 elif not standalone_mode: |
408 elif not standalone_mode: |
454 self.Add(btn, pos = pos_mapping[key], span = span_mapping[key], flag = wx.EXPAND) |
409 self.Add(btn, pos = pos_mapping[key], span = span_mapping[key], flag = wx.EXPAND) |
455 else: |
410 else: |
456 self.extra_buttons[key] = btn |
411 self.extra_buttons[key] = btn |
457 |
412 |
458 root.xyfeedc = wx.SpinCtrl(lltspanel, -1, str(root.settings.xy_feedrate), min = 0, max = 50000, size = (97, -1)) |
413 root.xyfeedc = wx.SpinCtrl(lltspanel, -1, str(root.settings.xy_feedrate), min = 0, max = 50000, size = (130, -1)) |
459 root.xyfeedc.SetToolTip(wx.ToolTip(_("Set Maximum Speed for X & Y axes (mm/min)"))) |
414 root.xyfeedc.SetToolTip(wx.ToolTip(_("Set Maximum Speed for X & Y axes (mm/min)"))) |
460 llts.Add(wx.StaticText(lltspanel, -1, _("XY:")), flag = wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL) |
415 llts.Add(wx.StaticText(lltspanel, -1, _("XY:")), flag = wx.ALIGN_CENTER_VERTICAL) |
461 llts.Add(root.xyfeedc) |
416 llts.Add(root.xyfeedc) |
462 llts.Add(wx.StaticText(lltspanel, -1, _("mm/min Z:")), flag = wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL) |
417 llts.Add(wx.StaticText(lltspanel, -1, _("mm/min Z:")), flag = wx.ALIGN_CENTER_VERTICAL) |
463 root.zfeedc = wx.SpinCtrl(lltspanel, -1, str(root.settings.z_feedrate), min = 0, max = 50000, size = (90, -1)) |
418 root.zfeedc = wx.SpinCtrl(lltspanel, -1, str(root.settings.z_feedrate), min = 0, max = 50000, size = (130, -1)) |
464 root.zfeedc.SetToolTip(wx.ToolTip(_("Set Maximum Speed for Z axis (mm/min)"))) |
419 root.zfeedc.SetToolTip(wx.ToolTip(_("Set Maximum Speed for Z axis (mm/min)"))) |
465 llts.Add(root.zfeedc,) |
420 llts.Add(root.zfeedc,) |
466 |
421 |
467 root.xyfeedc.Bind(wx.EVT_SPINCTRL, root.setfeeds) |
422 root.xyfeedc.Bind(wx.EVT_SPINCTRL, root.setfeeds) |
468 root.zfeedc.Bind(wx.EVT_SPINCTRL, root.setfeeds) |
423 root.zfeedc.Bind(wx.EVT_SPINCTRL, root.setfeeds) |