diff --git a/WebSites/pos/dashboard.json b/WebSites/pos/dashboard.json index 3b7c3d5b6689f1335b36d8807a0a603d14392bd5..f40f315eb1665482f0d5fa00ec39845375efd0b0 100644 --- a/WebSites/pos/dashboard.json +++ b/WebSites/pos/dashboard.json @@ -1,7 +1,7 @@ { "version": 1, "header_image": "", - "allow_edit": false, + "allow_edit": true, "plugins": [], "panes": [ { @@ -443,9 +443,9 @@ "plot_type": "bar", "legend": true, "height": 6, - "value": "let bcmdataset = [[0, datasources[\"beamcurr\"][\"ISrc-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"]],\n [2, datasources[\"beamcurr\"][\"LEBT-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"]],\n [3, datasources[\"beamcurr\"][\"RFQ-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"]],\n [4, datasources[\"beamcurr\"][\"MEBT-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"]],\n [6, datasources[\"beamcurr\"][\"MEBT-010:PBI-BCM-002:FlatTopCurrentR\"][\"value\"]],\n [7, datasources[\"beamcurr\"][\"DTL-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"]],\n [8, datasources[\"beamcurr\"][\"DTL-020:PBI-BCM-001:FlatTopCurrentR\"][\"value\"]],\n [9, datasources[\"beamcurr\"][\"DTL-030:PBI-BCM-001:FlatTopCurrentR\"][\"value\"]],\n [10, datasources[\"beamcurr\"][\"DTL-040:PBI-BCM-001:FlatTopCurrentR\"][\"value\"]]];\n\nlet fcdataset = [[1, datasources[\"beamcurr\"][\"LEBT-010:PBI-FC-001:STAT3-MeanValueR\"][\"value\"]],\n [5, datasources[\"beamcurr\"][\"MEBT-010:PBI-FC-001:STAT3-MeanValueR\"][\"value\"]],\n [11, 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", + "value": "let bcmdataset = [[0, Math.max(0,datasources[\"beamcurr\"][\"ISrc-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n [2, Math.max(0,datasources[\"beamcurr\"][\"LEBT-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n [3, Math.max(0,datasources[\"beamcurr\"][\"RFQ-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n [4, Math.max(0,datasources[\"beamcurr\"][\"MEBT-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n [6, Math.max(0,datasources[\"beamcurr\"][\"MEBT-010:PBI-BCM-002:FlatTopCurrentR\"][\"value\"])],\n [7, Math.max(0,datasources[\"beamcurr\"][\"DTL-010:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n [8, Math.max(0,datasources[\"beamcurr\"][\"DTL-020:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n [9, Math.max(0,datasources[\"beamcurr\"][\"DTL-030:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])],\n [10, Math.max(0,datasources[\"beamcurr\"][\"DTL-040:PBI-BCM-001:FlatTopCurrentR\"][\"value\"])]];\n\nlet fcdataset = [[1, Math.max(0,datasources[\"beamcurr\"][\"LEBT-010:PBI-FC-001:STAT3-MeanValueR\"][\"value\"])],\n [5, Math.max(0,datasources[\"beamcurr\"][\"MEBT-010:PBI-FC-001:STAT3-MeanValueR\"][\"value\"])],\n [11, Math.max(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", "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\nreturn xticks;", - "yticks": "let maxcurr = Math.max(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\"]);\n\nlet mincurr = Math.min(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\"]);\n\nlet step=(maxcurr-mincurr)/10;\nvar yticks=[];\nfor (i=mincurr; 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", + "yticks": "let maxcurr = Math.max(atasources[\"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\"]);\n\nif (maxcurr<0) {\n maxcurr=0;\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, "zoom": "xy" } @@ -506,4 +506,4 @@ } ], "columns": 6 -} +} \ No newline at end of file