Skip to content

Commit

Permalink
qtvcp -test_led: option to start with multiple LEDs with -o
Browse files Browse the repository at this point in the history
  • Loading branch information
c-morley committed Jun 25, 2022
1 parent ed281ae commit 34d97d1
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions share/qtvcp/panels/test_led/test_led_handler.py
Expand Up @@ -36,15 +36,33 @@ def __init__(self, halcomp,widgets,paths):
# the widgets are instantiated.
# the HAL pins are built but HAL is not set ready
def initialized__(self):
geom = self.w.frameGeometry()
geom.moveCenter(QDesktopWidget().availableGeometry().center())
self.w.setGeometry(geom)

if self.w.USEROPTIONS_ is not None:
if 'four' in self.w.USEROPTIONS_:
for i in range(3):
try:
num = int(self.w.USEROPTIONS_[0])
except:
print('Error with test_led number selection - not a number - using 1')
num = 1

if num >1:
for i in range(num-1):
self.addLED()
# make window taller now
x = self.w.geometry().x()
y = self.w.geometry().y()
w = self.w.geometry().width()
h = self.w.geometry().height() + 37
self.w.setGeometry(x,y,w,h)
self.w.setMinimumHeight(h)

self.addLED()
self.w.setWindowFlags(Qt.WindowStaysOnTopHint)
self.w.setWindowTitle('{}'.format(self.h.comp.getprefix()))

# build a
# build a LED/controls line
def addLED(self):

# new toolbar added to window
Expand Down

0 comments on commit 34d97d1

Please sign in to comment.