Skip to content

Commit f1f2734

Browse files
committed
qtvcp -vismach millturn: fix cleanup of HAL component
fixes an error when run a second time
1 parent 2384f60 commit f1f2734

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/python/qtvcp/lib/qt_vismach/millturn.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ def __init__(self):
276276
mainLayout.addWidget(self.glWidget)
277277
self.setLayout(mainLayout)
278278

279+
# need to explicitly kill the HAL component
280+
def cleanup(self):
281+
c.exit()
279282

280283
# but it you call this directly it should work too
281284
# It just makes a qtvcp5 window that is defined in qt_vismach.py

share/qtvcp/panels/vismach_millturn/vismach_millturn_handler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def __init__(self, halcomp,widgets,paths):
3535
# the widgets are instantiated.
3636
# the HAL pins are built but HAL is not set ready
3737
def initialized__(self):
38-
machine = MILL.Window()
39-
self.w.mainLayout.addWidget(machine)
38+
self.machine = MILL.Window()
39+
self.w.mainLayout.addWidget(self.machine)
4040

4141

4242
########################
@@ -58,6 +58,8 @@ def initialized__(self):
5858
###########################
5959
# **** closing event **** #
6060
###########################
61+
def closing_cleanup__(self):
62+
self.machine.cleanup()
6163

6264
##############################
6365
# required class boiler code #

0 commit comments

Comments
 (0)