Skip to content
Snippets Groups Projects
dashboard.json 21.4 KiB
Newer Older
Emanuele Laface's avatar
Emanuele Laface committed
{
	"version": 1,
	"header_image": "",
	"allow_edit": false,
Emanuele Laface's avatar
Emanuele Laface committed
	"plugins": [],
	"panes": [
		{
			"width": 1,
			"row": {
				"1": 1,
				"2": 1,
				"3": 1,
				"4": 1
			},
			"col": {
				"1": 1,
				"2": 1,
				"3": 1,
				"4": 1
			},
Emanuele Laface's avatar
Emanuele Laface committed
			"col_width": 4,
Emanuele Laface's avatar
Emanuele Laface committed
			"widgets": [
				{
					"type": "html",
					"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
						"html": "datasources[\"Clock\"][\"numeric_value\"]; // trick to trigger the update\nvar cols = document.getElementsByClassName('gs_w')[0].getAttribute('data-sizex');\ndocument.getElementsByClassName('gs_w')[0].firstElementChild.firstElementChild.innerHTML = \"\";\nif (cols == 4){\n    text = \"<div style=\\\"position: static; margin-top: -15px;\\\"><img src=\\\"../img/ess-logo.svg\\\" title=\\\"Designed by Emanuele Laface with PyEpics and Freeboard. Graphics by Dirk Nordt.\\\"><div class=\\\"tw-value\\\" style=\\\"font-size: 56px; color:#ffffff !important; position: relative; bottom: 35px; left: 160px;\\\" title=\\\"Designed by Emanuele Laface with PyEpics and Freeboard. Graphics by Dirk Nordt.\\\">Public Operations Screen</div></img></div>\";\n}\nif (cols == 3){\n    text = \"<div style=\\\"position: static; margin-top: -15px;\\\"><img src=\\\"../img/ess-logo.svg\\\" title=\\\"Designed by Emanuele Laface with PyEpics and Freeboard. Graphics by Dirk Nordt.\\\"><div class=\\\"tw-value\\\" style=\\\"font-size: 46px; color:#ffffff !important; position: relative; bottom: 45px; left: 100px;\\\" title=\\\"Designed by Emanuele Laface with PyEpics and Freeboard. Graphics by Dirk Nordt.\\\">Public Operations Screen</div></img></div>\";\n}\n\nif (cols == 2){\n    text = \"<div style=\\\"position: static; margin-top: -15px;\\\"><img src=\\\"../img/ess-logo.svg\\\" title=\\\"Designed by Emanuele Laface with PyEpics and Freeboard. Graphics by Dirk Nordt.\\\"><div class=\\\"tw-value\\\" style=\\\"font-size: 30px; color:#ffffff !important; position: relative; bottom: 55px; left: 30px;\\\" title=\\\"Designed by Emanuele Laface with PyEpics and Freeboard. Graphics by Dirk Nordt.\\\">Public Operations Screen</div></img></div>\";\n}\nif (cols == 1){\n    text = \"<div style=\\\"position: static; margin-top: -15px;\\\"><img src=\\\"../img/ess-logo.svg\\\" title=\\\"Designed by Emanuele Laface with PyEpics and Freeboard. Graphics by Dirk Nordt.\\\"><div class=\\\"tw-value\\\" style=\\\"font-size: 30px; color:#ffffff !important; position: relative; bottom: 55px; left: 30px;\\\" title=\\\"Designed by Emanuele Laface with PyEpics and Freeboard. Graphics by Dirk Nordt.\\\"></div></img></div>\";\n    document.getElementsByClassName('gs_w')[0].firstElementChild.firstElementChild.innerHTML = \"Public Operations Screen\";\n}\n\nreturn text\n\n",
Emanuele Laface's avatar
Emanuele Laface committed
						"height": 2
					}
				}
			]
		},
		{
Emanuele Laface's avatar
Emanuele Laface committed
			"title": "RFQ",
Emanuele Laface's avatar
Emanuele Laface committed
			"width": 1,
			"row": {
Emanuele Laface's avatar
Emanuele Laface committed
				"1": 47,
Emanuele Laface's avatar
Emanuele Laface committed
				"2": 15,
Emanuele Laface's avatar
Emanuele Laface committed
				"3": 7,
				"4": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"5": 7,
				"7": 7
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col": {
				"1": 1,
				"2": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"3": 2,
				"4": 3,
Emanuele Laface's avatar
Emanuele Laface committed
				"5": 3,
Emanuele Laface's avatar
Emanuele Laface committed
				"7": 3
Emanuele Laface's avatar
Emanuele Laface committed
			},
Emanuele Laface's avatar
Emanuele Laface committed
			"col_width": 2,
Emanuele Laface's avatar
Emanuele Laface committed
			"widgets": [
				{
Emanuele Laface's avatar
Emanuele Laface committed
					"type": "indicator",
Emanuele Laface's avatar
Emanuele Laface committed
					"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "timelength = datasources[\"POS\"][\"RFQ-010:RFS-EVR-101:RFSyncWdt-SP\"][\"value\"]/1000;\npwxdata = datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:Dwn6-XAxis.[0:100:-1]\"][\"value\"];\npwydata = datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:Dwn6-Cmp0.[0:100:-1]\"][\"value\"];\n\npower = datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:AI2-SMonAvg-Mag\"][\"value\"]-datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:AI3-SMonAvg-Mag\"][\"value\"]+datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:AI4-SMonAvg-Mag\"][\"value\"]-datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:AI5-SMonAvg-Mag\"][\"value\"];\n\npwdata = 0;\ncounts = 0;\n\ntimestamp = datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:Dwn6-Cmp0.[0:100:-1]\"][\"timestamp\"];\nnow = Math.floor((new Date()).getTime() / 1000);\nenable = 1;\nif (now - timestamp > 60) {\n    enable = 0;\n}\n\nfor (i=0; i < pwxdata.length; i++) {\n    if (pwxdata[i] > timelength) {\n        break;\n    }\n\tpwdata += enable*pwydata[i];\n    counts += 1;\n}\n\nif (counts == 0) {\n    return 0;\n}\n\nif (pwdata/counts < 3) {\n    return 0;\n}\n\nreturn 1;",
Emanuele Laface's avatar
Emanuele Laface committed
						"on_text": "RFQ On",
						"off_text": "RFQ Off"
Emanuele Laface's avatar
Emanuele Laface committed
					}
Emanuele Laface's avatar
Emanuele Laface committed
				},
Emanuele Laface's avatar
Emanuele Laface committed
				{
Emanuele Laface's avatar
Emanuele Laface committed
					"type": "text_widget",
Emanuele Laface's avatar
Emanuele Laface committed
					"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
						"title": "Average Power",
Emanuele Laface's avatar
Emanuele Laface committed
						"size": "regular",
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "power = datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:AI2-SMonAvg-Mag\"][\"value\"]-datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:AI3-SMonAvg-Mag\"][\"value\"]+datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:AI4-SMonAvg-Mag\"][\"value\"]-datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:AI5-SMonAvg-Mag\"][\"value\"];\n\ntimestamp = datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:AI2-SMonAvg-Mag\"][\"timestamp\"];\nnow = Math.floor((new Date()).getTime() / 1000);\nenable = 1;\nif (now - timestamp > 60) {\n    enable = 0;\n}\n\n\nreturn enable*power.toFixed(3);",
Emanuele Laface's avatar
Emanuele Laface committed
						"animate": true,
						"units": "kW"
					}
Emanuele Laface's avatar
Emanuele Laface committed
				},
				{
					"type": "flot_extended_plugin",
					"settings": {
						"plot_type": "area",
						"legend": true,
						"height": 4,
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "datasources[\"Clock\"][\"numeric_value\"];\n\ntimelength = datasources[\"POS\"][\"RFQ-010:RFS-EVR-101:RFSyncWdt-SP\"][\"value\"]/1000*2;\n\npwxdata = datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:Dwn6-XAxis.[0:100:-1]\"][\"value\"];\npwydata = datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:Dwn6-Cmp0.[0:100:-1]\"][\"value\"];\n\ntimestamp = datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:Dwn6-Cmp0.[0:100:-1]\"][\"timestamp\"];\nnow = Math.floor((new Date()).getTime() / 1000);\nenable = 1;\nif (now - timestamp > 60) {\n    enable = 0;\n}\nelse {\n    enable = 1;\n}\n\npwdata = [];\n\nfor (i=0; i < pwxdata.length; i++) {\n    if (pwxdata[i] > timelength) {\n        break;\n    }\n\tpwdata.push([pwxdata[i], enable*pwydata[i]]);\n}\n\ndata = [{label: 'Power applied', data: pwdata, color: \"green\"}];\n\nreturn data;",
Emanuele Laface's avatar
Emanuele Laface committed
						"xticks": "datasources[\"Clock\"][\"numeric_value\"];\n\nvar cols = document.getElementsByClassName('gs_w')[0].getAttribute('data-sizex');\n\ntimelength = datasources[\"POS\"][\"RFQ-010:RFS-EVR-101:RFSyncWdt-SP\"][\"value\"]/1000*2;\nxdata = datasources[\"POS\"][\"RFQ-010:RFS-DIG-101:Dwn6-XAxis.[0:100:-1]\"][\"value\"];\n\nif (timelength > xdata[xdata.length-1]) {\n    timelength = xdata[xdata.length-1];\n}\n\nxtick = [];\nsize = 10;\nif (cols == 1) {\n    size = 4;\n}\n\nfor (i = 0; i < (size+1); i += 1) {\n    xtick.push([timelength*i/size, (timelength*i/size).toFixed(3).toString()]);\n}\nxtick[size/2][1] = xtick[size/2][1]+\"<br>t [ms]\";\n\nreturn xtick;\n\n",
Emanuele Laface's avatar
Emanuele Laface committed
						"yticks": "datasources[\"Clock\"][\"numeric_value\"]\n\nif (typeof axes === 'undefined') {\n    return;\n}\n\nytick = [];\nfor (i = 0; i < axes.yaxis.ticks.length-1; i += 1) {\n\tytick.push([axes.yaxis.ticks[i][\"v\"], axes.yaxis.ticks[i][\"label\"]]);\n}\n\nytick.push([axes.yaxis.ticks[axes.yaxis.ticks.length-1][\"v\"], \"P [kW]\"]);\nreturn ytick;",
Emanuele Laface's avatar
Emanuele Laface committed
						"zoom": "xy"
					}
Emanuele Laface's avatar
Emanuele Laface committed
				}
			]
		},
