Skip to content

Commit 2384f60

Browse files
committed
qtvcp -vismach_fanuc_200f- fix cleanup of HAL component
fixes an error when run a second time
1 parent f8bf5e9 commit 2384f60

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

lib/python/qtvcp/lib/qt_vismach/fanuc_200f.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,15 @@ def __init__(self):
205205
mainLayout.addWidget(self.glWidget)
206206
self.setLayout(mainLayout)
207207

208+
# need to explicitly kill the HAL component
209+
def cleanup(self):
210+
c.exit()
208211

209212
# but it you call this directly it should work too
210-
# It just makes a qtvcp5 window that is defined in qt_vismach.py
213+
# It just makes a qtvcp window that is defined in qt_vismach.py
211214
# parameter list:
212215
# final model name must include all parts you want to use
213-
# tooltip (special for tool tip inclusuion)
216+
# tooltip (special for tool tip inclusion)
214217
# work (special for work part inclusion)
215218
# size of screen (bigger means more zoomed out to show more of machine)
216219
# hud None if no hud

share/qtvcp/panels/vismach_fanuc_200f/vismach_fanuc_200f_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 = Robot.Window()
39-
self.w.mainLayout.addWidget(machine)
38+
self.machine = Robot.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)