From 51c00c6bb479a05b17cf32858f214403947d72fe Mon Sep 17 00:00:00 2001 From: Emanuele Laface <Emanuele.Laface@esss.se> Date: Wed, 17 Apr 2019 14:02:39 +0000 Subject: [PATCH] Horizontal EMU --- Python server/pos-python-server.py | 16 +++++++++ Web sites/instruments/dashboard.json | 52 ++++++++++++++++++++++++---- Web sites/pos-dev/dashboard.json | 6 ++-- 3 files changed, 64 insertions(+), 10 deletions(-) diff --git a/Python server/pos-python-server.py b/Python server/pos-python-server.py index 4fd01c1..6abaa11 100755 --- a/Python server/pos-python-server.py +++ b/Python server/pos-python-server.py @@ -141,6 +141,9 @@ class epicsQuery(Thread): instruments['LNS-ISRC-010:PBI-EMV:BUFF-CURRENT']=epics.PV('LNS-ISRC-010:PBI-EMV:BUFF-CURRENT', auto_monitor=True) instruments['LNS-ISRC-010:PBI-EMV:MTR.NPTS']=epics.PV('LNS-ISRC-010:PBI-EMV:MTR.NPTS', auto_monitor=True) instruments['LNS-ISRC-010:PBI-EMV:PS.NPTS']=epics.PV('LNS-ISRC-010:PBI-EMV:PS.NPTS', auto_monitor=True) + 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) print('Done') while(not self.stop_signal.isSet()): publicpvs_return_dict={} @@ -245,6 +248,19 @@ class epicsQuery(Thread): plt.imsave('/var/www/data/tmp-emu-vimage.png', imarray, cmap='jet') os.rename('/var/www/data/tmp-emu-vimage.png', '/var/www/data/emu-vimage.png') + try: + if instruments['LNS-ISRC-010:PBI-EMH:BUFF-CURRENT'].connected: + pos = instruments['LNS-ISRC-010:PBI-EMH:MTR.NPTS'].value + ang = instruments['LNS-ISRC-010:PBI-EMH:PS.NPTS'].value + imarray = (instruments['LNS-ISRC-010:PBI-EMH:BUFF-CURRENT'].value)[:pos*ang].reshape((ang,pos)) + imarray=(imarray*255) + else: + imarray = zeros((200,200)) + except: + imarray = zeros((200,200)) + plt.imsave('/var/www/data/tmp-emu-himage.png', imarray, cmap='jet') + os.rename('/var/www/data/tmp-emu-himage.png', '/var/www/data/emu-himage.png') + instruments_return_dict={} for pv in instruments: instruments_return_dict[pv]={} diff --git a/Web sites/instruments/dashboard.json b/Web sites/instruments/dashboard.json index 2fe4c94..c6adb0b 100644 --- a/Web sites/instruments/dashboard.json +++ b/Web sites/instruments/dashboard.json @@ -79,7 +79,8 @@ "3": 17, "4": 17, "5": 17, - "9": 17 + "9": 17, + "10": 17 }, "col": { "1": 1, @@ -87,7 +88,8 @@ "3": 1, "4": 1, "5": 1, - "9": 1 + "9": 1, + "10": 1 }, "col_width": 2, "widgets": [ @@ -120,7 +122,8 @@ "3": 35, "4": 17, "7": 17, - "10": 17 + "10": 17, + "11": 17 }, "col": { "1": 1, @@ -128,7 +131,8 @@ "3": 1, "4": 3, "7": 3, - "10": 3 + "10": 3, + "11": 3 }, "col_width": 2, "widgets": [ @@ -155,22 +159,56 @@ { "title": "Vertical Emittance Meter", "width": 1, + "row": { + "1": 63, + "2": 63, + "3": 63, + "4": 35, + "11": 35, + "12": 35 + }, + "col": { + "1": 1, + "2": 1, + "3": 1, + "4": 3, + "11": 1, + "12": 1 + }, + "col_width": 2, + "widgets": [ + { + "type": "html", + "settings": { + "html": "<img width=\"100%\" height=\"100%\" id=\"emuvImage\", src=\"http://data.pos.esss.lu.se/emu-vimage.png\"></img>\n<script>\n setInterval(function() { \n var emuvImage = document.getElementById('emuvImage'); \n emuvImage.src = 'http://data.pos.esss.lu.se/emu-vimage.png?rnd=' + Math.random(); \n }, 1000); \n</script>", + "height": 4 + } + } + ] + }, + { + "title": "Horizontal Emittance Meter", + "width": 1, "row": { "1": 53, + "2": 53, + "3": 53, "4": 35, - "11": 35 + "13": 35 }, "col": { "1": 1, + "2": 1, + "3": 1, "4": 1, - "11": 1 + "13": 2 }, "col_width": 2, "widgets": [ { "type": "html", "settings": { - "html": "<img width=\"100%\" height=\"100%\" id=\"emuImage\", src=\"http://data.pos.esss.lu.se/emu-vimage.png\"></img>\n<script>\n setInterval(function() { \n var emuImage = document.getElementById('emuImage'); \n emuImage.src = 'http://data.pos.esss.lu.se/emu-vimage.png?rnd=' + Math.random(); \n }, 1000); \n</script>", + "html": "<img width=\"100%\" height=\"100%\" id=\"emuhImage\", src=\"http://data.pos.esss.lu.se/emu-himage.png\"></img>\n<script>\n setInterval(function() { \n var emuhImage = document.getElementById('emuhImage'); \n emuhImage.src = 'http://data.pos.esss.lu.se/emu-himage.png?rnd=' + Math.random(); \n }, 1000); \n</script>", "height": 4 } } diff --git a/Web sites/pos-dev/dashboard.json b/Web sites/pos-dev/dashboard.json index a4c586f..67d5270 100644 --- a/Web sites/pos-dev/dashboard.json +++ b/Web sites/pos-dev/dashboard.json @@ -94,7 +94,7 @@ { "type": "html", "settings": { - "html": "<img width=\"620\" height=\"240\" id=\"npmhImage\", src=\"http://data.pos.esss.lu.se/npm-himage.png\"></img>\n<script>\n setInterval(function() { \n var npmhImage = document.getElementById('npmhImage'); \n npmhImage.src = 'http://data.pos.esss.lu.se/npm-himage.png?rnd=' + Math.random(); \n }, 1000); \n</script>", + "html": "<img width=\"100%\" height=\"100%\" id=\"npmhImage\", src=\"http://data.pos.esss.lu.se/npm-himage.png\"></img>\n<script>\n setInterval(function() { \n var npmhImage = document.getElementById('npmhImage'); \n npmhImage.src = 'http://data.pos.esss.lu.se/npm-himage.png?rnd=' + Math.random(); \n }, 1000); \n</script>", "height": 4 } }, @@ -135,7 +135,7 @@ { "type": "html", "settings": { - "html": "<img width=\"620\" height=\"240\" id=\"npmvImage\", src=\"http://data.pos.esss.lu.se/npm-vimage.png\"></img>\n<script>\n setInterval(function() { \n var npmvImage = document.getElementById('npmvImage'); \n npmvImage.src = 'http://data.pos.esss.lu.se/npm-vimage.png?rnd=' + Math.random(); \n }, 1000); \n</script>", + "html": "<img width=\"100%\" height=\"100%\" id=\"npmvImage\", src=\"http://data.pos.esss.lu.se/npm-vimage.png\"></img>\n<script>\n setInterval(function() { \n var npmvImage = document.getElementById('npmvImage'); \n npmvImage.src = 'http://data.pos.esss.lu.se/npm-vimage.png?rnd=' + Math.random(); \n }, 1000); \n</script>", "height": 4 } }, @@ -170,7 +170,7 @@ { "type": "html", "settings": { - "html": "<img width=\"620\" height=\"240\" id=\"emuImage\", src=\"http://data.pos.esss.lu.se/emu-vimage.png\"></img>\n<script>\n setInterval(function() { \n var emuImage = document.getElementById('emuImage'); \n emuImage.src = 'http://data.pos.esss.lu.se/emu-vimage.png?rnd=' + Math.random(); \n }, 1000); \n</script>", + "html": "<img width=\"100%\" height=\"100%\" id=\"emuImage\", src=\"http://data.pos.esss.lu.se/emu-vimage.png\"></img>\n<script>\n setInterval(function() { \n var emuImage = document.getElementById('emuImage'); \n emuImage.src = 'http://data.pos.esss.lu.se/emu-vimage.png?rnd=' + Math.random(); \n }, 1000); \n</script>", "height": 4 } } -- GitLab