Emanuele Laface's avatar
Emanuele Laface committed
		{
			"title": "Permit table",
			"width": 1,
			"row": {
				"1": 7,
				"2": 7,
				"3": 7,
				"4": 7,
				"7": 11,
				"8": 11
			},
			"col": {
				"1": 1,
				"2": 1,
				"3": 1,
				"4": 1,
				"7": 2,
				"8": 2
			},
			"col_width": 1,
			"widgets": [
				{
					"type": "indicator",
					"settings": {
						"title": "",
						"value": "datasources[\"POS\"][\"FBIS::beam_permit_ok\"][\"value\"]",
						"on_text": "FBIS Global Permit",
						"off_text": "FBIS Global Permit"
					}
				},
Emanuele Laface's avatar
Emanuele Laface committed
				{
					"type": "indicator",
					"settings": {
						"value": "datasources[\"POS\"][\"BPROD:Ops:BState\"][\"value\"]",
						"on_text": "OP Beam Requested",
						"off_text": "OP Beam Requested"
					}
				},
Emanuele Laface's avatar
Emanuele Laface committed
				{
					"type": "text_widget",
					"settings": {
						"title": "PSS1 Mode of Operation",
						"size": "regular",
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "switch(datasources[\"POS\"][\"AccPSS:PSS-Area-1:PSSMode\"][\"value\"]) {\n  case 0:\n    return \"Alarm\";\n  case 1:\n    return \"Open Access\";\n  case 2:\n    return \"Search\";\n  case 3:\n    return \"Tunnel Closed\";\n  case 4:\n    return \"Beam On\";\n  case 5:\n    return \"RM Interlock\";\n  case 6:\n    return \"RP Survey\";\n  case 7:\n    return \"Restricted Access\";\n  default:\n    // code block\n}",
Emanuele Laface's avatar
Emanuele Laface committed
						"animate": true
					}
				}
			]
		},
