Skip to content

Commit

Permalink
qtvcp -vismachL add HideCollection function
Browse files Browse the repository at this point in the history
hides parts when HAL pin is true
  • Loading branch information
c-morley committed Dec 22, 2024
1 parent c625bc2 commit 2d9dea5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/python/qtvcp/lib/qt_vismach/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,25 @@ def set_volume(self, vol):
self.vol = vol;


class HideCollection(Collection):
def __init__(self, parts, comp, var):
self.parts = parts
self.comp = comp
self.var = var
self.vol = 0

def traverse(self):
try:
if self.comp is None:
v = bool(hal.get_value(self.var))
else:
v = bool(self.comp[self.var])
except:
v = 0
if v:
return
super(HideCollection,self).traverse()

class Translate(Collection):
def __init__(self, parts, x, y, z):
self.parts = parts
Expand Down

0 comments on commit 2d9dea5

Please sign in to comment.