Skip to content

Commit 0cd9804

Browse files
committed
qtplasmac: add paused time to statistics
1 parent 45a17c1 commit 0cd9804

8 files changed

Lines changed: 567 additions & 433 deletions

File tree

lib/hallib/plasmac.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ net plasmac:cutting-start spindle.0.on => plasmac.cutting-
1515
net plasmac:feed-override halui.feed-override.value => plasmac.feed-override
1616
net plasmac:feed-reduction motion.analog-out-03 => plasmac.feed-reduction
1717
net plasmac:feed-upm motion.feed-upm => plasmac.feed-upm
18+
net plasmac:homed motion.is-all-homed => plasmac.homed
1819
net plasmac:ignore-arc-ok-0 motion.digital-out-01 => plasmac.ignore-arc-ok-0
1920
net plasmac:motion-type motion.motion-type => plasmac.motion-type
2021
net plasmac:offsets-active motion.eoffset-active => plasmac.offsets-active

lib/hallib/qtplasmac_comp.hal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ net plasmac:feed-override halui.feed-override.value => plasmac.feed-ov
1616
net plasmac:feed-reduction motion.analog-out-03 => plasmac.feed-reduction
1717
net plasmac:float-switch-out db_float.out => plasmac.float-switch
1818
net plasmac:feed-upm motion.feed-upm => plasmac.feed-upm
19+
net plasmac:homed motion.is-all-homed => plasmac.homed
1920
net plasmac:ignore-arc-ok-0 motion.digital-out-01 => plasmac.ignore-arc-ok-0
2021
net machine-is-on halui.machine.is-on => plasmac.machine-is-on
2122
net plasmac:motion-type motion.motion-type => plasmac.motion-type

share/qtvcp/screens/qtplasmac/qtplasmac.ui

Lines changed: 173 additions & 136 deletions
Large diffs are not rendered by default.

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '1.226.211'
1+
VERSION = '1.227.212'
22

