Skip to content
Snippets Groups Projects
dashboard.json 19.3 KiB
Newer Older
Emanuele Laface's avatar
Emanuele Laface committed
{
	"version": 1,
	"header_image": "",
Emanuele Laface's avatar
Emanuele Laface committed
	"allow_edit": false,
Emanuele Laface's avatar
Emanuele Laface committed
	"plugins": [],
	"panes": [
		{
			"width": 1,
			"row": {
				"1": 1,
				"2": 1,
				"3": 1,
				"4": 1,
				"5": 1,
				"6": 1
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col": {
				"1": 1,
				"2": 1,
				"3": 1,
				"4": 1,
				"5": 1,
				"6": 1
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col_width": 6,
Emanuele Laface's avatar
Emanuele Laface committed
			"widgets": [
				{
					"type": "html",
					"settings": {
						"html": "let clock = datasources[\"Clock\"][\"numeric_value\"]; // trick to trigger the update\nlet cols = document.getElementsByClassName('gs_w')[0].getAttribute('data-sizex');\ndocument.getElementsByClassName('gs_w')[0].firstElementChild.firstElementChild.innerHTML = \"\";\n\nvar title = \"\";\nif (datasources[\"gwhealth\"][\"gwstatus\"] == \"OK\") {\n\ttitle = \"Public Operations Screen\"; // Change this title. Try not to exceed the 30 chars\n}\nif (datasources[\"gwhealth\"][\"gwstatus\"] == \"KO\") {\n\ttitle = \"Public Operations Screen [Offline]\"; // Change this title. Try not to exceed the 30 chars\n}\n\nlet fontsize = Math.round((-0.66486486*title.length+66.67567568)*cols/4);\nlet lmargin = Math.round((0.43918919*title.length-4.05405405)+3.75*cols*cols-34.75*cols+79.75);\nlet width = 100-lmargin;\n\nvar text = `<div style=\\\"position: relative; margin-top: -15px; text-align: left;\\\">\n\t\t\t<div style=\\\"position: relative;\\\">\n\t\t\t\t<img src=\\\"../img/ess-logo.svg\\\" title=\\\"Designed by Emanuele Laface with p4p and Freeboard. Graphics by Dirk Nordt.\\\"></img>\n\t\t\t</div>\n<div class=\\\"tw-value\\\" style=\\\"font-size: `+String(fontsize)+`px; color:#ffffff !important; position: absolute; left: `+String(lmargin)+`%; width: `+String(width)+`%; height: 100%; justify-content: center; display: flex; align-items: center;\\\" title=\\\"Designed by Emanuele Laface with p4p and Freeboard. Graphics by Dirk Nordt.\\\">\n\t\t\t\t`+title+`\n\t\t\t</div>\n\t\t</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 p4p 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 p4p and Freeboard. Graphics by Dirk Nordt.\\\"></div></img></div>\";\n    document.getElementsByClassName('gs_w')[0].firstElementChild.firstElementChild.innerHTML = title;\n}\n\nreturn text;",
Emanuele Laface's avatar
Emanuele Laface committed
						"height": 2
					}
				}
			]
		},
Emanuele Laface's avatar
Emanuele Laface committed
		{
			"title": "Permit table",
			"width": 1,
			"row": {
Emanuele Laface's avatar
Emanuele Laface committed
				"1": 7,
				"2": 7,
				"3": 7,
				"4": 7,
				"5": 7,
				"6": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"7": 11,
Emanuele Laface's avatar
Emanuele Laface committed
				"9": 11,
Emanuele Laface's avatar
Emanuele Laface committed
				"10": 11,
Emanuele Laface's avatar
Emanuele Laface committed
				"11": 11,
Emanuele Laface's avatar
Emanuele Laface committed
				"13": 11,
				"14": 11
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col": {
				"1": 1,
				"2": 1,
				"3": 1,
				"4": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"7": 2,
Emanuele Laface's avatar
Emanuele Laface committed
				"9": 2,
Emanuele Laface's avatar
Emanuele Laface committed
				"10": 2,
Emanuele Laface's avatar
Emanuele Laface committed
				"11": 2,
Emanuele Laface's avatar
Emanuele Laface committed
				"13": 2,
				"14": 2
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col_width": 1,
			"widgets": [
				{
					"type": "indicator",
					"settings": {
						"title": "",
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "datasources[\"general\"][\"FBIS::beam_permit_ok\"][\"value\"][\"index\"]",
Emanuele Laface's avatar
Emanuele Laface committed
						"on_text": "FBIS Global Permit",
						"off_text": "FBIS Global Permit"
					}
				},
Emanuele Laface's avatar
Emanuele Laface committed
				{
					"type": "indicator",
					"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "datasources[\"general\"][\"BPROD:Ops:BState\"][\"value\"][\"index\"]",
Emanuele Laface's avatar
Emanuele Laface committed
						"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": "return datasources[\"general\"][\"AccPSS:PSS-Area-1:PSSMode\"][\"value\"][\"choices\"][datasources[\"general\"][\"AccPSS:PSS-Area-1:PSSMode\"][\"value\"][\"index\"]];",
Emanuele Laface's avatar
Emanuele Laface committed
						"animate": true
					}
				}
			]
		},
Emanuele Laface's avatar
Emanuele Laface committed
		{
			"title": "Ion Source",
			"width": 1,
			"row": {
				"1": 15,
				"2": 7,
				"3": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"4": 7,
				"5": 7,
				"6": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"7": 7,
				"8": 7,
				"9": 7,
				"10": 7,
				"11": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"12": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"14": 7,
				"15": 7
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col": {
				"1": 1,
				"2": 2,
				"3": 2,
				"4": 2,
				"5": 2,
				"6": 2,
Emanuele Laface's avatar
Emanuele Laface committed
				"7": 1,
				"8": 1,
				"9": 1,
				"10": 1,
				"11": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"12": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"14": 1,
				"15": 1
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col_width": 1,
			"widgets": [
				{
					"type": "indicator",
					"settings": {
						"value": "datasources[\"source\"][\"ISrc-CS:ISS-Magtr-01:MwRdy\"][\"value\"][\"index\"]",
						"on_text": "Magnetron On",
						"off_text": "Magnetron Off"
					}
				},
				{
					"type": "text_widget",
					"settings": {
						"title": "Power",
						"size": "regular",
						"value": "datasources[\"source\"][\"ISrc-CS:ISS-Magtr-01:PulsHLvl-S\"][\"value\"]",
						"animate": true,
						"units": "W"
					}
				},
				{
					"type": "indicator",
					"settings": {
						"title": "High Voltage Platform",
						"value": "datasources[\"source\"][\"ISrc-CS:ISS-HVPS-01:Pwr-R\"][\"value\"][\"index\"]\n",
						"on_text": "String(datasources[\"source\"][\"ISrc-CS:ISS-HVPS-01:Vol-R\"][\"value\"].toFixed(0))+\" \"+datasources[\"source\"][\"ISrc-CS:ISS-HVPS-01:Vol-R\"][\"display\"][\"units\"]",
						"off_text": "String(datasources[\"source\"][\"ISrc-CS:ISS-HVPS-01:Vol-R\"][\"value\"].toFixed(0))+\" \"+datasources[\"source\"][\"ISrc-CS:ISS-HVPS-01:Vol-R\"][\"display\"][\"units\"]"
					}
Emanuele Laface's avatar
Emanuele Laface committed
				},
				{
					"type": "text_widget",
					"settings": {
						"title": "Beam Current",
						"size": "regular",
						"value": "datasources[\"beamcurr\"][\"ISrc-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"].toFixed(1);",
						"animate": true,
						"units": "mA"
					}
Emanuele Laface's avatar
Emanuele Laface committed
				}
			]
		},
Emanuele Laface's avatar
Emanuele Laface committed
			"title": "Control Room",
			"width": 1,
			"row": {
				"1": 31,
				"2": 15,
Emanuele Laface's avatar
Emanuele Laface committed
				"3": 7,
				"4": 7,
				"5": 7,
				"6": 7,
				"7": 7,
				"8": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"9": 7,
				"10": 7,
				"11": 7,
				"12": 7,
				"13": 7,
				"14": 7,
				"15": 7
			},
			"col": {
				"1": 1,
				"2": 1,
				"3": 3,
				"4": 4,
				"5": 5,
				"6": 6,
Emanuele Laface's avatar
Emanuele Laface committed
				"7": 1,
				"8": 1,
				"9": 1,
				"10": 1,
				"11": 1,
				"12": 1,
				"13": 1,
				"14": 1,
				"15": 1
Emanuele Laface's avatar
Emanuele Laface committed
			"col_width": 1,
			"widgets": [
				{
Emanuele Laface's avatar
Emanuele Laface committed
					"type": "text_widget",
					"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
						"title": "Shift ID",
						"size": "regular",
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "datasources[\"general\"][\"NSO:Ops:SID\"][\"value\"]",
Emanuele Laface's avatar
Emanuele Laface committed
						"animate": false
					}
				},
				{
					"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[\"general\"][\"NSO:Ops:Msg\"][\"value\"]) {\n        element.style.fontSize = \"18px\";\n    }\n}\n\nreturn datasources[\"general\"][\"NSO:Ops:Msg\"][\"value\"];",
Emanuele Laface's avatar
Emanuele Laface committed
						"animate": true
Emanuele Laface's avatar
Emanuele Laface committed
					"type": "indicator",
					"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "if (datasources[\"general\"][\"NSO:Ops:ESSSystemPermit\"][\"value\"][\"index\"] == 1) {\n    return 1;\n}\nelse {\n    return 0;\n}",
Emanuele Laface's avatar
Emanuele Laface committed
						"on_text": "Beam Authorization",
						"off_text": "Beam Authorization"
					}
				},
				{
					"type": "indicator",
					"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "datasources[\"general\"][\"NSO:Ops:ESSSystemPermit\"][\"value\"][\"index\"]",
Emanuele Laface's avatar
Emanuele Laface committed
						"on_text": "System Permit",
						"off_text": "System Permit"
Emanuele Laface's avatar
Emanuele Laface committed
		{
			"title": "Beam Production Table",
			"width": 1,
			"row": {
				"1": 41,
				"2": 17,
				"3": 15,
				"4": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"5": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"6": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"7": 13,
				"8": 13,
				"9": 13,
				"10": 13,
Emanuele Laface's avatar
Emanuele Laface committed
				"11": 13,
Emanuele Laface's avatar
Emanuele Laface committed
				"12": 13,
Emanuele Laface's avatar
Emanuele Laface committed
				"14": 13,
				"16": 13
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col": {
				"1": 1,
				"2": 2,
				"3": 1,
				"4": 3,
				"5": 3,
Emanuele Laface's avatar
Emanuele Laface committed
				"6": 3,
				"7": 1,
				"8": 1,
				"9": 1,
				"10": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"11": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"12": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"14": 1,
				"16": 1
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col_width": 1,
			"widgets": [
				{
					"type": "text_widget",
					"settings": {
						"title": "Frequency",
						"size": "regular",
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "datasources[\"beamprod\"][\"TD-M:Ctrl-SCE-1:NepEvtBPulseStFreq-I\"][\"value\"].toFixed(1)",
						"animate": true,
						"units": "Hz"
Emanuele Laface's avatar
Emanuele Laface committed
					}
				},
				{
					"type": "text_widget",
					"settings": {
						"title": "ISrc Pulse Length",
						"size": "regular",
						"value": "datasources[\"beamprod\"][\"BPROD:Ops:BSourcePL-RB\"][\"value\"]",
Emanuele Laface's avatar
Emanuele Laface committed
						"animate": true,
						"units": "µs"
					}
				},
				{
					"type": "text_widget",
					"settings": {
						"title": "LEBT Pulse Length",
						"size": "regular",
						"value": "datasources[\"beamprod\"][\"BPROD:Ops:BLebtPL-RB\"][\"value\"]",
Emanuele Laface's avatar
Emanuele Laface committed
						"animate": true,
						"units": "µs"
					}
				},
				{
					"type": "text_widget",
					"settings": {
						"title": "MEBT Pulse Length",
						"size": "regular",
						"value": "datasources[\"beamprod\"][\"BPROD:Ops:BeamPL-RB\"][\"value\"]",
Emanuele Laface's avatar
Emanuele Laface committed
						"animate": true,
						"units": "µs"
					}
				}
			]
		},
Emanuele Laface's avatar
Emanuele Laface committed
		{
Emanuele Laface's avatar
Emanuele Laface committed
			"title": "Beam",
Emanuele Laface's avatar
Emanuele Laface committed
			"width": 1,
			"row": {
				"1": 25,
				"2": 25,
Emanuele Laface's avatar
Emanuele Laface committed
				"3": 17,
				"4": 15,
				"5": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"6": 7,
				"9": 17,
				"10": 17,
				"11": 17,
				"12": 17,
				"14": 17,
				"15": 17
			},
			"col": {
				"1": 1,
				"2": 1,
Emanuele Laface's avatar
Emanuele Laface committed
				"3": 3,
				"4": 1,
				"5": 4,
Emanuele Laface's avatar
Emanuele Laface committed
				"6": 4,
				"9": 2,
				"10": 2,
				"11": 2,
				"12": 2,
				"14": 2,
				"15": 2
			},
			"col_width": 1,
			"widgets": [
				{
					"type": "text_widget",
					"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
						"title": "Theoretical Energy",
Emanuele Laface's avatar
Emanuele Laface committed
						"size": "regular",
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "switch(datasources[\"general\"][\"TD-M:Ctrl-SCE-1:BDest-Sel\"][\"value\"][\"index\"]) {\n    case 0: // IsRC\n        return \"0 MeV\";\n        break;\n    case 1: // LEBT\n\t\treturn \"0.075 MeV\";\n        break;\n\tcase 2: // MEBT\n        return \"3.6 MeV\"\n\t\t//return String(datasources[\"general\"][\"PBI-FBPM01::Energy-R\"][\"value\"].toFixed(2))+\" MeV\";\n        break;\n\tcase 3: // DTL 2\n\t\treturn \"39.6 MeV\";\n        break;\n\tcase 4: // DTL 4\n\t\treturn \"73.8 MeV\";\n        break;\n    default:\n        return \"N/A\";\n}",
Emanuele Laface's avatar
Emanuele Laface committed
						"animate": true
					}
Emanuele Laface's avatar
Emanuele Laface committed
				},
				{
					"type": "text_widget",
					"settings": {
						"title": "Theoretical Power",
						"size": "regular",
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "let frequency = datasources[\"beamprod\"][\"TD-M:Ctrl-SCE-1:NepEvtBPulseStFreq-I\"][\"value\"];\nlet lebtchopper = datasources[\"beamprod\"][\"BPROD:Ops:BLebtPL-RB\"][\"value\"];\nlet mebtchopper = datasources[\"beamprod\"][\"BPROD:Ops:BeamPL-RB\"][\"value\"];\nlet lebtcurr = datasources[\"beamcurr\"][\"LEBT-010:PBI-FC-001:STAT3-MeanValueR\"][\"value\"];\nlet mebtcurr = datasources[\"beamcurr\"][\"MEBT-010:PBI-FC-001:STAT3-MeanValueR\"][\"value\"];\n//let dtl4curr = datasources[\"beamcurr\"][\"DTL-040:PBI-BCM-001:FlatTopCurrentR\"][\"value\"];\nlet dtl4curr = datasources[\"beamcurr\"][\"DTL-040:PBI-FC-001:STAT3-MeanValueR\"][\"value\"];\nvar energy = 0;\nvar power = 0;\n\nswitch(datasources[\"general\"][\"TD-M:Ctrl-SCE-1:BDest-Sel\"][\"value\"][\"index\"]) {\n    case 0: // IsRC\n        return 0;\n        break;\n    case 1: // LEBT\n        energy = 75e3;\n        power = lebtcurr*1e-3*lebtchopper*1e-6*frequency*energy;\n\t\treturn power.toFixed(2);\n        break; \n\tcase 2: // MEBT\n        energy = 3.6e6;\n\t\tpower = mebtcurr*1e-3*mebtchopper*1e-6*frequency*energy;\n        return power.toFixed(2);\n        break;\n\tcase 3: // DTL 2\n\t\treturn \"N/A\";\n        break;\n\tcase 4: // DTL 4\n        energy = 73.8e6;\n\t\tpower = dtl4curr*1e-3*mebtchopper*1e-6*frequency*energy;\n\t\treturn power.toFixed(2);\n        break;\n    default:\n        return \"N/A\";\n}",
Emanuele Laface's avatar
Emanuele Laface committed
						"animate": true,
						"units": "W"
					}
Emanuele Laface's avatar
Emanuele Laface committed
				}
			]
		},
Emanuele Laface's avatar
Emanuele Laface committed
		{
			"title": "Beam Mode",
			"width": 1,
			"row": {
				"1": 51,
				"2": 27,
				"3": 15,
Emanuele Laface's avatar
Emanuele Laface committed
				"4": 17,
				"5": 13,
Emanuele Laface's avatar
Emanuele Laface committed
				"6": 7,
Emanuele Laface's avatar
Emanuele Laface committed
				"7": 21,
				"8": 21,
				"9": 21,
				"10": 21,
				"11": 21,
Emanuele Laface's avatar
Emanuele Laface committed
				"12": 21,
Emanuele Laface's avatar
Emanuele Laface committed
				"15": 21,
				"16": 21
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col": {
				"1": 1,
				"2": 2,
Emanuele Laface's avatar
Emanuele Laface committed
				"3": 2,
				"4": 2,
				"5": 4,
Emanuele Laface's avatar
Emanuele Laface committed
				"6": 5,
Emanuele Laface's avatar
Emanuele Laface committed
				"7": 3,
				"8": 3,
				"9": 3,
				"10": 3,
				"11": 3,
Emanuele Laface's avatar
Emanuele Laface committed
				"12": 3,
Emanuele Laface's avatar
Emanuele Laface committed
				"15": 3,
				"16": 3
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col_width": 1,
			"widgets": [
Emanuele Laface's avatar
Emanuele Laface committed
				{
					"type": "text_widget",
					"settings": {
						"size": "regular",
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "datasources[\"general\"][\"TD-M:Ctrl-SCE-1:BMod-Sel\"][\"value\"][\"choices\"][datasources[\"general\"][\"TD-M:Ctrl-SCE-1:BMod-Sel\"][\"value\"][\"index\"]]\n",
						"animate": true
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": "Destination",
						"size": "regular",
						"value": "datasources[\"general\"][\"TD-M:Ctrl-SCE-1:BDest-Sel\"][\"value\"][\"choices\"][datasources[\"general\"][\"TD-M:Ctrl-SCE-1:BDest-Sel\"][\"value\"][\"index\"]]",
						"animate": true
Emanuele Laface's avatar
Emanuele Laface committed
		},
		{
			"title": "Beam Current",
Emanuele Laface's avatar
Emanuele Laface committed
			"width": 1,
			"row": {
				"1": 57,
				"2": 33,
Emanuele Laface's avatar
Emanuele Laface committed
				"3": 25,
Emanuele Laface's avatar
Emanuele Laface committed
				"4": 23,
				"5": 19,
				"6": 17,
				"9": 17,
				"11": 17
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col": {
				"1": 1,
				"2": 1,
				"3": 1,
				"4": 1,
				"5": 1,
				"6": 1,
				"9": 1,
				"11": 1
Emanuele Laface's avatar
Emanuele Laface committed
			},
			"col_width": 6,
Emanuele Laface's avatar
Emanuele Laface committed
			"widgets": [
				{
					"type": "flot_extended_plugin",
					"settings": {
						"plot_type": "bar",
Emanuele Laface's avatar
Emanuele Laface committed
						"legend": true,
						"height": 6,
Emanuele Laface's avatar
Emanuele Laface committed
						"value": "let bcmdataset = [//[0, Math.max(0,datasources[\"beamcurr\"][\"ISrc-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n               [2, Math.max(1e-6,datasources[\"beamcurr\"][\"LEBT-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n               [3, Math.max(0.0,datasources[\"beamcurr\"][\"RFQ-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n               [4, Math.max(0.0,datasources[\"beamcurr\"][\"MEBT-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n               [6, Math.max(0.0,datasources[\"beamcurr\"][\"MEBT-010:PBI-BCM-002:FlatTopCurrentR\"][\"value\"])],\n               [7, Math.max(0.0,datasources[\"beamcurr\"][\"DTL-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n               [8, Math.max(0.0,datasources[\"beamcurr\"][\"DTL-020:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n               [9, Math.max(0.0,datasources[\"beamcurr\"][\"DTL-030:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n               [10, Math.max(0.0,datasources[\"beamcurr\"][\"DTL-040:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])]];\n\nlet fcdataset = [[1, Math.max(0.0,datasources[\"beamcurr\"][\"LEBT-010:PBI-FC-001:STAT3-MeanValueR\"][\"value\"])],\n               [5, Math.max(0.0,datasources[\"beamcurr\"][\"MEBT-010:PBI-FC-001:STAT3-MeanValueR\"][\"value\"])],\n               [11, Math.max(0.0,datasources[\"beamcurr\"][\"DTL-040:PBI-FC-001:STAT3-MeanValueR\"][\"value\"])]];\n\nlet data = [{data: bcmdataset, color: \"lime\"},\n            {data: fcdataset, color: \"yellow\"}];\nreturn data\n",
Emanuele Laface's avatar
Emanuele Laface committed
						"xticks": "let clock = datasources[\"Clock\"][\"numeric_value\"]; // trick to trigger the update\nlet cols = document.getElementsByClassName('gs_w')[0].getAttribute('data-sizex');\n\nvar xticks = [[0, \"Ion Source<br>BCM\"],\n               [1, \"LEBT<br>FC\"],\n               [2, \"LEBT<br>BCM\"],\n               [3, \"RFQ<br>BCM\"],\n               [4, \"MEBT<br>BCM 1\"],\n               [5, \"MEBT<br>FC\"],\n               [6, \"MEBT<br>BCM 2\"],\n               [7, \"DTL 1<br>BCM\"],\n               [8, \"DTL 2<br>BCM\"],\n               [9, \"DTL 3<br>BCM\"],\n               [10, \"DTL 4<br>BCM\"],\n               [11, \"DTL 4<br>FC\"]];\n\nif (cols == 1) {\n    xticks = [[0, \"ISrc<br>BCM\"],\n               [1, \"<br><br>LEBT<br>FC\"],\n               [2, \"LEBT<br>BCM\"],\n               [3, \"<br><br>RFQ<br>BCM\"],\n               [4, \"MEBT<br>BCM 1\"],\n               [5, \"<br><br>MEBT<br>FC\"],\n               [6, \"MEBT<br>BCM 2\"],\n               [7, \"<br><br>DTL 1<br>BCM\"],\n               [8, \"DTL 2<br>BCM\"],\n               [9, \"<br><br>DTL 3<br>BCM\"],\n               [10, \"DTL 4<br>BCM\"],\n               [11, \"<br><br>DTL 4<br>FC\"]];\n};\n\nif (cols == 2) {\n    xticks = [[0, \"ISrc<br>BCM\"],\n               [1, \"LEBT<br>FC\"],\n               [2, \"LEBT<br>BCM\"],\n               [3, \"RFQ<br>BCM\"],\n               [4, \"MEBT<br>BCM 1\"],\n               [5, \"MEBT<br>FC\"],\n               [6, \"MEBT<br>BCM 2\"],\n               [7, \"DTL 1<br>BCM\"],\n               [8, \"DTL 2<br>BCM\"],\n               [9, \"DTL 3<br>BCM\"],\n               [10, \"DTL 4<br>BCM\"],\n               [11, \"DTL 4<br>FC\"]];\n};\n\nreturn xticks;",
Emanuele Laface's avatar
Emanuele Laface committed
						"yticks": "let maxcurr = Math.max(//datasources[\"beamcurr\"][\"ISrc-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"],\n         datasources[\"beamcurr\"][\"LEBT-010:PBI-FC-001:STAT3-MeanValueR\"][\"value\"],\n         datasources[\"beamcurr\"][\"LEBT-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"],\n         datasources[\"beamcurr\"][\"RFQ-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"],\n         datasources[\"beamcurr\"][\"MEBT-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"],\n         datasources[\"beamcurr\"][\"MEBT-010:PBI-FC-001:STAT3-MeanValueR\"][\"value\"],\n         datasources[\"beamcurr\"][\"MEBT-010:PBI-BCM-002:FlatTopCurrentR\"][\"value\"],\n         datasources[\"beamcurr\"][\"DTL-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"],\n         datasources[\"beamcurr\"][\"DTL-020:PBI-BCM-001:FlatTopCurrentR\"][\"value\"],\n         datasources[\"beamcurr\"][\"DTL-030:PBI-BCM-001:FlatTopCurrentR\"][\"value\"],\n         datasources[\"beamcurr\"][\"DTL-040:PBI-BCM-001:FlatTopCurrentR\"][\"value\"],\n         datasources[\"beamcurr\"][\"DTL-040:PBI-FC-001:STAT3-MeanValueR\"][\"value\"],1);\n\n\nlet step=maxcurr/10;\nvar yticks=[];\nfor (i=0; i<=maxcurr+step; i+=step) {\n    yticks.push([i,i.toFixed(1).toString()]);\n}\n\nyticks[yticks.length-1] = [yticks[yticks.length-1][0],\"[mA]\"];\n\nreturn yticks;\n",
						"points": false,
Emanuele Laface's avatar
Emanuele Laface committed
						"zoom": "xy"
					}
				}
			]
Emanuele Laface's avatar
Emanuele Laface committed
		}
	],
	"datasources": [
		{
Emanuele Laface's avatar
Emanuele Laface committed
			"name": "general",
Emanuele Laface's avatar
Emanuele Laface committed
			"type": "JSON",
			"settings": {
				"url": "/data/api/v2/pvget/AccPSS:PSS-Area-1:PSSMode,BPROD:Ops:BState,NSO:Ops:SID,NSO:Ops:Msg,NSO:Ops:BeamAuthorization,NSO:Ops:ESSSystemPermit,FBIS::beam_permit_ok,PBI-FBPM01::Energy-R,TD-M:Ctrl-SCE-1:ScTable-RB,TD-M:Ctrl-SCE-1:BState-Sts,TD-M:Ctrl-SCE-1:BMod-Sel,TD-M:Ctrl-SCE-1:BDest-Sel",
Emanuele Laface's avatar
Emanuele Laface committed
				"use_thingproxy": false,
				"refresh": 10,
				"method": "GET",
				"name": "general"
Emanuele Laface's avatar
Emanuele Laface committed
			}
		},
		{
			"name": "Clock",
			"type": "clock",
			"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
		},
		{
			"name": "source",
			"type": "JSON",
			"settings": {
				"url": "/data/api/v2/pvget/ISrc-CS:ISS-Magtr-01:MwRdy,ISrc-CS:ISS-Magtr-01:PulsHLvl-S,ISrc-CS:ISS-HVPS-01:Pwr-R,ISrc-CS:ISS-HVPS-01:Vol-R",
Emanuele Laface's avatar
Emanuele Laface committed
				"use_thingproxy": true,
				"refresh": 10,
Emanuele Laface's avatar
Emanuele Laface committed
				"method": "GET",
				"name": "source"
Emanuele Laface's avatar
Emanuele Laface committed
			}
		},
		{
			"name": "beamprod",
Emanuele Laface's avatar
Emanuele Laface committed
			"type": "JSON",
			"settings": {
Emanuele Laface's avatar
Emanuele Laface committed
				"url": "/data/api/v2/pvget/TD-M:Ctrl-SCE-1:NepEvtBPulseStFreq-I,BPROD:Ops:BSourcePL-RB,BPROD:Ops:BLebtPL-RB,BPROD:Ops:BeamPL-RB",
Emanuele Laface's avatar
Emanuele Laface committed
				"use_thingproxy": true,
				"refresh": 10,
				"method": "GET"
			}
		},
		{
			"name": "beamcurr",
Emanuele Laface's avatar
Emanuele Laface committed
			"type": "JSON",
			"settings": {
				"url": "/data/api/v2/pvget/ISrc-010:PBI-BCM-001:FlatTopCurrentR,LEBT-010:PBI-FC-001:STAT3-MeanValueR,LEBT-010:PBI-BCM-001:FlatTopCurrentR,RFQ-010:PBI-BCM-001:FlatTopCurrentR,MEBT-010:PBI-BCM-001:FlatTopCurrentR,MEBT-010:PBI-FC-001:STAT3-MeanValueR,MEBT-010:PBI-BCM-002:FlatTopCurrentR,DTL-010:PBI-BCM-001:FlatTopCurrentR,DTL-020:PBI-BCM-001:FlatTopCurrentR,DTL-030:PBI-BCM-001:FlatTopCurrentR,DTL-040:PBI-BCM-001:FlatTopCurrentR,DTL-040:PBI-FC-001:STAT3-MeanValueR",
Emanuele Laface's avatar
Emanuele Laface committed
				"use_thingproxy": true,
				"refresh": 10,
				"method": "GET"
			}
		},
		{
			"name": "gwhealth",
			"type": "JSON",
			"settings": {
				"url": "/data/-/gwhealth/NSO:Ops:SID",
				"use_thingproxy": true,
				"refresh": 10,
				"method": "GET"
			}
Emanuele Laface's avatar
Emanuele Laface committed
		}
	],
Emanuele Laface's avatar
Emanuele Laface committed
}