Make display window optional for SIM_GALIL.py
This commit is contained in:
committed by
Ferdi Franceschini
parent
d2ac198251
commit
fc02a71882
@@ -77,8 +77,9 @@ class MyScreen(Screen):
|
||||
|
||||
def main(**kwargs):
|
||||
global screen, devices, factories
|
||||
parser = argparse.ArgumentParser( description="Generates fake Galil controllers for testing SICS" )
|
||||
parser.add_argument("instrument", help="The instrument name")
|
||||
parser = argparse.ArgumentParser( description='Generates fake Galil controllers for testing SICS' )
|
||||
parser.add_argument('instrument', help='The instrument name')
|
||||
parser.add_argument('-w', '--window', help='Create a display window', action='store_true', default=False)
|
||||
args = parser.parse_args()
|
||||
|
||||
basePort = {
|
||||
@@ -97,9 +98,10 @@ def main(**kwargs):
|
||||
factories[controllerName] = factory
|
||||
reactor.listenTCP(port, factory)
|
||||
|
||||
stdscr = curses.initscr()
|
||||
screen = MyScreen(stdscr)
|
||||
reactor.addReader(screen)
|
||||
if (args.window):
|
||||
stdscr = curses.initscr()
|
||||
screen = MyScreen(stdscr)
|
||||
reactor.addReader(screen)
|
||||
|
||||
#lc = LoopingCall(device_iterator)
|
||||
#lc.start(0.5)
|
||||
|
||||
Reference in New Issue
Block a user