33
'''
44
qtplasmac_handler.py
@@ -1499,7 +1499,6 @@ def file_loaded(self, obj, filename):
14991499
self.view_t_pressed()
15001500

15011501
def joints_all_homed(self, obj):
1502-
hal.set_p('plasmac.homed', '1')
15031502
self.interp_idle(None)
15041503
if not self.firstHoming:
15051504
ACTION.CALL_MDI_WAIT('T0 M6')
@@ -1531,7 +1530,6 @@ def joint_unhomed(self, obj, joints):
15311530
self.w.home_all.setEnabled(True)
15321531
self.w.update
15331532
STATUS.emit('dro-reference-change-request', 1)
1534-
hal.set_p('plasmac.homed', '0')
15351533
self.interp_idle(None)
15361534
self.w.gcodegraphics.updateGL()
15371535
self.w.conv_preview.updateGL()
@@ -2509,13 +2507,14 @@ def set_signal_connections(self):
25092507
self.paramTabDisable.value_changed.connect(lambda v:self.param_tab_changed(v))
25102508
self.convTabDisable.value_changed.connect(lambda v:self.conv_tab_changed(v))
25112509
self.motionTypePin.value_changed.connect(lambda v:self.motion_type_changed(v))
2512-
self.w.cut_time_reset.pressed.connect(lambda:self.statistic_reset('Cut time'))
2513-
self.w.probe_time_reset.pressed.connect(lambda:self.statistic_reset('Probe time'))
2514-
self.w.run_time_reset.pressed.connect(lambda:self.statistic_reset('Program run time'))
2515-
self.w.torch_time_reset.pressed.connect(lambda:self.statistic_reset('Torch on time'))
2516-
self.w.rapid_time_reset.pressed.connect(lambda:self.statistic_reset('Rapid time'))
2517-
self.w.cut_length_reset.pressed.connect(lambda:self.statistic_reset('Cut length'))
2518-
self.w.pierce_reset.pressed.connect(lambda:self.statistic_reset('Pierce count'))
2510+
self.w.cut_time_reset.pressed.connect(lambda:self.statistic_reset('cut_time', 'Cut time'))
2511+
self.w.probe_time_reset.pressed.connect(lambda:self.statistic_reset('probe_time', 'Probe time'))
2512+
self.w.paused_time_reset.pressed.connect(lambda:self.statistic_reset('paused_time', 'Paused time'))
2513+
self.w.run_time_reset.pressed.connect(lambda:self.statistic_reset('run_time', 'Program run time'))
2514+
self.w.torch_time_reset.pressed.connect(lambda:self.statistic_reset('torch_time', 'Torch on time'))
2515+
self.w.rapid_time_reset.pressed.connect(lambda:self.statistic_reset('rapid_time', 'Rapid time'))
2516+
self.w.cut_length_reset.pressed.connect(lambda:self.statistic_reset('cut_length', 'Cut length'))
2517+
self.w.pierce_reset.pressed.connect(lambda:self.statistic_reset('pierce_count', 'Pierce count'))
25192518
self.w.all_reset.pressed.connect(self.statistics_reset)
25202519
self.extPowerPin.value_changed.connect(lambda v:self.power_button("external", v))
25212520
self.extRunPin.value_changed.connect(lambda v:self.ext_run(v))
@@ -4803,14 +4802,15 @@ def cam_dia_minus_pressed(self):
48034802
# STATISTICS FUNCTIONS #
48044803
#########################################################################################################################
48054804
def statistics_show(self):
4806-
for stat in ['cut', 'probe', 'run', 'torch', 'rapid']:
4805+
for stat in ['cut', 'paused', 'probe', 'run', 'torch', 'rapid']:
48074806
self.display_hms('{}_time'.format(stat), hal.get_value('plasmac.{}-time'.format(stat)))
48084807
self.w.cut_length.setText('{:0.2f}'.format(hal.get_value('plasmac.cut-length') / self.statsDivisor))
48094808
self.w.pierce_count.setText('{:d}'.format(hal.get_value('plasmac.pierce-count')))
48104809
self.statistics_load()
48114810

48124811
def statistics_save(self, reset=False):
48134812
self.PREFS.putpref('Cut time', '{:0.2f}'.format(self.statsSaved['cut'] + hal.get_value('plasmac.cut-time')) , float,'STATISTICS')
4813+
self.PREFS.putpref('Paused time', '{:0.2f}'.format(self.statsSaved['paused'] + hal.get_value('plasmac.paused-time')) , float,'STATISTICS')
48144814
self.PREFS.putpref('Probe time', '{:0.2f}'.format(self.statsSaved['probe'] + hal.get_value('plasmac.probe-time')) , float,'STATISTICS')
48154815
self.PREFS.putpref('Program run time', '{:0.2f}'.format(self.statsSaved['run'] + hal.get_value('plasmac.run-time')) , float,'STATISTICS')
48164816
self.PREFS.putpref('Torch on time', '{:0.2f}'.format(self.statsSaved['torch'] + hal.get_value('plasmac.torch-time')) , float,'STATISTICS')
@@ -4822,13 +4822,14 @@ def statistics_save(self, reset=False):
48224822

48234823
def statistics_load(self):
48244824
self.statsSaved['cut'] = self.PREFS.getpref('Cut time', 0 , float,'STATISTICS')
4825+
self.statsSaved['paused'] = self.PREFS.getpref('Paused time', 0 , float,'STATISTICS')
48254826
self.statsSaved['probe'] = self.PREFS.getpref('Probe time', 0 , float,'STATISTICS')
48264827
self.statsSaved['run'] = self.PREFS.getpref('Program run time', 0 , float,'STATISTICS')
48274828
self.statsSaved['torch'] = self.PREFS.getpref('Torch on time', 0 , float,'STATISTICS')
48284829
self.statsSaved['rapid'] = self.PREFS.getpref('Rapid time', 0 , float,'STATISTICS')
48294830
self.statsSaved['length'] = self.PREFS.getpref('Cut length', 0 , float,'STATISTICS')
48304831
self.statsSaved['pierce'] = self.PREFS.getpref('Pierce count', 0 , int,'STATISTICS')
4831-
for stat in ['cut', 'probe', 'run', 'torch', 'rapid']:
4832+
for stat in ['cut', 'paused', 'probe', 'run', 'torch', 'rapid']:
48324833
self.display_hms('{}_time_t'.format(stat), self.statsSaved['{}'.format(stat)])
48334834
self.w.cut_length_t.setText('{:0.2f}'.format(self.statsSaved['length'] / self.statsDivisor))
48344835
self.w.pierce_count_t.setText('{:d}'.format(self.statsSaved['pierce']))
@@ -4838,14 +4839,25 @@ def display_hms(self, widget, time):
48384839
h, m = divmod(m, 60)
48394840
self.w[widget].setText('{:.0f}:{:02.0f}:{:02.0f}'.format(h,m,s))
48404841

4841-
def statistic_reset(self, stat):
4842-
self.PREFS.putpref(stat, 0 , float,'STATISTICS')
4842+
def statistic_reset(self, stat, statT):
4843+
if stat in ['cut_time', 'paused_time', 'probe_time', 'run_time', 'torch_time', 'rapid_time']:
4844+
self.display_hms('{}'.format(stat), 0)
4845+
elif stat == 'cut_length':
4846+
self.w.cut_length.setText('0.00')
4847+
elif stat == 'pierce_count':
4848+
self.w.pierce_count.setText('0')
4849+
self.PREFS.putpref(statT, 0 , float,'STATISTICS')
48434850
self.statistics_load()
48444851

48454852
def statistics_reset(self):
4846-
for stat in ['Cut time', 'Probe time', 'Program run time', 'Torch on time', \
4847-
'Rapid time', 'Cut length', 'Pierce count']:
4853+
for stat in ['cut', 'paused', 'probe', 'run', 'torch', 'rapid']:
4854+
self.display_hms('{}_time'.format(stat), 0)
4855+
self.w.cut_length.setText('0.00')
4856+
self.w.pierce_count.setText('0')
4857+
for stat in ['Cut time', 'Paused time', 'Probe time', 'Program run time', 'Torch on time', \
4858+
'Rapid time', 'Cut length']:
48484859
self.PREFS.putpref(stat, 0 , float,'STATISTICS')
4860+
self.PREFS.putpref('Pierce count', 0 , int ,'STATISTICS')
48494861
self.statistics_load()
48504862

48514863
def statistics_init(self):
@@ -4857,7 +4869,7 @@ def statistics_init(self):
48574869
unit = _translate('HandlerClass', 'Inches')
48584870
msg0 = _translate('HandlerClass', 'CUT LENGTH')
48594871
self.w.cut_length_label.setText('{} ({})'.format(msg0, unit))
4860-
self.statsSaved = {'cut':0, 'length':0, 'pierce':0, 'probe':0, 'rapid':0, 'run':0, 'torch':0}
4872+
self.statsSaved = {'cut':0, 'length':0, 'pierce':0, 'paused':0, 'probe':0, 'rapid':0, 'run':0, 'torch':0}
48614873
self.jobRunning = False
48624874
self.statistics_load()
48634875

share/qtvcp/screens/qtplasmac/versions.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ <h2>QtPlasmaC Version History</h2>
3030
</table>
3131
<br>
3232
<!--- ****** ADD NEXT VERSION BELOW THIS LINE ****** --->
33+
<br><b><u>v1.227.212 2022 July 02</u></b>
34+
<ul style="margin:0;">
35+
<li>add paused time to statistics</li>
36+
</ul>
37+
3338
<br><b><u>v1.226.211 2022 July 02</u></b>
3439
<ul style="margin:0;">
3540
<li>move statistics calculations to component</li>

0 commit comments

Comments
 (0)