Skip to content

Commit 6497d3c

Browse files
committed
qtplasmac: simple housekeeping
removed unused variables, add a few comments
1 parent b90e9e4 commit 6497d3c

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '1.229.225'
1+
VERSION = '1.229.226'
22

33
'''
44
qtplasmac_handler.py
@@ -147,15 +147,13 @@ def __init__(self, halcomp, widgets, paths):
147147
self.PREFS = Access(os.path.join(self.PATHS.CONFIGPATH, self.machineName + '.prefs'))
148148
self.STYLEEDITOR = SSE(widgets, paths)
149149
self.GCODES = GCodes(widgets)
150-
self.valid = QDoubleValidator(0.0, 999.999, 3)
151150
self.IMAGES = os.path.join(self.PATHS.IMAGEDIR, 'qtplasmac/images/')
152151
self.landscape = True
153152
if os.path.basename(self.PATHS.XML) == 'qtplasmac_9x16.ui':
154153
self.landscape = False
155154
self.gui43 = False
156155
if os.path.basename(self.PATHS.XML) == 'qtplasmac_4x3.ui':
157156
self.gui43 = True
158-
self.widgetsLoaded = 0
159157
KEYBIND.add_call('Key_F12','on_keycall_F12')
160158
KEYBIND.add_call('Key_F9','on_keycall_F9')
161159
KEYBIND.add_call('Key_Plus', 'on_keycall_PLUS')
@@ -311,6 +309,7 @@ def __init__(self, halcomp, widgets, paths):
311309
self.CUT_REC_OFF = 26
312310
self.DEBUG = 27
313311

312+
# called by qtvcp.py
314313
def initialized__(self):
315314
# ensure we get all startup errors
316315
STATUS.connect('error', self.error_update)
@@ -333,7 +332,6 @@ def initialized__(self):
333332
self.offset_peripherals()
334333
self.set_probe_offset_pins()
335334
self.wcs_rotation('get')
336-
self.widgetsLoaded = 1
337335
STATUS.connect('state-estop', lambda w:self.estop_state(True))
338336
STATUS.connect('state-estop-reset', lambda w:self.estop_state(False))
339337
STATUS.connect('state-on', lambda w:self.power_state(True))
@@ -394,6 +392,7 @@ def initialized__(self):
394392
self.firstRun = False
395393
self.startupTimer.start(250)
396394

395+
# called by qtvcp.py, can override qtvcp settings or qtvcp allowed user options (via ini)
397396
def before_loop__(self):
398397
self.w.setWindowTitle('{} - QtPlasmaC v{}, powered by QtVCP on LinuxCNC v{}'.format(self.machineName, VERSION, linuxcnc.version.split(':')[0]))
399398
self.w.setWindowIcon(QIcon(os.path.join(self.IMAGES, 'Chips_Plasma.png')))
@@ -402,6 +401,7 @@ def before_loop__(self):
402401
#########################################################################################################################
403402
# CLASS PATCHING SECTION #
404403
#########################################################################################################################
404+
# called by qtvcp.py
405405
def class_patch__(self):
406406
self.gcode_editor_patch()
407407
self.camview_patch()
@@ -1057,6 +1057,7 @@ def offset_peripherals(self):
10571057
msg0 = _translate('HandlerClass', 'Invalid entry for probe offset')
10581058
STATUS.emit('error', linuxcnc.OPERATOR_ERROR, '{}:\n{}\n'.format(head, msg0))
10591059

1060+
# called by the modified closeEvent function in this handler
10601061
def closing_cleanup__(self):
10611062
# disconnect powermax
10621063
self.w.pmx485_enable.setChecked(False)
@@ -1099,6 +1100,7 @@ def save_logfile(self, numLogs):
10991100
with open(logName, 'w') as f:
11001101
f.write(text)
11011102

1103+
# called by qt_makegui.py
11021104
def processed_key_event__(self,receiver,event,is_pressed,key,code,shift,cntrl):
11031105
# when typing in MDI, we don't want keybinding to call functions
11041106
# so we catch and process the events directly.
@@ -1608,6 +1610,7 @@ def set_start_line(self, line):
16081610

16091611
def update_gcode_properties(self, props):
16101612
if props:
1613+
print('>>PROPS:', props)
16111614
if 'qtplasmac_program_clear.ngc' in props['name']:
16121615
self.set_blank_gcodeprops()
16131616
else:
@@ -1804,7 +1807,7 @@ def height_ovr_encoder(self,value):
18041807
self.w.height_ovr_label.setText('{:.2f}'.format(self.heightOvr))
18051808
self.old_ovr_counts = value
18061809

1807-
def height_ovr_scale_change (self,value):
1810+
def height_ovr_scale_change(self,value):
18081811
if value:self.heightOvrScale = value
18091812

18101813
def touch_xy_clicked(self):
@@ -2129,6 +2132,7 @@ def conv_tab_changed(self, state):
21292132
#########################################################################################################################
21302133
# GENERAL FUNCTIONS #
21312134
#########################################################################################################################
2135+
# called by ScreenOptions, this function overrides ScreenOption's closeEvent
21322136
def closeEvent(self, event):
21332137
O = self.w.screen_options
21342138
if self.w.chk_exit_warning.isChecked() or not STATUS.is_interp_idle():

share/qtvcp/screens/qtplasmac/versions.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,15 @@ <h2>QtPlasmaC Version History</h2>
3030
</table>
3131
<br>
3232
<!--- ****** ADD NEXT VERSION BELOW THIS LINE ****** --->
33-
<br><b><u>v1.229.225 2022 Aug 14</u></b>
33+
<br><b><u>v1.229.226 2022 Aug 16</u></b>
3434
<ul style="margin:0;">
35-
<li>conv. use relative instead of absolute positon for origin</li>
35+
<li>simple housekeeping</li>
36+
</ul>
37+
<i>Changes submitted by snowgoer540 (Greg Carl)</i><br>
38+
39+
<br><b><u>v1.229.225 2022 Aug 16</u></b>
40+
<ul style="margin:0;">
41+
<li>conv. use relative instead of absolute position for origin</li>
3642
<li>fix closing_cleanup__ not being called</li>
3743
</ul>
3844
<i>Changes submitted by snowgoer540 (Greg Carl)</i><br>

0 commit comments

Comments
 (0)