Emanuele Laface's avatar
Emanuele Laface committed
		{
			"title": "Beam Production Table",
			"width": 1,
			"row": {
				"1": 19,
				"2": 29,
				"3": 15,
				"4": 15,
				"7": 13,
				"8": 13
			},
			"col": {
				"1": 1,
				"2": 2,
				"3": 1,
				"4": 2,
				"7": 1,
				"8": 1
			},
			"col_width": 1,
			"widgets": [
				{
					"type": "text_widget",
					"settings": {
						"title": "Frequency",
						"size": "regular",
						"value": "datasources[\"POS\"][\"TD-M:Ctrl-SCE-1:ScTable-RB\"][\"value\"].split(\"__\")[1];",
						"animate": true
					}
				},
				{
					"type": "text_widget",
					"settings": {
						"title": "ISrc Pulse Length",
						"size": "regular",
						"value": "datasources[\"POS\"][\"TD-M:Ctrl-SCE-1:ScTable-RB\"][\"value\"].split(\"__\")[2];",
						"animate": true,
						"units": "µs"
					}
				},
				{
					"type": "text_widget",
					"settings": {
						"title": "LEBT Pulse Length",
						"size": "regular",
						"value": "datasources[\"POS\"][\"TD-M:Ctrl-SCE-1:ScTable-RB\"][\"value\"].split(\"__\")[3];",
						"animate": true,
						"units": "µs"
					}
				},
				{
					"type": "text_widget",
					"settings": {
						"title": "MEBT Pulse Length",
						"size": "regular",
						"value": "datasources[\"POS\"][\"TD-M:Ctrl-SCE-1:ScTable-RB\"][\"value\"].split(\"__\")[4];",
						"animate": true,
						"units": "µs"
					}
				}
			]
		},
Emanuele Laface's avatar
Emanuele Laface committed
		{
Emanuele Laface's avatar
Emanuele Laface committed
			"title": "Control Room",
Emanuele Laface's avatar
Emanuele Laface committed
			"width": 1,
			"row": {
Emanuele Laface's avatar
Emanuele Laface committed
				"1": 29,
Emanuele Laface's avatar
Emanuele Laface committed
				"2": 29,
				"3": 21,
				"4": 15,
Emanuele Laface's avatar
Emanuele Laface committed
				"5": 7,
				"6": 7,
				"7": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"8": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"9": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"10": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"11": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"12": 7,
				"13": 7,
				"14": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"15": 7
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col": {
				"1": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"2": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"3": 2,
Emanuele Laface's avatar
Emanuele Laface committed
				"4": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"5": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"7": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"8": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"9": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"11": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"12": 1,
				"13": 1,
				"14": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"15": 1
Emanuele Laface's avatar
Emanuele Laface committed
			},
Emanuele Laface's avatar
Emanuele Laface committed
			"col_width": 1,
Emanuele Laface's avatar
Emanuele Laface committed
			"widgets": [
				{
Emanuele Laface's avatar
Emanuele Laface committed
					"type": "text_widget",
Emanuele Laface's avatar
Emanuele Laface committed
					"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
						"title": "Shift ID",
Emanuele Laface's avatar
Emanuele Laface committed
						"size": "regular",
						"value": "datasources[\"POS\"][\"NSO:Ops:SID\"][\"value\"]",
						"animate": false
Emanuele Laface's avatar
Emanuele Laface committed
					}
Emanuele Laface's avatar
Emanuele Laface committed
				},
Emanuele Laface's avatar
Emanuele Laface committed
				{
					"type": "text_widget",
					"settings": {
						"size": "regular",
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "datasources[\"Clock\"][\"numeric_value\"];\n\nvar elements = document.getElementsByClassName('tw-value');\n\nfor (var i = 0; i < elements.length; i++) {\n    var element = elements[i];\n    if (element.innerHTML == datasources[\"POS\"][\"NSO:Ops:Msg\"][\"value\"]) {\n        element.style.fontSize = \"18px\";\n    }\n}\n\nreturn datasources[\"POS\"][\"NSO:Ops:Msg\"][\"value\"];",
Emanuele Laface's avatar
Emanuele Laface committed
						"animate": true
Emanuele Laface's avatar
Emanuele Laface committed
					}
Emanuele Laface's avatar
Emanuele Laface committed
				},
Emanuele Laface's avatar
Emanuele Laface committed
				{
Emanuele Laface's avatar
Emanuele Laface committed
					"type": "indicator",
Emanuele Laface's avatar
Emanuele Laface committed
					"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "datasources[\"POS\"][\"NSO:Ops:ESSSystemPermit\"][\"value\"]",
						"on_text": "Beam Authorization",
						"off_text": "Beam Authorization"
Emanuele Laface's avatar
Emanuele Laface committed
				},
Emanuele Laface's avatar
Emanuele Laface committed
				{
Emanuele Laface's avatar
Emanuele Laface committed
					"type": "indicator",
Emanuele Laface's avatar
Emanuele Laface committed
					"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "datasources[\"POS\"][\"NSO:Ops:ESSSystemPermit\"][\"value\"]",
						"on_text": "System Permit",
						"off_text": "System Permit"
Emanuele Laface's avatar
Emanuele Laface committed
		},
Emanuele Laface's avatar
Emanuele Laface committed
		{
			"title": "Ion Source",
			"width": 1,
			"row": {
				"1": 39,
Emanuele Laface's avatar
Emanuele Laface committed
				"2": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"3": 21,
				"4": 7,
				"7": 7,
				"8": 7
			},
			"col": {
				"1": 1,
				"2": 2,
				"3": 3,
				"4": 2,
				"7": 1,
				"8": 1
			},
			"col_width": 1,
			"widgets": [
				{
					"type": "indicator",
					"settings": {
						"value": "datasources[\"POS\"][\"ISrc-CS:ISS-Magtr-01:MwRdy\"][\"value\"]",
						"on_text": "Magnetron On",
						"off_text": "Magnetron Off"
					}
				},
				{
					"type": "text_widget",
					"settings": {
						"title": "Average Power",
						"size": "regular",
						"value": "String(datasources[\"POS\"][\"ISrc-CS:ISS-Magtr-01:ForwdPwr-R\"][\"value\"])",
						"animate": true,
						"units": "W"
					}
				},
				{
					"type": "indicator",
					"settings": {
						"title": "High Voltage Platform",
						"value": "datasources[\"POS\"][\"ISrc-CS:ISS-HVPS-01:Pwr-R\"][\"value\"]",
						"on_text": "String(datasources[\"POS\"][\"ISrc-CS:ISS-HVPS-01:Pwr-R\"][\"value\"])+\" kV\"",
						"off_text": "String(datasources[\"POS\"][\"ISrc-CS:ISS-HVPS-01:Pwr-R\"][\"value\"])+\" kV\""
					}
				}
			]
		},
Emanuele Laface's avatar
Emanuele Laface committed
			"title": "Beam Mode",
Emanuele Laface's avatar
Emanuele Laface committed
			"width": 1,
			"row": {
Emanuele Laface's avatar
Emanuele Laface committed
				"1": 15,
				"2": 63,
				"3": 25,
				"4": 21,
				"7": 21
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col": {
				"1": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"2": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"3": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"4": 3,
				"7": 3
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col_width": 1,
			"widgets": [
				{
					"type": "text_widget",
					"settings": {
						"size": "regular",
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "switch(datasources[\"POS\"][\"TD-M:Ctrl-SCE-1:BMod-Sel\"][\"value\"]) {\n    case 0:\n        return \"No Beam\";\n    case 1:\n        return \"Conditioning\";\n    case 2:\n        return \"Probe Beam\";\n    case 3:\n        return \"Fast Commissioning\"\n    case 4:\n        return \"RF Test\";\n    case 5:\n        return \"Stability Test\";\n    case 6:\n        return \"Slow Commissioning\";\n    case 7:\n        return \"Fast Tuning\";\n    case 8:\n        return \"Slow Tunning\";\n    default:\n}",
Emanuele Laface's avatar
Emanuele Laface committed
						"animate": true
					}
				}
			]
Emanuele Laface's avatar
Emanuele Laface committed
		},
		{
Emanuele Laface's avatar
Emanuele Laface committed
			"title": "Beam Current",
Emanuele Laface's avatar
Emanuele Laface committed
			"width": 1,
			"row": {
				"1": 61,
				"2": 41,
Emanuele Laface's avatar
Emanuele Laface committed
				"3": 31,
				"4": 25,
Emanuele Laface's avatar
Emanuele Laface committed
				"7": 25,
				"8": 25,
				"9": 25
			},
			"col": {
				"1": 1,
				"2": 1,
				"3": 1,
				"4": 1,
				"7": 1,
				"8": 1,
				"9": 1
			},
			"col_width": 4,
			"widgets": [
				{
					"type": "flot_extended_plugin",
					"settings": {
						"plot_type": "line",
						"legend": true,
						"height": 5,
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "datasources[\"Clock\"][\"numeric_value\"];\n\nisrcxdata = datasources[\"POS\"][\"ISrc-010:PBI-BCM-001:PRC-TR1-ArrayTimeUs.[0:400:-1]\"][\"value\"];\nisrcydata = datasources[\"POS\"][\"ISrc-010:PBI-BCM-001:PRC-TR1-ArrayData.[0:400:-1]\"][\"value\"];\nlebtxdata = datasources[\"POS\"][\"LEBT-010:PBI-BCM-001:PRC-TR1-ArrayTimeUs.[0:400:-1]\"][\"value\"];\nlebtydata = datasources[\"POS\"][\"LEBT-010:PBI-BCM-001:PRC-TR1-ArrayData.[0:400:-1]\"][\"value\"];\nrfqxdata = datasources[\"POS\"][\"RFQ-010:PBI-BCM-001:PRC-TR1-ArrayTimeUs.[0:400:-1]\"][\"value\"];\nrfqydata = datasources[\"POS\"][\"RFQ-010:PBI-BCM-001:PRC-TR1-ArrayData.[0:400:-1]\"][\"value\"];\nmebt1xdata = datasources[\"POS\"][\"MEBT-010:PBI-BCM-001:PRC-TR1-ArrayTimeUs.[0:400:-1]\"][\"value\"];\nmebt1ydata = datasources[\"POS\"][\"MEBT-010:PBI-BCM-001:PRC-TR1-ArrayData.[0:400:-1]\"][\"value\"];\nmebt2xdata = datasources[\"POS\"][\"MEBT-010:PBI-BCM-002:PRC-TR1-ArrayTimeUs.[0:400:-1]\"][\"value\"];\nmebt2ydata = datasources[\"POS\"][\"MEBT-010:PBI-BCM-002:PRC-TR1-ArrayData.[0:400:-1]\"][\"value\"];\n\nfclebtydata = datasources[\"POS\"][\"LEBT-010:PBI-FC-001:TRC2-ArrayData-Comp.[0:20:-1]\"][\"value\"];\nfcmebtydata = datasources[\"POS\"][\"MEBT-010:PBI-FC-001:TRC2-ArrayData-Comp.[0:20:-1]\"][\"value\"];\n\nisrcdata = [];\nlebtdata = [];\nrfqdata = [];\nmebt1data = [];\nmebt2data = [];\nfclebtdata = [];\nfcmebtdata = [];\n\nmaxtime = 6400;\n\nfor (i=0; i < isrcxdata.length; i++) {\n    if (isrcxdata[i] > maxtime) {\n        break;\n    }\n\tisrcdata.push([isrcxdata[i], isrcydata[i]]);\n}\nfor (i=0; i < lebtxdata.length; i++) {\n\tif (lebtxdata[i] > maxtime) {\n        break;\n    }\n\tlebtdata.push([lebtxdata[i], lebtydata[i]]);\n}\nfor (i=0; i < rfqxdata.length; i++) {\n\tif (rfqxdata[i] > maxtime) {\n        break;\n    }\n\trfqdata.push([rfqxdata[i], rfqydata[i]]);\n}\nfor (i=0; i < mebt1xdata.length; i++) {\n\tif (mebt1xdata[i] > maxtime) {\n        break;\n    }\n\tmebt1data.push([mebt1xdata[i], mebt1ydata[i]]);\n}\nfor (i=0; i < mebt2xdata.length; i++) {\n\tif (mebt2xdata[i] > maxtime) {\n        break;\n    }\n\tmebt2data.push([mebt2xdata[i], mebt2ydata[i]]);\n}\nfor (i=0; i < fclebtydata.length; i++) {\n\tif (i > maxtime/20) {\n        break;\n    }\n\tfclebtdata.push([i*20, fclebtydata[i]]);\n}\nfor (i=0; i < fcmebtydata.length; i++) {    \n\tif (i > maxtime/20) {\n        break;\n    }\n\tfcmebtdata.push([i*20, fcmebtydata[i]]);\n}\n\ndata = [{label: 'BCM ISrc', data: isrcdata, color: \"lightblue\"},\n        {label: 'BCM LEBT', data: lebtdata, color: \"red\"},\n        {label: 'BCM RFQ', data: rfqdata, color: \"green\"},\n        {label: 'BCM MEBT 1', data: mebt1data, color: \"pink\"},\n        {label: 'BCM MEBT 2', data: mebt2data, color: \"black\"},\n        {label: 'FC LEBT', data: fclebtdata, color: \"lime\"},\n        {label: 'FC MEBT', data: fcmebtdata, color: \"yellow\"}];\n\nreturn data;",
						"xticks": "datasources[\"Clock\"][\"numeric_value\"];\n\nvar cols = document.getElementsByClassName('gs_w')[0].getAttribute('data-sizex');\n\ncurrtimelength = 6400;\n\ncurrxtick = [];\nsize = 10;\nif (cols == 1) {\n    size = 4;\n}\n\nfor (i = 0; i < (size+1); i += 1) {\n\tcurrxtick.push([currtimelength*i/size, (currtimelength*i/size/1000).toFixed(3).toString()]);\n}\n\ncurrxtick[size/2][1] = currxtick[size/2][1]+\"<br>t [ms]\";\nreturn currxtick;",
Emanuele Laface's avatar
Emanuele Laface committed
						"yticks": "datasources[\"Clock\"][\"numeric_value\"]\n\nif (typeof axes === 'undefined') {\n    return;\n}\n\nytick = [];\nfor (i = 0; i < axes.yaxis.ticks.length-1; i += 1) {\n\tytick.push([axes.yaxis.ticks[i][\"v\"], axes.yaxis.ticks[i][\"label\"]]);\n}\n\nytick.push([axes.yaxis.ticks[axes.yaxis.ticks.length-1][\"v\"], \"I [mA]\"]);\nreturn ytick;",
Emanuele Laface's avatar
Emanuele Laface committed
						"zoom": "xy"
					}
				}
			]
		},
		{
Emanuele Laface's avatar
Emanuele Laface committed
			"title": "Beam Position Monitors",
Emanuele Laface's avatar
Emanuele Laface committed
			"width": 1,
			"row": {
				"1": 73,
				"2": 53,
Emanuele Laface's avatar
Emanuele Laface committed
				"3": 43,
				"4": 37,
Emanuele Laface's avatar
Emanuele Laface committed
				"10": 37,
				"11": 37
			},
			"col": {
				"1": 1,
				"2": 1,
				"3": 1,
				"4": 1,
				"10": 1,
				"11": 1
			},
			"col_width": 4,
			"widgets": [
				{
					"type": "flot_extended_plugin",
					"settings": {
						"plot_type": "line",
						"legend": true,
						"height": 4,
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "datasources[\"Clock\"][\"numeric_value\"];\n\nxbpm = [];\nybpm = [];\n\nmaxdisp = 0;\n\nfor (i=1; i < 8; i++) {\n    xpv = \"MEBT-010:PBI-BPM-00\"+String(i)+\":XP-AvgValue\";\n\typv = \"MEBT-010:PBI-BPM-00\"+String(i)+\":YP-AvgValue\";\n    xvalue = Math.abs(datasources[\"POS\"][xpv][\"value\"]);\n    yvalue = Math.abs(datasources[\"POS\"][ypv][\"value\"]);\n    if (xvalue > maxdisp) {\n        maxdisp = xvalue;\n    }\n    if (yvalue > maxdisp) {\n        maxdisp = yvalue;\n    }\n}\n\nif (maxdisp > 100) {\n    for (i=1; i < 8; i++) {\n        xbpm.push([i, 0.0]);\n        ybpm.push([i, 0.0]);\n    }\n    data = [{label: 'Horizontal', data: xbpm, color: \"lime\"},\n        {label: 'Vertical', data: ybpm, color: \"yellow\"}];\n    return data;\n}\n    \nfor (i=1; i < 8; i++) {\n    xpv = \"MEBT-010:PBI-BPM-00\"+String(i)+\":XP-AvgValue\";\n    xvalue = datasources[\"POS\"][xpv][\"value\"];\n    if (xvalue == null) {\n        xvalue = 0.0;\n    }\n    xbpm.push([i, xvalue]);\n    ypv = \"MEBT-010:PBI-BPM-00\"+String(i)+\":YP-AvgValue\";\n    yvalue = datasources[\"POS\"][ypv][\"value\"];\n    if (yvalue == null) {\n        yvalue = 0.0;\n    }\n    ybpm.push([i, yvalue]);\n}\n\ndata = [{label: 'Horizontal', data: xbpm, color: \"lime\"},\n        {label: 'Vertical', data: ybpm, color: \"yellow\"}];\n\nreturn data;",
Emanuele Laface's avatar
Emanuele Laface committed
						"xticks": "datasources[\"Clock\"][\"numeric_value\"]\n\ncurrxtick = [];\nfor (i = 1; i < 8; i += 1) {\n\tcurrxtick.push([i, String(i)]);\n}\n\ncurrxtick[3][1] = currxtick[3][1]+\"<br>BPM Number\";\nreturn currxtick;",
Emanuele Laface's avatar
Emanuele Laface committed
						"yticks": "datasources[\"Clock\"][\"numeric_value\"]\n\nif (typeof axes === 'undefined') {\n    return;\n}\n\nytick = [];\nfor (i = 0; i < axes.yaxis.ticks.length-1; i += 1) {\n\tytick.push([axes.yaxis.ticks[i][\"v\"], axes.yaxis.ticks[i][\"label\"]]);\n}\n\nytick.push([axes.yaxis.ticks[axes.yaxis.ticks.length-1][\"v\"], \"∆X,∆Y<br>[mm]\"]);\nreturn ytick;",
Emanuele Laface's avatar
Emanuele Laface committed
						"points": true,
Emanuele Laface's avatar
Emanuele Laface committed
						"zoom": "xy"
					}
				}
			]
Emanuele Laface's avatar
Emanuele Laface committed
		}
	],
	"datasources": [
		{
Emanuele Laface's avatar
Emanuele Laface committed
			"type": "JSON",
			"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
				"url": "/data/api/v1/caget/ISrc-CS:ISS-Magtr-01:MwRdy,ISrc-CS:ISS-Magtr-01:ForwdPwr-R,ISrc-CS:ISS-HVPS-01:Pwr-R,RFQ-010:RFS-DIG-101:AI2-SMonAvg-Mag,RFQ-010:RFS-DIG-101:AI3-SMonAvg-Mag,RFQ-010:RFS-DIG-101:AI4-SMonAvg-Mag,RFQ-010:RFS-DIG-101:AI5-SMonAvg-Mag,RFQ-010:RFS-DIG-101:Dwn6-XAxis.[0:100:-1],RFQ-010:RFS-DIG-101:Dwn6-Cmp0.[0:100:-1],ISrc-010:PBI-BCM-001:PRC-TR1-ArrayTimeUs.[0:400:-1],ISrc-010:PBI-BCM-001:PRC-TR1-ArrayData.[0:400:-1],LEBT-010:PBI-BCM-001:PRC-TR1-ArrayTimeUs.[0:400:-1],LEBT-010:PBI-BCM-001:PRC-TR1-ArrayData.[0:400:-1],RFQ-010:PBI-BCM-001:PRC-TR1-ArrayTimeUs.[0:400:-1],RFQ-010:PBI-BCM-001:PRC-TR1-ArrayData.[0:400:-1],MEBT-010:PBI-BCM-001:PRC-TR1-ArrayTimeUs.[0:400:-1],MEBT-010:PBI-BCM-001:PRC-TR1-ArrayData.[0:400:-1],MEBT-010:PBI-BCM-002:PRC-TR1-ArrayTimeUs.[0:400:-1],MEBT-010:PBI-BCM-002:PRC-TR1-ArrayData.[0:400:-1],LEBT-010:PBI-FC-001:TRC2-ArrayData-Comp.[0:20:-1],MEBT-010:PBI-FC-001:TRC2-ArrayData-Comp.[0:20:-1],MEBT-010:PBI-BPM-001:XP-AvgValue,MEBT-010:PBI-BPM-002:XP-AvgValue,MEBT-010:PBI-BPM-003:XP-AvgValue,MEBT-010:PBI-BPM-004:XP-AvgValue,MEBT-010:PBI-BPM-005:XP-AvgValue,MEBT-010:PBI-BPM-006:XP-AvgValue,MEBT-010:PBI-BPM-007:XP-AvgValue,MEBT-010:PBI-BPM-008:XP-AvgValue,MEBT-010:PBI-BPM-001:YP-AvgValue,MEBT-010:PBI-BPM-002:YP-AvgValue,MEBT-010:PBI-BPM-003:YP-AvgValue,MEBT-010:PBI-BPM-004:YP-AvgValue,MEBT-010:PBI-BPM-005:YP-AvgValue,MEBT-010:PBI-BPM-006:YP-AvgValue,MEBT-010:PBI-BPM-007:YP-AvgValue,MEBT-010:PBI-BPM-008:YP-AvgValue,AccPSS:PSS-Area-1:PSSMode,NSO:Ops:SID,NSO:Ops:Msg,RFQ-010:RFS-EVR-101:RFSyncWdt-SP,FBIS::beam_permit_ok, Beam State Status,TD-M:Ctrl-SCE-1:ScTable-RB,BPROD:Ops:BState,TD-M:Ctrl-SCE-1:BState-Sts ,TD-M:Ctrl-SCE-1:BMod-Sel,NSO:Ops:BeamAuthorization,NSO:Ops:ESSSystemPermit",
Emanuele Laface's avatar
Emanuele Laface committed
				"use_thingproxy": false,
				"refresh": 10,
Emanuele Laface's avatar
Emanuele Laface committed
				"method": "GET"
Emanuele Laface's avatar
Emanuele Laface committed
			}
		},
		{
			"name": "Clock",
			"type": "clock",
			"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
		}
	],
	"columns": 4
}