Add link count and handle screen resize in fake Lakeshores
This commit is contained in:
@@ -52,7 +52,7 @@ class MYDEV(MYBASE):
|
||||
print MYDEV.__name__, "ctor"
|
||||
|
||||
def device_display():
|
||||
global stdscr, myDev, myOpts, myPort
|
||||
global screen, myDev, myOpts, myPort, myFactory
|
||||
try:
|
||||
myDev.doIteration();
|
||||
except:
|
||||
@@ -62,33 +62,45 @@ def device_display():
|
||||
return
|
||||
|
||||
try:
|
||||
stdscr.addstr(0, 0, "Random :%8.3f" % myDev.RANDOM)
|
||||
stdscr.addstr(0, 25, "Identity : %s (%d)" % (myDev.IDN, myPort))
|
||||
stdscr.addstr(1, 0, "Sensor :")
|
||||
rows, cols = screen.stdscr.getmaxyx()
|
||||
screen.stdscr.addstr(0, 0, "Lnks:%2d" % myFactory.numProtocols)
|
||||
screen.stdscr.addstr(0, 10, "Rnd:%6.3f" % myDev.RANDOM)
|
||||
screen.stdscr.addstr(0, 22, "Identity : %s (%d)" % (myDev.IDN, myPort))
|
||||
screen.stdscr.addstr(1, 0, "Sensor :")
|
||||
for idx in myDev.CONFIG_SNSRS:
|
||||
stdscr.addstr(1, 12 + (idx - 1) * 12, "%8.3f" % myDev.KRDG[idx])
|
||||
stdscr.addstr(2, 0, "PV :")
|
||||
stdscr.addstr(3, 0, "Setpoint :")
|
||||
stdscr.addstr(4, 0, "Diff :")
|
||||
if 12 + (idx - 1) * 12 > cols - 1:
|
||||
break
|
||||
screen.stdscr.addstr(1, 12 + (idx - 1) * 12, "%8.3f" % myDev.KRDG[idx])
|
||||
screen.stdscr.addstr(2, 0, "PV :")
|
||||
screen.stdscr.addstr(3, 0, "Setpoint :")
|
||||
screen.stdscr.addstr(4, 0, "Diff :")
|
||||
for idx in myDev.CONFIG_LOOPS:
|
||||
stdscr.addstr(2, 12 + (idx - 1) * 12, "%8.3f" % myDev.KRDG[myDev.LOOPINPUT[idx]])
|
||||
stdscr.addstr(3, 12 + (idx - 1) * 12, "%8.3f" % myDev.SETP[idx])
|
||||
stdscr.addstr(4, 12 + (idx - 1) * 12, "%8.3f" % (myDev.KRDG[myDev.LOOPINPUT[idx]] - myDev.SETP[idx]))
|
||||
stdscr.addstr(5, 0, "Target :")
|
||||
stdscr.addstr(6, 0, "Ramp Rate:")
|
||||
stdscr.addstr(7, 0, "Ramp On :")
|
||||
stdscr.addstr(8, 0, "Ramping :")
|
||||
if 12 + (idx - 1) * 12 > cols - 1:
|
||||
break
|
||||
screen.stdscr.addstr(2, 12 + (idx - 1) * 12, "%8.3f" % myDev.KRDG[myDev.LOOPINPUT[idx]])
|
||||
screen.stdscr.addstr(3, 12 + (idx - 1) * 12, "%8.3f" % myDev.SETP[idx])
|
||||
screen.stdscr.addstr(4, 12 + (idx - 1) * 12, "%8.3f" % (myDev.KRDG[myDev.LOOPINPUT[idx]] - myDev.SETP[idx]))
|
||||
screen.stdscr.addstr(5, 0, "Target :")
|
||||
screen.stdscr.addstr(6, 0, "Ramp Rate:")
|
||||
screen.stdscr.addstr(7, 0, "Ramp On :")
|
||||
screen.stdscr.addstr(8, 0, "Ramping :")
|
||||
for idx in myDev.CONFIG_RAMPS:
|
||||
stdscr.addstr(5, 12 + (idx - 1) * 12, "%8.3f" % myDev.TARGET[idx])
|
||||
stdscr.addstr(6, 12 + (idx - 1) * 12, "%8.3f" % myDev.RAMP_RATE[idx])
|
||||
stdscr.addstr(7, 12 + (idx - 1) * 12, "%8s" % ["No", "Yes"][myDev.RAMP_ON[idx]])
|
||||
stdscr.addstr(8, 12 + (idx - 1) * 12, "%8s" % ["No", "Yes"][myDev.RAMP_ST[idx]])
|
||||
stdscr.refresh()
|
||||
if 12 + (idx - 1) * 12 > cols - 1:
|
||||
break
|
||||
screen.stdscr.addstr(5, 12 + (idx - 1) * 12, "%8.3f" % myDev.TARGET[idx])
|
||||
screen.stdscr.addstr(6, 12 + (idx - 1) * 12, "%8.3f" % myDev.RAMP_RATE[idx])
|
||||
screen.stdscr.addstr(7, 12 + (idx - 1) * 12, "%8s" % ["No", "Yes"][myDev.RAMP_ON[idx]])
|
||||
screen.stdscr.addstr(8, 12 + (idx - 1) * 12, "%8s" % ["No", "Yes"][myDev.RAMP_ST[idx]])
|
||||
except:
|
||||
raise
|
||||
pass
|
||||
finally:
|
||||
try:
|
||||
screen.stdscr.refresh()
|
||||
except:
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
global stdscr, myDev, myOpts, myPort
|
||||
global screen, myDev, myOpts, myPort, myFactory
|
||||
|
||||
myOpts = MyOptions()
|
||||
try:
|
||||
|
||||
@@ -52,7 +52,7 @@ class MYDEV(MYBASE):
|
||||
print MYDEV.__name__, "ctor"
|
||||
|
||||
def device_display():
|
||||
global stdscr, myDev, myOpts, myPort
|
||||
global screen, myDev, myOpts, myPort, myFactory
|
||||
try:
|
||||
myDev.doIteration();
|
||||
except:
|
||||
@@ -62,33 +62,45 @@ def device_display():
|
||||
return
|
||||
|
||||
try:
|
||||
stdscr.addstr(0, 0, "Random :%8.3f" % myDev.RANDOM)
|
||||
stdscr.addstr(0, 25, "Identity : %s (%d)" % (myDev.IDN, myPort))
|
||||
stdscr.addstr(1, 0, "Sensor :")
|
||||
rows, cols = screen.stdscr.getmaxyx()
|
||||
screen.stdscr.addstr(0, 0, "Lnks:%2d" % myFactory.numProtocols)
|
||||
screen.stdscr.addstr(0, 10, "Rnd:%6.3f" % myDev.RANDOM)
|
||||
screen.stdscr.addstr(0, 22, "Identity : %s (%d)" % (myDev.IDN, myPort))
|
||||
screen.stdscr.addstr(1, 0, "Sensor :")
|
||||
for idx in myDev.CONFIG_SNSRS:
|
||||
stdscr.addstr(1, 12 + (idx - 1) * 12, "%8.3f" % myDev.KRDG[idx])
|
||||
stdscr.addstr(2, 0, "PV :")
|
||||
stdscr.addstr(3, 0, "Setpoint :")
|
||||
stdscr.addstr(4, 0, "Diff :")
|
||||
if 12 + (idx - 1) * 12 > cols - 1:
|
||||
break
|
||||
screen.stdscr.addstr(1, 12 + (idx - 1) * 12, "%8.3f" % myDev.KRDG[idx])
|
||||
screen.stdscr.addstr(2, 0, "PV :")
|
||||
screen.stdscr.addstr(3, 0, "Setpoint :")
|
||||
screen.stdscr.addstr(4, 0, "Diff :")
|
||||
for idx in myDev.CONFIG_LOOPS:
|
||||
stdscr.addstr(2, 12 + (idx - 1) * 12, "%8.3f" % myDev.KRDG[myDev.LOOPINPUT[idx]])
|
||||
stdscr.addstr(3, 12 + (idx - 1) * 12, "%8.3f" % myDev.SETP[idx])
|
||||
stdscr.addstr(4, 12 + (idx - 1) * 12, "%8.3f" % (myDev.KRDG[myDev.LOOPINPUT[idx]] - myDev.SETP[idx]))
|
||||
stdscr.addstr(5, 0, "Target :")
|
||||
stdscr.addstr(6, 0, "Ramp Rate:")
|
||||
stdscr.addstr(7, 0, "Ramp On :")
|
||||
stdscr.addstr(8, 0, "Ramping :")
|
||||
if 12 + (idx - 1) * 12 > cols - 1:
|
||||
break
|
||||
screen.stdscr.addstr(2, 12 + (idx - 1) * 12, "%8.3f" % myDev.KRDG[myDev.LOOPINPUT[idx]])
|
||||
screen.stdscr.addstr(3, 12 + (idx - 1) * 12, "%8.3f" % myDev.SETP[idx])
|
||||
screen.stdscr.addstr(4, 12 + (idx - 1) * 12, "%8.3f" % (myDev.KRDG[myDev.LOOPINPUT[idx]] - myDev.SETP[idx]))
|
||||
screen.stdscr.addstr(5, 0, "Target :")
|
||||
screen.stdscr.addstr(6, 0, "Ramp Rate:")
|
||||
screen.stdscr.addstr(7, 0, "Ramp On :")
|
||||
screen.stdscr.addstr(8, 0, "Ramping :")
|
||||
for idx in myDev.CONFIG_RAMPS:
|
||||
stdscr.addstr(5, 12 + (idx - 1) * 12, "%8.3f" % myDev.TARGET[idx])
|
||||
stdscr.addstr(6, 12 + (idx - 1) * 12, "%8.3f" % myDev.RAMP_RATE[idx])
|
||||
stdscr.addstr(7, 12 + (idx - 1) * 12, "%8s" % ["No", "Yes"][myDev.RAMP_ON[idx]])
|
||||
stdscr.addstr(8, 12 + (idx - 1) * 12, "%8s" % ["No", "Yes"][myDev.RAMP_ST[idx]])
|
||||
stdscr.refresh()
|
||||
if 12 + (idx - 1) * 12 > cols - 1:
|
||||
break
|
||||
screen.stdscr.addstr(5, 12 + (idx - 1) * 12, "%8.3f" % myDev.TARGET[idx])
|
||||
screen.stdscr.addstr(6, 12 + (idx - 1) * 12, "%8.3f" % myDev.RAMP_RATE[idx])
|
||||
screen.stdscr.addstr(7, 12 + (idx - 1) * 12, "%8s" % ["No", "Yes"][myDev.RAMP_ON[idx]])
|
||||
screen.stdscr.addstr(8, 12 + (idx - 1) * 12, "%8s" % ["No", "Yes"][myDev.RAMP_ST[idx]])
|
||||
except:
|
||||
raise
|
||||
pass
|
||||
finally:
|
||||
try:
|
||||
screen.stdscr.refresh()
|
||||
except:
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
global stdscr, myDev, myOpts, myPort
|
||||
global screen, myDev, myOpts, myPort, myFactory
|
||||
|
||||
myOpts = MyOptions()
|
||||
try:
|
||||
|
||||
@@ -52,7 +52,7 @@ class MYDEV(MYBASE):
|
||||
print MYDEV.__name__, "ctor"
|
||||
|
||||
def device_display():
|
||||
global stdscr, myDev, myOpts, myPort
|
||||
global screen, myDev, myOpts, myPort, myFactory
|
||||
try:
|
||||
myDev.doIteration();
|
||||
except:
|
||||
@@ -62,35 +62,45 @@ def device_display():
|
||||
return
|
||||
|
||||
try:
|
||||
stdscr.addstr(0, 0, "Random :%8.3f" % myDev.RANDOM)
|
||||
stdscr.addstr(0, 25, "Identity : %s (%d)" % (myDev.IDN, myPort))
|
||||
stdscr.addstr(1, 0, "Sensor :")
|
||||
rows, cols = screen.stdscr.getmaxyx()
|
||||
screen.stdscr.addstr(0, 0, "Lnks:%2d" % myFactory.numProtocols)
|
||||
screen.stdscr.addstr(0, 10, "Rnd:%6.3f" % myDev.RANDOM)
|
||||
screen.stdscr.addstr(0, 22, "Identity : %s (%d)" % (myDev.IDN, myPort))
|
||||
screen.stdscr.addstr(1, 0, "Sensor :")
|
||||
for idx in myDev.CONFIG_SNSRS:
|
||||
if idx > 4:
|
||||
continue
|
||||
stdscr.addstr(1, 12 + (idx - 1) * 12, "%8.3f" % myDev.KRDG[idx])
|
||||
stdscr.addstr(2, 0, "PV :")
|
||||
stdscr.addstr(3, 0, "Setpoint :")
|
||||
stdscr.addstr(4, 0, "Diff :")
|
||||
if 12 + (idx - 1) * 12 > cols - 1:
|
||||
break
|
||||
screen.stdscr.addstr(1, 12 + (idx - 1) * 12, "%8.3f" % myDev.KRDG[idx])
|
||||
screen.stdscr.addstr(2, 0, "PV :")
|
||||
screen.stdscr.addstr(3, 0, "Setpoint :")
|
||||
screen.stdscr.addstr(4, 0, "Diff :")
|
||||
for idx in myDev.CONFIG_LOOPS:
|
||||
stdscr.addstr(2, 12 + (idx - 1) * 12, "%8.3f" % myDev.KRDG[myDev.LOOPINPUT[idx]])
|
||||
stdscr.addstr(3, 12 + (idx - 1) * 12, "%8.3f" % myDev.SETP[idx])
|
||||
stdscr.addstr(4, 12 + (idx - 1) * 12, "%8.3f" % (myDev.KRDG[myDev.LOOPINPUT[idx]] - myDev.SETP[idx]))
|
||||
stdscr.addstr(5, 0, "Target :")
|
||||
stdscr.addstr(6, 0, "Ramp Rate:")
|
||||
stdscr.addstr(7, 0, "Ramp On :")
|
||||
stdscr.addstr(8, 0, "Ramping :")
|
||||
if 12 + (idx - 1) * 12 > cols - 1:
|
||||
break
|
||||
screen.stdscr.addstr(2, 12 + (idx - 1) * 12, "%8.3f" % myDev.KRDG[myDev.LOOPINPUT[idx]])
|
||||
screen.stdscr.addstr(3, 12 + (idx - 1) * 12, "%8.3f" % myDev.SETP[idx])
|
||||
screen.stdscr.addstr(4, 12 + (idx - 1) * 12, "%8.3f" % (myDev.KRDG[myDev.LOOPINPUT[idx]] - myDev.SETP[idx]))
|
||||
screen.stdscr.addstr(5, 0, "Target :")
|
||||
screen.stdscr.addstr(6, 0, "Ramp Rate:")
|
||||
screen.stdscr.addstr(7, 0, "Ramp On :")
|
||||
screen.stdscr.addstr(8, 0, "Ramping :")
|
||||
for idx in myDev.CONFIG_RAMPS:
|
||||
stdscr.addstr(5, 12 + (idx - 1) * 12, "%8.3f" % myDev.TARGET[idx])
|
||||
stdscr.addstr(6, 12 + (idx - 1) * 12, "%8.3f" % myDev.RAMP_RATE[idx])
|
||||
stdscr.addstr(7, 12 + (idx - 1) * 12, "%8s" % ["No", "Yes"][myDev.RAMP_ON[idx]])
|
||||
stdscr.addstr(8, 12 + (idx - 1) * 12, "%8s" % ["No", "Yes"][myDev.RAMP_ST[idx]])
|
||||
stdscr.refresh()
|
||||
if 12 + (idx - 1) * 12 > cols - 1:
|
||||
break
|
||||
screen.stdscr.addstr(5, 12 + (idx - 1) * 12, "%8.3f" % myDev.TARGET[idx])
|
||||
screen.stdscr.addstr(6, 12 + (idx - 1) * 12, "%8.3f" % myDev.RAMP_RATE[idx])
|
||||
screen.stdscr.addstr(7, 12 + (idx - 1) * 12, "%8s" % ["No", "Yes"][myDev.RAMP_ON[idx]])
|
||||
screen.stdscr.addstr(8, 12 + (idx - 1) * 12, "%8s" % ["No", "Yes"][myDev.RAMP_ST[idx]])
|
||||
except:
|
||||
raise
|
||||
pass
|
||||
finally:
|
||||
try:
|
||||
screen.stdscr.refresh()
|
||||
except:
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
global stdscr, myDev, myOpts, myPort
|
||||
global screen, myDev, myOpts, myPort, myFactory
|
||||
|
||||
myOpts = MyOptions()
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user