Skip to content

Commit 3bc32a5

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

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/python/qtvcp/lib/qt_vismach/gantry_5axis.py

+3
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ def __init__(self):
150150
mainLayout.addWidget(self.glWidget)
151151
self.setLayout(mainLayout)
152152

153+
# need to explicitly kill the HAL component
154+
def cleanup(self):
155+
c.exit()
153156

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

share/qtvcp/panels/vismach_5axis_gantry/vismach_5axis_gantry_handler.py

+4-2
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)