diff --git a/PythonServer/pos-python-server.py b/PythonServer/pos-python-server.py index 865f27ca58e99986e8d10eee43ef0e9360fe529f..186c74bc23506aacb17e84aa1974994ad0750dcd 100755 --- a/PythonServer/pos-python-server.py +++ b/PythonServer/pos-python-server.py @@ -7,7 +7,7 @@ import matplotlib.pyplot as plt from git import Repo from shutil import rmtree from glob import glob -from numpy import linspace, array, zeros, flip, rot90 +from numpy import linspace, array, zeros, flip, rot90, tile from http.server import BaseHTTPRequestHandler,HTTPServer from epicsarchiver import ArchiverAppliance from threading import Thread, Event @@ -150,6 +150,15 @@ class epicsQuery(Thread): instruments['LNS-ISRC-010:PBI-EMH:BUFF-CURRENT']=epics.PV('LNS-ISRC-010:PBI-EMH:BUFF-CURRENT', auto_monitor=True) instruments['LNS-ISRC-010:PBI-EMH:MTR.NPTS']=epics.PV('LNS-ISRC-010:PBI-EMH:MTR.NPTS', auto_monitor=True) instruments['LNS-ISRC-010:PBI-EMH:PS.NPTS']=epics.PV('LNS-ISRC-010:PBI-EMH:PS.NPTS', auto_monitor=True) + instruments['LEBT-010:PBI-Dpl-001:IMG1-ArrayData']=epics.PV('LEBT-010:PBI-Dpl-001:IMG1-ArrayData', auto_monitor=True) + instruments['LEBT-010:PBI-Dpl-001:FIT1-Y_RBV']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-Y_RBV', auto_monitor=True) + instruments['LEBT-010:PBI-Dpl-001:SPECT-MinWavelength']=epics.PV('LEBT-010:PBI-Dpl-001:SPECT-MinWavelength', auto_monitor=True) + instruments['LEBT-010:PBI-Dpl-001:SPECT-Wavelength_RBV']=epics.PV('LEBT-010:PBI-Dpl-001:SPECT-Wavelength_RBV', auto_monitor=True) + instruments['LEBT-010:PBI-Dpl-001:SPECT-MaxWavelength']=epics.PV('LEBT-010:PBI-Dpl-001:SPECT-MaxWavelength', auto_monitor=True) + instruments['LEBT-010:PBI-Dpl-001:FIT1-FracProton']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-FracProton', auto_monitor=True) + instruments['LEBT-010:PBI-Dpl-001:FIT1-FracH2']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-FracH2', auto_monitor=True) + instruments['LEBT-010:PBI-Dpl-001:FIT1-FracH3']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-FracH3', auto_monitor=True) + print('Done') while(not self.stop_signal.isSet()): publicpvs_return_dict={} @@ -349,6 +358,25 @@ class epicsQuery(Thread): instruments_return_dict[pv]['units']='n.c.' instruments_return_dict[pv]['value']='' continue + + try: + if instruments['LEBT-010:PBI-Dpl-001:IMG1-ArrayData'].connected: + imarray = tile(instruments['LEBT-010:PBI-Dpl-001:IMG1-ArrayData'].value, (256,1)) + else: + imarray = zeros((256,1024)) + except: + imarray = zeros((256,1024)) + plt.imsave('/var/www/data/tmp-dpl.png', imarray, cmap='hot') + os.rename('/var/www/data/tmp-dpl.png', '/var/www/data/dpl.png') + +# instruments['LEBT-010:PBI-Dpl-001:FIT1-Y_RBV']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-Y_RBV', auto_monitor=True) +# instruments['LEBT-010:PBI-Dpl-001:SPECT-MinWavelength']=epics.PV('LEBT-010:PBI-Dpl-001:SPECT-MinWavelength', auto_monitor=True) +# instruments['LEBT-010:PBI-Dpl-001:SPECT-Wavelength_RBV']=epics.PV('LEBT-010:PBI-Dpl-001:SPECT-Wavelength_RBV', auto_monitor=True) +# instruments['LEBT-010:PBI-Dpl-001:SPECT-MaxWavelength']=epics.PV('LEBT-010:PBI-Dpl-001:SPECT-MaxWavelength', auto_monitor=True) +# instruments['LEBT-010:PBI-Dpl-001:FIT1-FracProton']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-FracProton', auto_monitor=True) +# instruments['LEBT-010:PBI-Dpl-001:FIT1-FracH2']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-FracH2', auto_monitor=True) +# instruments['LEBT-010:PBI-Dpl-001:FIT1-FracH3']=epics.PV('LEBT-010:PBI-Dpl-001:FIT1-FracH3', auto_monitor=True) + if instruments[pv].count>1 or instruments[pv].count==0: continue try: