From 94836396dfcc47496633b85bfc3a6e85fbb12649 Mon Sep 17 00:00:00 2001 From: Lucio Zambon <lucio.zambon@elettra.eu> Date: Mon, 22 Apr 2024 13:35:53 +0000 Subject: [PATCH] Update 19 files - /blm.js - /blm2d.js - /bpm2d.js - /component.php - /elettra_lattice.php - /fermi_lattice.php - /magnet.php - /open.svg - /panther.js - /panther.php - /panther_conf.js - /panther_lattice.json - /panther2d.js - /panther2d.php - /save.svg - /updater.php - /elettra_lattice.json - /fermi_lattice.json - /README.md --- README.md | 23 +- blm.js | 104 ++ blm2d.js | 91 ++ bpm2d.js | 171 +++ component.php | 79 ++ elettra_lattice.json | 1719 ++++++++++++++++++++++++++++++ elettra_lattice.php | 374 +++++++ fermi_lattice.json | 2404 ++++++++++++++++++++++++++++++++++++++++++ fermi_lattice.php | 114 ++ magnet.php | 292 +++++ open.svg | 4 + panther.js | 923 ++++++++++++++++ panther.php | 85 ++ panther2d.js | 654 ++++++++++++ panther2d.php | 47 + panther_conf.js | 7 + panther_lattice.json | 133 +++ save.svg | 4 + updater.php | 152 +++ 19 files changed, 7379 insertions(+), 1 deletion(-) create mode 100644 blm.js create mode 100644 blm2d.js create mode 100644 bpm2d.js create mode 100644 component.php create mode 100644 elettra_lattice.json create mode 100644 elettra_lattice.php create mode 100644 fermi_lattice.json create mode 100644 fermi_lattice.php create mode 100644 magnet.php create mode 100644 open.svg create mode 100644 panther.js create mode 100644 panther.php create mode 100644 panther2d.js create mode 100644 panther2d.php create mode 100644 panther_conf.js create mode 100644 panther_lattice.json create mode 100644 save.svg create mode 100644 updater.php diff --git a/README.md b/README.md index 9468f3b..cd09414 100644 --- a/README.md +++ b/README.md @@ -1 +1,22 @@ -PAnTHer \ No newline at end of file +# PAnTHer + +Particle Accelerator on THreeJS +PAnTHer is a model of particle accelerators + +A live demo is available at this page: +https://luciozambon.altervista.org/app/panther.php + +A short video introduction is available at this page: +https://www.youtube.com/watch?v=53zyVab37rg + +## Installation +- Install Three.js from https://github.com/mrdoob/three.js/ +- Install JQuery and JQuery UI from https://jquery.com/ +- Install Hammer.js from https://hammerjs.github.io/ +- Install svg-pan-zoom from https://github.com/bumbu/svg-pan-zoom +- Create a lattice file in JSON format according to the specifications: +https://gitlab.elettra.eu/puma/client/web/-/raw/master/panther/panther_lattice.json +for example: +https://gitlab.elettra.eu/puma/client/web/-/raw/master/panther/elettra_lattice.json +- create a component bundle for 3D using component.php?machine=<your_machine>&save and a coponent bundle for 2D using component.php?machine=<your_machine>&2d&save +- edit file panther_conf.js, panther.php and panther2d.php according to your setup diff --git a/blm.js b/blm.js new file mode 100644 index 0000000..4e2bbfd --- /dev/null +++ b/blm.js @@ -0,0 +1,104 @@ +// jshint esversion: 6 + export function label(blm, params, camera, THREE) { + const widthHalf = window.innerWidth / 2, heightHalf = window.innerHeight / 2; + if (blm[params.blm].obj.length) $('.blm.'+params.blm).each(function(i, obj) { + const id = $(this)[0].id; + if (typeof blm[params.blm].tag[id] != 'undefined' && typeof blm[params.blm].obj[i] != 'undefined') { + const pos = blm[params.blm].obj[i].position.clone(); + pos.project(camera); + const frustum = new THREE.Frustum(); + const matrix = new THREE.Matrix4().multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse); + frustum.setFromProjectionMatrix(matrix); + const dist = Math.abs(camera.position.x-blm[params.blm].tag[id].position.x)+Math.abs(camera.position.y-blm[params.blm].tag[id].position.y)+Math.abs(camera.position.z-blm[params.blm].tag[$(this)[0].id].position.z); + document.getElementById(id).style.display = (frustum.containsPoint(blm[params.blm].tag[id].position) && dist>140 && dist<25000*params.highlightScale)? 'block': 'none'; + document.getElementById(id).style.top = (-(pos.y * heightHalf) + heightHalf - 20)+'px'; + const val = typeof blm[params.blm].val[blm[params.blm].map[i]] == 'undefined'? '???': blm[params.blm].val[blm[params.blm].map[i]].toPrecision(3); + document.getElementById(id).innerHTML = id+': <span class="blmVal">'+val+'</span>'; + if (blm[params.blm].dir[i]>0) document.getElementById(id).style.left = ((pos.x * widthHalf ) + widthHalf + 35)+'px'; else document.getElementById(id).style.right = (widthHalf - (pos.x * widthHalf ) + 35)+'px'; + } + }); + } + export function menu(lattice, facilities, params, gui, blm, componentCreator) { + params.blm = ''; + if (document.location.search.indexOf('blm')>-1) {params.blm = document.location.search.indexOf('blm'); myswitch(blm, params, componentCreator);} + gui.add(params, 'blm', facilities).onChange(function() {myswitch(blm, params, componentCreator);}); + for (let f in facilities) { + const b = facilities[f]; + if (b=='') continue; + console.log('blmMenu() - ',b); + blm[b] = {map: [], dir: [], tag: {}, val: [], obj: [], confsrc: lattice[b].blm.confsrc, datasrc: lattice[b].blm.datasrc, skip: lattice[b].blm.skip}; + fetch(lattice[b].blm.confsrc) + .then((response) => {return response.json();}) + .then((blmData) => { + let blmCounter = 0; + let photoCounter = 0; + for (let i in blmData) { + if (!blmData[i] || blmData[i].indexOf('/')==-1) continue; + console.log(typeof blmData[i]); + const name = blmData[i].split('/')[2].toUpperCase(); + if (name.indexOf(blm[b].skip)>-1) continue; + for (let bl in blm[b].obj) { + if (name==blm[b].obj[bl].name.replace('BPM','BLM') || name=='BLM_'+blm[b].obj[bl].name) {blm[b].map[bl] = blmCounter; blmCounter++; break;} + } + } + }); + } + } + export function myswitch(blm, params, componentCreator) { + if (blm.reader !== false) clearInterval(blm.reader); + blm.reader = false; + $('.blm').css('display', 'none'); + if (typeof blm[blm.oldIndex] != 'undefined') for (let i=0; i<blm[blm.oldIndex].obj.length; i++) componentCreator.blmUpdate(blm[blm.oldIndex].obj[i], 0); + if (params.blm=='') { + $('#application').hide(); + $('#applicationFrame').removeAttr("src"); + } + else { + blm.oldIndex = params.blm; + read(blm, params); + blm.reader = setInterval(read, 1000, blm, params); + $('#application').show(); + $('.blm.'+params.blm).css('display', 'block'); + $('#applicationFrame').attr("src", "/spa/index.html?s=blm&src="+params.blm+(document.location.search.indexOf('demo')>-1? '&demo': '')); + $("#applicationFrame").height(window.innerHeight); + } + + } + export function render(blm, params, componentCreator, camera, THREE) { + if (params.blm!='' && typeof blm[params.blm] !== 'undefined' && blm[params.blm].val != [] && blm[params.blm].map != [] && window.blmTime != blm.acqTime) { + console.log('blmRender()', params.blm, blm[params.blm].val, blm[params.blm].map, window.blmTime, blm.acqTime); + blm.acqTime = window.blmTime; + const blmMax = Math.max.apply(null, blm[params.blm].val.map(Math.abs)); // https://stackoverflow.com/questions/29515761/find-absolute-max-value-in-javascript-array + let blmPeak = (Math.log10(blmMax) + 2) * 5000; + blmPeak = blmPeak>20000? 20000: (blmPeak<2000? 2000: blmPeak); + const blmFactor = blmPeak/blmMax; + for (let i=0; i<blm[params.blm].obj.length; i++) { + componentCreator.blmUpdate(blm[params.blm].obj[i], blm[params.blm].val[blm[params.blm].map[i]], blm[params.blm].dir[i], 100, blmFactor); + } + } + if (params.blm) {label(blm, params, camera, THREE);} + } + export function read(blm, params) { + fetch(blm[params.blm].datasrc) + .then((response) => {return response.json();}) + .then((eventData) => { + blm[params.blm].val = eventData; + window.blmTime = +new Date(); + }); + } + export function append(blm, facility, mycomp, direction) { + if (!blm[facility]) return; + if (mycomp.name.indexOf('PHOTO')==-1) { + blm[facility].obj.push(mycomp); + blm[facility].tag[mycomp.name] = mycomp; + blm[facility].dir.push(direction*(mycomp.name.indexOf('_R')==-1? 1: -1)); + const div = document.createElement('div'); + div.id = mycomp.name; + div.className = 'blm '+facility; + //div.style.cssText = 'position: absolute; color: white; display: none;'; + div.style.cssText = 'position: absolute; color: white;'; + div.innerHTML = mycomp.name; + document.body.appendChild(div); + } + } + diff --git a/blm2d.js b/blm2d.js new file mode 100644 index 0000000..c8a6e07 --- /dev/null +++ b/blm2d.js @@ -0,0 +1,91 @@ +// jshint esversion: 6 + const blm = {obj: [], dir: []}; + function blmMenu(lattice, facilities, params) { + params.blm = false; + if (document.location.search.indexOf('blm')>-1) {params.blm = document.location.search.indexOf('blm')>-1; blmSwitch(blm, params);} + gui.add(params, 'blm').onChange(function() {blmSwitch(blm, params);}); + blm.map = []; + // console.log('blmMenu(), src', conf.blmSrcUrl); + fetch((conf.blmSrcUrl.indexOf('http')==-1? conf.rchan: '')+conf.blmSrcUrl) + .then((response) => {return response.json();}) + .then((blmData) => { + // console.log('blmMenu(), blmData', blmData); + let blmCounter = 0; + for (let i in blmData) { + const name = blmData[i].split('/')[2].toUpperCase(); + // console.log('blmMenu(), name', name); + // if (name.indexOf(blm.skip)>-1) continue; // blm skip feature + for (let bl in blm.obj) { + // console.log('bl', bl, blm.obj); + if (name==blm.obj[bl] || name=='BLM_'+blm.obj[bl]) {blm.map[bl] = blmCounter; blmCounter++;} + } + } + }); + } + function blmSwitch(blm, params) { + if (blm.reader !== false) clearInterval(blm.reader); + blm.reader = false; + // $('.blm').css('display', 'none'); + if (blm.reader) $('.blm').show(); else $('.blm').hide(); + if (typeof blm[blm.oldIndex] != 'undefined') for (let i=0; i<blm[blm.oldIndex].obj.length; i++) blmUpdate(blm[blm.oldIndex].obj[i], 0); + if (params.blm=='') { + $('#application').hide(); + $('#applicationFrame').removeAttr("src"); + } + else { + blm.oldIndex = params.blm; + blmRead(blm, params); + blm.reader = setInterval(blmRead, 997, blm, params); + $('.blm').show(); // $('#application').show(); + // $('.blm.'+params.blm).css('display', 'block'); + $('#applicationFrame').attr("src", "/spa/index.html?s=blm&src="+params.blm+(document.location.search.indexOf('demo')>-1? '&demo': '')); + $("#applicationFrame").height(window.innerHeight); + } + + } + function blmRender() { + // console.log('blmRender()', blm); + const blmMax = Math.max.apply(null, blm.val.map(Math.abs)); // https://stackoverflow.com/questions/29515761/find-absolute-max-value-in-javascript-array + let blmPeak = (Math.log10(blmMax) + 2) * 5000; + blmPeak = blmPeak>20000? 20000: (blmPeak<2000? 2000: blmPeak); + const blmFactor = blmPeak/blmMax; + // console.log(blm.obj[i], blm.val[blm.map[i]], blm.dir[i], 100, blmFactor); + for (let i=0; i<blm.obj.length; i++) { + // console.log(blm.obj[i], blm.val[blm.map[i]], blm.dir[i], 100, blmFactor); + blmUpdate(blm.obj[i], blm.val[blm.map[i]], blm.dir[i], 100, blmFactor); + } + // if (params.blm) {blmLabel(blm, params, camera, THREE);} + } + function blmRead(blm, params) { + fetch((conf.blmUrl.indexOf('http')==-1? conf.rchan: '')+conf.blmUrl) + .then((response) => {return response.json();}) + .then((eventData) => { + blm.val = eventData; + blmRender(); + }); + } + function blmColor(val) { + if (document.location.search.indexOf('demo')>-1) { + if (val < 0) return 'white'; + else if (val < 1) return 'yellow'; + else if (val < 2) return 'orange'; + else if (val < 3) return 'red'; + else return 'violet'; + } + if (val < 20) return 'white'; + else if (val < 50) return 'yellow'; + else if (val < 100) return 'orange'; + else if (val < 200) return 'red'; + else return 'violet'; + } + function blmUpdate(c, val, direction, width, blmFactor) { + // console.log('blmUpdate()', c, val, direction, width, blmFactor); + if (typeof val !== 'undefined' && typeof blmFactor !== 'undefined') { + document.getElementById(c).height.baseVal.value = Math.abs(val*blmFactor); + document.getElementById(c).style.fill = blmColor(val); + } + else { + document.getElementById(c).height.baseVal.value = Math.abs(40); + document.getElementById(c).style.fill = 'black'; + } + } diff --git a/bpm2d.js b/bpm2d.js new file mode 100644 index 0000000..3d1d32a --- /dev/null +++ b/bpm2d.js @@ -0,0 +1,171 @@ +// jshint esversion: 6 + const bpmData = {}; + const corr = {}; + function bpmMenu(lattice, facilities, params) { + if (document.location.search.indexOf('new')>-1) {bpmMenuNew(params); return;} + params.bpm = ''; + $('.bpmhor').css('display', 'none'); + $('.bpmver').css('display', 'none'); + if (document.location.search.indexOf('bpm=')>-1) {params.bpm = document.location.search.split('bpm=')[1].split('&')[0]; bpmSwitch(bpmData, params);} + gui.add(params, 'bpm', facilities).name('bpm H <img id="h" src="red.svg" style="margin-bottom: -4px;"> V <img id="v" src="green.svg" style="margin-bottom: -4px;"> ').onChange(function() {bpmSwitch(bpmData, params);}); + for (let f in facilities) { + const b = facilities[f]; + if (b=='' || typeof bpmData[b] == 'undefined' || typeof lattice[b].bpm == 'undefined' || typeof lattice[b].bpm.orbitconf == 'undefined') continue; + console.log('bpmMenu() - ',b); + // bpmData[b].datasrc = lattice[b].bpm.orbithor+';'+lattice[b].bpm.orbitver; + bpmData[b].datasrc = lattice[b].bpm.orbithor; + bpmData[b].map = []; + fetch(conf.rchan+lattice[b].bpm.orbitconf) + .then((response) => {return response.json();}) + .then((bpmData2) => { + let bpmCounter = 0; + let photoCounter = 0; + for (let i in bpmData2) { + const name = bpmData2[i]; + if (name.indexOf(bpmData[b].skip)>-1) continue; + for (let bl in bpmData[b].obj) { + // console.log('b', bl, bpmData[b].obj, bpmData[b].obj[bl]); + if (name==bpmData[b].obj[bl]) {bpmData[b].map[bl] = bpmCounter; bpmCounter++;} + } + } + console.log('bpmMenu(), name', b, bpmData[b], lattice[b]); + }); + } + } + function bpmMenuNew(params) { + params.bpm = ''; + bpmSwitchNew(params); + fetch(conf.bpmSrcUrl) + .then((response) => {return response.json();}) + .then((bpmData) => { + let bpmCounter = 0; + let photoCounter = 0; + console.log('bpmMenu(), name', bpmData); + for (let i in bpmData) { + const name = bpmData[i]; + if (name.indexOf(conf.bpmSkip)>-1) continue; + for (let bl in bpmData[i].obj) { + console.log('bl', bl, bpmData[i].obj, bpmData[i].obj[bl]); + if (name==bpmData[i].obj[bl]) {bpmData[i].map[bl] = bpmCounter; bpmCounter++;} + } + } + }); + } + const threshold = document.location.search.indexOf('threshold=')>-1? document.location.search.split('threshold=')[1].split('&')[0]: 1000; + const f = document.location.search.indexOf('factor=')>-1? document.location.search.split('factor=')[1].split('&')[0]: 3000; + function bpmInit(facility) { + if (bpmData[facility].obj.length>0) { + console.log('bpmInit', facility, bpmData[facility]); + const dhor = []; + const dver = []; + for (i=0; i<bpmData[facility].pos.length; i++) { + if (i>threshold) break; + const dir = bpmData[facility].dir[i]; + const beta = Math.PI*dir/180; + if (threshold<1000) console.log('i', i, 'pos',bpmData[facility].pos[i], 'dir', dir, beta, Math.cos(beta), Math.sin(beta)); + dhor.push((i==0?'M':'L')+ + Math.round(bpmData[facility].pos[i][0] - f*Math.sin(beta)) + ' ' + + Math.round(bpmData[facility].pos[i][1] + f*Math.cos(beta)) + ); + dver.push((i==0?'M':'L')+ + Math.round(bpmData[facility].pos[i][0] - f*1.05*Math.sin(beta)) + ' ' + + Math.round(bpmData[facility].pos[i][1] + f*1.05*Math.cos(beta)) + ); + } + appendSvg("path", {id:facility+"_bpmhor", class: "bpmhor "+facility, visibility:"hidden", name:"bpmhor", fill: "none", "stroke-width":"50", "stroke":"red", d: dhor.join(' ')+(lattice[facility].sections[0].chamber?' Z':'')}); + appendSvg("path", {id:facility+"_bpmver", class: "bpmver "+facility, visibility:"hidden", name:"bpmver", fill: "none", "stroke-width":"50", "stroke":"green", d: dver.join(' ')+(lattice[facility].sections[0].chamber?' Z':'')}); + console.log("path", {id:facility+"_bpmhor", name:"bpmhor", d: dver.join(' ')+' Z'}); + } + } + function bpmSwitch(bpmData, params) { + if (bpmData.reader !== false) clearInterval(bpmData.reader); + bpmData.reader = false; + if (params.bpm=='') { + $('#application').hide(); + $('#applicationFrame').removeAttr("src"); + } + else { + if (typeof params.bpm != 'string') return; + const bpms = params.bpm.split(','); + for (let bs=0; bs<bpms.length; bs++) { + bpmData.oldIndex = bpms[bs]; + bpmRead(bpmData, params); + $('#'+bpms[bs]+"_bpmhor").attr('visibility', "visible"); + $('#'+bpms[bs]+"_bpmver").attr('visibility', "visible"); + } + bpmData.reader = setInterval(bpmRead, 3000, bpmData, params); + $('#application').show(); + $('.bpmhor').css('display', 'block'); + $('.bpmver').css('display', 'block'); + $('#applicationFrame').attr("src", "/spa/index.html?s=bpm&src="+params.bpm+(document.location.search.indexOf('demo')>-1? '&demo': '')); + $("#applicationFrame").height(window.innerHeight); + } + } + function bpmSwitchNew(bpmData, params) { + if (bpmData.reader !== false) clearInterval(bpmData.reader); + bpmData.reader = false; + $('.bpmhor').css('display', 'none'); + $('.bpmver').css('display', 'none'); + if (params.bpm=='') { + $('#application').hide(); + $('#applicationFrame').removeAttr("src"); + } + else { + bpmData.oldIndex = params.bpm; + bpmRead(bpmData, params); + $('#'+params.bpm+"_bpmhor").attr('visibility', "visible"); + $('#'+params.bpm+"_bpmver").attr('visibility', "visible"); + + bpmData.reader = setInterval(bpmRead, 3000, bpmData, params); + $('#application').show(); + $('.bpmhor.'+params.bpm).css('display', 'block'); + $('.bpmver.'+params.bpm).css('display', 'block'); + $('#applicationFrame').attr("src", "/spa/index.html?s=bpm&src="+params.bpm+(document.location.search.indexOf('demo')>-1? '&demo': '')); + $("#applicationFrame").height(window.innerHeight); + } + } + function bpmRender(bpm, bpmData) { + const facility = bpm.split('_')[0]; + console.log('bpmRender(), facility', facility, 'bpmData', bpmData); + const bpmd = facility==''? bpmData: bpmData[facility]; + const bpmMax = Math.max.apply(null, bpmd.val.map(Math.abs)); // https://stackoverflow.com/questions/29515761/find-absolute-max-value-in-javascript-array + let bpmPeak = (Math.log10(bpmMax) + 2) * 5000; + bpmPeak = bpmPeak>20000? 20000: (bpmPeak<2000? 2000: bpmPeak); + const bpmFactor = bpmPeak/bpmMax; + const dhor = []; + const dver = []; + for (i=0; i<bpmd.pos.length; i++) { + if (i>threshold) break; + const dir = bpmd.dir[i]; + const beta = Math.PI*dir/180; + if (threshold<1000) console.log('i', i, 'pos',bpmd.pos[i], 'dir', dir, beta, Math.cos(beta), Math.sin(beta)); + dhor.push((i==0?'M':'L')+ + Math.round(bpmd.pos[i][0] - bpmd.val[0][i]/1000*Math.sin(beta)) + ' ' + + Math.round(bpmd.pos[i][1] + bpmd.val[0][i]/1000*Math.cos(beta)) + ); + dver.push((i==0?'M':'L')+ + Math.round(bpmd.pos[i][0] - bpmd.val[1][i]/1000*Math.sin(beta)) + ' ' + + Math.round(bpmd.pos[i][1] + bpmd.val[1][i]/1000*Math.cos(beta)) + ); + } + $('#'+facility+"_bpmhor").attr('d', dhor.join(' ')+(lattice[facility].sections[0].chamber?' Z':'')); + $('#'+facility+"_bpmver").attr('d', dver.join(' ')+(lattice[facility].sections[0].chamber?' Z':'')); + console.log("bpmRender(),", {id:facility+"_bpmhor", name:"bpmhor", d: dver.join(' ')+' Z'}); + // if (params.bpm) {bpmLabel(bpmData, params, camera, THREE);} + } + function bpmRead(bpmData, params) { + const bpms = params.bpm.split(','); + console.log('bpms',bpms); + for (let bs=0; bs<bpms.length; bs++) { + if (bpmData[bpms[bs]] && bpmData[bpms[bs]].datasrc) { + console.log((bpmData[bpms[bs]].datasrc.indexOf('http')>-1? '': conf.rchan)+bpmData[bpms[bs]].datasrc); + fetch((bpmData[bpms[bs]].datasrc.indexOf('http')>-1? '': conf.rchan)+bpmData[bpms[bs]].datasrc) + .then((response) => {return response.json();}) + .then((eventData) => { + bpmData[bpms[bs]].val = eventData; + console.log('bpmRead()', conf.rchan+bpmData[bpms[bs]].datasrc, bpms[bs], bpmData, eventData); + bpmRender(bpms[bs], bpmData); + }); + } + } + } diff --git a/component.php b/component.php new file mode 100644 index 0000000..9962725 --- /dev/null +++ b/component.php @@ -0,0 +1,79 @@ +<?php +header("Content-type: text/javascript"); +function bundle_include($c) { + global $import, $bundle; + $f = file("./components/{$c}.js"); + foreach($f as $i=> $l) { + if (strpos($l, 'import')!==false) {$import[$l] = true; unset($f[$i]);} + if (strpos($l, 'jshint')!==false) {unset($f[$i]);} + } + $bundle .= implode('', $f)."\n"; +} +function bundle_include2d($c) { + global $import, $bundleArray; + $height = $width = ''; + $f = file("./components/{$c}.svg"); + foreach($f as $i=> $l) {if (strpos($l, 'svg')!==false) {$g = explode('"', $l); break;}} + // print_r($g); + foreach ($g as $i=>$v) { + if (strpos($v, '=')!==false) {$id = strtr($v, array(' '=>'','='=>'','<svg'=>'')); $$id = $g[$i+1];} + } + $vb = explode(' ', $viewBox); + if (empty($width)) { $width = strtr($vb[2], array('px'=>''));} + if (empty($height)) { $height = strtr($vb[3], array('px'=>''));} + $width *= 2; + $height *= 2; + $bundle = "<symbol id=\"$c\" viewBox=\"0 0 {$width}px {$height}px\" width=\"$width\" height=\"$height\"><g class=\"{$c}scale scale\">\n"; + foreach($f as $i=> $l) { + if (strpos($l, 'svg')!==false) {unset($f[$i]);} + } + $bundle .= implode('', $f)."</g></symbol>\n"; + $bundleArray[$c] = $bundle; +} + +$machine = empty($_REQUEST['machine'])? 'elettra': $_REQUEST['machine']; +$latticeFile = empty($_REQUEST['lattice'])? "./{$machine}_lattice.json": $_REQUEST['lattice']; +$latticeStr = file_get_contents($latticeFile); +$lattice = json_decode($latticeStr, true); +if (isset($_REQUEST['debug'])) {echo "latticeFile: $latticeFile\nlattice: \n"; print_r($lattice);} +$comp = $import = array(); +$bundle = "\n"; +$bundleArray = []; +foreach ($lattice as $l) { + foreach ($l['sections'] as $s) { + $comp[$s['bending']['type']] = true; + foreach ($s['components'] as $m) $comp[$m['type']] = true; + } +} +if (isset($_REQUEST['2d'])) { + $bundle = '<svg id="panther" viewBox="-50000 -50000 50000 50000" version="1.1" xmlns="http://www.w3.org/2000/svg" style="width: 100%; overflow: hidden; display: inline; min-width: inherit; max-width: inherit; min-height: inherit;">'."\n"; + foreach ($comp as $c=>$v) { + if (file_exists("./components/{$c}.svg")) bundle_include2d($c); else unset($comp[$c]); + } + ksort($bundleArray); + $bundle .= implode('', $bundleArray); + if (isset($_REQUEST['import'])) { + $f = file_get_contents('./panther.js'); + $js = explode('// import components', $f); + $c = implode(',', array_keys($comp)); + die(strtr($js[0], array('let lattice'=>'//let lattice'))."\nimport { $c } from './component.php';\nconst amesh = { $c };\n\nconst lattice = $latticeStr;\n init();\nfor (var key in lattice) {if (document.location.search.indexOf(key+'=hide')==-1) initLattice(lattice[key], key);}\n//".$js[2]); + } + if (isset($_REQUEST['save'])) {file_put_contents("./components/bundle_{$machine}2d.svg", implode('', array_keys($import)).$bundle);} + die(implode('', array_keys($import)).$bundle); +} + +foreach ($comp as $c=>$v) { + $fast = (isset($_REQUEST['fast']) && file_exists("./components/{$c}fast.js"))? 'fast': ''; + if (file_exists("./components/{$c}{$fast}.js")) bundle_include($c.$fast); else unset($comp[$c]); +} +if (isset($_REQUEST['import'])) { + $f = file_get_contents('./panther.js'); + $js = explode('// import components', $f); + $c = implode(',', array_keys($comp)); + die(strtr($js[0], array('let lattice'=>'//let lattice'))."\nimport { $c } from './component.php';\nconst amesh = { $c };\n\nconst lattice = $latticeStr;\n init();\nfor (var key in lattice) {if (document.location.search.indexOf(key+'=hide')==-1) initLattice(lattice[key], key);}\n//".$js[2]); +} +$fast = isset($_REQUEST['fast'])? 'fast': ''; +if (isset($_REQUEST['save'])) {file_put_contents("./components/bundle_{$machine}{$fast}.js","/*jshint esversion: 6 */\n".implode('', array_keys($import)).$bundle);} +echo implode('', array_keys($import)).$bundle; + +?> diff --git a/elettra_lattice.json b/elettra_lattice.json new file mode 100644 index 0000000..0a13ce8 --- /dev/null +++ b/elettra_lattice.json @@ -0,0 +1,1719 @@ +{ + "preinjector": { + "sections": [ + { + "start": {"x": 19415, "z": 14125}, + "components": [ + {"type": "gun", "position": -300, "name": "Gun", "href": "https://puma-01.elettra.eu/spa/index.html?s=preinj_summary"}, + {"type": "lens", "position": 130, "name": "LENS_P1.1", "labelReverse": [270, 1600, -70]}, + {"type": "vlv", "position": 190, "name": "VLV_P1.1"}, + {"type": "cm", "position": 360, "name": "CM_P1.1"}, + {"type": "lens", "position": 480, "name": "LENS_P1.2", "labelReverse": [270, 1600, -50]}, + {"type": "lens", "position": 600, "name": "LENS_P1.3", "labelReverse": [270, 1600, -140]}, + {"type": "flsc", "position": 692, "name": "FLSC_P1.1"}, + {"type": "lens", "position": 890, "name": "LENS_P1.4", "labelReverse": [270, 1600, -50]}, + {"type": "lens", "position": 1050, "name": "LENS_P1.5", "labelReverse": [270, 1600, -100]}, + {"type": "cm", "position": 1150, "name": "CM_P1.2"}, + {"type": "quadrupolebooster", "position": 1366, "length": 50, "name": "Q_P1.1"}, + {"type": "quadrupolebooster", "position": 1649, "length": 50, "name": "Q_P1.2"}, + {"type": "quadrupolebooster", "position": 1932, "length": 50, "name": "Q_P1.3"}, + {"type": "bpm", "position": 2182, "name": "BPM_P1.1"}, + {"type": "blm", "position": 2282, "name": "BPM_P1.1_R"}, + {"type": "blm", "position": 2282, "name": "BPM_P1.1_L"}, + {"type": "flsc", "position": 2382, "name": "FLSC_P1.2"}, + {"type": "correctorbooster", "position": 2621.5, "name": "CH_P1.1"}, + {"type": "correctorbooster", "position": 2881.5, "name": "CV_P1.1"}, + {"type": "vlv", "position": 3100, "name": "VLV_P1.2"}, + {"type": "cavitylinac", "position": 4804, "length": 3300, "rotateY": "PI/2", "href": "https://puma-01.elettra.eu/spa/index.html?s=preinj_summary", "offset2d": [1100, 100], "name": "ACCT_P1.1"}, + {"type": "vlv", "position": 6700, "name": "VLV_P1.3"}, + {"type": "cm", "position": 7000, "name": "CM_P1.3"}, + {"type": "correctorbooster", "position": 7256.5, "name": "CH_P1.2"}, + {"type": "correctorbooster", "position": 7486.5, "name": "CV_P1.2"}, + {"type": "quadrupolebooster", "position": 7772, "length": 50, "name": "Q_P1.4"}, + {"type": "quadrupolebooster", "position": 8085, "length": 50, "name": "Q_P1.5"}, + {"type": "quadrupolebooster", "position": 8338, "length": 50, "name": "Q_P1.6"}, + {"type": "bpm", "position": 8723, "name": "BPM_P1.2"}, + {"type": "blm", "position": 8783, "name": "BPM_P1.2_R"}, + {"type": "blm", "position": 8783, "name": "BPM_P1.2_L"}, + {"type": "flsc", "position": 9198, "name": "FLSC_P1.3"}, + {"type": "cavitylinac", "position": 11281, "length": 3300, "rotateY": "PI/2", "href": "https://puma-01.elettra.eu/spa/index.html?s=preinj_summary","offset2d": [1500, 170], "name": "ACCT_P1.2"}, + {"type": "vlv", "position": 13000, "name": "VLV_PTB1.1"}, + {"type": "cm", "position": 13316, "name": "CM_PTB1.1"}, + {"type": "correctorbooster", "position": 13663.5, "name": "CV_PTB1.1"}, + {"type": "correctorbooster", "position": 13869, "name": "CH_PTB1.1"}, + {"type": "bpm", "position": 14409, "name": "BPM_PTB1.1"}, + {"type": "blm", "position": 14609, "name": "BPM_PTB1.1_R"}, + {"type": "blm", "position": 14609, "name": "BPM_PTB1.1_L"}, + {"type": "quadrupolebooster", "position": 14751.9, "length": 175, "name": "Q_PTB1.1"}, + {"type": "blm", "position": 14952, "name": "BLM_Q_PTB1.1"}, + {"type": "quadrupolebooster", "position": 15121.9, "length": 175, "name": "Q_PTB1.2"}, + {"type": "blm", "position": 15322, "name": "BLM_Q_PTB1.2"} + ] + }, + { + "start": {"x": 3560, "z": 11640}, + "bending": {"type": "dipolebooster", "length": 300, "name": "B_PTB1.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_PTB1.1_R", "labelReverse": [270, 1600, -50]}, + {"type": "blm", "position": 100, "name": "BLM_B_PTB1.1_L", "labelReverse": [270, 1600, -50]}, + {"type": "vlv", "position": 400, "name": "VLV_PTB1.2", "labelReverse": [270, 1600, -50]}, + {"type": "flsc", "position": 627.9, "name": "FLSC_PTB1.2", "labelReverse": [270, 1800, -50]}, + {"type": "blm", "position": 698, "name": "BLM_FLSC_PTB1.2", "labelReverse": [270, 1800, -50]}, + {"type": "bpm", "position": 847.9, "name": "BPM_PTB1.3", "labelReverse": [270, 1800, -50]}, + {"type": "correctorbooster", "position": 1097.9, "name": "CH_PTB1.2", "labelReverse": [270, 1400, -50]}, + {"type": "correctorbooster", "position": 1297.9, "name": "CV_PTB1.2", "labelReverse": [270, 1400, -50]}, + {"type": "quadrupolebooster", "position": 1535.9, "length": 175, "name": "Q_PTB1.3", "labelReverse": [270, 1400, -50]}, + {"type": "blm", "position": 1436, "name": "BLM_Q_PTB1.3", "labelReverse": [270, 1600, -50]}, + {"type": "quadrupolebooster", "position": 1805.9, "length": 175, "name": "Q_PTB1.4", "labelReverse": [270, 1400, -50]}, + {"type": "blm", "position": 1806, "name": "BLM_Q_PTB1.4"}, + {"type": "bpm", "position": 2054.9, "name": "BPM_PTB1.4"}, + {"type": "quadrupolebooster", "position": 2425.9, "length": 175, "name": "Q_PTB1.5"}, + {"type": "blm", "position": 2326, "name": "BLM_Q_PTB1.5"}, + {"type": "correctorbooster", "position": 2744.9, "name": "CH_PTB1.3"}, + {"type": "correctorbooster", "position": 2930.9, "name": "CV_PTB1.3"}, + {"type": "quadrupolebooster", "position": 3183.9, "length": 175, "name": "Q_PTB1.6"}, + {"type": "blm", "position": 3484, "name": "BLM_Q_PTB1.6"}, + {"type": "quadrupolebooster", "position": 3553.9, "length": 175, "name": "Q_PTB1.7"}, + {"type": "blm", "position": 3854, "name": "BLM_Q_PTB1.7"}, + {"type": "scraper", "position": 4077.9, "name": "SCRH_PTB1.1"}, + {"type": "scraper", "position": 4272.9, "name": "SCRV_PTB1.1"}, + {"type": "blm", "position": 4273, "name": "BLM_SCRV_PTB1.1_R"}, + {"type": "blm", "position": 4273, "name": "BLM_SCRV_PTB1.1_L"}, + {"type": "flsc", "position": 4897.9, "name": "FLSC_PTB1.3"}, + {"type": "correctorbooster", "position": 4517.9, "name": "CH_PTB1.4"}, + {"type": "correctorbooster", "position": 4717.9, "name": "CV_PTB1.4"}, + {"type": "blm", "position": 4918, "name": "BLM_FLSC_PTB1.3"}, + {"type": "quadrupolebooster", "position": 5183.9, "length": 175, "name": "Q_PTB1.8"}, + {"type": "blm", "position": 5184, "name": "BLM_Q_PTB1.8"}, + {"type": "cm", "position": 5452.9, "name": "CM_PTB1.2"}, + {"type": "bpm", "position": 5652.9, "name": "BPM_PTB1.5"}, + {"type": "vlv", "position": 5850, "name": "VLV_PTB1.3"} + + ] + }, + { + "start": {"x": -2910, "z": 9230}, + "chamber": {"type": "chamber"}, + "components": [ + ] + }, + { + "start": {"x": 3560, "z": 11640}, + "components": [ + ] + }, + { + "start": {"x": 1975, "z": 11391}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "flsc", "position": 900, "name": "FLSC_PTB1.1", "labelReverse": [90, -500, 100]} + ] + } + ], + "servicearea": { + "sections": [ + { + "start": {"x": -2910, "z": 9230}, + "components": [ + ] + } + ] + }, + "bpm": { + "orbitconf": "https://pwma-dev.elettra.eu/panther/updater.php?read&filename=preinjector.100.bpm.src", + "orbithor": "https://pwma-dev.elettra.eu/panther/updater.php?read&filename=preinjector.100.bpm", + "pos": "https://pwma-dev.elettra.eu/panther/updater.php?read&filename=preinjector.100.bpm", + "rms": "https://pwma-dev.elettra.eu/misc/bpm.php?rms&facility=preinjector", + "length": 6, + "offset": 3 + }, + "blm": { + "confsrc": "https://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sa/radio_protection/blmmaster_p_ptb_a11.01(BlmConfiguration)", + "datasrc": "https://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sa/radio_protection/blmmaster_p_ptb_a11.01/BlmData" + + } + }, + "booster": { + "sections": [ + { + "start": {"x": -8800, "z": 8695}, + "bending": {"type": "dipolebooster", "name": "B_B1.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B1.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B1.1_L"}, + {"type": "quadrupolebooster", "position": 1650, "length": 175, "name": "QD_B1.1"}, + {"type": "flsc", "position": 2267, "name": "FLSC_B1.1"}, + {"type": "blm", "position": 2267, "name": "BLM_FLSC_B1.1_R"}, + {"type": "blm", "position": 2267, "name": "BLM_FLSC_B1.1_L"}, + {"type": "dcct", "position": 3300, "name": "DCCT_B1.1"}, + {"type": "bpm", "position": 3810, "name": "BPMT_B1.1"}, + {"type": "quadrupolebooster", "position": 4750, "length": 280, "name": "QF_B1.2"}, + {"type": "bpm", "position": 5080, "name": "BPM_B1.1"}, + {"type": "sextupolebooster", "position": 5310, "name": "SF_B1.1"} + ] + }, + { + "start": {"x": -15050, "z": 6630}, + "bending": {"type": "dipolebooster", "name": "B_B2.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B2.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B2.1_L"}, + {"type": "correctorbooster", "position": 1400, "name": "CV_B2.1"}, + {"type": "quadrupolebooster", "position": 1650, "length": 175, "name": "QD_B2.1"}, + {"type": "sextupolebooster", "position": 2010, "name": "SD_B2.1"} + ] + }, + { + "start": {"x": -17850, "z": 4940}, + "bending": {"type": "dipolebooster", "name": "B_B3.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B3.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B3.1_L"}, + {"type": "correctorbooster", "position": 1300, "name": "CH_B3.1"}, + {"type": "quadrupolebooster", "position": 1480, "length": 280, "name": "QF_B3.1"}, + {"type": "bpm", "position": 1720, "name": "BPM_B3.1"}, + {"type": "sextupolebooster", "position": 2080, "name": "SF_B3.1"} + ] + }, + { + "start": {"x": -20225, "z": 2665}, + "bending": {"type": "dipolebooster", "name": "B_B4.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B4.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B4.1_L"}, + {"type": "correctorbooster", "position": 1300, "name": "CV_B4.1"}, + {"type": "quadrupolebooster", "position": 1480, "length": 175, "name": "QD_B4.1"}, + {"type": "bpm", "position": 1720, "name": "BPM_B4.1"}, + {"type": "sextupolebooster", "position": 2080, "name": "SD_B4.1"} + ] + }, + { + "start": {"x": -22025, "z": -90}, + "bending": {"type": "dipolebooster", "name": "B_B5.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B5.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B5.1_L"}, + {"type": "correctorbooster", "position": 1300, "name": "CH_B5.1"}, + {"type": "quadrupolebooster", "position": 1480, "length": 280, "name": "QF_B5.1"}, + {"type": "bpm", "position": 1720, "name": "BPM_B5.1"}, + {"type": "sextupolebooster", "position": 2080, "name": "SF_B5.1"} + ] + }, + { + "start": {"x": -23165, "z": -3155}, + "bending": {"type": "dipolebooster", "name": "B_B6.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B6.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B6.1_L"}, + {"type": "correctorbooster", "position": 1300, "name": "CV_B6.1"}, + {"type": "quadrupolebooster", "position": 1480, "length": 175, "name": "QD_B6.1"}, + {"type": "bpm", "position": 1720, "name": "BPM_B6.1"}, + {"type": "sextupolebooster", "position": 2080, "name": "SD_B6.1"} + ] + }, + { + "start": {"x": -23615, "z": -6415}, + "bending": {"type": "dipolebooster", "name": "B_B7.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "plc", "position": 0, "name": "SPAC_B7", "offset3d": [0, -700, 0], "offset2d": [400, 200], "labelReverse": [270, 1100, -150]}, + {"type": "blm", "position": 1000, "name": "BLM_B_B7.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B7.1_L"}, + {"type": "correctorbooster", "position": 1360, "name": "CH_B7.1"}, + {"type": "quadrupolebooster", "position": 1650, "length": 280, "name": "QF_B7.1"}, + {"type": "vlv", "position": 1967, "name": "VLV_B7.1"} + ] + }, + { + "start": {"x": -23295, "z": -9690}, + "bending": {"type": "dipolebooster", "name": "B_B8.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B8.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B8.1_L"}, + {"type": "correctorbooster", "position": 1300, "name": "CV_B8.1"}, + {"type": "quadrupolebooster", "position": 1480, "length": 175, "name": "QD_B8.1"}, + {"type": "bpm", "position": 1720, "name": "BPM_B8.1"}, + {"type": "sextupolebooster", "position": 2080, "name": "SD_B8.1"} + ] + }, + { + "start": {"x": -22275, "z": -12825}, + "bending": {"type": "dipolebooster", "rotateY": "-PI", "name": "B_B9.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B9.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B9.1_L"}, + {"type": "correctorbooster", "position": 1300, "name": "CH_B9.1"}, + {"type": "quadrupolebooster", "position": 1480, "length": 280, "name": "QF_B9.1"}, + {"type": "bpm", "position": 1720, "name": "BPM_B9.1"}, + {"type": "sextupolebooster", "position": 2080, "name": "SF_B9.1"} + ] + }, + { + "start": {"x": -20590, "z": -15640}, + "bending": {"type": "dipolebooster", "rotateY": "-PI", "name": "B_B10.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B10.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B10.1_L"}, + {"type": "correctorbooster", "position": 1300, "name": "CV_B10.1"}, + {"type": "quadrupolebooster", "position": 1480, "length": 175, "name": "QD_B10.1"}, + {"type": "bpm", "position": 1720, "name": "BPM_B10.1"}, + {"type": "sextupolebooster", "position": 2080, "name": "SD_B10.1"} + ] + }, + { + "start": {"x": -18305, "z": -17990}, + "bending": {"type": "dipolebooster", "rotateY": "-PI", "name": "B_B11.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B11.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B11.1_L"}, + {"type": "correctorbooster", "position": 1300, "name": "CH_B11.1"}, + {"type": "quadrupolebooster", "position": 1480, "length": 280, "name": "QF_B11.1"}, + {"type": "bpm", "position": 1720, "name": "BPM_B11.1"}, + {"type": "sextupolebooster", "position": 2080, "name": "SF_B11.1"} + ] + }, + { + "start": {"x": -15560, "z": -19815}, + "bending": {"type": "dipolebooster", "rotateY": "-PI", "name": "B_B12.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B12.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B12.1_L"}, + {"type": "correctorbooster", "position": 1400, "name": "CV_B12.1"}, + {"type": "quadrupolebooster", "position": 1650, "length": 175, "name": "QD_B12.1"}, + {"type": "sextupolebooster", "position": 2010, "name": "SD_B12.1"} + ] + }, + { + "start": {"x": -12485, "z": -20960}, + "bending": {"type": "dipolebooster", "rotateY": "-PI", "name": "B_B13.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "plc", "position": 0, "name": "SPAC_B13", "offset3d": [0, -700, 0], "offset2d": [-200, 500], "labelReverse": [270, 1200, -150]}, + {"type": "blm", "position": 1000, "name": "BLM_B_B13.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B13.1_L"}, + {"type": "quadrupolebooster", "position": 1350, "length": 280, "name": "QF_B13.1"}, + {"type": "bpm", "position": 1650, "name": "BPM_B13.1"}, + {"type": "sextupolebooster", "position": 2010, "name": "SF_B13.1"}, + {"type": "vlv", "position": 2250, "name": "VLVKE_B13.1"}, + {"type": "kicker", "position": 2710, "name": "KEB_B2.1", "name2": "KE_B13.1"}, + {"type": "vlv", "position": 3250, "name": "VLVKE_B13.2"}, + {"type": "correctorbooster", "position": 3560, "name": "BUMPER_B13.1"}, + {"type": "quadrupolebooster", "position": 4950, "length": 175, "name": "QD_B13.2"} + ] + }, + { + "start": {"x": -5965, "z": -21825}, + "bending": {"type": "dipolebooster", "rotateY": "-PI/2", "name": "B_B14.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B14.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B14.1_L"}, + {"type": "quadrupolebooster", "position": 1250, "length": 280, "name": "QF_B14.1"}, + {"type": "blm", "position": 1350, "name": "BLM_QF_B14.1_R"}, + {"type": "blm", "position": 1350, "name": "BLM_QF_B14.1_L"}, + {"type": "vlv", "position": 1990, "name": "VLVVE_B14.1"}, + {"type": "spte", "position": 2450, "offset2d": [0, -50], "offset3d": [0, 0, 200], "ps": ["SEB_B2.1","SEB_B2.2"], "name": "SEB_B2.1 - 2.2", "name2": "SEB_B14.1 - SEB_B14.2"}, + {"type": "blm", "position": 3300, "name": "BLM_SPTE_B14.1_R"}, + {"type": "blm", "position": 3300, "name": "BLM_SPTE_B14.1_L"}, + {"type": "correctorbooster", "position": 4262.5, "name": "CH_B14.1", "labelReverse": true}, + {"type": "correctorbooster", "position": 4562.5, "name": "BUMPER_B14.2", "labelReverse": true}, + {"type": "quadrupolebooster", "position": 4850, "length": 175, "name": "QD_B14.2", "labelReverse": true}, + {"type": "bpm", "position": 5130, "name": "BPM_B14.1", "labelReverse": true}, + {"type": "vlv", "position": 5700, "name": "VLVVE_B14.2", "labelReverse": [90, -500, 300]}, + {"type": "flsc", "position": 6600, "name": "FLSC_B14.1", "labelReverse": [90, -500, 300]}, + {"type": "correctorbooster", "position": 7250, "name": "BUMPER_B14.3", "labelReverse": true}, + {"type": "bst", "position": 7600, "name": "BST_B14.1", "labelReverse": true}, + {"type": "quadrupolebooster", "position": 8250, "length": 280, "name": "QF_B14.3", "labelReverse": true} + ] + }, + { + "start": {"x": 3865, "z": -20905}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B15.1", "labelReverse": true}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "plc", "position": 0, "name": "SPAC_B15", "offset3d": [0, -700, 0], "offset2d": [-100, -350], "labelReverse": [180, 1500, 50]}, + {"type": "blm", "position": 1000, "name": "BLM_B_B15.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B15.1_L"}, + {"type": "quadrupolebooster", "position": 1650, "length": 175, "name": "QD_B15.1"}, + {"type": "strp", "position": 4202, "name": "STRP_B15.1"}, + {"type": "quadrupolebooster", "position": 4650, "length": 280, "name": "QF_B15.2"}, + {"type": "bpm", "position": 4930, "name": "BPM_B15.1"}, + {"type": "sextupolebooster", "position": 5310, "name": "SF_B15.1"} + ] + }, + { + "start": {"x": 10125, "z": -18845}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B16.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B16.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B16.1_L"}, + {"type": "correctorbooster", "position": 1400, "name": "CV_B16.1"}, + {"type": "quadrupolebooster", "position": 1650, "length": 175, "name": "QD_B16.1"}, + {"type": "sextupolebooster", "position": 2010, "name": "SD_B16.1"} + ] + }, + { + "start": {"x": 12950, "z": -17160}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B17.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B17.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B17.1_L"}, + {"type": "correctorbooster", "position": 1260, "name": "CH_B17.1"}, + {"type": "quadrupolebooster", "position": 1500, "length": 280, "name": "QF_B17.1"}, + {"type": "bpm", "position": 1780, "name": "BPM_B17.1"}, + {"type": "sextupolebooster", "position": 2150, "name": "SF_B17.1"} + ] + }, + { + "start": {"x": 15310, "z": -14885}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B18.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B18.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B18.1_L"}, + {"type": "correctorbooster", "position": 1260, "name": "CV_B18.1"}, + {"type": "quadrupolebooster", "position": 1500, "length": 175, "name": "QD_B18.1"}, + {"type": "bpm", "position": 1780, "name": "BPM_B18.1"}, + {"type": "sextupolebooster", "position": 2150, "name": "SD_B18.1"} + ] + }, + { + "start": {"x": 17110, "z": -12120}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B19.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B19.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B19.1_L"}, + {"type": "correctorbooster", "position": 1260, "name": "CH_B19.1"}, + {"type": "quadrupolebooster", "position": 1500, "length": 280, "name": "QF_B19.1"}, + {"type": "bpm", "position": 1780, "name": "BPM_B19.1"}, + {"type": "sextupolebooster", "position": 2150, "name": "SF_B19.1"} + ] + }, + { + "start": {"x": 18265, "z": -9050}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B20.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "plc", "position": 0, "name": "SPAC_B20", "offset3d": [0, -700, 0], "offset2d": [-500, -100], "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 1000, "name": "BLM_B_B20.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B20.1_L"}, + {"type": "correctorbooster", "position": 1260, "name": "CV_B20.1"}, + {"type": "quadrupolebooster", "position": 1500, "length": 175, "name": "QD_B20.1"}, + {"type": "bpm", "position": 1780, "name": "BPM_B20.1"}, + {"type": "sextupolebooster", "position": 2150, "name": "SD_B20.1"} + ] + }, + { + "start": {"x": 18690, "z": -5800}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B21.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B21.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B21.1_L"}, + {"type": "correctorbooster", "position": 1360, "name": "CH_B21.1"}, + {"type": "quadrupolebooster", "position": 1650, "length": 280, "name": "QF_B21.1"}, + {"type": "vlv", "position": 2050, "name": "VLV_B21.1"} + ] + }, + { + "start": {"x": 18390, "z": -2535}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B22.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B22.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B22.1_L"}, + {"type": "correctorbooster", "position": 1260, "name": "CV_B22.1"}, + {"type": "quadrupolebooster", "position": 1500, "length": 175, "name": "QD_B22.1"}, + {"type": "bpm", "position": 1780, "name": "BPM_B22.1"}, + {"type": "sextupolebooster", "position": 2150, "name": "SD_B22.1"} + ] + }, + { + "start": {"x": 17365, "z": 580}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B23.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B23.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B23.1_L"}, + {"type": "correctorbooster", "position": 1260, "name": "CH_B23.1"}, + {"type": "quadrupolebooster", "position": 1500, "length": 280, "name": "QF_B23.1"}, + {"type": "bpm", "position": 1780, "name": "BPM_B23.1"}, + {"type": "sextupolebooster", "position": 2150, "name": "SF_B23.1"} + ] + }, + { + "start": {"x": 15680, "z": 3405}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B24.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B24.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B24.1_L"}, + {"type": "correctorbooster", "position": 1260, "name": "CV_B24.1"}, + {"type": "quadrupolebooster", "position": 1500, "length": 175, "name": "QD_B24.1"}, + {"type": "bpm", "position": 1780, "name": "BPM_B24.1"}, + {"type": "sextupolebooster", "position": 2150, "name": "SD_B24.1"} + ] + }, + { + "start": {"x": 13395, "z": 5785}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B25.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "plc", "position": 0, "name": "SPAC_B25", "offset3d": [0, -700, 0], "offset2d": [-100, -500], "labelReverse": [90, -200, 250]}, + {"type": "blm", "position": 1000, "name": "BLM_B_B25.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B25.1_L"}, + {"type": "correctorbooster", "position": 1260, "name": "CH_B25.1"}, + {"type": "quadrupolebooster", "position": 1500, "length": 280, "name": "QF_B25.1"}, + {"type": "bpm", "position": 1780, "name": "BPM_B25.1"}, + {"type": "sextupolebooster", "position": 2150, "name": "SF_B25.1"} + ] + }, + { + "start": {"x": 10660, "z": 7580}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B26.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B26.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B26.1_L"}, + {"type": "correctorbooster", "position": 1400, "name": "CV_B26.1"}, + {"type": "quadrupolebooster", "position": 1650, "length": 175, "name": "QD_B26.1"}, + {"type": "sextupolebooster", "position": 2010, "name": "SD_B26.1"} + ] + }, + { + "start": {"x": 7580, "z": 8750}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "name": "B_B27.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1000, "name": "BLM_B_B27.1_R"}, + {"type": "blm", "position": 1000, "name": "BLM_B_B27.1_L"}, + {"type": "quadrupolebooster", "position": 1650, "length": 280, "name": "QF_B27.1"}, + {"type": "bpm", "position": 1900, "name": "BPM_B27.1"}, + {"type": "sextupolebooster", "position": 2230, "name": "SF_B27.1"}, + {"type": "vlv", "position": 3000, "name": "VLVRF_B27.1", "labelReverse": [90, -250, 250]}, + {"type": "cavity", "position": 3300.2, "name": "RF_B27.1", "labelReverse": [90, -250, 250]}, + {"type": "vlv", "position": 3700, "name": "VLVRF_B27.2", "labelReverse": [90, -250, 250]}, + {"type": "quadrupolebooster", "position": 4950, "length": 175, "name": "QD_B27.2", "labelReverse": [90, -250, 250]} + ] + }, + { + "start": {"x": 1055, "z": 9590}, + "bending": {"type": "dipolebooster", "rotateY": "PI/2", "name": "B_B28.1", "labelReverse": [90, -500, 0]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1400, "name": "BLM_B_B28.1_R"}, + {"type": "blm", "position": 1400, "name": "BLM_B_B28.1_L"}, + {"type": "quadrupolebooster", "position": 1650, "length": 280, "name": "QF_B28.1", "labelReverse": [90, -500, 300]}, + {"type": "flsc", "position": 2365, "name": "FLSC_B28.1", "labelReverse": [90, -500, 300]}, + {"type": "vlv", "position": 2800, "name": "VLVI_B28.1", "labelReverse": [90, -500, 300]}, + {"type": "blm", "position": 2665, "name": "BLM_FLSC_B27.1_R", "labelReverse": true}, + {"type": "blm", "position": 2665, "name": "BLM_FLSC_B27.1_L", "labelReverse": true}, + {"type": "strp", "position": 2915, "name": "STRP_B28.1", "labelReverse": true}, + {"type": "spte", "position": 3418.91, "offset2d": [-50, 50], "name": "SIB_B1.1", "name2": "SI_B28.1", "labelReverse": true}, + {"type": "blm", "position": 4137, "name": "BLM_SIB_B28.1_R"}, + {"type": "blm", "position": 4137, "name": "BLM_SIB_B28.1_L"}, + {"type": "vlv", "position": 4300, "name": "VLVI_B28.2"}, + {"type": "flsc", "position": 4574, "name": "FLSC_B28.2"}, + {"type": "quadrupolebooster", "position": 4887.5, "length": 175, "name": "QD_B28.2"}, + {"type": "bpm", "position": 5167.5, "name": "BPM_B28.1"}, + {"type": "vlv", "position": 6367, "name": "VLVKI_B28.1"}, + {"type": "kicker", "position": 6937.5, "name": "KIB_B28.1", "name2": "KIB_B1.1"}, + {"type": "blm", "position": 7437, "name": "BLM_KIB_B28.1_R"}, + {"type": "blm", "position": 7437, "name": "BLM_KIB_B28.1_L"}, + {"type": "vlv", "position": 7567, "name": "VLVKI_B28.2"}, + {"type": "quadrupolebooster", "position": 8187.5, "length": 280, "name": "QF_B28.2"}, + {"type": "plc", "position": 8187, "name": "SPAC_BSA1.1", "offset3d": [700, -100, -4000], "offset2d": [0, -1300], "labelReverse": [90, -250, 250]} + ] + } + ], + "blm": { + "confsrc": "https://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sa/radio_protection/blmmaster_b_a11.01(BlmConfiguration)", + "datasrc": "https://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sa/radio_protection/blmmaster_b_a11.01/BlmData" + } + }, + "bts": { + "sections": [ + { + "start": {"x": -3100, "z": -21558}, + "components": [ + {"type": "BTS_SEB1", "position": 0, "name": "BTS_SEB1"}, + {"type": "BTS_SEB2", "position": 62.2, "name": "BTS_SEB2"}, + {"type": "vlv", "position": 1450, "name": "VLV_BTS1.1"}, + {"type": "sip", "position": 1650, "name": "SIP55_BTS1.1"}, + {"type": "cm", "position": 2142.4, "name": "CM_BTS1.1"}, + {"type": "flsc", "position": 2442.4, "name": "FLSC_BTS1.1"}, + {"type": "blm", "position": 2392.4, "name": "BLM_FLSC_BTS1.1_R"}, + {"type": "blm", "position": 2392.4, "name": "BLM_FLSC_BTS1.1_L"}, + {"type": "corrector", "position": 2712.4, "name": "CH_BTS1.1"}, + {"type": "corrector", "position": 2992.4, "name": "CV_BTS1.1"}, + {"type": "quadrupolebooster", "position": 3244.9, "name": "Q_BTS1.1"}, + {"type": "blm", "position": 3244.9, "name": "BLM_Q_BTS1.1"}, + {"type": "quadrupolebooster", "position": 4044.9, "name": "Q_BTS1.2"}, + {"type": "blm", "position": 4044.9, "name": "BLM_Q_BTS1.2"}, + {"type": "bpm", "position": 4297.4, "name": "BPM_BTS1.1"}, + {"type": "corrector", "position": 4717.4, "name": "CH_BTS1.2"}, + {"type": "corrector", "position": 4997.4, "name": "CV_BTS1.2"}, + {"type": "bst", "position": 5400, "name": "BST_BTS1.1"}, + {"type": "bst", "position": 6200, "name": "BST_BTS1.2"}, + {"type": "sip", "position": 6300, "name": "SIP55_BTS1.2"} + ] + }, + { + "start": {"x": 5035, "z": -21920}, + "bending": {"type": "dipolebooster", "length": 1200, "name": "B_BTS1.1", "labelReverse": 180}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 737, "name": "BLM_B_BTS1.1_R"}, + {"type": "blm", "position": 737, "name": "BLM_B_BTS1.1_L"}, + {"type": "quadrupolebooster", "position": 2492, "name": "Q_BTS1.3"}, + {"type": "blm", "position": 2492, "name": "BLM_Q_BTS1.3"}, + {"type": "bpm", "position": 2744.5, "name": "BPM_BTS1.2"}, + {"type": "vlv_notfound", "position": 2950, "name": "VLVP_BTS1.2"}, + {"type": "sip", "position": 3150, "name": "SIP55_BTS1.3"}, + {"type": "quadrupolebooster", "position": 3607, "name": "Q_BTS1.4"}, + {"type": "blm", "position": 3607, "name": "BLM_Q_BTS1.4"}, + {"type": "corrector", "position": 4059.5, "name": "CH_BTS1.3"}, + {"type": "corrector", "position": 4339.5, "name": "CV_BTS1.3"}, + {"type": "sip", "position": 7650, "name": "SIP55_BTS1.4"}, + {"type": "bpm", "position": 7836, "name": "BPM_BTS1.3"}, + {"type": "blm", "position": 7836, "name": "BLM_BPM_BTS1.3_R"}, + {"type": "blm", "position": 7836, "name": "BLM_BPM_BTS1.3_L"}, + {"type": "vlv", "position": 8050, "name": "VLV_BTS1.2"}, + {"type": "plc", "position": 8400, "name": "SPAC_BTS1", "offset3d": [0, 100, -700], "offset2d": [0, 300], "labelReverse": [90, -250, 250]}, + {"type": "bpm", "position": 10570.35, "name": "BPM_BTS1.4"}, + {"type": "flsc", "position": 10864.35, "name": "FLSC_BTS1.2"}, + {"type": "corrector", "position": 11264.35, "name": "CH_BTS1.4"}, + {"type": "corrector", "position": 11544.35, "name": "CV_BTS1.4"}, + {"type": "quadrupolebooster", "position": 12296.85, "name": "Q_BTS1.5"}, + {"type": "blm", "position": 12297, "name": "BLM_Q_BTS1.5"}, + {"type": "sip", "position": 12700, "name": "SIP55_BTS1.5"}, + {"type": "quadrupolebooster", "position": 13011.85, "name": "Q_BTS1.6"}, + {"type": "blm", "position": 13012, "name": "BLM_Q_BTS1.6"}, + {"type": "bpm", "position": 13292.31, "name": "BPM_BTS1.5"} + ] + }, + { + "start": {"x": 20085, "z": -25560}, + "bending": {"type": "dipolebooster", "length": 1200, "name": "B_BTS1.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 737, "name": "BLM_B_BTS1.2_R"}, + {"type": "blm", "position": 737, "name": "BLM_B_BTS1.2_L"} + ] + }, + { + "start": {"x": 21860, "z": -25600}, + "bending": {"type": "dipolebooster", "rotateY": "-PI/2", "length": 1200, "name": "B_BTS1.3"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 737, "name": "BLM_B_BTS1.3_R"}, + {"type": "blm", "position": 737, "name": "BLM_B_BTS1.3_L"}, + {"type": "bst", "position": 950, "name": "BST_BTS1.3"}, + {"type": "vlv", "position": 2950, "name": "VLV_BTS2.1"}, + {"type": "corrector", "position": 3516.42, "name": "CH_BTS2.1"}, + {"type": "corrector", "position": 3796.42, "name": "CV_BTS2.1"}, + {"type": "quadrupolebooster", "position": 4149, "name": "Q_BTS2.1"}, + {"type": "blm", "position": 4149, "name": "BLM_Q_BTS2.1_R"}, + {"type": "blm", "position": 4149, "name": "BLM_Q_BTS2.1_L"}, + {"type": "scraper", "position": 4522.15, "name": "SCRH_BTS2.1"} + ] + }, + { + "start": {"x": 27535, "z": -24425}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "length": 1200, "name": "B_BTS2.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 737, "name": "BLM_B_BTS2.1_R"}, + {"type": "blm", "position": 737, "name": "BLM_B_BTS2.1_L"}, + {"type": "sip", "position": 1270, "name": "SIP55_BTS2.1"}, + {"type": "vgpe", "position": 1470, "name": "VGPE_BTS2.1"}, + {"type": "vlv", "position": 1570, "name": "VLV_BTS2.2"}, + {"type": "flsc", "position": 1849.77, "name": "FLSC_BTS2.1"}, + {"type": "quadrupolebooster", "position": 2299.5, "name": "Q_BTS2.2"}, + {"type": "blm", "position": 2300, "name": "BLM_Q_BTS2.2"}, + {"type": "quadrupolebooster", "position": 2604.5, "name": "Q_BTS2.3"}, + {"type": "blm", "position": 2605, "name": "BLM_Q_BTS2.3"}, + {"type": "bpm", "position": 2857, "name": "BPM_BTS2.1"}, + {"type": "corrector", "position": 3182, "name": "CH_BTS2.2"}, + {"type": "corrector", "position": 3462, "name": "CV_BTS2.2"}, + {"type": "sip", "position": 3700, "name": "SIP55_BTS2.2"}, + {"type": "vgpi", "position": 3900, "name": "VGPI_BTS2.1"}, + {"type": "quadrupolebooster", "position": 4144.5, "name": "Q_BTS2.4"}, + {"type": "blm", "position": 4145, "name": "BLM_Q_BTS2.4_R"}, + {"type": "blm", "position": 4145, "name": "BLM_Q_BTS2.4_L"} + ] + }, + { + "start": {"x": 33020, "z": -21875}, + "bending": {"type": "dipolebooster", "rotateY": "PI", "length": 1200, "name": "B_BTS2.2", "labelReverse": [90, -500, 0]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 737, "name": "BLM_B_BTS2.2_R"}, + {"type": "blm", "position": 737, "name": "BLM_B_BTS2.2_L"}, + {"type": "sip", "position": 1270, "name": "SIP55_BTS2.3"} + ] + }, + { + "start": {"x": 35040, "z": -20380}, + "bending": {"type": "dipole", "rotateY": "PI", "length": 2000, "name": "B_BTS2.3", "labelReverse": [90, -500, 0]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 1217, "name": "BLM_B_BTS2.3_R"}, + {"type": "blm", "position": 1217, "name": "BLM_B_BTS2.3_L"}, + {"type": "quadrupolebooster", "position": 1523.5, "name": "Q_BTS2.5", "labelReverse": true}, + {"type": "blm", "position": 1524, "name": "BLM_Q_BTS2.5", "labelReverse": true}, + {"type": "quadrupolebooster", "position": 1808.5, "name": "Q_BTS2.6", "labelReverse": true}, + {"type": "blm", "position": 1809, "name": "BLM_Q_BTS2.6", "labelReverse": true}, + {"type": "corrector", "position": 2032, "name": "CH_BTS2.3", "labelReverse": true}, + {"type": "corrector", "position": 2312, "name": "CV_BTS2.3", "labelReverse": true}, + {"type": "bpm", "position": 2588.5, "name": "BPM_BTS2.2", "labelReverse": true}, + {"type": "sip", "position": 2870, "name": "SIP55_BTS2.4", "labelReverse": true}, + {"type": "flsc", "position": 3150, "name": "FLSC_BTS2.2", "labelReverse": [90, -500, 300]}, + {"type": "blm", "position": 3150, "name": "BLM_FLSC_BTS2.2", "labelReverse": true}, + {"type": "cm", "position": 3481.2, "name": "CM_BTS2.1", "labelReverse": true}, + {"type": "bpm", "position": 3673.2, "name": "BPM_BTS2.3", "labelReverse": true}, + {"type": "bst", "position": 4000, "name": "BST_BTS2.1", "labelReverse": true}, + {"type": "quadrupolebooster", "position": 4465.8, "name": "Q_BTS2.7", "labelReverse": true}, + {"type": "blm", "position": 4466, "name": "BLM_Q_BTS2.7", "labelReverse": true}, + {"type": "corrector", "position": 4689.3, "name": "CH_BTS2.4", "labelReverse": true}, + {"type": "corrector", "position": 4969.3, "name": "CV_BTS2.4", "labelReverse": true}, + {"type": "sip", "position": 5170, "name": "SIP55_BTS2.5", "labelReverse": true}, + {"type": "vgpe", "position": 5370, "name": "VGPE_BTS2.2", "labelReverse": true}, + {"type": "bpm", "position": 5189.7, "name": "BPM_BTS2.4", "labelReverse": true} + + + ] + }, + { + "start": {"x": 38740, "z": -13180}, + "bending": {"rotateY": "PI"}, + "chamber": {"type": "chamber"}, + "components": [ + ] + } + ], + "bpm": { + "orbitconf": "https://pwma-dev.elettra.eu/panther/updater.php?read&filename=bts.100.bpm.src", + "orbithor": "https://pwma-dev.elettra.eu/panther/updater.php?read&filename=bts.100.bpm", + "orbitver": "https://pwma-dev.elettra.eu/misc/bpm.php?orbitver&facility=bts", + "pos": "https://pwma-dev.elettra.eu/panther/updater.php?read&filename=bts.100.bpm", + "rms": "https://pwma-dev.elettra.eu/misc/bpm.php?rms&facility=bts", + "length": 10, + "offset": 9 + }, + "blm": { + "confsrc": "https://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sa/radio_protection/blmmaster_bts_a11.01(BlmConfiguration)", + "datasrc": "https://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sa/radio_protection/blmmaster_bts_a11.01/BlmData" + } + }, + "sr": { + "sections": [ + { + "start": {"x": 41320, "z": 1880}, + "bending": {"type": "dipole", "label": "show", "rotateY": "PI", "lengthIndex": 83, "name": "B_S1.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1365, "name": "Q3_S1.1"}, + {"type": "bpm", "position": 1630, "name": "BPM_S1.2"}, + {"type": "quadrupole", "position": 1995, "length": 498, "name": "Q2_S1.1"}, + {"type": "sextupole", "position": 2585, "length": 115, "name": "S1_S1.1"}, + {"type": "blm", "position": 2585, "name": "BERGOZ_S1_S1.1"}, + {"type": "quadrupole", "position": 2995, "name": "Q1_S1.1"}, + {"type": "bpm", "position": 3245, "name": "BPM_S1.3"}, + {"type": "blm", "position": 3315, "name": "BERGOZ_CHV_S1.3"}, + {"type": "tag", "position": 6241, "name": "TAG_S1.1"}, + {"type": "vlv", "position": 3900, "name": "VLVID_S1.1"}, + {"type": "blm", "position": 4050, "name": "BERGOZ_ID_S1.1"}, + {"type": "corrector", "position": 4500, "ps": ["PSCH_S1.3","PSCV_S1.3"], "name": "CHV_S1.3"}, + {"type": "undulator", "position": 5550, "name": "ID_S1.1", "offset2d": [100, -450]}, + {"type": "undulator", "position": 6950, "name": "ID_S1.2", "offset2d": [100, -450]}, + {"type": "corrector", "position": 8067, "ps": ["PSCH_S1.4","PSCV_S1.4"], "name": "CHV_S1.4"}, + {"type": "blm", "position": 8550, "name": "BERGOZ_ID_S1.2"}, + {"type": "vlv", "position": 8700, "name": "VLVSCT_S1"}, + {"type": "bpm", "position": 9237, "name": "BPM_S1.4"}, + {"type": "quadrupole", "position": 9487, "name": "Q1_S1.2"}, + {"type": "sextupole", "position": 9897, "length": 115, "name": "S1_S1.2"}, + {"type": "blm", "position": 9897, "name": "BERGOZ_S1_S1.2"}, + {"type": "quadrupole", "position": 10487, "length": 498, "name": "Q2_S1.2"}, + {"type": "bpm", "position": 10852, "name": "BPM_S1.5"}, + {"type": "quadrupole", "position": 11117, "name": "Q3_S1.2"}, + {"type": "bpm", "position": 11362, "name": "BPM_S1.6"}, + {"type": "corrector", "position": 11600, "ps": ["PSCH_S1.5","PSCV_S1.5"], "name": "CHV_S1.5"}, + {"type": "blm", "position": 11517, "name": "PHOTO_CHV_S1.5"} + ] + }, + { + "start": {"x": 38860, "z": 14100}, + "bending": {"type": "dipole", "label": "show", "rotateY": "PI", "lengthIndex": 139, "name": "B_S1.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1405, "length": 409, "name": "QF_S1.2"}, + {"type": "bpm", "position": 1725, "name": "BPM_S1.7"}, + {"type": "sextupole", "position": 1985, "name": "SF_S1.2"}, + {"type": "blm", "position": 1985, "name": "BERGOZ_SF_S1.2"}, + {"type": "corrector", "position": 2340, "ps": ["PSCH_S1.6","PSCV_S1.6"], "name": "CHV_S1.6"}, + {"type": "corrector", "position": 3714, "ps": ["PSCH_S1.7","PSCV_S1.7"], "name": "CHV_S1.7"}, + {"type": "sextupole", "position": 4059, "name": "SD_S1.1"}, + {"type": "blm", "position": 4059, "name": "BERGOZ_SD_S1.1"}, + {"type": "quadrupole", "position": 4559, "name": "QD_S1.1"}, + {"type": "bpm", "position": 4804, "name": "BPM_S1.8"}, + {"type": "sextupole", "position": 5059, "name": "SD_S1.2"}, + {"type": "blm", "position": 5059, "name": "BERGOZ_SD_S1.2"}, + {"type": "corrector", "position": 6778, "ps": ["PSCH_S2.1","PSCV_S2.1"], "name": "CHV_S2.1"}, + {"type": "sextupole", "position": 7133, "name": "SF_S2.1"}, + {"type": "blm", "position": 7133, "name": "BERGOZ_SF_S2.1"}, + {"type": "bpm", "position": 7393, "name": "BPM_S2.1"}, + {"type": "quadrupole", "position": 7713, "length": 409, "name": "QF_S2.1"}, + {"type": "corrector", "position": 8128, "ps": ["PSCH_S2.2","PSCV_S2.2"], "name": "CHV_S2.2"}, + {"type": "blm", "position": 8128, "name": "PHOTO_CHV_S2.2"} + ] + }, + { + "start": {"x": 34800, "z": 22360}, + "bending": {"type": "dipole", "label": "show", "rotateY": "PI", "lengthIndex": 189, "name": "B_S2.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1365, "name": "Q3_S2.1"}, + {"type": "bpm", "position": 1630, "name": "BPM_S2.2"}, + {"type": "quadrupole", "position": 1995, "length": 498, "name": "Q2_S2.1"}, + {"type": "sextupole", "position": 2585, "length": 115, "name": "S1_S2.1"}, + {"type": "blm", "position": 2585, "name": "BERGOZ_S1_S2.1"}, + {"type": "quadrupole", "position": 2995, "name": "Q1_S2.1"}, + {"type": "bpm", "position": 3245, "name": "BPM_S2.3"}, + {"type": "vlv", "position": 3900, "name": "VLVID_S2.1"}, + {"type": "blm", "position": 4050, "name": "BERGOZ_CHV_S2.3"}, + {"type": "corrector", "position": 4500, "ps": ["PSCH_S2.3","PSCV_S2.3"], "name": "CHV_S2.3"}, + {"type": "undulator", "position": 5550, "name": "ID_S2.1", "offset2d": [300, -300]}, + {"type": "undulator", "position": 6950, "name": "ID_S2.2", "offset2d": [300, -300]}, + {"type": "corrector", "position": 8067, "ps": ["PSCH_S2.4","PSCV_S2.4"], "name": "CHV_S2.4"}, + {"type": "vlv", "position": 8700, "name": "VLVID_S2.2"}, + {"type": "blm", "position": 8550, "name": "BERGOZ_CHV_S2.4"}, + {"type": "bpm", "position": 9237, "name": "BPM_S2.4"}, + {"type": "quadrupole", "position": 9487, "name": "Q1_S2.2"}, + {"type": "sextupole", "position": 9897, "length": 115, "name": "S1_S2.2"}, + {"type": "blm", "position": 9897, "name": "BERGOZ_S1_S2.2"}, + {"type": "quadrupole", "position": 10487, "length": 498, "name": "Q2_S2.2"}, + {"type": "bpm", "position": 10852, "name": "BPM_S2.5"}, + {"type": "quadrupole", "position": 11117, "name": "Q3_S2.2"}, + {"type": "bpm", "position": 11362, "name": "BPM_S2.6"}, + {"type": "corrector", "position": 11617, "ps": ["PSCH_S2.5","PSCV_S2.5"], "name": "CHV_S2.5"}, + {"type": "blm", "position": 11517, "name": "PHOTO_CHV_S2.5"} + ] + }, + { + "start": {"x": 26600, "z": 31660}, + "bending": {"type": "dipole", "label": "show", "rotateY": "PI", "lengthIndex": 241, "name": "B_S2.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1405, "length": 409, "name": "QF_S2.2"}, + {"type": "bpm", "position": 1725, "name": "BPM_S2.7"}, + {"type": "sextupole", "position": 1985, "name": "SF_S2.2"}, + {"type": "blm", "position": 1985, "name": "BERGOZ_SF_S2.2"}, + {"type": "corrector", "position": 2340, "ps": ["PSCH_S2.6","PSCV_S2.6"], "name": "CHV_S2.6"}, + {"type": "flsc", "position": 3231, "name": "FLSC_S2"}, + {"type": "corrector", "position": 3714, "ps": ["PSCH_S2.7","PSCV_S2.7"], "name": "CHV_S2.7"}, + {"type": "sextupole", "position": 4059, "name": "SD_S2.1"}, + {"type": "blm", "position": 4059, "name": "BERGOZ_SD_S2.1"}, + {"type": "quadrupole", "position": 4559, "name": "QD_S2.1"}, + {"type": "bpm", "position": 4804, "name": "BPM_S2.8"}, + {"type": "sextupole", "position": 5059, "name": "SD_S2.2"}, + {"type": "blm", "position": 5059, "name": "BERGOZ_SD_S2.2"}, + {"type": "vlv", "position": 5785, "name": "VLVRF_S2.1"}, + {"type": "cavity", "position": 6085.5, "name": "RF_S2.1"}, + {"type": "vlv", "position": 6485, "name": "VLVRF_S2.2"}, + {"type": "corrector", "position": 6778, "ps": ["PSCH_S3.1","PSCV_S3.1"], "name": "CHV_S3.1"}, + {"type": "sextupole", "position": 7133, "name": "SF_S3.1"}, + {"type": "blm", "position": 7133, "name": "BERGOZ_SF_S3.1"}, + {"type": "bpm", "position": 7393, "name": "BPM_S3.1"}, + {"type": "quadrupole", "position": 7713, "length": 409, "name": "QF_S3.1"}, + {"type": "corrector", "position": 8128, "ps": ["PSCH_S3.2","PSCV_S3.2"], "name": "CHV_S3.2"}, + {"type": "blm", "position": 8128, "name": "PHOTO_CHV_S3.2"} + ] + }, + { + "start": {"x": 18980, "z": 36740}, + "bending": {"type": "dipole", "label": "show", "rotateY": "PI", "lengthIndex": 295, "name": "B_S3.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1365, "name": "Q3_S3.1"}, + {"type": "bpm", "position": 1630, "name": "BPM_S3.2"}, + {"type": "quadrupole", "position": 1995, "length": 498, "name": "Q2_S3.1"}, + {"type": "sextupole", "position": 2585, "length": 115, "name": "S1_S3.1"}, + {"type": "blm", "position": 2585, "name": "BERGOZ_S1_S3.1"}, + {"type": "quadrupole", "position": 2995, "name": "Q1_S3.1"}, + {"type": "bpm", "position": 3245, "name": "BPM_S3.3"}, + {"type": "vlv", "position": 3500, "name": "VLVID_S3.1"}, + {"type": "blm", "position": 3615, "name": "BERGOZ_CHV_S3.3"}, + {"type": "corrector", "position": 3715, "ps": ["PSCH_S3.3","PSCV_S3.3"], "name": "CHV_S3.3"}, + {"type": "undulator", "position": 4800, "name": "ID_S3.1", "offset2d": [600, -200]}, + {"type": "undulator", "position": 6200, "name": "ID_S3.2", "offset2d": [600, -200]}, + {"type": "undulator", "position": 7600, "name": "ID_S3.3", "offset2d": [600, -200]}, + {"type": "blm", "position": 8550, "name": "BERGOZ_ID_S3"}, + {"type": "corrector", "position": 8600, "ps": ["PSCH_S3.4","PSCV_S3.4"], "name": "CHV_S3.4"}, + {"type": "vlv", "position": 8900, "name": "VLVSCT_S3"}, + {"type": "bpm", "position": 9237, "name": "BPM_S3.4"}, + {"type": "quadrupole", "position": 9487, "name": "Q1_S3.2"}, + {"type": "sextupole", "position": 9897, "length": 115, "name": "S1_S3.2"}, + {"type": "blm", "position": 9897, "name": "BERGOZ_S1_S3.2"}, + {"type": "quadrupole", "position": 10487, "length": 498, "name": "Q2_S3.2"}, + {"type": "bpm", "position": 10852, "name": "BPM_S3.5"}, + {"type": "quadrupole", "position": 11117, "name": "Q3_S3.2"}, + {"type": "bpm", "position": 11362, "name": "BPM_S3.6"}, + {"type": "corrector", "position": 11617, "ps": ["PSCH_S3.5","PSCV_S3.5"], "name": "CHV_S3.5"}, + {"type": "blm", "position": 11517, "name": "PHOTO_CHV_S3.5"} + ] + }, + { + "start": {"x": 7160, "z": 40700}, + "bending": {"type": "dipole", "label": "show", "rotateY": "PI", "lengthIndex": 349, "name": "B_S3.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1405, "length": 409, "name": "QF_S3.2"}, + {"type": "bpm", "position": 1725, "name": "BPM_S3.7"}, + {"type": "sextupole", "position": 1985, "name": "SF_S3.2"}, + {"type": "blm", "position": 1985, "name": "BERGOZ_SF_S3.2"}, + {"type": "corrector", "position": 2340, "ps": ["PSCH_S3.6","PSCV_S3.6"], "name": "CHV_S3.6"}, + {"type": "corrector", "position": 3714, "ps": ["PSCH_S3.7","PSCV_S3.7"], "name": "CHV_S3.7"}, + {"type": "sextupole", "position": 4059, "name": "SD_S3.1"}, + {"type": "blm", "position": 4059, "name": "BERGOZ_SD_S3.1"}, + {"type": "quadrupole", "position": 4559, "name": "QD_S3.1"}, + {"type": "bpm", "position": 4804, "name": "BPM_S3.8"}, + {"type": "sextupole", "position": 5059, "name": "SD_S3.2"}, + {"type": "blm", "position": 5059, "name": "BERGOZ_SD_S3.2"}, + {"type": "vlv", "position": 5785, "name": "VLVRF_S3.1"}, + {"type": "cavity", "position": 6085.5, "name": "RF_S3.1"}, + {"type": "vlv", "position": 6485, "name": "VLVRF_S3.2"}, + {"type": "corrector", "position": 6778, "ps": ["PSCH_S4.1","PSCV_S4.1"], "name": "CHV_S4.1"}, + {"type": "sextupole", "position": 7133, "name": "SF_S4.1"}, + {"type": "blm", "position": 7133, "name": "BERGOZ_SF_S4.1"}, + {"type": "bpm", "position": 7393, "name": "BPM_S4.1"}, + {"type": "quadrupole", "position": 7713, "length": 409, "name": "QF_S4.1"}, + {"type": "corrector", "position": 8128, "ps": ["PSCH_S4.2","PSCV_S4.2"], "name": "CHV_S4.2"}, + {"type": "blm", "position": 8128, "name": "PHOTO_CHV_S4.2"} + ] + }, + { + "start": {"x": -1960, "z": 41280}, + "bending": {"type": "dipole", "label": "show", "lengthIndex": 401, "name": "B_S4.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1365, "name": "Q3_S4.1"}, + {"type": "bpm", "position": 1630, "name": "BPM_S4.2"}, + {"type": "quadrupole", "position": 1995, "length": 498, "name": "Q2_S4.1"}, + {"type": "sextupole", "position": 2585, "length": 115, "name": "S1_S4.1"}, + {"type": "blm", "position": 2585, "name": "BERGOZ_S1_S4.1"}, + {"type": "quadrupole", "position": 2995, "name": "Q1_S4.1"}, + {"type": "bpm", "position": 3245, "name": "BPM_S4.3"}, + {"type": "vlv", "position": 3900, "name": "VLVID_S4.1"}, + {"type": "blm", "position": 4050, "name": "BERGOZ_CHV_S4.3"}, + {"type": "corrector", "position": 4500, "ps": ["PSCH_S4.3","PSCV_S4.3"], "name": "CHV_S4.3"}, + {"type": "wiggler", "position": 5550, "name": "ID_S4.1", "offset2d": [-100, 0]}, + {"type": "wiggler", "position": 6950, "name": "ID_S4.2", "offset2d": [400, 100]}, + {"type": "corrector", "position": 8067, "ps": ["PSCH_S4.4","PSCV_S4.4"], "name": "CHV_S4.4"}, + {"type": "vlv", "position": 8700, "name": "VLVID_S4.2"}, + {"type": "bpm", "position": 9237, "name": "BPM_S4.4"}, + {"type": "quadrupole", "position": 9487, "name": "Q1_S4.2"}, + {"type": "sextupole", "position": 9897, "length": 115, "name": "S1_S4.2"}, + {"type": "blm", "position": 9897, "name": "BERGOZ_S1_S4.2"}, + {"type": "quadrupole", "position": 10487, "length": 498, "name": "Q2_S4.2"}, + {"type": "bpm", "position": 10852, "name": "BPM_S4.5"}, + {"type": "quadrupole", "position": 11117, "name": "Q3_S4.2"}, + {"type": "bpm", "position": 11362, "name": "BPM_S4.6"}, + {"type": "corrector", "position": 11617, "ps": ["PSCH_S4.5","PSCV_S4.5"], "name": "CHV_S4.5"}, + {"type": "blm", "position": 11517, "name": "PHOTO_CHV_S4.5"} + ] + }, + { + "start": {"x": -14240, "z": 38840}, + "bending": {"type": "dipole", "label": "show", "lengthIndex": 453, "name": "B_S4.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1405, "length": 409, "name": "QF_S4.2"}, + {"type": "bpm", "position": 1725, "name": "BPM_S4.7"}, + {"type": "sextupole", "position": 1985, "name": "SF_S4.2"}, + {"type": "blm", "position": 1985, "name": "BERGOZ_SF_S4.2"}, + {"type": "corrector", "position": 2340, "ps": ["PSCH_S4.6","PSCV_S4.6"], "name": "CHV_S4.6"}, + {"type": "flsc", "position": 3379, "name": "FLSC_S4"}, + {"type": "corrector", "position": 3714, "ps": ["PSCH_S4.7","PSCV_S4.7"], "name": "CHV_S4.7"}, + {"type": "sextupole", "position": 4059, "name": "SD_S4.1"}, + {"type": "blm", "position": 4059, "name": "BERGOZ_SD_S4.1"}, + {"type": "quadrupole", "position": 4559, "name": "QD_S4.1"}, + {"type": "bpm", "position": 4804, "name": "BPM_S4.8"}, + {"type": "sextupole", "position": 5059, "name": "SD_S4.2"}, + {"type": "blm", "position": 5059, "name": "BERGOZ_SD_S4.2"}, + {"type": "corrector", "position": 6778, "ps": ["PSCH_S5.1","PSCV_S5.1"], "name": "CHV_S5.1"}, + {"type": "sextupole", "position": 7133, "name": "SF_S5.1"}, + {"type": "blm", "position": 7133, "name": "BERGOZ_SF_S5.1"}, + {"type": "bpm", "position": 7393, "name": "BPM_S5.1"}, + {"type": "quadrupole", "position": 7713, "length": 409, "name": "QF_S5.1"}, + {"type": "corrector", "position": 8128, "ps": ["PSCH_S5.2","PSCV_S5.2"], "name": "CHV_S5.2"}, + {"type": "blm", "position": 8128, "name": "PHOTO_CHV_S5.2"} + ] + }, + { + "start": {"x": -22320, "z": 34780}, + "bending": {"type": "dipole", "label": "show", "lengthIndex": 505, "name": "B_S5.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1365, "name": "Q3_S5.1"}, + {"type": "bpm", "position": 1630, "name": "BPM_S5.2"}, + {"type": "quadrupole", "position": 1995, "length": 498, "name": "Q2_S5.1"}, + {"type": "sextupole", "position": 2585, "length": 115, "name": "S1_S5.1"}, + {"type": "blm", "position": 2585, "name": "BERGOZ_S1_S5.1"}, + {"type": "quadrupole", "position": 2995, "name": "Q1_S5.1"}, + {"type": "bpm", "position": 3245, "name": "BPM_S5.3"}, + {"type": "vlv", "position": 3525, "name": "VLVID_S5"}, + {"type": "blm", "position": 3315, "name": "BERGOZ_CHV_S5.3"}, + {"type": "corrector", "position": 3715, "ps": ["PSCH_S5.3","PSCV_S5.3"], "name": "CHV_S5.3"}, + {"type": "undulator", "position": 4800, "name": "ID_S5.1", "offset2d": [430, 400]}, + {"type": "undulator", "position": 6200, "name": "ID_S5.2", "offset2d": [430, 400]}, + {"type": "undulator", "position": 7500, "name": "ID_S5.3", "offset2d": [430, 400]}, + {"type": "corrector", "position": 8600, "ps": ["PSCH_S5.4","PSCV_S5.4"], "name": "CHV_S5.4"}, + {"type": "blm", "position": 8800, "name": "BERGOZ_ID_S5"}, + {"type": "vlv", "position": 8900, "name": "VLVSCT_S5"}, + {"type": "bpm", "position": 9237, "name": "BPM_S5.4"}, + {"type": "quadrupole", "position": 9487, "name": "Q1_S5.2"}, + {"type": "sextupole", "position": 9897, "length": 115, "name": "S1_S5.2"}, + {"type": "blm", "position": 9897, "name": "BERGOZ_S1_S5.2"}, + {"type": "quadrupole", "position": 10487, "length": 498, "name": "Q2_S5.2"}, + {"type": "bpm", "position": 10852, "name": "BPM_S5.5"}, + {"type": "quadrupole", "position": 11117, "name": "Q3_S5.2"}, + {"type": "bpm", "position": 11362, "name": "BPM_S5.6"}, + {"type": "corrector", "position": 11617, "ps": ["PSCH_S5.5","PSCV_S5.5"], "name": "CHV_S5.5"}, + {"type": "blm", "position": 11517, "name": "PHOTO_CHV_S5.5"} + ] + }, + { + "start": {"x": -31700, "z": 26520}, + "bending": {"type": "dipole", "label": "show", "lengthIndex": 559, "name": "B_S5.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1405, "length": 409, "name": "QF_S5.2"}, + {"type": "bpm", "position": 1725, "name": "BPM_S5.7"}, + {"type": "sextupole", "position": 1985, "name": "SF_S5.2"}, + {"type": "blm", "position": 1985, "name": "BERGOZ_SF_S5.2"}, + {"type": "corrector", "position": 2340, "ps": ["PSCH_S5.6","PSCV_S5.6"], "name": "CHV_S5.6"}, + {"type": "corrector", "position": 3714, "ps": ["PSCH_S5.7","PSCV_S5.7"], "name": "CHV_S5.7"}, + {"type": "sextupole", "position": 4059, "name": "SD_S5.1"}, + {"type": "blm", "position": 4059, "name": "BERGOZ_SD_S5.1"}, + {"type": "quadrupole", "position": 4559, "name": "QD_S5.1"}, + {"type": "bpm", "position": 4804, "name": "BPM_S5.8"}, + {"type": "sextupole", "position": 5059, "name": "SD_S5.2"}, + {"type": "blm", "position": 5059, "name": "BERGOZ_SD_S5.2"}, + {"type": "scraper", "position": 6453, "name": "SCRPH_S5"}, + {"type": "corrector", "position": 6778, "ps": ["PSCH_S6.1","PSCV_S6.1"], "name": "CHV_S6.1"}, + {"type": "sextupole", "position": 7133, "name": "SF_S6.1"}, + {"type": "blm", "position": 7133, "name": "BERGOZ_SF_S6.1"}, + {"type": "bpm", "position": 7393, "name": "BPM_S6.1"}, + {"type": "quadrupole", "position": 7713, "length": 409, "name": "QF_S6.1"}, + {"type": "corrector", "position": 8128, "ps": ["PSCH_S6.2","PSCV_S6.2"], "name": "CHV_S6.2"}, + {"type": "blm", "position": 8128, "name": "PHOTO_CHV_S6.2"} + ] + }, + { + "start": {"x": -36740, "z": 18900}, + "bending": {"type": "dipole", "label": "show", "lengthIndex": 611, "name": "B_S6.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1365, "name": "Q3_S6.1"}, + {"type": "bpm", "position": 1630, "name": "BPM_S6.2"}, + {"type": "quadrupole", "position": 1995, "length": 498, "name": "Q2_S6.1"}, + {"type": "corrector", "position": 2373, "ps": ["PSCH_S6.8","PSCV_S6.8"], "name": "CHV_S6.8"}, + {"type": "sextupole", "position": 2585, "length": 115, "name": "S1_S6.1"}, + {"type": "blm", "position": 2585, "name": "BERGOZ_S1_S6.1"}, + {"type": "quadrupole", "position": 2995, "name": "Q1_S6.1"}, + {"type": "bpm", "position": 3245, "name": "BPM_S6.3"}, + {"type": "vlv", "position": 3500, "name": "VLVID_S6.1"}, + {"type": "blm", "position": 3615, "name": "BERGOZ_CHVV_S6.3"}, + {"type": "corrector", "position": 3715, "ps": ["PSCH_S6.3","PSCV_S6.3"], "name": "CHV_S6.3"}, + {"type": "undulator", "position": 4800, "name": "ID_S6.1", "offset2d": [160, 500]}, + {"type": "undulator", "position": 6200, "name": "ID_S6.2", "offset2d": [160, 500]}, + {"type": "undulator", "position": 7600, "name": "ID_S6.3", "offset2d": [160, 500]}, + {"type": "corrector", "position": 8600, "ps": ["PSCH_S6.4","PSCV_S6.4"], "name": "CHV_S6.4"}, + {"type": "blm", "position": 8800, "name": "BERGOZ_ID_S6"}, + {"type": "vlv", "position": 8900, "name": "VLVID_S6.2"}, + {"type": "bpm", "position": 9237, "name": "BPM_S6.4"}, + {"type": "quadrupole", "position": 9487, "name": "Q1_S6.2"}, + {"type": "sextupole", "position": 9897, "length": 115, "name": "S1_S6.2"}, + {"type": "blm", "position": 9897, "name": "BERGOZ_S1_S6.2"}, + {"type": "quadrupole", "position": 10487, "length": 498, "name": "Q2_S6.2"}, + {"type": "bpm", "position": 10852, "name": "BPM_S6.5"}, + {"type": "quadrupole", "position": 11117, "name": "Q3_S6.2"}, + {"type": "bpm", "position": 11362, "name": "BPM_S6.6"}, + {"type": "corrector", "position": 11617, "ps": ["PSCH_S6.5","PSCV_S6.5"], "name": "CHV_S6.5"}, + {"type": "blm", "position": 11517, "name": "PHOTO_CHV_S6.5"} + ] + }, + { + "start": {"x": -40720, "z": 7000}, + "bending": {"type": "dipole", "label": "show", "lengthIndex": 667, "name": "B_S6.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1405, "length": 409, "name": "QF_S6.2"}, + {"type": "bpm", "position": 1725, "name": "BPM_S6.7"}, + {"type": "sextupole", "position": 1985, "name": "SF_S6.2"}, + {"type": "blm", "position": 1985, "name": "BERGOZ_SF_S6.2"}, + {"type": "corrector", "position": 2340, "ps": ["PSCH_S6.6","PSCV_S6.6"], "name": "CHV_S6.6"}, + {"type": "flsc", "position": 3379, "name": "FLSC_S6"}, + {"type": "corrector", "position": 3714, "ps": ["PSCH_S6.7","PSCV_S6.7"], "name": "CHV_S6.7"}, + {"type": "sextupole", "position": 4059, "name": "SD_S6.1"}, + {"type": "blm", "position": 4059, "name": "BERGOZ_SD_S6.1"}, + {"type": "quadrupole", "position": 4559, "name": "QD_S6.1"}, + {"type": "bpm", "position": 4804, "name": "BPM_S6.8"}, + {"type": "sextupole", "position": 5059, "name": "SD_S6.2"}, + {"type": "blm", "position": 5059, "name": "BERGOZ_SD_S6.2"}, + {"type": "corrector", "position": 6778, "ps": ["PSCH_S7.1","PSCV_S7.1"], "name": "CHV_S7.1"}, + {"type": "sextupole", "position": 7133, "name": "SF_S7.1"}, + {"type": "blm", "position": 7133, "name": "BERGOZ_SF_S7.1"}, + {"type": "bpm", "position": 7393, "name": "BPM_S7.1"}, + {"type": "quadrupole", "position": 7713, "length": 409, "name": "QF_S7.1"}, + {"type": "corrector", "position": 8128, "ps": ["PSCH_S7.2","PSCV_S7.2"], "name": "CHV_S7.2"}, + {"type": "blm", "position": 8128, "name": "PHOTO_CHV_S7.2"} + ] + }, + { + "start": {"x": -41280, "z": -2000}, + "bending": {"type": "dipole", "label": "show", "lengthIndex": 719, "name": "B_S7.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1365, "name": "Q3_S7.1"}, + {"type": "bpm", "position": 1630, "name": "BPM_S7.2"}, + {"type": "quadrupole", "position": 1995, "length": 498, "name": "Q2_S7.1"}, + {"type": "corrector", "position": 2373, "ps": ["PSCH_S7.8","PSCV_S7.8"], "name": "CHV_S7.8"}, + {"type": "sextupole", "position": 2585, "length": 115, "name": "S1_S7.1"}, + {"type": "blm", "position": 2585, "name": "BERGOZ_S1_S7.1"}, + {"type": "quadrupole", "position": 2995, "name": "Q1_S7.1"}, + {"type": "bpm", "position": 3245, "name": "BPM_S7.3"}, + {"type": "vlv", "position": 3900, "name": "VLVID_S7"}, + {"type": "blm", "position": 4050, "name": "BERGOZ_CHV_S7.3"}, + {"type": "corrector", "position": 4500, "ps": ["PSCH_S7.3","PSCV_S7.3"], "name": "CHV_S7.3"}, + {"type": "undulator", "position": 5550, "name": "ID_S7.1", "offset2d": [-70, 300]}, + {"type": "undulator", "position": 6950, "name": "ID_S7.2", "offset2d": [-70, 300]}, + {"type": "corrector", "position": 8067, "ps": ["PSCH_S7.4","PSCV_S7.4"], "name": "CHV_S7.4"}, + {"type": "blm", "position": 8550, "name": "BERGOZ_ID_S7"}, + {"type": "vlv", "position": 8700, "name": "VLVSCT_S7"}, + {"type": "bpm", "position": 9237, "name": "BPM_S7.4"}, + {"type": "quadrupole", "position": 9487, "name": "Q1_S7.2"}, + {"type": "sextupole", "position": 9897, "length": 115, "name": "S1_S7.2"}, + {"type": "blm", "position": 9897, "name": "BERGOZ_S1_S7.2"}, + {"type": "quadrupole", "position": 10487, "length": 498, "name": "Q2_S7.2"}, + {"type": "bpm", "position": 10852, "name": "BPM_S7.5"}, + {"type": "quadrupole", "position": 11117, "name": "Q3_S7.2"}, + {"type": "bpm", "position": 11362, "name": "BPM_S7.6"}, + {"type": "corrector", "position": 11617, "ps": ["PSCH_S7.5","PSCV_S7.5"], "name": "CHV_S7.5"}, + {"type": "blm", "position": 11517, "name": "PHOTO_CHV_S7.5"} + ] + }, + { + "start": {"x": -38800, "z": -14260}, + "bending": {"type": "dipole", "label": "show", "lengthIndex": 773, "name": "B_S7.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1405, "length": 409, "name": "QF_S7.2"}, + {"type": "bpm", "position": 1725, "name": "BPM_S7.7"}, + {"type": "sextupole", "position": 1985, "name": "SF_S7.2"}, + {"type": "blm", "position": 1985, "name": "BERGOZ_SF_S7.2"}, + {"type": "corrector", "position": 2340, "ps": ["PSCH_S7.6","PSCV_S7.6"], "name": "CHV_S7.6"}, + {"type": "lmbf", "position": 3000, "name": "LMBF"}, + {"type": "corrector", "position": 3714, "ps": ["PSCH_S7.7","PSCV_S7.7"], "name": "CHV_S7.7"}, + {"type": "sextupole", "position": 4059, "name": "SD_S7.1"}, + {"type": "blm", "position": 4059, "name": "BERGOZ_SD_S7.1"}, + {"type": "quadrupole", "position": 4559, "name": "QD_S7.1"}, + {"type": "bpm", "position": 4804, "name": "BPM_S7.8"}, + {"type": "sextupole", "position": 5059, "name": "SD_S7.2"}, + {"type": "blm", "position": 5059, "name": "BERGOZ_SD_S7.2"}, + {"type": "tmbf", "position": 6000, "name": "TMBF"}, + {"type": "corrector", "position": 6778, "ps": ["PSCH_S8.1","PSCV_S8.1"], "name": "CHV_S8.1"}, + {"type": "sextupole", "position": 7133, "name": "SF_S8.1"}, + {"type": "blm", "position": 7133, "name": "BERGOZ_SF_S8.1"}, + {"type": "bpm", "position": 7393, "name": "BPM_S8.1"}, + {"type": "quadrupole", "position": 7713, "length": 409, "name": "QF_S8.1"}, + {"type": "corrector", "position": 8128, "ps": ["PSCH_S8.2","PSCV_S8.2"], "name": "CHV_S8.2"}, + {"type": "blm", "position": 8128, "name": "PHOTO_CHV_S8.2"} + ] + }, + { + "start": {"x": -34720, "z": -22480}, + "bending": {"type": "dipole", "label": "show", "lengthIndex": 823, "name": "B_S8.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1365, "name": "Q3_S8.1"}, + {"type": "bpm", "position": 1630, "name": "BPM_S8.2"}, + {"type": "quadrupole", "position": 1995, "length": 498, "name": "Q2_S8.1"}, + {"type": "corrector", "position": 2373, "ps": ["PSCH_S8.8","PSCV_S8.8"], "name": "CHV_S8.8"}, + {"type": "sextupole", "position": 2585, "length": 115, "name": "S1_S8.1"}, + {"type": "blm", "position": 2585, "name": "BERGOZ_S1_S8.1"}, + {"type": "quadrupole", "position": 2995, "name": "Q1_S8.1"}, + {"type": "bpm", "position": 3245, "name": "BPM_S8.3"}, + {"type": "vlv", "position": 3900, "name": "VLVID_S8.1"}, + {"type": "blm", "position": 4050, "name": "BERGOZ_CHV_S8.3"}, + {"type": "corrector", "position": 4500, "ps": ["PSCH_S8.3","PSCV_S8.3"], "name": "CHV_S8.3"}, + {"type": "undulator", "position": 5550, "name": "ID_S8.1", "offset2d": [-350, 400]}, + {"type": "undulator", "position": 6950, "name": "ID_S8.2", "offset2d": [-350, 400]}, + {"type": "corrector", "position": 8067, "ps": ["PSCH_S8.4","PSCV_S8.4"], "name": "CHV_S8.4"}, + {"type": "blm", "position": 8550, "name": "BERGOZ_ID_S8"}, + {"type": "vlv", "position": 8700, "name": "VLVID_S8.2"}, + {"type": "bpm", "position": 9237, "name": "BPM_S8.4"}, + {"type": "quadrupole", "position": 9487, "name": "Q1_S8.2"}, + {"type": "sextupole", "position": 9897, "length": 115, "name": "S1_S8.2"}, + {"type": "blm", "position": 9897, "name": "BERGOZ_S1_S8.2"}, + {"type": "quadrupole", "position": 10487, "length": 498, "name": "Q2_S8.2"}, + {"type": "bpm", "position": 10852, "name": "BPM_S8.5"}, + {"type": "quadrupole", "position": 11117, "name": "Q3_S8.2"}, + {"type": "bpm", "position": 11362, "name": "BPM_S8.6"}, + {"type": "corrector", "position": 11617, "ps": ["PSCH_S8.5","PSCV_S8.5"], "name": "CHV_S8.5"}, + {"type": "blm", "position": 11517, "name": "PHOTO_CHV_S8.5"} + ] + }, + { + "start": {"x": -26460, "z": -31820}, + "bending": {"type": "dipole", "label": "show", "lengthIndex": 878, "name": "B_S8.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1405, "length": 409, "name": "QF_S8.2"}, + {"type": "bpm", "position": 1725, "name": "BPM_S8.7"}, + {"type": "sextupole", "position": 1985, "name": "SF_S8.2"}, + {"type": "blm", "position": 1985, "name": "BERGOZ_SF_S8.2"}, + {"type": "corrector", "position": 2340, "ps": ["PSCH_S8.6","PSCV_S8.6"], "name": "CHV_S8.6"}, + {"type": "flsc", "position": 3231, "name": "FLSC_S8"}, + {"type": "corrector", "position": 3714, "ps": ["PSCH_S8.7","PSCV_S8.7"], "name": "CHV_S8.7"}, + {"type": "sextupole", "position": 4059, "name": "SD_S8.1"}, + {"type": "blm", "position": 4059, "name": "BERGOZ_SD_S8.1"}, + {"type": "quadrupole", "position": 4559, "name": "QD_S8.1"}, + {"type": "bpm", "position": 4804, "name": "BPM_S8.8"}, + {"type": "sextupole", "position": 5059, "name": "SD_S8.2"}, + {"type": "blm", "position": 5059, "name": "BERGOZ_SD_S8.2"}, + {"type": "vlv_notfound", "position": 5785, "name": "VLVRF_S8.1"}, + {"type": "cavity", "position": 6085.5, "name": "RF_S8.1"}, + {"type": "vlv_notfound", "position": 6485, "name": "VLVRF_S8.2"}, + {"type": "corrector", "position": 6778, "ps": ["PSCH_S9.1","PSCV_S9.1"], "name": "CHV_S9.1"}, + {"type": "sextupole", "position": 7133, "name": "SF_S9.1"}, + {"type": "blm", "position": 7133, "name": "BERGOZ_SF_S9.1"}, + {"type": "bpm", "position": 7393, "name": "BPM_S9.1"}, + {"type": "quadrupole", "position": 7713, "length": 409, "name": "QF_S9.1"}, + {"type": "corrector", "position": 8128, "ps": ["PSCH_S9.2","PSCV_S9.2"], "name": "CHV_S9.2"}, + {"type": "blm", "position": 8128, "name": "PHOTO_CHV_S9.2"} + ] + }, + { + "start": {"x": -18940, "z": -36840}, + "bending": {"type": "dipole", "label": "show", "lengthIndex": 932, "name": "B_S9.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1365, "name": "Q3_S9.1"}, + {"type": "bpm", "position": 1630, "name": "BPM_S9.2"}, + {"type": "quadrupole", "position": 1995, "length": 498, "name": "Q2_S9.1"}, + {"type": "corrector", "position": 2373, "ps": ["PSCH_S9.8","PSCV_S9.8"], "name": "CHV_S9.8"}, + {"type": "sextupole", "position": 2585, "length": 115, "name": "S1_S9.1"}, + {"type": "blm", "position": 2585, "name": "BERGOZ_S1_S9.1"}, + {"type": "quadrupole", "position": 2995, "name": "Q1_S9.1"}, + {"type": "bpm", "position": 3245, "name": "BPM_S9.3"}, + {"type": "vlv", "position": 3900, "name": "VLVID_S9"}, + {"type": "blm", "position": 4050, "name": "BERGOZ_CHV_S9.3"}, + {"type": "corrector", "position": 4500, "ps": ["PSCH_S9.3","PSCV_S9.3"], "name": "CHV_S9.3"}, + {"type": "undulator", "position": 5550, "name": "ID_S9.1", "offset2d": [-400, 150]}, + {"type": "undulator", "position": 6950, "name": "ID_S9.2", "offset2d": [-400, 150]}, + {"type": "corrector", "position": 8067, "ps": ["PSCH_S9.4","PSCV_S9.4"], "name": "CHV_S9.4"}, + {"type": "blm", "position": 8550, "name": "BERGOZ_ID_S9"}, + {"type": "vlv", "position": 8700, "name": "VLVSCT_S9"}, + {"type": "bpm", "position": 9237, "name": "BPM_S9.4"}, + {"type": "quadrupole", "position": 9487, "name": "Q1_S9.2"}, + {"type": "sextupole", "position": 9897, "length": 115, "name": "S1_S9.2"}, + {"type": "blm", "position": 9897, "name": "BERGOZ_S1_S9.2"}, + {"type": "quadrupole", "position": 10487, "length": 498, "name": "Q2_S9.2"}, + {"type": "bpm", "position": 10852, "name": "BPM_S9.5"}, + {"type": "quadrupole", "position": 11117, "name": "Q3_S9.2"}, + {"type": "bpm", "position": 11362, "name": "BPM_S9.6"}, + {"type": "corrector", "position": 11617, "ps": ["PSCH_S9.5","PSCV_S9.5"], "name": "CHV_S9.5"}, + {"type": "blm", "position": 11517, "name": "PHOTO_CHV_S9.5"} + ] + }, + { + "start": {"x": -7120, "z": -40800}, + "bending": {"type": "dipole", "label": "show", "lengthIndex": 993, "name": "B_S9.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1405, "length": 409, "name": "QF_S9.2"}, + {"type": "bpm", "position": 1725, "name": "BPM_S9.7"}, + {"type": "sextupole", "position": 1985, "name": "SF_S9.2"}, + {"type": "blm", "position": 1985, "name": "BERGOZ_SF_S9.2"}, + {"type": "corrector", "position": 2340, "ps": ["PSCH_S9.6","PSCV_S9.6"], "name": "CHV_S9.6"}, + {"type": "corrector", "position": 3714, "ps": ["PSCH_S9.7","PSCV_S9.7"], "name": "CHV_S9.7"}, + {"type": "sextupole", "position": 4059, "name": "SD_S9.1"}, + {"type": "blm", "position": 4059, "name": "BERGOZ_SD_S9.1"}, + {"type": "quadrupole", "position": 4559, "name": "QD_S9.1"}, + {"type": "bpm", "position": 4804, "name": "BPM_S9.8"}, + {"type": "sextupole", "position": 5059, "name": "SD_S9.2"}, + {"type": "blm", "position": 5059, "name": "BERGOZ_SD_S9.2"}, + {"type": "vlv", "position": 5785, "name": "VLVRF_S9.1"}, + {"type": "cavity", "position": 6085.5, "name": "RF_S9.1"}, + {"type": "vlv", "position": 6485, "name": "VLVRF_S9.2"}, + {"type": "corrector", "position": 6778, "ps": ["PSCH_S10.1","PSCV_S10.1"], "name": "CHV_S10.1"}, + {"type": "sextupole", "position": 7133, "name": "SF_S10.1"}, + {"type": "blm", "position": 7133, "name": "BERGOZ_SF_S10.1"}, + {"type": "bpm", "position": 7393, "name": "BPM_S10.1"}, + {"type": "quadrupole", "position": 7713, "length": 409, "name": "QF_S10.1"}, + {"type": "corrector", "position": 8128, "ps": ["PSCH_S10.2","PSCV_S10.2"], "name": "CHV_S10.2"}, + {"type": "blm", "position": 8128, "name": "PHOTO_CHV_S10.2"} + ] + }, + { + "start": {"x": 1960, "z": -41400}, + "bending": {"type": "dipole", "label": "show", "rotateY": "-PI/2", "lengthIndex": 1045, "name": "B_S10.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1365, "name": "Q3_S10.1"}, + {"type": "bpm", "position": 1630, "name": "BPM_S10.2"}, + {"type": "quadrupole", "position": 1995, "length": 498, "name": "Q2_S10.1"}, + {"type": "corrector", "position": 2373, "ps": ["PSCH_S10.8","PSCV_S10.8"], "name": "CHV_S10.8"}, + {"type": "sextupole", "position": 2585, "length": 115, "name": "S1_S10.1"}, + {"type": "blm", "position": 2585, "name": "BERGOZ_S1_S10.1"}, + {"type": "quadrupole", "position": 2995, "name": "Q1_S10.1"}, + {"type": "bpm", "position": 3245, "name": "BPM_S10.3"}, + {"type": "vlv", "position": 3900, "name": "VLVID_S10.1"}, + {"type": "blm", "position": 4050, "name": "BERGOZ_CHV_S10.3"}, + {"type": "corrector", "position": 4500, "ps": ["PSCH_S10.3","PSCV_S10.3"], "name": "CHV_S10.3"}, + {"type": "undulator", "position": 5550, "name": "ID_S10.1", "offset2d": [-400, -100]}, + {"type": "tag", "position": 6241, "name": "TAG_S10.1"}, + {"type": "undulator", "position": 6950, "name": "ID_S10,2", "offset2d": [-400, -100]}, + {"type": "corrector", "position": 8067, "ps": ["PSCH_S10.4","PSCV_S10.4"], "name": "CHV_S10.4"}, + {"type": "blm", "position": 8550, "name": "BERGOZ_ID_S10"}, + {"type": "vlv", "position": 8700, "name": "VLVID_S10.2"}, + {"type": "bpm", "position": 9237, "name": "BPM_S10.4"}, + {"type": "quadrupole", "position": 9487, "name": "Q1_S10.2"}, + {"type": "sextupole", "position": 9897, "length": 115, "name": "S1_S10.2"}, + {"type": "blm", "position": 9897, "name": "BERGOZ_S1_S10.2"}, + {"type": "quadrupole", "position": 10487, "length": 498, "name": "Q2_S10.2"}, + {"type": "bpm", "position": 10852, "name": "BPM_S10.5"}, + {"type": "quadrupole", "position": 11117, "name": "Q3_S10.2"}, + {"type": "bpm", "position": 11362, "name": "BPM_S10.6"}, + {"type": "corrector", "position": 11617, "ps": ["PSCH_S10.5","PSCV_S10.5"], "name": "CHV_S10.5"}, + {"type": "blm", "position": 11517, "name": "PHOTO_CHV_S10.5"} + ] + }, + { + "start": {"x": 14160, "z": -38960}, + "bending": {"type": "dipole", "label": "show", "rotateY": "PI", "lengthIndex": 1099, "name": "B_S10.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1405, "length": 409, "name": "QF_S10.2"}, + {"type": "bpm", "position": 1725, "name": "BPM_S10.7"}, + {"type": "sextupole", "position": 1985, "name": "SF_S10.2"}, + {"type": "blm", "position": 1985, "name": "BERGOZ_SF_S10.2"}, + {"type": "corrector", "position": 2340, "ps": ["PSCH_S10.6","PSCV_S10.6"], "name": "CHV_S10.6"}, + {"type": "flsc", "position": 3379, "name": "FLSC_S10"}, + {"type": "corrector", "position": 3714, "ps": ["PSCH_S10.7","PSCV_S10.7"], "name": "CHV_S10.7"}, + {"type": "sextupole", "position": 4059, "name": "SD_S10.1"}, + {"type": "blm", "position": 4059, "name": "BERGOZ_SD_S10.1"}, + {"type": "quadrupole", "position": 4559, "name": "QD_S10.1"}, + {"type": "bpm", "position": 4804, "name": "BPM_S10.8"}, + {"type": "sextupole", "position": 5059, "name": "SD_S10.2"}, + {"type": "blm", "position": 5059, "name": "BERGOZ_SD_S10.2"}, + {"type": "corrector", "position": 6778, "ps": ["PSCH_S11.1","PSCV_S11.1"], "name": "CHV_S11.1"}, + {"type": "sextupole", "position": 7133, "name": "SF_S11.1"}, + {"type": "blm", "position": 7133, "name": "BERGOZ_SF_S11.1"}, + {"type": "bpm", "position": 7393, "name": "BPM_S11.1"}, + {"type": "quadrupole", "position": 7713, "length": 409, "name": "QF_S11.1"}, + {"type": "corrector", "position": 8128, "ps": ["PSCH_S11.2","PSCV_S11.2"], "name": "CHV_S11.2"}, + {"type": "blm", "position": 8128, "name": "PHOTO_CHV_S11.2"} + ] + }, + { + "start": {"x": 22360, "z": -34900}, + "bending": {"type": "dipole", "label": "show", "rotateY": "PI", "lengthIndex": 1151, "name": "B_S11.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1365, "name": "Q3_S11.1"}, + {"type": "bpm", "position": 1630, "name": "BPM_S11.2"}, + {"type": "quadrupole", "position": 1995, "length": 498, "name": "Q2_S11.1"}, + {"type": "corrector", "position": 2373, "ps": ["PSCH_S11.8","PSCV_S11.8"], "name": "CHV_S11.8"}, + {"type": "sextupole", "position": 2585, "length": 115, "name": "S1_S11.1"}, + {"type": "blm", "position": 2585, "name": "BERGOZ_S1_S11.1"}, + {"type": "quadrupole", "position": 2995, "name": "Q1_S11.1"}, + {"type": "blm", "position": 2995, "name": "BERGOZ_Q1_S11.1"}, + {"type": "bpm", "position": 3245, "name": "BPM_S11.3"}, + {"type": "vlv", "position": 3555, "name": "VLV3HC_S11.1"}, + {"type": "corrector", "position": 3815, "ps": ["PSCH_S11.3","PSCV_S11.3"], "name": "CHV_S11.3"}, + {"type": "cavity_3hc", "position": 4700, "name": "3HC_S11.1", "offset2d": [-100, -500]}, + {"type": "vlv", "position": 5505, "name": "VLV3HC_S11.2"}, + {"type": "blm", "position": 8600, "name": "BERGOZ_SCRV_S11.1"}, + {"type": "tag", "position": 6241, "name": "TAG_S11.1"}, + {"type": "scw", "position": 6900, "name": "SCW_S11", "offset2d": [-400, -700]}, + {"type": "corrector", "position": 8100, "ps": ["PSCH_S11.4","PSCV_S11.4"], "name": "CHV_S11.4"}, + {"type": "blm", "position": 8600, "name": "BERGOZ_SCW_S11_UP"}, + {"type": "blm", "position": 8600, "name": "BERGOZ_SCW_S11_DOWN"}, + {"type": "vlv", "position": 8767, "name": "VLVSCT_S11"}, + {"type": "bpm", "position": 9237, "name": "BPM_S11.4"}, + {"type": "quadrupole", "position": 9487, "name": "Q1_S11.2"}, + {"type": "sextupole", "position": 9897, "length": 115, "name": "S1_S11.2"}, + {"type": "quadrupole", "position": 10487, "length": 498, "name": "Q2_S11.2"}, + {"type": "bpm", "position": 10852, "name": "BPM_S11.5"}, + {"type": "quadrupole", "position": 11117, "name": "Q3_S11.2"}, + {"type": "bpm", "position": 11362, "name": "BPM_S11.6"}, + {"type": "corrector", "position": 11607, "ps": ["PSCH_S11.5","PSCV_S11.5"], "name": "CHV_S11.5"}, + {"type": "blm", "position": 11517, "name": "PHOTO_CHV_S11.5"} + ] + }, + { + "start": {"x": 31720, "z": -26640}, + "bending": {"type": "dipole", "label": "show", "rotateY": "PI", "lengthIndex": 1207, "name": "B_S11.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1405, "length": 409, "name": "QF_S11.2"}, + {"type": "bpm", "position": 1725, "name": "BPM_S11.7"}, + {"type": "sextupole", "position": 1985, "name": "SF_S11.2"}, + {"type": "blm", "position": 1985, "name": "BERGOZ_SF_S11.2"}, + {"type": "corrector", "position": 2340, "ps": ["PSCH_S11.6","PSCV_S11.6"], "name": "CHV_S11.6"}, + {"type": "scraper", "position": 3067, "name": "SCRPV_S11"}, + {"type": "scraper", "position": 3267, "name": "SCRPH_S11"}, + {"type": "corrector", "position": 3714, "ps": ["PSCH_S11.7","PSCV_S11.7"], "name": "CHV_S11.7"}, + {"type": "sextupole", "position": 4059, "name": "SD_S11.1"}, + {"type": "quadrupole", "position": 4559, "name": "QD_S11.1"}, + {"type": "bpm", "position": 4804, "name": "BPM_S11.8"}, + {"type": "sextupole", "position": 5059, "name": "SD_S11.2"}, + {"type": "blm", "position": 5059, "name": "BERGOZ_SD_S11.2"}, + {"type": "corrector", "position": 6700, "ps": ["PSCH_S12.1","PSCV_S12.1"], "name": "CHV_S12.1"}, + {"type": "sextupole", "position": 7133, "name": "SF_S12.1"}, + {"type": "blm", "position": 7133, "name": "BERGOZ_SF_S12.1"}, + {"type": "bpm", "position": 7393, "name": "BPM_S12.1"}, + {"type": "quadrupole", "position": 7713, "length": 409, "name": "QF_S12.1"}, + {"type": "corrector", "position": 8128, "ps": ["PSCH_S12.2","PSCV_S12.2"], "name": "CHV_S12.2"}, + {"type": "blm", "position": 8128, "name": "PHOTO_CHV_S12.2"} + ] + }, + { + "start": {"x": 36760, "z": -19040}, + "bending": {"type": "dipole", "label": "show", "rotateY": "PI", "lengthIndex": 1257, "name": "B_S12.1"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1065, "name": "Q3_S12.1"}, + {"type": "bpm", "position": 1330, "name": "BPM_S12.2"}, + {"type": "quadrupole", "position": 1695, "length": 498, "name": "Q2_S12.1"}, + {"type": "sextupole", "position": 2285, "length": 115, "name": "S1_S12.1"}, + {"type": "blm", "position": 2285, "name": "BERGOZ_S1_S12.1"}, + {"type": "quadrupole", "position": 2695, "name": "Q1_S12.1"}, + {"type": "bpm", "position": 2993.784, "name": "BPM_S12.3"}, + {"type": "kicker", "position": 3755, "name": "KICKER_S12.1"}, + {"type": "vlv", "position": 4235, "name": "VLVINJ_S12.1"}, + {"type": "kicker", "position": 4696, "name": "KICKER_S12.2"}, + {"type": "flsc", "position": 5236, "name": "FLSC_S12.1"}, + {"type": "spte", "position": 6100, "length": 1600, "offset3d": [0, 0, 150], "ps": ["SISR_BTS2.1","SISR_BTS2.2"],"name": "SISR_BTS2.1 - 2.2", "name2": "SE_S12.1 - 12.2"}, + {"type": "flsc", "position": 7221, "name": "FLSC_S12.2"}, + {"type": "kicker", "position": 7786, "name": "KICKER_S12.3"}, + {"type": "vlv", "position": 8268, "name": "VLVINJ_S12.2"}, + {"type": "kicker", "position": 8727, "name": "KICKER_S12.4"}, + {"type": "bpm", "position": 9388, "name": "BPM_S12.4"}, + {"type": "quadrupole", "position": 9587, "name": "Q1_S12.2"}, + {"type": "sextupole", "position": 9997, "length": 115, "name": "S1_S12.2"}, + {"type": "blm", "position": 9997, "name": "BERGOZ_S1_S12.2"}, + {"type": "quadrupole", "position": 10587, "length": 498, "name": "Q2_S12.2"}, + {"type": "bpm", "position": 10952, "name": "BPM_S12.5"}, + {"type": "quadrupole", "position": 11217, "name": "Q3_S12.2"}, + {"type": "bpm", "position": 11462, "name": "BPM_S12.6"}, + {"type": "corrector", "position": 11651, "ps": ["PSCH_S12.5","PSCV_S12.5"], "name": "CHV_S12.5"}, + {"type": "blm", "position": 11517, "name": "PHOTO_CHV_S12.5"}, + {"type": "srpm", "position": 11757.55, "name": "SRPM_E12"} + ] + }, + { + "start": {"x": 40740, "z": -7180}, + "bending": {"type": "dipole", "label": "show", "rotateY": "PI", "lengthIndex": 33, "name": "B_S12.2"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "quadrupole", "position": 1405, "length": 409, "name": "QF_S12.2"}, + {"type": "bpm", "position": 1725, "name": "BPM_S12.7"}, + {"type": "sextupole", "position": 1985, "name": "SF_S12.2"}, + {"type": "blm", "position": 1985, "name": "BERGOZ_SF_S12.2"}, + {"type": "corrector", "position": 2340, "ps": ["PSCH_S12.6","PSCV_S12.6"], "name": "CHV_S12.6"}, + {"type": "bst", "position": 2940, "name": "BST_S12.3"}, + {"type": "corrector", "position": 3714, "ps": ["PSCH_S12.7","PSCV_S12.7"], "name": "CHV_S12.7"}, + {"type": "sextupole", "position": 4059, "name": "SD_S12.1"}, + {"type": "blm", "position": 4059, "name": "BERGOZ_SD_S12.1"}, + {"type": "quadrupole", "position": 4559, "name": "QD_S12.1"}, + {"type": "bpm", "position": 4804, "name": "BPM_S12.8"}, + {"type": "sextupole", "position": 5059, "name": "SD_S12.2"}, + {"type": "blm", "position": 5059, "name": "BERGOZ_SD_S12.2"}, + {"type": "blm", "position": 5200, "name": "BERGOZ_MINI_ID_S12.1"}, + {"type": "miniundulator", "position": 6000, "length": 700, "offset2d": [0, -170], "name": "MINI_ID_S12.1"}, + {"type": "corrector", "position": 6778, "ps": ["PSCH_S1.1","PSCV_S1.1"], "name": "CHV_S1.1"}, + {"type": "sextupole", "position": 7133, "name": "SF_S1.1"}, + {"type": "blm", "position": 7133, "name": "BERGOZ_SF_S1.1"}, + {"type": "bpm", "position": 7393, "name": "BPM_S1.1"}, + {"type": "quadrupole", "position": 7713, "length": 409, "name": "QF_S1.1"}, + {"type": "corrector", "position": 8128, "ps": ["PSCH_S1.2","PSCV_S1.2"], "name": "CHV_S1.2"}, + {"type": "blm", "position": 8128, "name": "PHOTO_CHV_S1.2"} + ] + } + ], + "blm": { + "confsrc": "https://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/ecrada11/blmmaster/sr(BlmConfiguration)", + "datasrc": "https://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/ecrada11/blmmaster/sr/BlmBergoz", + "skip": "PHOTO" + }, + "bpm": { + "orbitconf": "https://pwma-dev.elettra.eu/panther/updater.php?read&filename=sr.100.bpm.src", + "orbithor": "https://pwma-dev.elettra.eu/panther/updater.php?read&filename=sr.100.bpm", + "orbitver": "srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/feedback/profile_s/OrbitVerFast", + "relorbithor": "srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/feedback/profile_s/RelativeOrbitHorFast", + "relorbitver": "srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/feedback/profile_s/RelativeOrbitVerFast", + "corrconf": "srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/feedback/profile_s->GetSrCorrNames", + "corrhor": "srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/feedback/profile_s/CorrHorFast", + "corrver": "srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/feedback/profile_s/CorrVerFast", + "pos": "https://pwma-dev.elettra.eu/panther/updater.php?read&filename=sr.100.bpm", + "rms": "https://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/DIAGNOSTICS/bpm_s/HorMeanRms;srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/DIAGNOSTICS/bpm_s/VertMeanRms", + "length": 95, + "offset": 30, + "skip": ["LGBPM_S2.1","LGBPM_S2.2","BPM_S7.6","LGBPM_S7.1","LGBPM_S7.2"] + }, + "envelope": { + "src": "https://pwma-dev.elettra.eu/misc/threejs/envelope.php", + "src2": "https://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-ctrl-01:20000/at/test/0/sigma_x;srv-tango-ctrl-01:20000/at/test/0/sigma_y", + "length": [55,0,235,300,0,300,541,300,0,300,261.216,0,68.784,260,222.5,0,115,0,283.5,498,116,0,135,260,115,0,55,100,0,0,100,140.55,0,1448.9,476.05,409,115.5,0,145,0,230,0,140,100,0,0,100,1174,100,0,0,100,130,0,230,0,255,260,115,0,140,0,230,0,1504,100,0,0,100,140,0,230,0,145,0,115.5,409,110.5,100,0,0,100,165.55,1448.9,510.55,260,135,0,116,498,63,66,66,88.5,0,115,0,222.5,260,120,0,370,100,0,0,100,86.4,2007.2,332.4,0,332.4,2007.2,86.4,100,0,0,100,370,0,120,260,222.5,0,115,0,283.5,498,116,0,135,260,115,0,55,100,0,0,100,140.55,1448.9,476.05,409,115.5,0,145,0,230,0,140,100,0,0,100,1174,100,0,0,100,130,0,230,0,255,260,115,0,140,0,230,0,1504,100,0,0,100,140,0,230,0,145,0,115.5,409,110.5,100,0,0,100,165.55,1448.9,510.55,260,135,0,116,498,63,66,66,88.5,0,115,0,222.5,260,120,0,220,100,0,0,100,322,4508,322,100,0,0,100,220,0,120,260,222.5,0,115,0,283.5,498,116,0,135,260,115,0,55,100,0,0,100,140.55,1448.9,476.05,409,115.5,0,145,0,230,0,140,100,0,0,100,791,0,383,100,0,0,100,130,0,230,0,255,260,115,0,140,0,230,0,911.5,0,592.5,100,0,0,100,140,0,230,0,145,0,115.5,409,110.5,100,0,0,100,165.55,1448.9,510.55,260,135,0,116,498,63,66,66,88.5,0,115,0,222.5,260,120,0,370,100,0,0,100,173.12,1501.92,1501.92,1501.92,173.12,100,0,0,100,370,0,120,260,222.5,0,115,0,283.5,498,116,0,135,260,115,0,55,100,0,0,100,140.55,1448.9,476.05,409,115.5,0,145,0,230,0,140,100,0,0,100,1174,100,0,0,100,130,0,230,0,255,260,115,0,140,0,230,0,911.5,0,592.5,100,0,0,100,140,0,230,0,145,0,115.5,409,110.5,100,0,0,100,165.55,1448.9,510.55,260,135,0,116,498,63,66,66,88.5,0,115,0,222.5,260,120,0,370,100,0,0,100,836,3180,836,100,0,0,100,370,0,120,260,222.5,0,115,0,283.5,498,116,0,135,260,115,0,55,100,0,0,100,140.55,1448.9,476.05,409,115.5,0,145,0,230,0,140,100,0,0,100,939,0,235,100,0,0,100,130,0,230,0,255,260,115,0,140,0,230,0,1504,100,0,0,100,140,0,230,0,145,0,115.5,409,110.5,100,0,0,100,165.55,1448.9,510.55,260,135,0,116,498,63,66,66,88.5,0,115,0,222.5,260,120,0,370,100,0,0,100,176,1500,1500,1500,176,100,0,0,100,370,0,120,260,222.5,0,115,0,283.5,498,116,0,135,260,115,0,55,100,0,0,100,140.55,1448.9,476.05,409,115.5,0,145,0,230,0,140,100,0,0,100,1174,100,0,0,100,130,0,230,0,255,260,115,0,140,0,230,0,1279,0,225,100,0,0,100,140,0,230,0,145,0,115.5,409,110.5,100,0,0,100,165.55,1448.9,510.55,260,135,0,116,498,63,66,0,0,66,88.5,0,115,0,222.5,260,120,0,370,100,0,0,100,173.12,1501.92,1501.92,1501.92,173.12,100,0,0,100,370,0,120,260,222.5,0,115,0,283.5,498,116,0,135,260,115,0,55,100,0,0,100,140.55,1448.9,476.05,409,115.5,0,145,0,230,0,140,100,0,0,100,939,0,235,100,0,0,100,130,0,230,0,255,260,115,0,140,0,230,0,1504,100,0,0,100,140,0,230,0,145,0,115.5,409,110.5,100,0,0,100,165.55,1448.9,510.55,260,135,0,116,498,63,66,0,0,66,88.5,0,115,0,222.5,260,120,0,370,100,0,0,100,1662,1528,1662,100,0,0,100,370,0,120,260,222.5,0,115,0,283.5,498,116,0,135,260,115,0,55,100,0,0,100,140.55,1448.9,476.05,409,115.5,0,145,0,230,0,140,100,0,0,100,1174,100,0,0,100,130,0,230,0,255,260,115,0,140,0,230,0,1504,100,0,0,100,140,0,230,0,145,0,115.5,409,110.5,100,0,0,100,165.55,1448.9,510.55,260,135,0,116,498,63,66,0,0,66,88.5,0,115,0,222.5,260,120,0,370,100,0,0,100,2426,131.18,2237.64,57.18,100,0,0,100,370,0,120,260,222.5,0,115,0,283.5,498,116,0,135,260,115,0,55,100,0,0,100,140.55,1448.9,476.05,409,115.5,0,145,0,230,0,140,100,0,0,100,791,0,383,100,0,0,100,130,0,230,0,255,260,115,0,140,0,230,0,911.5,0,592.5,100,0,0,100,140,0,230,0,145,0,115.5,409,110.5,100,0,0,100,165.55,1448.9,510.55,260,135,0,116,498,63,66,0,0,66,88.5,0,115,0,222.5,260,120,0,370,100,0,0,100,124.5,2125,116.5,60,0,0,60,88.52,2172.96,104.52,100,0,0,100,370,0,120,260,222.5,0,115,0,283.5,498,116,0,135,260,115,0,55,100,0,0,100,140.55,1448.9,476.05,409,115.5,0,145,0,230,0,140,100,0,0,100,1174,100,0,0,100,130,0,230,0,255,260,115,0,140,0,230,0,911.5,0,592.5,100,0,0,100,140,0,230,0,145,0,115.5,409,110.5,100,0,0,100,165.55,1448.9,510.55,260,135,0,116,498,63,66,0,0,66,88.5,0,115,0,222.5,260,120,0,370,100,0,0,100,2426,0,2426,100,0,0,100,370,0,120,260,222.5,0,115,0,283.5,498,116,0,135,260,115,0,55,100,0,0,100,140.55,1448.9,476.05,409,115.5,0,145,0,230,0,140,100,0,0,100,939,0,235,100,0,0,100,130,0,230,0,255,260,115,0,140,0,230,0,1504,100,0,0,100,140,0,230,0,145,0,115.5,409,110.5,100,0,0,100,165.55,1448.9,510.55,260,135,0,116,498,63,66,0,0,66,88.5,0,115,0,222.5,260,120,0,370,100,0,0,100,2426,0,2426,0,0,100,0,0,100,370,0,120,260,222.5,0,115,0,283.5,498,116,0,135,260,115,0,55,100,0,0,100,140.55,1448.9,476.05,409,115.5,0,145,0,230,0,140,100,0,0,100,1174,100,0,0,100,130,0,230,0,255,260,115,0,140,0,230,0,1504,100,0,0,100,140,0,230,0,145,0,115.5,409,110.5,100,0,0,100,165.55,1448.9,510.55,260,135,0,116,498,63,66,66,88.5,0,115,0,222.5,260,68.784,0,261.216,300,0,300,541,300,0,300,340,0,1460] + } + }, + "bl": { + "sections": [ + { + "start": {"x": 41320, "z": 1880}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "TWINMIC"} + ] + }, + { + "start": {"x": 42770, "z": 24530}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": 38860, "z": 14100}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "Nanospectroscopy"}, + {"type": "beamlineUp", "position": 1000, "name": "NanoESCA"} + ] + }, + { + "start": {"x": 33940, "z": 38500}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": 34800, "z": 22360}, + "components": [] + }, + { + "start": {"x": 24650, "z": 43010}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": 26600, "z": 31660}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "ESCA Microscopy"}, + {"type": "beamlineUp", "position": 1000, "name": "SuperESCA"} + ] + }, + { + "start": {"x": 10200, "z": 50260}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": 18980, "z": 36740}, + "components": [ + ] + }, + { + "start": {"x": -70, "z": 49440}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": 7160, "z": 40700}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "Spectro Microscopy"}, + {"type": "beamlineUp", "position": 1000, "name": "VUV Photoemission"} + ] + }, + { + "start": {"x": -16480, "z": 48620}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": -1960, "z": 41280}, + "components": [ + ] + }, + { + "start": {"x": -24760, "z": 42730}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": -14240, "z": 38840}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "CiPo", "labelReverse": true} + ] + }, + { + "start": {"x": -38800, "z": 33960}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": -22320, "z": 34780}, + "components": [ + ] + }, + { + "start": {"x": -42520, "z": 24630}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": -31700, "z": 26520}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "SAXS", "labelReverse": true}, + {"type": "beamlineUp", "position": 1000, "name": "XRD1", "labelReverse": true} + ] + }, + { + "start": {"x": -50460, "z": 10000}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": -36740, "z": 18900}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "Material Science", "labelReverse": true}, + {"type": "beamlineUp", "position": 1000, "name": "SYRMEP", "labelReverse": true} + ] + }, + { + "start": {"x": -49340, "z": -150}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": -40720, "z": 7000}, + "components": [ + {"type": "beamlineUp", "position": 1000, "name": "Gas Phase", "labelReverse": true} + ] + }, + { + "start": {"x": -48680, "z": -16800}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": -41280, "z": -2000}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "MCX", "labelReverse": true} + ] + }, + { + "start": {"x": -42680, "z": -24500}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": -38800, "z": -14260}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "ALOISA", "labelReverse": true} + ] + }, + { + "start": {"x": -33840, "z": -38780}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": -34720, "z": -22480}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "BEAR", "labelReverse": true}, + {"type": "beamlineUp", "position": 1000, "name": "LILIT", "labelReverse": true} + ] + }, + { + "start": {"x": -24520, "z": -43030}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": -26460, "z": -31820}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "BACH", "labelReverse": true} + ] + }, + { + "start": {"x": -9940, "z": -50500}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": -18940, "z": -36840}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "SISSI", "labelReverse": true} + ] + }, + { + "start": {"x": -140, "z": -49390}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": -7120, "z": -40800}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "APE", "labelReverse": true} + ] + }, + { + "start": {"x": 16520, "z": -48720}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": 1960, "z": -41400}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "Microfluorescence", "labelReverse": true}, + {"type": "beamlineUp", "position": 1000, "name": "DXRL", "labelReverse": true} + ] + }, + { + "start": {"x": 24660, "z": -42900}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": 14160, "z": -38960}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "IUVS"}, + {"type": "beamlineUp", "position": 1000, "name": "BaDElPh"} + ] + }, + { + "start": {"x": 38560, "z": -34080}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": 22360, "z": -34900}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "XAFS"}, + {"type": "beamlineUp", "position": 1000, "name": "WhITE"} + ] + }, + { + "start": {"x": 42860, "z": -24750}, + "chamber": {"type": "chamberbl"} + }, + { + "start": {"x": 22360, "z": -34900}, + "start": {"x": 31720, "z": -26640}, + "components": [ + {"type": "beamlineDown", "position": 1000, "name": "XDR2"}, + {"type": "beamlineUp", "position": 1000, "name": "XPRESS"} + ] + }, + { + "start": {"x": 50440, "z": -10120}, + "chamber": {"type": "chamberbl"} + } + ] + } +} diff --git a/elettra_lattice.php b/elettra_lattice.php new file mode 100644 index 0000000..f8a4e9c --- /dev/null +++ b/elettra_lattice.php @@ -0,0 +1,374 @@ +<?php +$src = array( + 'preinjector' => 'https://gitlab.elettra.eu/dt/machine/lattice/elettra/-/raw/main/ptblattice.m', + 'booster'=> 'https://gitlab.elettra.eu/dt/machine/lattice/elettra/-/raw/main/booster_m.m', + 'bts'=> 'https://gitlab.elettra.eu/dt/machine/lattice/elettra/-/raw/main/btslattice.m', + 'sr'=> 'https://gitlab.elettra.eu/dt/machine/lattice/elettra/-/raw/main/elettra_strS.m' +); +$blmSrcs = array('sr'=>'http://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/ecrada11/blmmaster/sr(BlmConfiguration)', + 'booster'=>"http://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sa/radio_protection/blmmaster_b_a11.01(BlmConfiguration)", + 'bts'=>"http://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sa/radio_protection/blmmaster_bts_a11.01(BlmConfiguration)", + 'preinjector'=>"http://pwma-dev.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sa/radio_protection/blmmaster_p_ptb_a11.01(BlmConfiguration)" + ); + +$blm = array('sr'=>array(),'booster'=>array(),'bts'=>array(),'preinjector'=>array()); +foreach ($blmSrcs as $facility=>$blmSrc) { + $blms = json_decode(file_get_contents($blmSrc)); + foreach ($blms as $b) { + $c = explode(':', $b); + $d = strtoupper(strtr(implode('_', array_slice(explode('_',$c[2]), 2)), array('chv'=>'ch'))); + $blm[$facility][$d] = $c[2]; + $n = explode('/', $c[2]); + if (isset($_REQUEST['blm']) && isset($_REQUEST['json'])) echo ' {"type": "blm", "position": xyz, "name": "'.strtoupper($n[2]).'"},<br>'; + } +} +if (isset($_REQUEST['blm'])) {die("<pre>".print_r($blm, true)."</pre>\n");} + +if ($_REQUEST['json']=='src') {header('Content-Type: application/json; charset=utf-8'); die(json_encode($src));} +if (isset($_REQUEST['src'])) {echo "<h2>elettra lattice sources</h2>"; foreach ($src as $s) {$a = explode('/', $s); echo "<a href='$s'>{$a[count($a)-1]}</a><br>";} exit();} +$prefix = array( + "AC" => "cavitylinac", + "B_" => "dipolebooster", + "SI" => "si", + "BP" => "bpm", + "CT" => "dcct", + "CA" => "cavity", + "CS" => "correctorbooster", + "CB" => "corrector", + "CH" => "corrector", + "CV" => "corrector", + "HC" => "corrector", + "VC" => "corrector", + "CM" => "cm", + "D_" => "drift", + "D1" => "drift", + "D2" => "drift", + "D3" => "drift", + "DK" => "drift", + "DB" => "drift", + "DC" => "drift", + "DF" => "drift", + "DM" => "drift", + "DS" => "drift", + "DP" => "drift", + "DT" => "drift", + "D0" => "drift", + "DL" => "drift", + "MO" => "drift", + "FL" => "flsc", + "ID" => "id", + "KI" => "kicker", + "KE" => "kicker", + "Q_" => "quadrupole", + "QB" => "quadrupolebooster", + "Q1" => "quadrupole", + "Q2" => "quadrupole", + "Q3" => "quadrupole", + "QD" => "quadrupole", + "QF" => "quadrupole", + "RF" => "rf",//"cavitylinac", + "SE" => "spte", + "SB" => "sextupolebooster", + "S1" => "sextupole", + "S2" => "sextupole", + "S3" => "sextupole", + "S4" => "sextupole", + "S5" => "sextupole", + "S6" => "sextupole", + "S7" => "sextupole", + "S8" => "sextupole", + "S9" => "sextupole", + "SF" => "sextupole", + "SD" => "sextupole", + "SR" => "srpm", + "SC" => "scraper", + "ST" => "strp", + "TA" => "tag", + "ZI" => "zigzag" +); +$latticeFile = empty($_REQUEST['lattice'])? './elettra_lattice.json': $_REQUEST['lattice']; +$json = file($latticeFile); +$buf = isset($_REQUEST['json'])? "<pre>{ <br>": "<table>\n"; + +// ---------------------------------------------------------------- +// emit diff +function eval_diff($a, $b) { + $old_error_reporting = error_reporting(E_ALL); + require_once('../../lib/diff.php'); + error_reporting($old_error_reporting); + $diff = new diff; + $text = $diff->inline($a,$b,2); + echo '<h3>Differences between JSON lattice and references</h3>'.count($diff->changes).' changes'; + echo $text; +} + +function component_diff() { + global $latticeFile; + echo '<h3>Supported components</h3><table>'; + $json = json_decode(file_get_contents($latticeFile), true); + $comp = array(); + foreach ($json as $devname=>$device) { + foreach ($device as $kseg=>$segment) { + foreach ($segment['magnets'] as $m) $comp[$m['type']] = true; + } + } + foreach ($comp as $component=>$v) { + if (strpos($component, '_FLSC')!==false) continue; + echo "<tr><td>$component </td><td> ".(file_exists("./components/{$component}.js")? "OK": "missing")."</td></tr>\n"; + } + die("</table>"); +} + + +// ------------------ Preinjector ------------------- +$f = file($src['preinjector']); +$pos = 2200; +$skip = true; +$p = array(); +$j = 0; +function initBranch() { + global $p, $j, $json; + if (empty($p)) $pbuf = ' "preinjector": [<br> {<br>'; else {$pbuf .= ' ]<br> },<br> {<br>';}; + while (strpos($json[$j], '"start":')===false && $j<10000) {$j++;} + $pbuf .= $json[$j]; + $j++; + if (strpos($json[$j], '"bending":')!==false) {$pbuf .= $json[$j]; $j++;} + if (strpos($json[$j], '"chamber":')!==false) {$pbuf .= $json[$j]; $j++;} + $pbuf .= ' "magnets": [<br>'; + if (empty($p)) $pbuf .= ' {"type": "gun", "position": 0, "name": "Gun", "href": "https://puma-01.elettra.eu/spa/index.html?s=preinj_summary"},<br>'; + $p[] = $pbuf; +} +initBranch(); +foreach($f as $r) { + if (strpos($r, "marker('EXIT")!==false) {$skip = true; } + if (substr($r, 0, 2)=='B_') initBranch(); + if (!$skip) $p[] = $r; + if (strpos($r, "marker('START")!==false) {$skip = false; } +} +// initBranch(); +foreach($p as $r) { + if (strpos($r, '"start":')!==false) {$buf = substr($buf, 0, -5).'<br>'.$r; continue;} + $c = explode(',', $r); + if (count($c)<2) continue; + $nq = explode("'", $c[0]); + $n = explode("=", strtr($c[0],array(' '=>'','Q_'=>$nq[1].'_', 'P1_'=>'P1.', 'PTB1_'=>'PTB1.'))); + $p = 0; + if (strpos($c[1], "'")===false) $p = $c[1]*1000.0; + $type = substr($n[0], 0, 2); + if (strpos($c[0], "drift")===false && !isset($prefix[$type])) $buf .= "<h3>$r</h3>\n"; + $len = $p; + if ($prefix[$type] == "sextupole" && $len==230) $len = 0; + if ($prefix[$type] == "quadrupole" && $len==260) $len = 0; + if ($prefix[$type] == "quadrupole") $type = 'QB'; + if ($type=='CV') continue; + if ($prefix[$type] == "corrector") $type = 'CS'; + if (strpos($c[0], "ACCT")!==false) $len = $len.', "rotateY": "PI/2", "href": "https://puma-01.elettra.eu/spa/index.html?s=preinj_summary"'; + if ((strpos($c[0], "drift")===false || strpos($c[0], "ACCT")!==false) && $type!='B_') $buf .= isset($_REQUEST['json'])? ' {"type": "'.$prefix[$type].'", "position": '.($pos+$p/2).($len>0? ', "length": '.$len:'').', "name": "'.$n[0].'"},<br>': "<tr><td>{$n[0]}</td><td>".($pos+$p/2)."</td><td>$p</td></tr>\n"; + $pos += $p; + if ($type=='B_') {$pos = $p/2;} +} +$buf .= ' ]<br> }<br> ],<br>'; + + +// ------------------ BOOSTER ------------------- +$pos = 4800; //-2400000000000; +$booster = ''; +$f = file($src['booster']); +$section = 28; $qnum = 1; +$j = 0; +foreach($f as $r) { + if (strpos($r, 'ring =')!==false || strpos($r, 'atringparam')!==false) continue; + if (strpos($r, '};')!==false) break; + $c = explode(',', $r); + if (strpos($r, 'atsbend(')!==false) { + $section++; + if ($section == 29) {$bbuf = "$booster ]<br> },<br>"; $booster = ''; $section = 1;} else $booster .= ' ]<br> },<br>'; + $k = "B_B{$section}.1"; + $pos += $c[1]*1000.0/2; + if (isset($_REQUEST['json'])) {while (strpos($json[$j], $k)===false && $j<10000) {$j++;} $booster .= ' {<br>'.$json[$j-1].$json[$j].$json[$j+1].' "magnets": [<br>';} + else $booster .= "</table>\nlength: $pos<h3>$k</h3>\n<table>\n"; + $pos = $c[1]*1000.0/2; + if (isset($blm['booster'][$k.'_R'])) { + $blmfound = $blm['booster'][$k.'_R']; + $blmnames = explode('/', strtoupper($blm['booster'][$k.'_R'])); + $booster .= ' {"type": "blm", "position": '.$pos.', "name": "'.$blmnames[2].'"},<br>'; + // "<tr><td>$k.'_R'</td><td>0</td><td>$pos</td><td>$blmfound</td></tr>\n"; + unset($blm['booster'][$k.'_R']); + $blmfound = $blm['booster'][$k.'_L']; + $blmnames = explode('/', strtoupper($blm['booster'][$k.'_L'])); + $booster .= ' {"type": "blm", "position": '.$pos.', "name": "'.$blmnames[2].'"},<br>'; + // "<tr><td>$k.'_L'</td><td>0</td><td>$pos</td><td>$blmfound</td></tr>\n"; + unset($blm['booster'][$k.'_L']); + } + $qnum = 0; + } + else { + $n = explode("'", $c[0]); + $p = 0; + if (strpos($c[1], "'")===false) $p = $c[1]*1000.0; + $type = substr($n[1], 0, 2); + if (!isset($prefix[$type])) $booster .= "<h3>$r</h3>\n"; + $len = $p; + if ($prefix[$type] == "sextupole" && $len==230) $len = 0; + if ($prefix[$type] == "quadrupole" && $len==260) $len = 0; + if ($prefix[$type] == "sextupole") $type = 'SB'; + if ($prefix[$type] == "quadrupole") {$type = 'QB'; $qnum++;} + // if (strpos($r, "RF_B") $type = 'CB'; + if (strpos($r, "atmarker('DCCT')")!==false) $type = 'CT'; + if ($type=='CV') continue; + if ($prefix[$type] == "corrector") $type = 'CS'; + $num = $type=='QB'? $qnum: 1; + $name = "{$n[1]}_B{$section}.$num";; + if (strpos($c[0], "drift")===false) $booster .= isset($_REQUEST['json'])? ' {"type": "'.$prefix[$type].'", "position": '.($pos+$p/2).($len>0? ', "length": '.$len:'').', "name": "'.$name.'"},<br>': "<tr><td>$name</td><td>".($pos+$p/2)."</td><td>$p</td></tr>\n"; + $pos += $p; + } +} +$booster = strtr($booster.substr($bbuf,0,-5), array('},<br> ]'=>'}<br> ]', "},\n ]"=>"}\n ]")); +$buf .= (isset($_REQUEST['json'])? ' "booster": [<br>': "</table><br><br><br><br><br><h1>Booster</h1><table>\n").$booster."\n ],\n"; + + +// ------------------ BTS ------------------- +$f = file($src['bts']); +$start = false; +$btsbuf = isset($_REQUEST['json'])? ' "bts": [<br> {<br> "start": {"x": -3100, "z": -21558},<br> "magnets": [<br>': "<br><br><br><br><h1>BTS</h1><br>\n"; +$j = 0; +$bending = array( + 'BTS_B1' => 'B_BTS1.1', + 'BTS_B2' => 'B_BTS1.2', + 'BTS_B3' => 'B_BTS1.3', + 'BTS_B4' => 'B_BTS2.1', + 'BTS_B5' => 'B_BTS2.2', + 'BTS_B6' => 'B_BTS2.3' +); +foreach($f as $r) { + if ($r{0}=='%') continue; + $eq = explode('=', $r); + $c = explode(',', $r); + if (strpos($r, "drift('BTS_D")!==false) { + $drift[trim($eq[0])] = $c[1]-0; + } + $Lquad = 0.495; + if (strpos($r, "quadrupole(")!==false) { + $quadrupole[trim($eq[0])] = $Lquad; + } + if (strpos($r, "START_BTS")!==false) {$start = true; $pos = 0; continue;} + if (strpos($r, "EXIT")!==false) {$start = false;} + if ($start) { + $sp = explode(' ', $r); + foreach ($sp as $comp) { + if (trim($comp) == '...') continue; + if (isset($drift[$comp])) $pos += $drift[$comp]*1000; + else { + if (strpos($comp, 'BTS_B')!==false && strpos($comp, 'BPM')===false) { + if (isset($_REQUEST['json'])) {while (strpos($json[$j], $bending[$comp])===false && $j<10000) {$j++;} $btsbuf .= ' ]<br> },<br> {<br>'.$json[$j-1].$json[$j].$json[$j+1].' "magnets": [<br>';} + // $btsbuf .= isset($_REQUEST['json'])? ' ]<br> "bending": {"type": "dipolebooster", "label": "show", "name": "'.trim($comp).'"},<br> "magnets": [<br>': "</table>\nlength: $pos<h3>$comp</h3>\n<table>\n"; + $pos = $comp=='BTS_B6'? 1217: 737; + echo "{$bending[$comp]}_R<br>"; + if (isset($blm['bts'][$bending[$comp].'_R'])) { + $blmfound = $blm['bts'][$bending[$comp].'_R']; + $blmnames = explode('/', strtoupper($blm['bts'][$bending[$comp].'_R'])); + $btsbuf .= ' {"type": "blm", "position": '.$pos.', "name": "'.$blmnames[2].'"},<br>'; + // "<tr><td>$comp.'_R'</td><td>0</td><td>$pos</td><td>$blmfound</td></tr>\n"; + unset($blm['bts'][$bending[$comp].'_R']); + $blmfound = $blm['bts'][$bending[$comp].'_L']; + $blmnames = explode('/', strtoupper($blm['bts'][$bending[$comp].'_L'])); + $btsbuf .= ' {"type": "blm", "position": '.$pos.', "name": "'.$blmnames[2].'"},<br>'; + // "<tr><td>$comp.'_L'</td><td>0</td><td>$pos</td><td>$blmfound</td></tr>\n"; + unset($blm['bts'][$bending[$comp].'_L']); + } + } + else { + $type = isset($quadrupole[$comp])? 'quadrupolebooster': (strpos($comp, 'BPM')!==false? 'bpm': $comp); + if ($comp=='CH' || $comp=='CV') $type = 'corrector'; + $btsbuf .= isset($_REQUEST['json'])? ' {"type": "'.$type.'", "position": '.$pos.', "name": "'.$comp.'"},<br>': "<tr><td>{$comp}</td><td>".$pos."</td></tr>\n"; + if (isset($blm['bts'][$comp.'_R'])) { + $blmfound = $blm['bts'][$comp.'_R']; + $blmnames = explode('/', strtoupper($blm['bts'][$comp.'_R'])); + $btsbuf .= ' {"type": "blm", "position": '.$pos.', "name": "'.$blmnames[2].'"},<br>'; + // "<tr><td>$comp.'_R'</td><td>0</td><td>$pos</td><td>$blmfound</td></tr>\n"; + unset($blm['bts'][$comp.'_R']); + $blmfound = $blm['bts'][$comp.'_L']; + $blmnames = explode('/', strtoupper($blm['bts'][$comp.'_L'])); + $btsbuf .= ' {"type": "blm", "position": '.$pos.', "name": "'.$blmnames[2].'"},<br>'; + // "<tr><td>$comp.'_L'</td><td>0</td><td>$pos</td><td>$blmfound</td></tr>\n"; + unset($blm['bts'][$comp.'_L']); + } + } + } + } + } +} +$btsbuf .= ' ]<br> },<br> {<br> "start": {"x": 38740, "z": -13180},<br> "bending": {"rotateY": "PI"},<br> "chamber": {"type": "chamber"},<br> "magnets": [<br> ]<br> }<br> ],<br>'; +$buf .= strtr($btsbuf, array('},<br> ]'=>'}<br> ]')); + + +// ------------------ SR ------------------- +$f = file($src['sr']); +$k = 'B_S12.1'; +$pos = 6996; +$buf .= isset($_REQUEST['json'])? ' "sr": [<br>': "</table><br><br><br><br><br><h1>SR</h1><table>\n"; +$srbuf = ''; +foreach($f as $r) { + $c = explode(',', $r); + if (count($c)<2) continue; + if (strpos($r, 'atrbend(')!==false) { + $k = strtr($c[0], array("atrbend("=>'', "'"=>'')); + $pos += $c[1]*1000.0/2; + if (strpos($r, "atrbend('B_S1.1")!==false) {$srtail = $srbuf; $srbuf = '';} + if (isset($_REQUEST['json'])) {$j=0; while (strpos($json[$j], trim($k))===false && $j<10000) {$j++;} $srbuf .= (strpos($r, "atrbend('B_S1.1")===false? ' ]<br> },<br>':'').' {<br>'.$json[$j-1].$json[$j].$json[$j+1].' "magnets": [<br>';} + else $srbuf .= isset($_REQUEST['json'])? ' ]<br> "bending": {"type": "dipole", "label": "show", "name": "'.trim($k).'"},<br> "magnets": [<br>': "</table>\nlength: $pos<h3>$k</h3>\n<table>\n"; + $pos = $c[1]*1000.0/2; + } + else { + $n = explode("'", $c[0]); + $p = 0; + if (strpos($c[1], "'")===false) $p = $c[1]*1000.0; + $type = substr($n[1], 0, 2); + if (!isset($prefix[$type])) $srbuf .= "<h3>$r</h3>\n"; + $len = $p; + if ($prefix[$type] == "sextupole" && $len==230) $len = 0; + if ($prefix[$type] == "quadrupole" && $len==260) $len = 0; + if ($type=='CV') continue; + $blmfound = ''; + if (isset($blm['sr'][$n[1]])) {$blmfound = $blm['sr'][$n[1]]; $blmnames = explode('/', strtoupper($blm['sr'][$n[1]]));} + if (strpos($c[0], "drift")===false) $srbuf .= isset($_REQUEST['json'])? + ' {"type": "'.$prefix[$type].'", "position": '.($pos+$p/2).($len>0? ', "length": '.$len:'').', "name": "'.$n[1].'"},<br>'. + (isset($blm['sr'][$n[1]])? ' {"type": "blm", "position": '.($pos+$p/2).', "name": "'.$blmnames[2].'"},<br>': ''): + "<tr><td>{$n[1]}</td><td>".($pos+$p/2)."</td><td>$p</td><td>$blmfound</td></tr>\n"; + if (isset($blm['sr'][$n[1]])) {unset($blm['sr'][$n[1]]);} + $pos += $p; + } +} +$srbuf .= $srtail.(isset($_REQUEST['json'])? " ]<br> }<br> ]<br>}</pre>": "</table>\n"); +$buf .= strtr($srbuf,array('},<br> ]'=>'}<br> ]', "},\n ]"=>"}\n ]")); +$envelope = $bpm = false; +if ($_REQUEST['json']=='diff') { + foreach ($json as $i=>$j) { + $json[$i] = rtrim($j); + if (strpos($j,'undulator')!==false || strpos($j,"wiggler")!==false) unset($json[$i]); + if (strpos($j,'envelope')!==false) { + if (strpos($j,'{')!==false && strpos($j,'}')===false) $envelope = true; + unset($json[$i]); + } + else if ($envelope) { + if (strpos($j,'}')!==false) $envelope = false; + unset($json[$i]); + } + if (strpos($j,'"bpm": ')!==false) { + if (strpos($j,'{')!==false && strpos($j,'}')===false) $bpm=3; + unset($json[$i]); + } + else if ($bpm>0) { + if (strpos($j,'}')!==false) $bpm--; + unset($json[$i]); + } + } + $b = explode("\n", strtr($buf, array('<br>'=>"\n", '<pre>'=>'', '</pre>'=>'', "},\n ]"=>"}\n ]"))); + foreach ($b as $i=>$j) $b[$i] = rtrim($j); + eval_diff($json, $b); + component_diff(); +} +$blmend = ''; +if (isset($_REQUEST['blmend'])) die("<h2>BLM</h2><pre>".print_r($blm, true)."</pre>"); +die(strtr($buf, array('<br>'=>"\n"))); +?> diff --git a/fermi_lattice.json b/fermi_lattice.json new file mode 100644 index 0000000..d4bf236 --- /dev/null +++ b/fermi_lattice.json @@ -0,0 +1,2404 @@ +{ + "conf": { + "index": { + "Gun": "GUN_INJ.01", + "LH": "Q_LH.01", + "L1": "ACCT_L01.01", + "BC01": "Q_BC01.01", + "L02": "ACCT_L02.01", + "L03": "ACCBT_L03.01", + "BC02": "Q_BC02.01", + "L04": "ACCBT_L04.01", + "TLS": "Q_TLS.01", + "SCL": "CHV_SCL.01", + "SFEL": "Q_SFEL01.01", + "MBD": "MSCR_MBD.01", + "UH": "VLV_PFE_F01.01", + "Hutch": "VLV_POS.01", + "BL": "VLV_POS_DPI.01", + "KS": "KGSP", + "K4": "KG04", + "K10": "KG10", + "K15": "KG15", + "SSA": "RPS_SSA.01", + "USA": "RPS_USA.01", + "ESA": "RTF_ESA.01" + } + }, + "linac": { + "sections": [ + { + "start": {"x": -173929, "z": -5811}, + "components": [ + {"type": "INJ", "position": 0, "name": "INJ_01"}, + {"type": "gun", "position": -100, "name": "GUN_INJ.01"}, + {"type": "SOL", "position": -130, "name": "SOL_INJ.01"}, + {"type": "vlv", "position": 200, "name": "VLV_INJ.01", "labelReverse": [90, 1350, 200]}, + {"type": "correctorfermi", "position": 300, "ps": ["PSCH_INJ.01","PSCV_INJ.01"], "name": "CHV_INJ.01"}, + {"type": "cm", "position": 450, "name": "CM_INJ.01", "labelReverse": [90, -220, 150]}, + {"type": "flsc", "position": 550, "name": "YSCR_INJ.01"}, + {"type": "flsc", "position": 720, "name": "YSCR_INJ.02"}, + {"type": "FC", "position": 931, "name": "FC_INJ.01"}, + {"type": "flsc", "position": 1600, "name": "YSCR_INJ.03"}, + {"type": "bpm", "position": 1850, "name": "BPM_INJ.01"}, + {"type": "correctorfermi", "position": 2051, "ps": ["PSCH_INJ.02","PSCV_INJ.02"], "name": "CHV_INJ.02"}, + {"type": "vlv", "position": 2290, "name": "VLV_L00.01"}, + {"type": "cavitylinac", "position": 2502, "name": "ACCT_L00.01"}, + {"type": "SOL", "position": 4636, "name": "SOL_L0.01"}, + {"type": "ACCT", "position": 4221, "name": "ACCT_L00.01"}, + {"type": "blm", "position": 4221, "name": "BLM_ACCT_L00.01"}, + {"type": "ACCT", "position": 4887, "name": "ACCT0_L00.01"}, + {"type": "bpm", "position": 4868, "name": "RTBPM_L00.01"}, + {"type": "quadrupolefermi", "position": 5049, "name": "Q_L00.01"}, + {"type": "blm", "position": 5149, "name": "BLM_Q_L00.01"}, + {"type": "quadrupolefermi", "position": 5339, "name": "Q_L00.02"}, + {"type": "blm", "position": 5339, "name": "BLM_Q_L00.02"}, + {"type": "flsc", "position": 5541, "name": "MSCR_L00.01"}, + {"type": "blm", "position": 5541, "name": "BLM_MSCR_L00.01"}, + {"type": "ACCT0", "position": 5598, "name": "ACCT0_L00.02"}, + {"type": "SOL", "position": 5906, "name": "SOL_L00.02"}, + {"type": "cavitylinac", "position": 6402, "name": "ACCT_L00.02"}, + {"type": "ACCT", "position": 7491, "name": "ACCT_L00.02"}, + {"type": "blm", "position": 8100, "name": "BLM_ACCT_L00.02"}, + {"type": "ACCT0", "position": 9207, "name": "ACCT0_L00.02"}, + {"type": "L00", "position": 9207, "name": "L00"}, + {"type": "LH", "position": 9207, "name": "LH_01"}, + {"type": "cm", "position": 9301, "name": "CM_LH.01"}, + {"type": "quadrupolefermi", "position": 9521, "name": "Q_LH.01"}, + {"type": "blm", "position": 9521, "name": "BLM_Q_LH.01"}, + {"type": "vlv", "position": 9880, "name": "VLV_LH.01"}, + {"type": "quadrupolefermi", "position": 10111, "name": "Q_LH.02"}, + {"type": "correctorfermi", "position": 10451, "ps": ["PSCH_LH.01","PSCV_LH.01"], "name": "CHV_LH.01"}, + {"type": "quadrupolefermi", "position": 10811, "name": "Q_LH.03"}, + {"type": "plc", "position": 10811, "name": "SPIN_LH01.01", "offset3d": [0, -700, 0], "offset2d": [0, 300], "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 10811, "name": "BLM_Q_LH.03"}, + {"type": "quadrupolefermi", "position": 11511, "name": "Q_LH.04"}, + {"type": "flsc", "position": 12081, "name": "MSCR_LH.01"}, + {"type": "blm", "position": 12081, "name": "BLM_MSCR_LH.01"}, + {"type": "correctorfermi", "position": 12281, "ps": ["PSCH_LH.02","PSCV_LH.02"], "name": "CHV_LH.02"}, + {"type": "bpm", "position": 12536, "name": "RTBPM_LH.01"}, + {"type": "BAM", "position": 13044, "name": "BAM_LH.01"}, + {"type": "bpm", "position": 13600, "name": "RTBPM_LH.02"}, + {"type": "LS", "position": 14096, "name": "LS_CHICANE"} + ] + }, + { + "start": {"x": -159733, "z": -5811}, + "chamber": {"type": "chamber"}, + "components": [ + ] + }, + { + "start": {"x": -173928, "z": -5811}, + "components": [ + ] + }, + { + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "-PI", "length": 100, "name": "B_SPINJ.01", "labelReverse": [63.5, 1300, 0]}, + "start": {"x": -172609, "z": -5811}, + "components": [ + {"type": "bpm", "position": 350, "name": "BPM_SPINJ.01", "labelReverse": [90, -350, 300]}, + {"type": "quadrupolefermi", "position": 530, "name": "Q_SPINJ.01", "labelReverse": [90, -350, 300]}, + {"type": "FC", "position": 631, "name": "FC_SPINJ.01", "labelReverse": [90, -350, 300]}, + {"type": "flsc", "position": 700, "name": "YSCR_SPINJ.01", "labelReverse": [90, -550, 300]} + ] + }, + { + "start": {"x": -172200, "z": -5311}, + "chamber": {"type": "chamber"}, + "components": [ + ] + }, + { + "start": {"x": -159733, "z": -5809}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 200, "name": "B_LH.01"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_LH.01"} + ] + }, + { + "start": {"x": -159233, "z": -5782}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 200, "name": "B_LH.02"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_LH.02"}, + {"type": "flsc", "position": 326, "name": "MSCR_LH.02"}, + {"type": "blm", "position": 326, "name": "BLM_MSCR_LH.02"}, + {"type": "miniundulator", "position": 536, "name": "ID_LH.01", "labelReverse": [90, 1350, 800]}, + {"type": "flsc", "position": 1790, "name": "MSCR_LH.03"}, + {"type": "blm", "position": 1790, "name": "BLM_MSCR_LH.03"}, + {"type": "bpm", "position": 2076, "name": "RTBPM_LH.03"} + ] + }, + { + "start": {"x": -156205, "z": -5782}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 200, "name": "B_LH.03", "labelReverse": [270, 1100, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_LH.03"} + ] + }, + { + "start": {"x": -155706, "z": -5809}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 200, "name": "B_LH.04", "labelReverse": [270, 1100, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "LS", "position": 100, "name": "LS_CHICANE"}, + {"type": "correctorfermi", "position": 450, "ps": ["PSCH_LH.03","PSCV_LH.03"], "name": "CHV_LH.03", "labelReverse": [90, 1400, 100]}, + {"type": "bpm", "position": 710, "name": "RTBPM_LH.04", "labelReverse": [90, 1700, 200]}, + {"type": "quadrupolefermi", "position": 925, "name": "Q_LH.05", "labelReverse": [90, 1150, 300]}, + {"type": "blm", "position": 925, "name": "BLM_Q_LH.05"}, + {"type": "LH", "position": 1250, "name": "LH_01"}, + {"type": "SPLH", "position": 1250, "name": "SPLH"} + ] + }, + { + "start": {"x": -153969, "z": -5908}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI/2", "length": 1000, "name": "B_SPLH.01", "labelReverse": [-69, -300, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_SPLH.01_R"}, + {"type": "blm", "position": 100, "name": "BLM_B_SPLH.01_L"}, + {"type": "bpm", "position": 689, "name": "RTBPM_LH.03B"}, + {"type": "CM", "position": 1893, "name": "CM_SPLH.01"}, + {"type": "flsc", "position": 2163, "name": "MSCR_SPLH.01"}, + {"type": "blm", "position": 2163, "name": "BLM_MSCR_SPLH.01"}, + {"type": "BD", "position": 2435, "name": "BD_SPLH.01"}, + {"type": "SPLH", "position": 2635, "name": "SPLH"} + ] + }, + { + "start": {"x": -151969, "z": -7508}, + "chamber": {"type": "chamber"}, + "components": [ + ] + }, + { + "start": {"x": -153969, "z": -5908}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "LH", "position": 496, "name": "LH_02"}, + {"type": "bpm", "position": 506, "name": "RTBPM_LH.05", "labelReverse": [90, -470, 270]}, + {"type": "flsc", "position": 736, "name": "MSCR_LH.04", "labelReverse": [90, -470, 270]}, + {"type": "blm", "position": 736, "name": "BLM_MSCR_LH.04"}, + {"type": "quadrupolefermi", "position": 1075, "name": "Q_LH.06", "labelReverse": [90, -470, 270]}, + {"type": "blm", "position": 1075, "name": "BLM_Q_LH.06"}, + {"type": "vlv", "position": 1430, "name": "VLV_L01.01", "labelReverse": [90, -420, 220]}, + {"type": "correctorfermi", "position": 1651, "ps": ["PSCH_LH.04","PSCV_LH.04"], "name": "CHV_LH.04", "labelReverse": [90, -470, 300]}, + {"type": "quadrupolefermi", "position": 1891, "name": "Q_LH.07"}, + {"type": "blm", "position": 1811, "name": "BLM_Q_LH.07"}, + {"type": "LH", "position": 2011, "name": "LH_02"}, + {"type": "L01", "position": 2011, "name": "L01"}, + {"type": "cavitylinac", "position": 2711, "name": "ACCT_L01.01"}, + {"type": "blm", "position": 2711, "name": "BLM_ACCT_L01.01"}, + {"type": "ACCT", "position": 4419, "name": "ACCT_L01.01"}, + {"type": "ACCT", "position": 6807, "name": "ACCT_L01.01"}, + {"type": "bpm", "position": 6736, "name": "RTBPM_L01.01"}, + {"type": "quadrupolefermi", "position": 7023, "name": "Q_L01.01"}, + {"type": "blm", "position": 7023, "name": "BLM_Q_L01.01"}, + {"type": "correctorfermi", "position": 7414, "ps": ["PSCH_L01.01","PSCV_L01.01"], "name": "CHV_L01.01"}, + {"type": "cavitylinac", "position": 7605, "name": "ACCT_L01.02"}, + {"type": "blm", "position": 7605, "name": "BLM_ACCT_L01.02"}, + {"type": "ACCT", "position": 10015, "name": "ACCT_L01.02"}, + {"type": "ACCT", "position": 12803, "name": "ACCT_L01.02"}, + {"type": "correctorfermi", "position": 11800, "ps": ["PSCH_L01.02","PSCV_L01.02"], "name": "CHV_L01.02"}, + {"type": "vlv", "position": 12200, "name": "VLV_XBL01.01", "labelReverse": [90, 1630, 170]}, + {"type": "bpm", "position": 12396, "name": "RTBPM_L01.02"}, + {"type": "quadrupolefermi", "position": 12809, "name": "Q_L01.02"}, + {"type": "blm", "position": 12609, "name": "BLM_Q_L01.02"}, + {"type": "ACcorrectorfermi", "position": 13261, "name": "ACCH_L01.01"}, + {"type": "bpm", "position": 13317, "name": "RTBPM_L01.03"}, + {"type": "vlv", "position": 13700, "name": "VLV_L01.02", "labelReverse": [90, 1370, 170]}, + {"type": "cavitylinac", "position": 14225, "name": "ACCT_L01.03"}, + {"type": "blm", "position": 14225, "name": "BLM_ACCT_L01.03"}, + {"type": "ACCT", "position": 16511, "name": "ACCT_L01.04"}, + {"type": "blm", "position": 16511, "name": "BLM_ACCT_L01.04"}, + {"type": "ACCT", "position": 18809, "name": "ACCT_L01.03"}, + {"type": "bpm", "position": 18828, "name": "RTBPM_L01.04"}, + {"type": "quadrupolefermi", "position": 19136, "name": "Q_L01.03"}, + {"type": "blm", "position": 19136, "name": "BLM_Q_L01.03"}, + {"type": "flsc", "position": 19360, "name": "MSCR_L01.01"}, + {"type": "plc", "position": 19130, "name": "SPMO_INL03.01", "offset3d": [0, -700, 0], "offset2d": [0, 300], "labelReverse": [90, -250, 250]}, + {"type": "correctorfermi", "position": 19576, "ps": ["PSCH_L01.03","PSCV_L01.03"], "name": "CHV_L01.03"}, + {"type": "cavitylinac", "position": 19896, "name": "ACCT_L01.04"}, + {"type": "ACCT", "position": 22106, "name": "ACCT_L01.04"}, + {"type": "ACCT", "position": 24494, "name": "ACCT_L01.04"}, + {"type": "bpm", "position": 24424, "name": "RTBPM_L01.05"}, + {"type": "quadrupolefermi", "position": 24717, "name": "Q_L01.04"}, + {"type": "blm", "position": 24717, "name": "BLM_Q_L01.04"}, + {"type": "correctorfermi", "position": 25108, "ps": ["PSCH_L01.04","PSCV_L01.04"], "name": "CHV_L01.04"}, + {"type": "plc", "position": 24717, "name": "SPIN_L01.01", "offset3d": [0, -700, 0], "offset2d": [0, 300], "labelReverse": [90, -250, 250]}, + {"type": "vlv", "position": 25370, "name": "VLV_BC01.01"}, + {"type": "L01", "position": 25667, "name": "L01"}, + {"type": "BC01", "position": 25667, "name": "BC01_01"} + ] + }, + { + "start": {"x": -128103, "z": -5815}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI/2", "length": 400, "name": "B_BC01.01", "labelReverse": [270, 1310, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_BC01.01_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_BC01.01_R"}, + {"type": "quadrupolefermi", "position": 602, "name": "Q_BC01.01", "labelReverse": [90, 1300, 250]}, + {"type": "blm", "position": 602, "name": "BLM_Q_BC01.01"} + ] + }, + { + "start": {"x": -125125, "z": -6060}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI/2", "length": 400, "name": "B_BC01.02", "labelReverse": [90, 1300, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_BC01.02_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_BC01.02_R"}, + {"type": "SCRPH", "position": 524, "name": "SCRPH_BC01.01"}, + {"type": "bpm", "position": 675, "name": "BPM_BC01.01"}, + {"type": "flsc", "position": 967, "name": "MSCR_BC01.01"} + ] + }, + { + "start": {"x": -123631, "z": -6060}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 400, "name": "B_BC01.03", "labelReverse": [90, 1300, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_BC01.03_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_BC01.03_R"}, + {"type": "quadrupolefermi", "position": 2392, "name": "Q_BC01.02"}, + {"type": "blm", "position": 2392, "name": "BLM_Q_BC01.02"} + ] + }, + { + "start": {"x": -120647, "z": -5815}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI/2", "length": 400, "name": "B_BC01.04", "labelReverse": [270, 1400, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_BC01.04_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_BC01.04_R"}, + {"type": "CBLM", "position": 330, "name": "CBLM_BC01.01"}, + {"type": "GBLM", "position": 978, "name": "GBLM_BC01.01"}, + {"type": "correctorfermi", "position": 1645, "ps": ["PSCH_BC01.01","PSCV_BC01.01"], "name": "CHV_BC01.01", "labelReverse": [90, 1500, 200]}, + {"type": "blm", "position": 1645, "name": "BLM_CHV_BC01.01"}, + {"type": "BAM", "position": 1917, "name": "BAM_BC01.01"}, + {"type": "bpm", "position": 1908, "name": "RTBPM_BC01.02", "labelReverse": [90, 1800, 200]}, + {"type": "vlv", "position": 2200, "name": "VLV_BC01.02", "labelReverse": [90, 1480, 200]}, + {"type": "DCAV", "position": 3022, "name": "DCAV_BC01.01"}, + {"type": "blm", "position": 3022, "name": "BLM_DCAV_BC01.01"}, + {"type": "vlv", "position": 3200, "name": "VLV_BC01.03", "labelReverse": [90, 1480, 200]}, + {"type": "quadrupolefermi", "position": 3492, "name": "Q_BC01.03", "labelReverse": [90, 1280, 200]}, + {"type": "blm", "position": 3492, "name": "BLM_Q_BC01.03"}, + {"type": "quadrupolefermi", "position": 3942, "name": "Q_BC01.04", "labelReverse": [90, 1280, 200]}, + {"type": "blm", "position": 3942, "name": "BLM_Q_BC01.04"}, + {"type": "correctorfermi", "position": 4367, "ps": ["PSCH_BC01.02","PSCV_BC01.02"], "name": "CHV_BC01.02", "labelReverse": [90, 1530, 250]}, + {"type": "quadrupolefermi", "position": 4642, "name": "Q_BC01.05", "labelReverse": [90, 1280, 300]}, + {"type": "blm", "position": 4642, "name": "BLM_Q_BC01.05"}, + {"type": "quadrupolefermi", "position": 5092, "name": "Q_BC01.06", "labelReverse": [90, 1280, 300]}, + {"type": "blm", "position": 5092, "name": "BLM_Q_BC01.06"}, + {"type": "bpm", "position": 5423, "name": "RTBPM_BC01.03", "labelReverse": [90, 1850, 200]}, + {"type": "quadrupolefermi", "position": 5629, "name": "Q_BC01.07", "labelReverse": [90, 1280, 300]}, + {"type": "blm", "position": 5629, "name": "BLM_Q_BC01.07"}, + {"type": "correctorfermi", "position": 5939, "ps": ["PSCH_BC01.03","PSCV_BC01.03"], "name": "CHV_BC01.03", "labelReverse": [90, 1550, 250]}, + {"type": "blm", "position": 5939, "name": "BLM_CHV_BC01.03"}, + {"type": "GCOL", "position": 6667, "name": "GCOL_BC01.01"}, + {"type": "blm", "position": 6667, "name": "BLM_GCOL_BC01.01"}, + {"type": "flsc", "position": 7269, "name": "MSCR_BC01.02", "labelReverse": [90, 1750, 300]}, + {"type": "blm", "position": 7269, "name": "BLM_MSCR_BC01.02"}, + {"type": "flsc", "position": 12350, "name": "MSCR_BC01.03", "labelReverse": [90, 1750, 300]}, + {"type": "correctorfermi", "position": 13128, "ps": ["PSCH_BC01.04","PSCV_BC01.04"], "name": "CHV_BC01.04", "labelReverse": [90, 1550, 250]}, + {"type": "quadrupolefermi", "position": 13444, "name": "Q_BC01.08", "labelReverse": [90, 1280, 300]}, + {"type": "plc", "position": 13444, "name": "SPIN_BC01.01", "offset3d": [0, -700, 0], "offset2d": [0, 300], "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 13444, "name": "BLM_Q_BC01.08"}, + {"type": "correctorfermi", "position": 13843, "ps": ["PSCH_BC01.05","PSCV_BC01.05"], "name": "CHV_BC01.05", "labelReverse": [90, 1550, 250]}, + {"type": "quadrupolefermi", "position": 14278, "name": "Q_BC01.09", "labelReverse": [90, 1280, 300]}, + {"type": "blm", "position": 14278, "name": "BLM_Q_BC01.09"}, + {"type": "bpm", "position": 14568, "name": "RTBPM_BC01.04", "labelReverse": [90, 1850, 300]}, + {"type": "BC01", "position": 15259, "name": "BC01_01"}, + {"type": "SPBC01", "position": 15259, "name": "SPBC01"} + ] + }, + { + "start": {"x": -105230, "z": -5828}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI/2", "length": 320, "name": "B_SPBC01.01", "labelReverse": [-72, -300, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "bpm", "position": 589, "name": "BPM_SPBC01.01"}, + {"type": "quadrupolefermi", "position": 1128, "name": "Q_SPBC01.01"}, + {"type": "quadrupolefermi", "position": 1678, "name": "Q_SPBC01.02"}, + {"type": "flsc", "position": 2168, "name": "MSCR_SPBC01.01"}, + {"type": "blm", "position": 2268, "name": "BLM_MSCR_SPBC01.01"}, + {"type": "cm", "position": 2483, "name": "CM_SPBC01.01"}, + {"type": "D", "position": 3703, "name": "D_SPBC01.01"}, + {"type": "SPBC01", "position": 3903, "name": "SPBC01"} + ] + }, + { + "start": {"x": -103230, "z": -7208}, + "chamber": {"type": "chamber"}, + "components": [ + ] + + }, + + { + "start": {"x": -105230, "z": -5828}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "BC01", "position": 850, "name": "BC01_02"}, + {"type": "bpm", "position": 446, "name": "RTBPM_BC01.05", "labelReverse": [90, -450, 300]}, + {"type": "blm", "position": 846, "name": "BLM_BPM_BC01.05"}, + {"type": "GCOL", "position": 1471, "name": "GCOL_BC01.02"}, + {"type": "blm", "position": 1471, "name": "BLM_GCOL_BC01.02"}, + {"type": "flsc", "position": 1327, "name": "MSCR_BC01.04", "labelReverse": [90, -450, 300]}, + {"type": "blm", "position": 2127, "name": "BLM_MSCR_BC01.04"}, + {"type": "quadrupolefermi", "position": 2442, "name": "Q_BC01.10"}, + {"type": "blm", "position": 2442, "name": "BLM_Q_BC01.10"}, + {"type": "cm", "position": 2831, "name": "CM_BC01.01"}, + {"type": "correctorfermi", "position": 3049, "ps": ["PSCH_BC01.06","PSCV_BC01.06"], "name": "CHV_BC01.06"}, + {"type": "quadrupolefermi", "position": 3374, "name": "Q_BC01.11"}, + {"type": "blm", "position": 3474, "name": "BLM_Q_BC01.11"}, + {"type": "vlv", "position": 3710, "name": "VLV_L02.01", "labelReverse": [90, 1380, 250]}, + {"type": "BC01", "position": 3910, "name": "BC01_02"}, + {"type": "L02", "position": 3910, "name": "L02"}, + {"type": "cavitylinac", "position": 3910, "name": "ACCT_L02.01"}, + {"type": "blm", "position": 3910, "name": "BLM_ACCT_L02.01"}, + {"type": "ACCT", "position": 6320, "name": "ACCT_L02.01"}, + {"type": "ACCT", "position": 8708, "name": "ACCT_L02.01"}, + {"type": "bpm", "position": 8578, "name": "RTBPM_L02.01"}, + {"type": "quadrupolefermi", "position": 8803, "name": "Q_L02.01"}, + {"type": "blm", "position": 8953, "name": "BLM_Q_L02.01"}, + {"type": "correctorfermi", "position": 9193, "ps": ["PSCH_L02.01","PSCV_L02.01"], "name": "CHV_L02.01"}, + {"type": "cavitylinac", "position": 9506, "name": "ACCT_L02.02"}, + {"type": "blm", "position": 9506, "name": "BLM_ACCT_L02.02"}, + {"type": "ACCT", "position": 11916, "name": "ACCT_L02.02"}, + {"type": "ACCT", "position": 14304, "name": "ACCT_L02.02"}, + {"type": "bpm", "position": 14134, "name": "RTBPM_L02.02"}, + {"type": "quadrupolefermi", "position": 14439, "name": "Q_L02.02"}, + {"type": "plc", "position": 14439, "name": "SPMO_L0.01", "offset3d": [0, -700, 0], "offset2d": [0, 300], "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 14439, "name": "BLM_Q_L02.02"}, + {"type": "correctorfermi", "position": 14729, "ps": ["PSCH_L02.02","PSCV_L02.02"], "name": "CHV_L02.02"}, + {"type": "vlv", "position": 15000, "name": "VLV_L02.02", "labelReverse": [90, 1380, 250]}, + {"type": "cavitylinac", "position": 15202, "name": "ACCT_L02.03", "length": 200}, + {"type": "blm", "position": 15102, "name": "BLM_ACCT_L02.03"}, + {"type": "ACCT", "position": 17512, "name": "ACCT_L02.03"}, + {"type": "ACCT", "position": 19900, "name": "ACCT_L02.03"}, + {"type": "bpm", "position": 19830, "name": "RTBPM_L02.03"}, + {"type": "quadrupolefermi", "position": 20125, "name": "Q_L02.03"}, + {"type": "blm", "position": 20125, "name": "BLM_Q_L02.03"}, + {"type": "correctorfermi", "position": 20426, "ps": ["PSCH_L02.03","PSCV_L02.03"], "name": "CHV_L02.03"}, + {"type": "ACCT", "position": 22300, "name": "ACCT_L02.04"}, + {"type": "blm", "position": 22300, "name": "BLM_ACCT_L02.04"}, + {"type": "bpm", "position": 23846, "name": "RTBPM_L02.04"}, + {"type": "quadrupolefermi", "position": 24041, "name": "Q_L02.04"}, + {"type": "blm", "position": 24041, "name": "BLM_Q_L02.04"}, + {"type": "correctorfermi", "position": 24336, "ps": ["PSCH_L02.04","PSCV_L02.04"], "name": "CHV_L02.04"}, + {"type": "vlv", "position": 24590, "name": "VLV_L03.01"}, + {"type": "L02", "position": 24700, "name": "L02"}, + {"type": "L03", "position": 24700, "name": "L03"}, + {"type": "cavitylinac", "position": 24800, "name": "ACCBT_L03.01"}, + {"type": "ACCBT", "position": 27931, "name": "ACCBT_L03.01"}, + {"type": "ACCBT", "position": 31133, "name": "ACCBT_L03.01"}, + {"type": "bpm", "position": 31063, "name": "RTBPM_L03.01"}, + {"type": "quadrupolefermi", "position": 31371, "name": "Q_L03.01"}, + {"type": "blm", "position": 31371, "name": "BLM_Q_L03.01"}, + {"type": "correctorfermi", "position": 31695, "ps": ["PSCH_L03.01","PSCV_L03.01"], "name": "CHV_L03.01"}, + {"type": "cavitylinac", "position": 31933, "name": "ACCBT_L03.02"}, + {"type": "blm", "position": 31933, "name": "BLM_ACCBT_L03.02"}, + {"type": "ACCBT", "position": 35164, "name": "ACCBT_L03.02"}, + {"type": "ACCBT", "position": 38365, "name": "ACCBT_L03.02"}, + {"type": "vlv", "position": 37980, "name": "VLV_BC02.01", "labelReverse": [90, 1530, 260]}, + {"type": "bpm", "position": 38189, "name": "RTBPM_L03.02"}, + {"type": "quadrupolefermi", "position": 38425, "name": "Q_L03.02"}, + {"type": "blm", "position": 38425, "name": "BLM_Q_L03.02"}, + {"type": "flsc", "position": 38831, "name": "MSCR_L03.01"}, + {"type": "blm", "position": 38831, "name": "BLM_MSCR_L03.01"}, + {"type": "correctorfermi", "position": 39069, "ps": ["PSCH_L03.02","PSCV_L03.02"], "name": "CHV_L03.02"}, + {"type": "L03", "position": 39427, "name": "L03"}, + {"type": "BC02", "position": 39427, "name": "BC02"} + ] + }, + + { + "start": {"x": -65603, "z": -5811}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 400, "name": "B_BC02.01", "labelReverse": [90, 1320, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_BC02.01_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_BC02.01_R"}, + {"type": "quadrupolefermi", "position": 500, "name": "Q_BC02.01"}, + {"type": "blm", "position": 500, "name": "BLM_Q_BC02.01"} + ] + }, + { + "start": {"x": -62626, "z": -5811}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 400, "name": "B_BC02.02", "labelReverse": [90, 1320, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_BC02.02_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_BC02.02_R"}, + {"type": "SCRPH", "position": 524, "name": "SCRPH_BC02.01"}, + {"type": "bpm", "position": 474, "name": "RTBPM_BC02.01"}, + {"type": "flsc", "position": 767, "name": "MSCR_BC02.01"} + ] + }, + { + "start": {"x": -61131, "z": -5811}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 400, "name": "B_BC02.03", "labelReverse": [90, 1320, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_BC02.03_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_BC02.03_R"}, + {"type": "quadrupolefermi", "position": 2283, "name": "Q_BC02.02"}, + {"type": "blm", "position": 2383, "name": "BLM_Q_BC02.02"} + ] + }, + { + "start": {"x": -58148, "z": -5811}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 400, "name": "B_BC02.04", "labelReverse": [90, 1320, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_BC02.04_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_BC02.04_R"}, + {"type": "CBLM", "position": 331, "name": "CBLM_BC02.01"}, + {"type": "GBLM", "position": 979, "name": "GBLM_BC02.01"}, + {"type": "BAM", "position": 1130, "name": "BAM_BC02.01"}, + {"type": "bpm", "position": 701, "name": "RTBPM_BC02.02"}, + {"type": "quadrupolefermi", "position": 940, "name": "Q_BC02.03"}, + {"type": "blm", "position": 940, "name": "BLM_Q_BC02.03"}, + {"type": "cm", "position": 1258, "name": "CM_BC02.01"}, + {"type": "correctorfermi", "position": 1460, "ps": ["PSCH_BC02.01","PSCV_BC02.01"], "name": "CHV_BC02.01"}, + {"type": "vlv", "position": 1717, "name": "VLV_L04.01"}, + {"type": "BC02", "position": 1817, "name": "BC02"}, + {"type": "L04", "position": 1817, "name": "L04"}, + {"type": "cavitylinac", "position": 1997, "name": "ACCBT_L04.01"}, + {"type": "ACCBT", "position": 5048, "name": "ACCBT_L04.01"}, + {"type": "ACCBT", "position": 8250, "name": "ACCBT_L04.01"}, + {"type": "bpm", "position": 8180, "name": "RTBPM_L04.01"}, + {"type": "quadrupolefermi", "position": 8428, "name": "Q_L04.01"}, + {"type": "blm", "position": 8428, "name": "BLM_Q_L04.01"}, + {"type": "flsc", "position": 8682, "name": "MSCR_L04.01"}, + {"type": "correctorfermi", "position": 8912, "ps": ["PSCH_L04.01","PSCV_L04.01"], "name": "CHV_L04.01"}, + {"type": "cavitylinac", "position": 9150, "name": "ACCBT_L04.02"}, + {"type": "ACCBT", "position": 12281, "name": "ACCBT_L04.02"}, + {"type": "ACCBT", "position": 15482, "name": "ACCBT_L04.02"}, + {"type": "bpm", "position": 15412, "name": "RTBPM_L04.02"}, + {"type": "quadrupolefermi", "position": 15712, "name": "Q_L04.02"}, + {"type": "blm", "position": 15712, "name": "BLM_Q_L04.02"}, + {"type": "correctorfermi", "position": 16007, "ps": ["PSCH_L04.02","PSCV_L04.02"], "name": "CHV_L04.02"}, + {"type": "vlv", "position": 16260, "name": "VLV_L04.02"}, + {"type": "cavitylinac", "position": 16482, "name": "ACCBT_L04.03"}, + {"type": "ACCBT", "position": 19513, "name": "ACCBT_L04.03"}, + {"type": "ACCBT", "position": 22715, "name": "ACCBT_L04.03"}, + {"type": "bpm", "position": 22645, "name": "RTBPM_L04.03"}, + {"type": "quadrupolefermi", "position": 22945, "name": "Q_L04.03"}, + {"type": "blm", "position": 22945, "name": "BLM_Q_L04.03"}, + {"type": "correctorfermi", "position": 23240, "ps": ["PSCH_L04.03","PSCV_L04.03"], "name": "CHV_L04.03"}, + {"type": "cavitylinac", "position": 23515, "name": "ACCBT_L04.04"}, + {"type": "ACCBT", "position": 26746, "name": "ACCBT_L04.04"}, + {"type": "ACCBT", "position": 29947, "name": "ACCBT_L04.04"}, + {"type": "bpm", "position": 29817, "name": "RTBPM_L04.04"}, + {"type": "quadrupolefermi", "position": 30117, "name": "Q_L04.04"}, + {"type": "plc", "position": 30117, "name": "SPIN_L04.01", "offset3d": [0, -700, 0], "offset2d": [0, 300], "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 30117, "name": "BLM_Q_L04.04"}, + {"type": "correctorfermi", "position": 30412, "ps": ["PSCH_L04.04","PSCV_L04.04"], "name": "CHV_L04.04"}, + {"type": "vlv", "position": 30650, "name": "VLV_L04.03"}, + {"type": "cavitylinac", "position": 30847, "name": "ACCBT_L04.05"}, + {"type": "ACCBT", "position": 33978, "name": "ACCBT_L04.05"}, + {"type": "ACCBT", "position": 37180, "name": "ACCBT_L04.05"}, + {"type": "bpm", "position": 37110, "name": "RTBPM_L04.05"}, + {"type": "quadrupolefermi", "position": 37410, "name": "Q_L04.05"}, + {"type": "blm", "position": 37410, "name": "BLM_Q_L04.05"}, + {"type": "correctorfermi", "position": 37805, "ps": ["PSCH_L04.05","PSCV_L04.05"], "name": "CHV_L04.05"}, + {"type": "blm", "position": 37805, "name": "BLM_CHV_L04.05"}, + {"type": "ACCT", "position": 39660, "name": "ACCT_L04.06"}, + {"type": "bpm", "position": 41160, "name": "RTBPM_L04.06"}, + {"type": "blm", "position": 41417, "name": "BLM_CHV_L04.06"}, + {"type": "quadrupolefermi", "position": 41500, "name": "Q_L04.06"}, + {"type": "blm", "position": 41677, "name": "BLM_Q_L04.06"}, + {"type": "vlv", "position": 41877, "name": "VLV_L.04.04"}, + {"type": "correctorfermi", "position": 42197, "ps": ["PSCH_L04.06","PSCV_L04.06"], "name": "CHV_L04.06"}, + {"type": "ACCT", "position": 43297, "name": "ACCT_L04.07"}, + {"type": "quadrupolefermi", "position": 45133, "name": "Q_L04.07"}, + {"type": "blm", "position": 45133, "name": "BLM_Q_L04.07"}, + {"type": "bpm", "position": 45372, "name": "RTBPM_L04.07"}, + {"type": "correctorfermi", "position": 45828, "ps": ["PSCH_L04.07","PSCV_L04.07"], "name": "CHV_L04.07"}, + {"type": "blm", "position": 45828, "name": "BLM_CHV_L04.07"}, + {"type": "DCAV", "position": 47430, "name": "DCAV_L04.01"}, + {"type": "blm", "position": 47430, "name": "BLM_DCAV_L04.01"}, + {"type": "L04", "position": 48680, "name": "L04"}, + {"type": "TLS", "position": 48680, "name": "TLS_01"}, + {"type": "quadrupolefermi", "position": 48955, "name": "Q_TLS.01"}, + {"type": "blm", "position": 48955, "name": "BLM_Q_TLS.01"}, + {"type": "quadrupolefermi", "position": 49455, "name": "Q_TLS.02"}, + {"type": "plc", "position": 49455, "name": "SPIN_TLS.01", "offset3d": [0, -700, 0], "offset2d": [0, 300], "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 49455, "name": "BLM_Q_TLS.02"}, + {"type": "vlv", "position": 49850, "name": "VLV_TLS.01"}, + {"type": "correctorfermi", "position": 50105, "ps": ["PSCH_TLS.01","PSCV_TLS.01"], "name": "CHV_TLS.01"}, + {"type": "blm", "position": 50105, "name": "BLM_CHV_TLS.01"}, + {"type": "bpm", "position": 50392, "name": "RTBPM_TLS.01"}, + {"type": "flsc", "position": 50695, "name": "MSCR_TLS.01"}, + {"type": "blm", "position": 50695, "name": "BLM_MSCR_TLS.01"}, + {"type": "GCOL", "position": 51315, "name": "GCOL_TLS.01"}, + {"type": "blm", "position": 51315, "name": "BLM_GCOL_TLS.01"}, + {"type": "quadrupolefermi", "position": 51910, "name": "Q_TLS.03"}, + {"type": "blm", "position": 51910, "name": "BLM_Q_TLS.03"}, + {"type": "quadrupolefermi", "position": 52710, "name": "Q_TLS.04"}, + {"type": "blm", "position": 52710, "name": "BLM_Q_TLS.04"}, + {"type": "TLS", "position": 53223, "name": "TLS_01"}, + {"type": "DBD", "position": 53223, "name": "DBD"} + ] + }, + { + "start": {"x": -3722, "z": -5645}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 2437, "name": "B_DBD.01"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_DBD.01_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_DBD.01_R"}, + {"type": "quadrupolefermi", "position": 1806, "name": "Q_DBD.01", "labelReverse": [90, -450, 150]}, + {"type": "plc", "position": 1506, "name": "SPAC_LT04", "offset3d": [0, 500, 2000], "offset2d": [0, 900], "labelReverse": [90, -250, 250]}, + {"type": "bpm", "position": 2191, "name": "RTBPM_DBD.01", "labelReverse": [90, -250, 350]}, + {"type": "quadrupolefermi", "position": 2714, "name": "Q_DBD.02"}, + {"type": "blm", "position": 2714, "name": "BLM_Q_DBD.02"}, + {"type": "flsc", "position": 3168, "name": "MSCR_DBD.01"}, + {"type": "quadrupolefermi", "position": 3622, "name": "Q_DBD.03"}, + {"type": "blm", "position": 3622, "name": "BLM_Q_DBD.03"} + ] + }, + { + "start": {"x": 902, "z": -2823}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 2437, "name": "B_DBD.02"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_DBD.02_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_DBD.02_R"}, + {"type": "bpm", "position": 1624, "name": "RTBPM_DBD.02"}, + {"type": "correctorfermi", "position": 2096, "name": "CH_DBD.01"}, + {"type": "blm", "position": 2096, "name": "BLM_CH_DBD.01"}, + {"type": "correctorfermi", "position": 2472, "name": "CV_DBD.01"}, + {"type": "quadrupolefermi", "position": 3208, "name": "Q_DBD.04"}, + {"type": "blm", "position": 3208, "name": "BLM_Q_DBD.04"}, + {"type": "vlv", "position": 4400, "name": "VLV_DBD.01"}, + {"type": "quadrupolefermi", "position": 5706, "name": "Q_DBD.05"}, + {"type": "blm", "position": 5706, "name": "BLM_Q_DBD.05"}, + {"type": "cm", "position": 6476, "name": "CM_DBD.01"}, + {"type": "flsc", "position": 6872, "name": "MSCR_DBD.02"}, + {"type": "blm", "position": 6872, "name": "BLM_MSCR_DBD.02"}, + {"type": "D", "position": 8300, "name": "D_DBD.01"}, + {"type": "DBD", "position": 9152, "name": "DBD"} + ] + }, + { + "start": {"x": 6647, "z": 5813}, + + "chamber": {"type": "chamber"}, + "components": [] + } + ], + "blm": { + "confsrc": "https://puma-01.elettra.eu/misc/threejs/fermi_blm.php?linac&conf=long", + "datasrc": "https://puma-01.elettra.eu/misc/threejs/fermi_blm.php?linac" + }, + "bpm": { + "pos": "https://puma-01.elettra.eu/misc/threejs/fermi_bpm.php?std&linac", + "rms": "https://puma-01.elettra.eu/misc/threejs/fermi_bpm.php?rms&linac", + "defaultZoom": 0.01, + "length": 38, + "offset": 0 + } + }, + "fel1": { + "sections": [ + { + "start": {"x": -3722, "z": -5645}, + "components": [ + {"type": "flsc", "position": 549, "name": "MSCR_TLS.02"}, + {"type": "correctorfermi", "position": 899, "ps": ["PSCH_TLS.02","PSCV_TLS.02"], "name": "CHV_TLS.02"}, + {"type": "blm", "position": 1249, "name": "RTBLM_TLS.02"}, + {"type": "flsc", "position": 1549, "name": "MSCR_TLS.03"}, + {"type": "quadrupolefermi", "position": 1899, "name": "Q_TLS.05"}, + {"type": "correctorfermi", "position": 2221, "ps": ["PSCH_TLS.03","PSCV_TLS.03"], "name": "CHV_TLS.03"}, + {"type": "quadrupolefermi", "position": 2599, "name": "Q_TLS.06"}, + {"type": "blm", "position": 2806, "name": "RTBPM_TLS.03"}, + {"type": "quadrupolefermi", "position": 3114, "name": "Q_TLS.07"}, + {"type": "bst", "position": 3414, "name": "BST_TLS.01"}, + {"type": "vlv", "position": 3800, "name": "VLV_SCL.01"}, + {"type": "quadrupolefermi", "position": 10100, "name": "Q_SCL.01", "labelReverse": [90, 1300, 250]} + + ] + }, + { + "start": {"x": 7140, "z": -5645}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI/2", "length": 250, "name": "B_SCL.01", "labelReverse": [270, 1400, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_SCL.01"}, + {"type": "correctorfermi", "position": 449, "ps": ["PSCH_SCL.01","PSCV_SCL.01"], "name": "CHV_SCL.01", "labelReverse": [90, 1550, 250]}, + {"type": "quadrupolefermi", "position": 799, "name": "Q_SCL.02", "labelReverse": [90, 1300, 250]}, + {"type": "blm", "position": 799, "name": "BLM_Q_SCL.02"}, + {"type": "quadrupolefermi", "position": 1749, "name": "Q_SCL.03", "labelReverse": [90, 1300, 250]}, + {"type": "blm", "position": 1749, "name": "BLM_Q_SCL.03"}, + {"type": "bpm", "position": 2019, "name": "RTBPM_SCL.01", "labelReverse": [90, 1850, 250]}, + {"type": "ECOL", "position": 2644, "name": "ECOL_SCL.01"}, + {"type": "blm", "position": 2644, "name": "BLM_ECOL_SCL.01"}, + {"type": "quadrupolefermi", "position": 2899, "name": "Q_SCL.04", "labelReverse": [90, 1300, 250]}, + {"type": "blm", "position": 2899, "name": "BLM_Q_SCL.04"}, + {"type": "flsc", "position": 3119, "name": "MSCR_SCL.01", "labelReverse": [90, 1750, 250]}, + {"type": "blm", "position": 3119, "name": "BLM_MSCR_SCL.01"}, + {"type": "quadrupolefermi", "position": 3414, "name": "Q_SCL.05", "labelReverse": [90, 1300, 250]}, + {"type": "blm", "position": 3514, "name": "BLM_Q_SCL.05"}, + {"type": "correctorfermi", "position": 3821, "ps": ["PSCH_SCL.02","PSCV_SCL.02"], "name": "CHV_SCL.02", "labelReverse": [90, 1550, 250]} + ] + }, + { + "start": {"x": 11440, "z": -6064}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "-PI", "length": 250, "name": "B_SCL.02", "labelReverse": [270, 1300, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_SCL.02"}, + {"type": "bpm", "position": 315, "name": "RTBPM_SCL.02", "labelReverse": [90, 1850, 250]}, + {"type": "quadrupolefermi", "position": 800, "name": "Q_SCL.06", "labelReverse": [90, 1300, 250]}, + {"type": "plc", "position": 800, "name": "SPIN-UH.01", "offset3d": [0, -700, 0], "offset2d": [0, 300], "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 800, "name": "BLM_Q_SCL.06", "labelReverse": [90, 1300, 250]}, + {"type": "quadrupolefermi", "position": 1750, "name": "Q_SCL.07", "labelReverse": [90, 1300, 250]}, + {"type": "blm", "position": 1750, "name": "BLM_Q_SCL.07"}, + {"type": "quadrupolefermi", "position": 3300, "name": "Q_SCL.08", "labelReverse": [90, 1300, 250]}, + {"type": "blm", "position": 3300, "name": "BLM_Q_SCL.08"}, + {"type": "correctorfermi", "position": 3680, "ps": ["PSCH_SCL.03","PSCV_SCL.03"], "name": "CHV_SCL.03", "labelReverse": [90, 1550, 250]}, + {"type": "blm", "position": 3680, "name": "BLM_CHV_SCL.03"}, + {"type": "quadrupolefermi", "position": 4015, "name": "Q_SCL.09", "labelReverse": [90, 1300, 250]}, + {"type": "blm", "position": 4015, "name": "BLM_Q_SCL.09"}, + {"type": "SCL", "position": 4640, "name": "SCL"}, + {"type": "SFEL01", "position": 4640, "name": "SFEL01"}, + {"type": "quadrupolefermi", "position": 6015, "name": "Q_SFEL01.01", "labelReverse": [90, 1600, 250]}, + {"type": "blm", "position": 6015, "name": "BLM_Q_SFEL01.01"}, + {"type": "vlv", "position": 9300, "name": "VLV_SFEL01.01", "labelReverse": [90, 1750, 150]}, + {"type": "correctorfermi", "position": 10015, "ps": ["PSCH_SFEL01.01","PSCV_SFEL01.01"], "name": "CHV_SFEL01.01", "labelReverse": [90, 1800, 250]}, + {"type": "bpm", "position": 10290, "name": "RTBPM_SFEL01.01", "labelReverse": [90, 2100, 250]}, + {"type": "quadrupolefermi", "position": 10815, "name": "Q_SFEL01.02", "labelReverse": [90, 1550, 250]}, + {"type": "blm", "position": 10815, "name": "BLM_Q_SFEL01.02"}, + {"type": "quadrupolefermi", "position": 12815, "name": "Q_SFEL01.03", "labelReverse": [90, 1600, 250]}, + {"type": "blm", "position": 12815, "name": "BLM_Q_SFEL01.03"}, + {"type": "plc", "position": 12815, "name": "SPIN-UH.02", "offset3d": [0, -300, 0], "offset2d": [0, 300], "labelReverse": [185,50,80]}, + {"type": "plc", "position": 13215, "name": "SP_SLU_UH.03", "offset3d": [0, -300, 0], "offset2d": [0, 300], "labelReverse": [185,1830,80]}, + {"type": "correctorfermi", "position": 13215, "ps": ["PSCH_SFEL01.02","PSCV_SFEL01.02"], "name": "CHV_SFEL01.02", "labelReverse": [90, 1850, 250]} + ] + }, + { + "start": {"x": 25655, "z": -7555}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "-PI", "length": 250, "name": "B_SFEL01.01", "labelReverse": [90, 1600, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_SFEL01.01"}, + {"type": "bpm", "position": 357, "name": "RTBPM_SFEL01.02", "labelReverse": [90, 2170, 250]}, + {"type": "quadrupolefermi", "position": 837, "name": "Q_SFEL01.04", "labelReverse": [90, 1600, 250]}, + {"type": "plc", "position": 837, "name": "SP_LSU_EOS.02", "offset3d": [0, -300, 0], "offset2d": [0, 300], "labelReverse": [180,2000,80]}, + {"type": "blm", "position": 837, "name": "BLM_Q_SFEL01.04"}, + {"type": "correctorfermi", "position": 1237, "ps": ["PSCH_SFEL01.03","PSCV_SFEL01.03"], "name": "CHV_SFEL01.03", "labelReverse": [90, 1850, 250]}, + {"type": "quadrupolefermi", "position": 1787, "name": "Q_SFEL01.05", "labelReverse": [90, 1600, 250]}, + {"type": "blm", "position": 1787, "name": "BLM_Q_SFEL01.05"}, + {"type": "bpm", "position": 2056, "name": "RTBPM_SFEL01.03", "labelReverse": [90, 2150, 250]}, + {"type": "ECOL", "position": 2682, "name": "ECOL_SFEL01.01"}, + {"type": "quadrupolefermi", "position": 3337, "name": "Q_SFEL01.06", "labelReverse": [90, 1600, 250]}, + {"type": "flsc", "position": 3657, "name": "MSCR_SFEL01.01", "labelReverse": [90, 2000, 250]}, + {"type": "quadrupolefermi", "position": 4052, "name": "Q_SFEL01.07", "labelReverse": [90, 1600, 250]}, + {"type": "blm", "position": 4052, "name": "BLM_Q_SFEL01.07"} + ] + }, + { + "start": {"x": 30485, "z": -7808}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "-PI", "length": 250, "name": "B_SFEL01.02", "labelReverse": [90, 1600, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "plc", "position": 0, "name": "SPIN-UH.03", "offset3d": [0, -300, 0], "offset2d": [-200, 350], "labelReverse": [180,1500,80]}, + {"type": "blm", "position": 100, "name": "BLM_B_SFEL01.02"}, + {"type": "correctorfermi", "position": 800, "ps": ["PSCH_SFEL01.04","PSCV_SFEL01.04"], "name": "CHV_SFEL01.04", "labelReverse": [90, 1850, 250]}, + {"type": "blm", "position": 800, "name": "BLM_CHV_SFEL01.04"}, + {"type": "quadrupolefermi", "position": 1200, "name": "Q_SFEL01.08", "labelReverse": [90, 1600, 250]}, + {"type": "correctorfermi", "position": 1503, "ps": ["PSCH_SFEL01.05","PSCV_SFEL01.05"], "name": "CHV_SFEL01.05", "labelReverse": [90, 1850, 250]}, + {"type": "bpm", "position": 1775, "name": "RTBPM_SFEL01.04", "labelReverse": [90, 2150, 250]}, + {"type": "blm", "position": 1775, "name": "BLM_BPM_SFEL01.04"}, + {"type": "quadrupolefermi", "position": 2250, "name": "Q_SFEL01.09", "labelReverse": [90, 1600, 250]}, + {"type": "blm", "position": 2250, "name": "BLM_Q_SFEL01.09"}, + {"type": "quadrupolefermi", "position": 2950, "name": "Q_SFEL01.10", "labelReverse": [90, 1600, 250]}, + {"type": "correctorfermi", "position": 3727, "ps": ["PSCH_SFEL01.06","PSCV_SFEL01.06"], "name": "CHV_SFEL01.06", "labelReverse": [90, 1850, 250]}, + {"type": "quadrupolefermi", "position": 4050, "name": "Q_SFEL01.11", "labelReverse": [90, 1600, 250]}, + {"type": "blm", "position": 4050, "name": "BLM_Q_SFEL01.11"}, + {"type": "bpm", "position": 4525, "name": "CBPM_SFEL01.01", "labelReverse": [90, 2050, 250]}, + {"type": "cm", "position": 4750, "name": "CM_SFEL01.01", "labelReverse": [90, 1790, 250]}, + {"type": "flsc", "position": 5000, "name": "MSCR_SFEL01.02", "labelReverse": [90, 2050, 250]}, + {"type": "BAM", "position": 5006, "name": "BAM_SFEL01.01"}, + {"type": "bpm", "position": 5550, "name": "CBPM_SFEL01.02", "labelReverse": [90, 2050, 250]}, + {"type": "EOS", "position": 6935, "name": "EOS_SFEL01.01"}, + {"type": "vlv", "position": 7930, "name": "VLV_SFEL01.02", "labelReverse": [90, 1850, 150]}, + {"type": "bpm", "position": 8204, "name": "CBPM_SFEL01.03", "labelReverse": [90, 2050, 250]}, + {"type": "SFEL01", "position": 8675, "name": "SFEL01"}, + {"type": "UND", "position": 8675, "name": "UND_F01"}, + {"type": "undulator", "position": 10285, "name": "ID_FEL01.01 (MOD01.01)", "labelReverse": [90, 2650, 250]}, + {"type": "bpm", "position": 11819, "name": "CBPM_FEL01.01", "labelReverse": [90, 1950, 250]}, + {"type": "quadrupolefermi", "position": 12050, "name": "Q_FEL01.01", "labelReverse": [90, 1500, 250]}, + {"type": "correctorfermi", "position": 12350, "ps": ["PSCH_FEL01.01","PSCV_FEL01.01"], "name": "CHV_FEL01.01", "labelReverse": [90, 1780, 250]}, + {"type": "flsc", "position": 12602, "name": "MSCR_FEL01.01", "labelReverse": [90, 1950, 250]} + ] + }, + { + "start": {"x": 43690, "z": -7809}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "-PI/2", "length": 413, "name": "B_EEHG_FEL01.01", "labelReverse": [90, 2150, 150]}, + "chamber": {"type": "chamber"}, + "components": [ + ] + }, + { + "start": {"x": 45099, "z": -7809}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 412, "name": "B_EEHG_FEL01.02", "labelReverse": [90, 2150, 50]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "flsc", "position": 340, "name": "MSCR_EEHG_FEL01.01", "labelReverse": [90, 2600, 250], "offset2d": [-220, 0]} + ] + }, + { + "start": {"x": 45779, "z": -7809}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 412, "name": "B_EEHG_FEL01.03", "labelReverse": [90, 2150, 150]}, + "chamber": {"type": "chamber"}, + "components": [ + ] + }, + { + "start": {"x": 47188, "z": -7809}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 412, "name": "B_EEHG_FEL01.04", "labelReverse": [90, 2150, 150]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "bpm", "position": 424, "name": "CBPM_FEL01.02"}, + {"type": "quadrupolefermi", "position": 835, "name": "Q_FEL01.02"}, + {"type": "correctorfermi", "position": 1195, "ps": ["PSCH_FEL01.02","PSCV_FEL01.02"], "name": "CHV_FEL01.02"}, + {"type": "flsc", "position": 1437, "name": "MSCR_FEL01.02"}, + {"type": "blm", "position": 1437, "name": "BLM_MSCR_FEL01.02"}, + {"type": "BAM", "position": 1283, "name": "BAM_FEL01.01"}, + {"type": "undulator", "position": 2142, "name": "ID_FEL01.03 (MOD01.02)"}, + {"type": "W", "position": 3455, "name": "W_FEL01.01"}, + {"type": "bpm", "position": 3721, "name": "CBPM_IUFEL01.02"}, + {"type": "quadrupolefermi", "position": 4431, "name": "Q_IUFEL01.02"}, + {"type": "correctorfermi", "position": 4991, "ps": ["PSCH_IUFEL01.02","PSCV_IUFEL01.02"], "name": "CHV_IUFEL01.02"}, + {"type": "flsc", "position": 5523, "name": "MSCR_IUFEL01.02"}, + {"type": "undulator", "position": 6340, "name": "ID_FEL01.04 (RAD01.03)"}, + {"type": "PHSH", "position": 7688, "name": "PHSH_IUFEL01.03"}, + {"type": "bpm", "position": 7936, "name": "CBPM_IUFEL01.03"}, + {"type": "quadrupolefermi", "position": 8446, "name": "Q_IUFEL01.03"}, + {"type": "correctorfermi", "position": 9006, "ps": ["PSCH_IUFEL01.03","PSCV_IUFEL01.03"], "name": "CHV_IUFEL01.03"}, + {"type": "flsc", "position": 9338, "name": "MSCR_IUFEL01.03"}, + {"type": "undulator", "position": 10055, "name": "ID_FEL01.05 (RAD01.04)"}, + {"type": "blm", "position": 10055, "name": "BLM_ID_FEL01.05"}, + {"type": "PHSH", "position": 11403, "name": "PHSH_IUFEL01.04"}, + {"type": "bpm", "position": 11651, "name": "CBPM_IUFEL01.04"}, + {"type": "quadrupolefermi", "position": 12061, "name": "Q_IUFEL01.04"}, + {"type": "correctorfermi", "position": 12431, "ps": ["PSCH_IUFEL01.04","PSCV_IUFEL01.04"], "name": "CHV_IUFEL01.04"}, + {"type": "flsc", "position": 12903, "name": "MSCR_IUFEL01.04"}, + {"type": "undulator", "position": 13770, "name": "ID_FEL01.06 (RAD01.05)"}, + {"type": "PHSH", "position": 15118, "name": "PHSH_IUFEL01.05"}, + {"type": "bpm", "position": 15365, "name": "CBPM_IUFEL01.05"}, + {"type": "quadrupolefermi", "position": 15851, "name": "Q_IUFEL01.05"}, + {"type": "correctorfermi", "position": 16405, "ps": ["PSCH_IUFEL01.05","PSCV_IUFEL01.05"], "name": "CHV_IUFEL01.05"}, + {"type": "flsc", "position": 16768, "name": "MSCR_IUFEL01.05"}, + {"type": "undulator", "position": 17484, "name": "ID_FEL01.07 (RAD01.06)"}, + {"type": "PHSH", "position": 18832, "name": "PHSH_IUFEL01.06"}, + {"type": "bpm", "position": 19080, "name": "CBPM_IUFEL01.06"}, + {"type": "quadrupolefermi", "position": 19591, "name": "Q_IUFEL01.06"}, + {"type": "correctorfermi", "position": 20060, "ps": ["PSCH_IUFEL01.06","PSCV_IUFEL01.06"], "name": "CHV_IUFEL01.06"}, + {"type": "flsc", "position": 20383, "name": "MSCR_IUFEL01.06"}, + {"type": "undulator", "position": 21189, "name": "ID_FEL01.08 (RAD01.07)"}, + {"type": "PHSH", "position": 22547, "name": "PHSH_IUFEL01.07"}, + {"type": "bpm", "position": 22795, "name": "CBPM_IUFEL01.07"}, + {"type": "quadrupolefermi", "position": 23206, "name": "Q_IUFEL01.07"}, + {"type": "correctorfermi", "position": 23665, "ps": ["PSCH_IUFEL01.07","PSCV_IUFEL01.07"], "name": "CHV_IUFEL01.07"}, + {"type": "flsc", "position": 24198, "name": "MSCR_IUFEL01.07"}, + {"type": "undulator", "position": 24904, "name": "ID_FEL01.09 (RAD01.08)"}, + {"type": "blm", "position": 24904, "name": "BLM_ID_FEL01.09"}, + {"type": "bpm", "position": 26532, "name": "CBPM_IUFEL01.08"}, + {"type": "quadrupolefermi", "position": 27021, "name": "Q_IUFEL01.08"}, + {"type": "correctorfermi", "position": 27490, "ps": ["PSCH_IUFEL01.08","PSCV_IUFEL01.08"], "name": "CHV_IUFEL01.08"}, + {"type": "flsc", "position": 27899, "name": "MSCR_IUFEL01.08"}, + {"type": "LINE", "position": 27949, "name": "LINE_IUFEL"}, + {"type": "BD", "position": 27949, "name": "BD_MBD_FEL01"}, + {"type": "vlv", "position": 28530, "name": "VLV_MBD_FEL01.01"}, + {"type": "cm", "position": 28935, "name": "CM_MBD_FEL01.01"}, + {"type": "correctorfermi", "position": 29335, "ps": ["PSCH_MBD_FEL01.01","PSCV_MBD_FEL01.01"], "name": "CHV_MBD_FEL01.01"}, + {"type": "flsc", "position": 29800, "name": "MBSCR_FEL01.01"}, + {"type": "quadrupolefermi", "position": 30728, "name": "Q_MBD_FEL01.01"}, + {"type": "vlv", "position": 31530, "name": "FVLV_MBD_FEL01.01"}, + {"type": "quadrupolefermi", "position": 32348, "name": "Q_MBD_FEL01.02"}, + {"type": "correctorfermi", "position": 32965, "ps": ["PSCH_MBD_FEL01.02","PSCV_MBD_FEL01.02"], "name": "CHV_MBD_FEL01.02"}, + {"type": "bpm", "position": 33761, "name": "BPM_MBD_FEL01.01"}, + {"type": "flsc", "position": 35803, "name": "MSCR_MBD_FEL01.01"}, + {"type": "bpm", "position": 37886, "name": "BPM_MBD_FEL01.02"}, + {"type": "correctorfermi", "position": 38466, "ps": ["PSCH_MBD_FEL01.03","PSCV_MBD_FEL01.03"], "name": "CHV_MBD_FEL01.03"}, + {"type": "blm", "position": 38466, "name": "BLM_CHV_MBD_FEL01.03"}, + {"type": "quadrupolefermi", "position": 39076, "name": "Q_MBD_FEL01.03"}, + {"type": "blm", "position": 39076, "name": "BLM_Q_MBD_FEL01.03"}, + {"type": "quadrupolefermi", "position": 40296, "name": "Q_MBD_FEL01.04"}, + {"type": "blm", "position": 40296, "name": "BLM_Q_MBD_FEL01.04_L"}, + {"type": "blm", "position": 40296, "name": "BLM_Q_MBD_FEL01.04_R"}, + {"type": "plc", "position": 45296, "name": "SPIN-FE.01", "offset3d": [0, -300, 0], "offset2d": [0, -200]} + ] + }, + { + "start": {"x": 88866, "z": -7809}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 1122, "name": "B_MBD_FEL01.01"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_MBD_FEL01.01_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_MBD_FEL01.01_R"}, + {"type": "quadrupolefermi", "position": 1050, "name": "Q_MBD_FEL01.05"}, + {"type": "bpm", "position": 1378, "name": "RTBPM_MBD_FEL01.03"}, + {"type": "quadrupolefermi", "position": 1700, "name": "Q_MBD_FEL01.06"}, + {"type": "blm", "position": 1700, "name": "BLM_Q_MBD_FEL01.06_L"}, + {"type": "blm", "position": 1700, "name": "BLM_Q_MBD_FEL01.06_R"}, + {"type": "vlv", "position": 2200, "name": "VLV_MBD_FEL01.02"}, + {"type": "correctorfermi", "position": 2500, "ps": ["PSCH_MBD_FEL01.04","PSCV_MBD_FEL01.04"], "name": "CHV_MBD_FEL01.04"}, + {"type": "bpm", "position": 4662, "name": "RTBPM_MBD.01"}, + {"type": "blm", "position": 4662, "name": "BLM_BPM_MBD.01_DN"}, + {"type": "blm", "position": 4662, "name": "BLM_BPM_MBD.01_UP"}, + {"type": "correctorfermi", "position": 4922, "ps": ["PSCH_MBD.01","PSCV_MBD.01"], "name": "CHV_MBD.01"}, + {"type": "quadrupolefermi", "position": 5246, "name": "Q_MBD.01"}, + {"type": "blm", "position": 5246, "name": "BLM_Q_MBD.01_L"}, + {"type": "blm", "position": 5246, "name": "BLM_Q_MBD.01_R"} + ] + }, + { + "start": {"x": 95500, "z": -5774}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI/2", "length": 2437, "name": "B_MBD.01"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_MBD.01_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_MBD.01_R"}, + {"type": "bpm", "position": 1543, "name": "RTBPM_MBD.02"}, + {"type": "blm", "position": 1543, "name": "BLM_BPM_MBD.02_DN"}, + {"type": "blm", "position": 1543, "name": "BLM_BPM_MBD.02_UP"}, + {"type": "correctorfermi", "position": 1822, "ps": ["PSCH_MBD.02","PSCV_MBD.02"], "name": "CHV_MBD.02"}, + {"type": "quadrupolefermi", "position": 2289, "name": "Q_MBD.02"}, + {"type": "blm", "position": 2289, "name": "BLM_Q_MBD.02_L"}, + {"type": "blm", "position": 2289, "name": "BLM_Q_MBD.02_R"}, + {"type": "vlv", "position": 2800, "name": "VLV_MBD.01"}, + {"type": "quadrupolefermi", "position": 3191, "name": "Q_MBD.03"}, + {"type": "plc", "position": 3191, "name": "SPIN-UH.06", "offset3d": [0, -300, 0], "offset2d": [-200, 350], "labelReverse": true}, + {"type": "blm", "position": 3191, "name": "BLM_Q_MBD.03_L"}, + {"type": "blm", "position": 3191, "name": "BLM_Q_MBD.03_R"}, + {"type": "bpm", "position": 3460, "name": "RTBPM_MBD.03"}, + {"type": "correctorfermi", "position": 3793, "ps": ["PSCH_MBD.03","PSCV_MBD.03"], "name": "CHV_MBD.03"}, + {"type": "blm", "position": 3793, "name": "BLM_CHV_MBD.03_L"}, + {"type": "blm", "position": 3793, "name": "BLM_CHV_MBD.03_R"}, + {"type": "cm", "position": 4245, "name": "CM_MBD.01"}, + {"type": "SC", "position": 4391, "name": "SC_THZ_MBD.01"}, + {"type": "blm", "position": 4391, "name": "BLM_SC_THZ_MBD.01_L"}, + {"type": "blm", "position": 4391, "name": "BLM_SC_THZ_MBD.01_R"}, + {"type": "flsc", "position": 5588, "name": "MSCR_MBD.01"}, + {"type": "blm", "position": 5588, "name": "BLM_MSCR_MBD.01_L"}, + {"type": "blm", "position": 5588, "name": "BLM_MSCR_MBD.01_R"}, + {"type": "D", "position": 6566, "name": "D_MBD.01"}, + {"type": "BD", "position": 6067, "name": "BD_FEL01"}, + {"type": "Perm", "position": 4292, "name": "Perm_Magn_F2"}, + {"type": "SFEL02", "position": 79449, "name": "SFEL02"} + ] + }, + { + "start": {"x": 100500, "z": -2300}, + "chamber": {"type": "chamber"}, + "components": [ + ] + } + ], + "blm": { + "confsrc": "https://puma-01.elettra.eu/misc/threejs/fermi_blm.php?fel1&conf=long", + "datasrc": "https://puma-01.elettra.eu/misc/threejs/fermi_blm.php?fel1" + }, + "bpm": { + "pos": "https://puma-01.elettra.eu/misc/threejs/fermi_bpm.php?std&fel1", + "rms": "https://puma-01.elettra.eu/misc/threejs/fermi_bpm.php?rms&fel1", + "defaultZoom": 0.01, + "length": 24, + "offset": 0 + } + }, + "fel2": { + "sections": [ + { + "start": {"x": 11440, "z": -6064} + }, + { + "start": {"x": 16179, "z": -6559}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "-PI/2", "length": 250, "name": "B_SFEL02.01", "labelReverse": [90, 1600, 100]}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_SFEL02.01", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 800, "name": "Q_SFEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 800, "name": "BLM_Q_SFEL02.01", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 1750, "name": "Q_SFEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 1750, "name": "BLM_Q_SFEL02.02", "labelReverse": true}, + {"type": "bpm", "position": 2019, "name": "RTBPM_SFEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "ECOL", "position": 2645, "name": "ECOL_SFEL02.01", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 3300, "name": "Q_SFEL02.03", "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 3300, "name": "BLM_Q_SFEL02.03", "labelReverse": true}, + {"type": "flsc", "position": 3620, "name": "MSCR_SFEL02.01", "labelReverse": [90, -450, 250]}, + {"type": "quadrupolefermi", "position": 4015, "name": "Q_SFEL02.04", "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 4015, "name": "BLM_Q_SFEL02.04", "labelReverse": [90, 1550, 250]} + ] + }, + { + "start": {"x": 20972, "z": -6810}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "-PI", "length": 250, "name": "B_SFEL02.02", "labelReverse": [90, -250, 0]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_SFEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "bpm", "position": 350, "name": "RTBPM_SFEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "quadrupolefermi", "position": 800, "name": "Q_SFEL02.05", "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 800, "name": "BLM_Q_SFEL02.05", "labelReverse": [90, -250, 250]}, + {"type": "correctorfermi", "position": 1200, "ps": ["PSCH_SFEL02.01","PSCV_SFEL02.01"], "name": "CHV_SFEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "vlv", "position": 1480, "name": "VLV_SFEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "quadrupolefermi", "position": 1850, "name": "Q_SFEL02.06", "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 1850, "name": "BLM_Q_SFEL02.06", "labelReverse": [90, -250, 250]}, + {"type": "correctorfermi", "position": 2275, "ps": ["PSCH_SFEL02.02","PSCV_SFEL02.02"], "name": "CHV_SFEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "quadrupolefermi", "position": 3000, "name": "Q_SFEL02.07", "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 3000, "name": "BLM_Q_SFEL02.07", "labelReverse": [90, -250, 250]}, + {"type": "correctorfermi", "position": 3650, "ps": ["PSCH_SFEL02.03","PSCV_SFEL02.03"], "name": "CHV_SFEL02.03", "labelReverse": [90, -250, 250]}, + {"type": "quadrupolefermi", "position": 4050, "name": "Q_SFEL02.08", "labelReverse": [90, -250, 250]}, + {"type": "blm", "position": 4050, "name": "BLM_Q_SFEL02.08", "labelReverse": [90, -250, 250]}, + {"type": "correctorfermi", "position": 4400, "ps": ["PSCH_SFEL02.04","PSCV_SFEL02.04"], "name": "CHV_SFEL02.04", "labelReverse": [90, -250, 250]}, + {"type": "bpm", "position": 4629, "name": "CBPM_SFEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "cm", "position": 4935, "name": "CM_SFEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "BAM", "position": 5300, "name": "BAM_SFEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "bpm", "position": 5500, "name": "CBPM_SFEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "flsc", "position": 5921, "name": "MSCR_SFEL02.02", "labelReverse": [90, -550, 250]}, + {"type": "blm", "position": 5921, "name": "BLM_MSCR_SFEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "EOS", "position": 6935, "name": "EOS_SFEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "vlv", "position": 8000, "name": "VLV_SFEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "bpm", "position": 8404, "name": "CBPM_SFEL02.03", "labelReverse": [90, -250, 250]}, + {"type": "SFEL02", "position": 8675, "name": "SFEL02", "labelReverse": [90, -250, 250]}, + {"type": "UND", "position": 8675, "name": "UND_F02", "labelReverse": [90, -250, 250]}, + {"type": "undulator", "position": 10285, "name": "ID_FEL02.01 (MOD02.01)", "labelReverse": [90, -250, 250]}, + {"type": "W", "position": 12443, "name": "W_FEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "bpm", "position": 12068, "name": "CBPM_FEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "quadrupolefermi", "position": 12579, "name": "Q_FEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "correctorfermi", "position": 13048, "ps": ["PSCH_FEL02.01","PSCV_FEL02.01"], "name": "CHV_FEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "flsc", "position": 13556, "name": "MSCR_FEL02.01", "labelReverse": [90, -450, 250]}, + {"type": "undulator", "position": 15103, "name": "ID_FEL02.02 (RAD02.01)", "labelReverse": [90, -250, 250]}, + {"type": "PHSH", "position": 16454, "name": "PHSH_IUFEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "bpm", "position": 16708, "name": "CBPM_IUFEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "quadrupolefermi", "position": 17219, "name": "Q_IUFEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "correctorfermi", "position": 17688, "ps": ["PSCH_IUFEL02.01","PSCV_IUFEL02.01"], "name": "CHV_IUFEL02.01", "labelReverse": [90, -250, 250]}, + {"type": "flsc", "position": 18096, "name": "MSCR_IUFEL02.01", "labelReverse": [90, -450, 250]}, + {"type": "undulator", "position": 18818, "name": "ID_FEL02.03 (RAD02.02)", "labelReverse": [90, -250, 250]}, + {"type": "PHSH", "position": 20169, "name": "PHSH_IUFEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "bpm", "position": 20423, "name": "CBPM_IUFEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "quadrupolefermi", "position": 20934, "name": "Q_IUFEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "correctorfermi", "position": 21393, "ps": ["PSCH_IUFEL02.02","PSCV_IUFEL02.02"], "name": "CHV_IUFEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "flsc", "position": 21711, "name": "MSCR_IUFEL02.02", "labelReverse": [90, -450, 250]}, + {"type": "undulator", "position": 22533, "name": "ID_FEL02.04 (RAD02.03)", "labelReverse": [90, -250, 250]}, + {"type": "bpm", "position": 23951, "name": "CBPM_FEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "quadrupolefermi", "position": 24161, "name": "Q_FEL02.02", "labelReverse": [90, -250, 250]}, + {"type": "correctorfermi", "position": 24421, "ps": ["PSCH_FEL02.02","PSCV_FEL02.02"], "name": "CHV_FEL02.02", "labelReverse": [90, -250, 250]} + ] + }, + { + "start": {"x": 45868, "z": -6811}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "-PI/2", "length": 320, "name": "B_FEL02.01", "labelReverse": [90, -250, 0]}, + "chamber": {"type": "chamber"}, + "components": [ + ] + }, + { + "start": {"x": 46328, "z": -6811}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 320, "name": "B_FEL02.02", "labelReverse": [90, -250, 0]}, + "chamber": {"type": "chamber"}, + "components": [ + ] + }, + { + "start": {"x": 46788, "z": -6811}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 320, "name": "B_FEL02.03", "labelReverse": [90, -250, 0]}, + "chamber": {"type": "chamber"}, + "components": [ + ] + }, + { + "start": {"x": 47248, "z": -6811}, + "bending": {"type": "dipolefermi", "label": "show", "rotateY": "PI", "length": 320, "name": "B_FEL02.04", "labelReverse": [90, -250, 0]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "bpm", "position": 356, "name": "CBPM_FEL02.03", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 866, "name": "Q_FEL02.03", "labelReverse": true}, + {"type": "correctorfermi", "position": 1266, "ps": ["PSCH_FEL02.03","PSCV_FEL02.03"], "name": "CHV_FEL02.03", "labelReverse": true}, + {"type": "flsc", "position": 1643, "name": "MSCR_FEL02.02", "labelReverse": [90, -450, 250]}, + {"type": "undulator", "position": 2472, "name": "ID_FEL02.05 (MOD02.02)", "labelReverse": true}, + {"type": "W", "position": 4248, "name": "W_FEL02.02", "labelReverse": true}, + {"type": "vlv", "position": 4600, "name": "VLV_FEL02.01", "labelReverse": true}, + {"type": "bpm", "position": 4873, "name": "CBPM_FEL02.04", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 5284, "name": "Q_FEL02.04", "labelReverse": true}, + {"type": "correctorfermi", "position": 5693, "ps": ["PSCH_FEL02.04","PSCV_FEL02.04"], "name": "CHV_FEL02.04", "labelReverse": true}, + {"type": "flsc", "position": 6061, "name": "MSCR_FEL02.03", "labelReverse": [90, -450, 250]}, + {"type": "undulator", "position": 6886, "name": "ID_FEL02.06 (RAD02.04)", "labelReverse": true}, + {"type": "PHSH", "position": 8251, "name": "PHSH_IUFEL02.03", "labelReverse": true}, + {"type": "bpm", "position": 8492, "name": "CBPM_IUFEL02.03", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 8902, "name": "Q_IUFEL02.03", "labelReverse": true}, + {"type": "correctorfermi", "position": 9362, "ps": ["PSCH_IUFEL02.03","PSCV_IUFEL02.03"], "name": "CHV_IUFEL02.03", "labelReverse": true}, + {"type": "flsc", "position": 9780, "name": "MSCR_IUFEL02.03", "labelReverse": [90, -450, 250]}, + {"type": "undulator", "position": 10602, "name": "ID_FEL02.07 (RAD02.05)", "labelReverse": true}, + {"type": "blm", "position": 10602, "name": "BLM_ID_FEL02.07", "labelReverse": true}, + {"type": "PHSH", "position": 11966, "name": "PHSH_IUFEL02.04", "labelReverse": true}, + {"type": "bpm", "position": 12207, "name": "CBPM_IUFEL02.04", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 12718, "name": "Q_IUFEL02.04", "labelReverse": true}, + {"type": "correctorfermi", "position": 13177, "ps": ["PSCH_IUFEL02.04","PSCV_IUFEL02.04"], "name": "CHV_IUFEL02.04", "labelReverse": true}, + {"type": "flsc", "position": 13596, "name": "MSCR_IUFEL02.04", "labelReverse": [90, -450, 250]}, + {"type": "undulator", "position": 14317, "name": "ID_FEL02.08 (RAD02.06)", "labelReverse": true}, + {"type": "PHSH", "position": 15681, "name": "PHSH_IUFEL02.05", "labelReverse": true}, + {"type": "bpm", "position": 15922, "name": "CBPM_IUFEL02.05", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 16433, "name": "Q_IUFEL02.05", "labelReverse": true}, + {"type": "correctorfermi", "position": 16842, "ps": ["PSCH_IUFEL02.05","PSCV_IUFEL02.05"], "name": "CHV_IUFEL02.05", "labelReverse": true}, + {"type": "flsc", "position": 17211, "name": "MSCR_IUFEL02.05", "labelReverse": [90, -450, 250]}, + {"type": "undulator", "position": 18032, "name": "ID_FEL02.09 (RAD02.07)", "labelReverse": true}, + {"type": "PHSH", "position": 19396, "name": "PHSH_IUFEL02.06", "labelReverse": true}, + {"type": "bpm", "position": 19637, "name": "CBPM_IUFEL02.06", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 19948, "name": "Q_IUFEL02.06", "labelReverse": true}, + {"type": "correctorfermi", "position": 20259, "ps": ["PSCH_IUFEL02.06","PSCV_IUFEL02.06"], "name": "CHV_IUFEL02.06", "labelReverse": true}, + {"type": "vlv", "position": 20700, "name": "VLV_IUFEL02.01", "labelReverse": true}, + {"type": "flsc", "position": 20926, "name": "MSCR_IUFEL02.06", "labelReverse": [90, -450, 250]}, + {"type": "undulator", "position": 21747, "name": "ID_FEL02.10 (RAD02.08)", "labelReverse": true}, + {"type": "PHSH", "position": 23111, "name": "PHSH_IUFEL02.07", "labelReverse": true}, + {"type": "bpm", "position": 23352, "name": "CBPM_IUFEL02.07", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 23863, "name": "Q_IUFEL02.07", "labelReverse": true}, + {"type": "correctorfermi", "position": 24292, "ps": ["PSCH_IUFEL02.07","PSCV_IUFEL02.07"], "name": "CHV_IUFEL02.07", "labelReverse": true}, + {"type": "flsc", "position": 24641, "name": "MSCR_IUFEL02.07", "labelReverse": [90, -450, 250]}, + {"type": "undulator", "position": 25462, "name": "ID_FEL02.11 (RAD02.09)", "labelReverse": true}, + {"type": "blm", "position": 25462, "name": "BLM_ID_FEL02.11", "labelReverse": true}, + {"type": "PHSH", "position": 26829, "name": "PHSH_IUFEL02.08", "labelReverse": true}, + {"type": "bpm", "position": 27067, "name": "CBPM_IUFEL02.08", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 27578, "name": "Q_IUFEL02.08", "labelReverse": true}, + {"type": "correctorfermi", "position": 28037, "ps": ["PSCH_IUFEL02.08","PSCV_IUFEL02.08"], "name": "CHV_IUFEL02.08", "labelReverse": true}, + {"type": "flsc", "position": 28356, "name": "MSCR_IUFEL02.08", "labelReverse": [90, -450, 250]}, + {"type": "undulator", "position": 29177, "name": "ID_FEL02.12 (RAD02.10)", "labelReverse": true}, + {"type": "PHSH", "position": 30491, "name": "PHSH_IUFEL02.09", "labelReverse": true}, + {"type": "bpm", "position": 30681, "name": "RTBPM_IUFEL02.01", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 31193, "name": "Q_IUFEL02.09", "labelReverse": true}, + {"type": "correctorfermi", "position": 31663, "ps": ["PSCH_IUFEL02.09","PSCV_IUFEL02.09"], "name": "CHV_IUFEL02.09", "labelReverse": true}, + {"type": "flsc", "position": 32024, "name": "MSCR_IUFEL02.09", "labelReverse": [90, -450, 250]}, + {"type": "undulator", "position": 32931, "name": "ID_FEL02.13 (RAD02.11)", "labelReverse": true}, + {"type": "bpm", "position": 34507, "name": "CBPM_IUFEL02.10", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 34908, "name": "Q_IUFEL02.10", "labelReverse": true}, + {"type": "correctorfermi", "position": 35300, "ps": ["PSCH_IUFEL02.10","PSCV_IUFEL02.10"], "name": "CHV_IUFEL02.10", "labelReverse": true}, + {"type": "blm", "position": 35400, "name": "BLM_CHV_IUFEL02.10", "labelReverse": true}, + {"type": "FEL02", "position": 35579, "name": "FEL02", "labelReverse": true}, + {"type": "MBD", "position": 35579, "name": "MBD_FEL02", "labelReverse": true}, + {"type": "cm", "position": 35629, "name": "CM_MBD_FEL02.01", "labelReverse": true}, + {"type": "vlv", "position": 36000, "name": "VLV_MBD_FEL02.01", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 36359, "name": "Q_MBD_FEL02.01", "labelReverse": true}, + {"type": "blm", "position": 36259, "name": "BLM_Q_MBD_FEL02.01", "labelReverse": true}, + {"type": "vlv", "position": 36850, "name": "FVLV_MBD_FEL02.01", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 37244, "name": "Q_MBD_FEL02.02", "labelReverse": true}, + {"type": "blm", "position": 37244, "name": "BLM_Q_MBD_FEL02.02", "labelReverse": true}, + {"type": "FBMSCR", "position": 37348, "name": "FBMSCR_FEL02.01", "labelReverse": true}, + {"type": "correctorfermi", "position": 37658, "ps": ["PSCH_MBD_FEL02.01","PSCV_MBD_FEL02.01"], "name": "CHV_MBD_FEL02.01", "labelReverse": true}, + {"type": "bpm", "position": 37983, "name": "RTBPM_MBD_FEL02.01", "labelReverse": true}, + {"type": "flsc", "position": 40033, "name": "MBSCR_MBD_FEL02.01", "labelReverse": [90, -450, 250]}, + {"type": "flsc", "position": 40633, "name": "MSCR_MBD_FEL02.01", "labelReverse": [90, -450, 250]}, + {"type": "bpm", "position": 42039, "name": "RTBPM_MBD_FEL02.02", "labelReverse": true}, + {"type": "correctorfermi", "position": 42808, "ps": ["PSCH_MBD_FEL02.02","PSCV_MBD_FEL02.02"], "name": "CHV_MBD_FEL02.02", "labelReverse": true}, + {"type": "blm", "position": 42808, "name": "BLM_CHV_MBD_FEL02.02", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 43408, "name": "Q_MBD_FEL02.03", "labelReverse": true}, + {"type": "blm", "position": 43408, "name": "BLM_Q_MBD_FEL02.03", "labelReverse": true}, + {"type": "vlv", "position": 43799, "name": "VLV_MBD_FEL02.02", "labelReverse": true}, + {"type": "quadrupolefermi", "position": 44128, "name": "Q_MBD_FEL02.04", "labelReverse": true}, + {"type": "blm", "position": 44128, "name": "BLM_Q_MBD_FEL02.04_L", "labelReverse": true}, + {"type": "blm", "position": 44128, "name": "BLM_Q_MBD_FEL02.04_R", "labelReverse": true}, + {"type": "plc", "position": 47915, "name": "SPIN-FEUH.02", "offset3d": [0, -700, 0], "offset2d": [0, -200], "labelReverse": [180, 1800, 50]} + ] + }, + { + "start": {"x": 92100, "z": -6811}, + "bending": {"type": "dipolefermi", "label": "show", "length": 1122, "name": "B_MBD_FEL02.01", "labelReverse": true}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "blm", "position": 100, "name": "BLM_B_MBD_FEL02.01_L"}, + {"type": "blm", "position": 100, "name": "BLM_B_MBD_FEL02.01_R"}, + {"type": "BD", "position": 560, "name": "BD_MBD_FEL02"}, + {"type": "Perm", "position": 2061, "name": "Perm_Magn_F2"} + ] + }, + { + "start": {"x": 100500, "z": -2300} + }, + + { + "start": {"x": 92100, "y": -700, "z": -6811} + }, + { + "start": {"x": 100500, "y": -700, "z": -2300} + } + ], + "blm": { + "confsrc": "https://puma-01.elettra.eu/misc/threejs/fermi_blm.php?fel2&conf=long", + "datasrc": "https://puma-01.elettra.eu/misc/threejs/fermi_blm.php?fel2" + }, + "bpm": { + "pos": "https://puma-01.elettra.eu/misc/threejs/fermi_bpm.php?std&fel2", + "rms": "https://puma-01.elettra.eu/misc/threejs/fermi_bpm.php?rms&fel2", + "defaultZoom": 0.01, + "length": 21, + "offset": 0 + } + }, + "padres": { + "sections": [ + { + "start": {"x": 88866, "z": -7809}, + "components": [ + {"type": "vlv", "position": 11000, "name": "VLV_PFE_F01.01"}, + {"type": "vlv", "position": 12000, "name": "SH_PFE_F01.01"}, + {"type": "vlv", "position": 13000, "name": "VLV_PFE_F01.02"}, + {"type": "vlv", "position": 14000, "name": "VLV_PFE_F01.03"}, + {"type": "vlv", "position": 15000, "name": "VLV_PFE_F01.04"}, + {"type": "vlv", "position": 16000, "name": "VLV_PFE_F01.05"}, + {"type": "bst", "position": 16333, "name": "BST_PFE_F01.01"}, + {"type": "bst", "position": 16666, "name": "BST_PFE_F01.02"}, + {"type": "vlv", "position": 17000, "name": "VLV_PFE_F01.06"}, + {"type": "vlv", "position": 18000, "name": "VLV_PFE_F01.07"}, + {"type": "vlv", "position": 19000, "name": "VLV_PFE_F01.08"}, + {"type": "vlv", "position": 20000, "name": "VLV_PFE_F01.09"}, + {"type": "vlv", "position": 21000, "name": "VLV_PFE_F01.10"}, + {"type": "vlv", "position": 22000, "name": "VLV_POS_F01.01"}, + {"type": "vlv", "position": 23000, "name": "VLV_POS_F01.02"} + ] + }, + { + "start": {"x": 113200, "z": -7809}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_F01.01"}, + "chamber": {"type": "chamber"} + }, + { + "start": {"x": 119400, "z": -7250}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS.01"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 1000, "name": "VLV_POS.01"} + ] + }, + { + "start": {"x": 122600, "z": -7550}, + "bending": {"type": "mrc", "label": "show", "name": "PESP_POS.01"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 1000, "name": "VLV_POS.02"}, + {"type": "vlv", "position": 2000, "name": "SH_POS.01"} + ] + }, + { + "start": {"x": 127100, "z": -7550}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS.02"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 2000, "name": "VLV_POS_TMR.01", "labelReverse": [90, 2000, 180]}, + {"type": "vlv", "position": 5000, "name": "VLV_POS_TMR.02", "labelReverse": [90, 2000, 180]}, + {"type": "vlv", "position": 9000, "name": "VLV_POS_TMR.03", "labelReverse": [90, 2000, 180]}, + {"type": "vlv", "position": 11000, "name": "VLV_POS_TMR.04", "labelReverse": [90, 2000, 180]}, + {"type": "vlv", "position": 13000, "name": "VLV_POS_TMR.05", "labelReverse": [90, 2000, 180]} + ] + }, + { + "start": {"x": 142100, "z": -8850}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_TMR.02", "labelReverse": [0, 2000, 300]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 1500, "name": "VLV_POS_TMR.06", "labelReverse": [90, 2000, 180]}, + {"type": "vlv", "position": 2950, "name": "VLV_POS_TMR.07", "labelReverse": [90, 2000, 180]}, + {"type": "vlv", "position": 6200, "name": "VLV_POS_TMR.08", "labelReverse": [180, 2000, -100]} + ] + }, + { + "start": {"x": 153300, "z": -10450}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_TMR.05", "labelReverse": [0, -300, -100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 590, "name": "VLV_POS_TMR.09", "labelReverse": [90, 1900, 180]} + ] + }, + { + "start": {"x": 155000, "z": -10750}, + "bending": {"type": "exp", "label": "show", "name": "TIMER", "labelReverse": [90, 800, 50]}, + "chamber": {"type": "chamber"} + }, + { + "start": {"x": 142100, "z": -8850}, + "components": [ + {"type": "vlv", "position": 2200, "name": "VLV_POS_TMRB.01", "labelReverse": [90, 2000, 180]} + ] + }, + { + "start": {"x": 144800, "z": -9150}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_TMR.04", "labelReverse": [6, 1800, 300]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 3500, "name": "VLV_POS_TMRA.01", "labelReverse": [90, 2000, 200]}, + {"type": "vlv", "position": 9000, "name": "VLV_POS_TMRA.04", "labelReverse": [90, 2000, 200]} + ] + }, + { + "start": {"x": 154100, "z": -11750}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_TMRA.03", "labelReverse": [90, 2200, 100]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 820, "name": "VLV_POS_TMRA.06", "labelReverse": [90, 1950, 210]} + ] + }, + { + "start": {"x": 155000, "z": -10750}, + "chamber": {"type": "chamber"} + }, + { + "start": {"x": 144800, "z": -9150} + }, + { + "start": {"x": 151200, "z": -10930}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_TMRA.01", "labelReverse": [95, 2200, 100]}, + "components": [ + {"type": "vlv", "position": 400, "name": "VLV_POS_TMRA.02", "labelReverse": [85, 2000, 200]} + ] + }, + { + "start": {"x": 155000, "z": -10750}, + "chamber": {"type": "chamber"} + }, + { + "start": {"x": 144800, "z": -9150} + }, + { + "start": {"x": 152100, "z": -11200}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_TMRA.02", "labelReverse": [90, 2200, 100]}, + "components": [ + {"type": "vlv", "position": 400, "name": "VLV_POS_TMRA.03", "labelReverse": [80, 2000, 200]} + ] + }, + { + "start": {"x": 155000, "z": -10750}, + "chamber": {"type": "chamber"} + }, + { + "start": {"x": 153900, "z": -11690}, + "components": [ + {"type": "vlv", "position": 700, "name": "VLV_POS_TMRA.05", "labelReverse": [95, 2050, 150]} + ] + }, + { + "start": {"x": 155000, "z": -10750}, + "chamber": {"type": "chamber"} + }, + { + "start": {"x": 114200, "z": -6773}, + "components": [ + {"type": "vlv", "position": 700, "name": "VLV_POS_F02.01", "labelReverse": [95, 2050, 150]}, + {"type": "vlv", "position": 1700, "name": "VLV_POS_F02.02", "labelReverse": [95, 2050, 150]} + ] + }, + { + "start": {"x": 119400, "z": -7250}, + "chamber": {"type": "chamber"} + }, + { + "start": {"x": 144800, "z": -9150}, + "components": [ + {"type": "vlv", "position": 3500, "name": "VLV_POS_TMRB.02", "labelReverse": [180, 2100, -100]}, + {"type": "vlv", "position": 8500, "name": "VLV_POS_TMRB.05", "labelReverse": [205, 2050, 200]} + ] + }, + { + "start": {"x": 154400, "z": -9750}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_TMRB.03", "labelReverse": [25, 2000, 300]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 300, "name": "VLV_POS_TMRB.07", "labelReverse": [235, 2050, 0]} + ] + }, + { + "start": {"x": 155000, "z": -10750}, + "chamber": {"type": "chamber"} + }, + { + "start": {"x": 154200, "z": -9740}, + "components": [ + {"type": "vlv", "position": 650, "name": "VLV_POS_TMRB.06", "labelReverse": [226, 2050, 0]} + ] + }, + { + "start": {"x": 155000, "z": -10750}, + "chamber": {"type": "chamber"} + }, + { + "start": {"x": 144800, "z": -9150} + }, + { + "start": {"x": 151400, "z": -9570}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_TMRB.01", "labelReverse": [40, 1950, 300]}, + "components": [ + {"type": "vlv", "position": 250, "name": "VLV_POS_TMRB.03", "labelReverse": [225, 2050, 250]} + ] + }, + { + "start": {"x": 155000, "z": -10750}, + "chamber": {"type": "chamber"} + }, + { + "start": {"x": 144800, "z": -9150} + }, + { + "start": {"x": 152350, "z": -9630}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_TMRB.02", "labelReverse": [40, 2100, 250]}, + "components": [ + {"type": "vlv", "position": 250, "name": "VLV_POS_TMRB.04", "labelReverse": [225, 2050, 200]} + ] + }, + { + "start": {"x": 155000, "z": -10750}, + "chamber": {"type": "chamber"} + }, + + { + "start": {"x": 127100, "z": -7550}, + "components": [ + {"type": "vlv", "position": 4000, "name": "VLV_POS.03"}, + {"type": "vlv", "position": 8000, "name": "VLV_POS.04"}, + {"type": "vlv", "position": 12000, "name": "VLV_POS.05"} + ] + }, + { + "start": {"x": 142700, "z": -7550}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS.03"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 4000, "name": "VLV_POS_TMX.01", "labelReverse": [180, 2000, 200]}, + {"type": "vlv", "position": 8500, "name": "VLV_POS_TMX.02", "labelReverse": [180, 1800, 200]} + ] + }, + { + "start": {"x": 157500, "z": -8650}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_TMX.01", "labelReverse": [-90, 2000, 150]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 600, "name": "VLV_POS_TMX.03", "labelReverse": [90, 1800, 200]} + ] + }, + { + "start": {"x": 158800, "z": -8950}, + "bending": {"type": "exp", "label": "show", "name": "TIMEX"}, + "chamber": {"type": "chamber"} + }, + + { + "start": {"x": 142700, "z": -7550}, + "components": [ + {"type": "vlv", "position": 4000, "name": "VLV_POS_DPI.01", "labelReverse": [180, 1900, 200]}, + {"type": "vlv", "position": 10000, "name": "VLV_POS_DPI.02", "labelReverse": [180, 1800, 200]}, + {"type": "vlv", "position": 20000, "name": "VLV_POS_DPI.03", "labelReverse": [195, 1800, 200]} + ] + }, + { + "start": {"x": 164400, "z": -7550}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_DPI.03", "labelReverse": [15, 1800, 300]}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 500, "name": "VLV_POS_DPI.04", "labelReverse": [90, 1800, 200]} + ] + }, + { + "start": {"x": 165600, "z": -7700}, + "bending": {"type": "exp", "label": "show", "name": "DiProI"}, + "chamber": {"type": "chamber"} + }, + + { + "start": {"x": 142700, "z": -7550}, + "components": [ + {"type": "vlv", "position": 4000, "name": "VLV_POS_LDM.01", "labelReverse": [180, 2000, 200]}, + {"type": "vlv", "position": 8500, "name": "VLV_POS_LDM.02", "labelReverse": [180, 1800, 200]} + ] + }, + { + "start": {"x": 161100, "z": -6250}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_LDM.03", "labelReverse": true}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 500, "name": "VLV_POS_LDM.03", "labelReverse": [90, -150, 200]} + ] + }, + { + "start": {"x": 162300, "z": -6050}, + "bending": {"type": "exp", "label": "show", "name": "LDM"}, + "chamber": {"type": "chamber"} + }, + + { + "start": {"x": 92100, "z": -6773}, + "components": [ + {"type": "vlv", "position": 11000, "name": "VLV_PFE_F02.01", "labelReverse": [90, -150, 200]}, + {"type": "vlv", "position": 12000, "name": "SH_PFE_F02.01", "labelReverse": [90, -150, 200]}, + {"type": "vlv", "position": 13000, "name": "VLV_PFE_F02.02", "labelReverse": [90, -150, 200]}, + {"type": "vlv", "position": 14000, "name": "VLV_PFE_F02.03", "labelReverse": [90, -150, 200]}, + {"type": "vlv", "position": 15000, "name": "VLV_PFE_F02.04", "labelReverse": [90, -150, 200]}, + {"type": "vlv", "position": 16000, "name": "VLV_PFE_F02.05", "labelReverse": [90, -150, 200]}, + {"type": "bst", "position": 16333, "name": "BST_PFE_F02.01", "labelReverse": [90, -250, 200]}, + {"type": "bst", "position": 16666, "name": "BST_PFE_F02.02", "labelReverse": [90, -250, 200]}, + {"type": "vlv", "position": 17000, "name": "VLV_PFE_F02.06", "labelReverse": [90, -150, 200]}, + {"type": "vlv", "position": 18000, "name": "VLV_PFE_F02.07", "labelReverse": [90, -150, 200]}, + {"type": "vlv", "position": 19000, "name": "VLV_PFE_F02.08", "labelReverse": [90, -150, 200]}, + {"type": "vlv", "position": 20000, "name": "VLV_PFE_F02.09", "labelReverse": [90, -150, 200]}, + {"type": "vlv", "position": 21000, "name": "VLV_PFE_F02.10", "labelReverse": [90, -150, 200]} + ] + }, + { + "start": {"x": 114200, "z": -6773}, + "bending": {"type": "mrc", "label": "show", "name": "MRC_POS_F02.01"}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "vlv", "position": 11000, "name": "VLV_POS_MAG.01"}, + {"type": "vlv", "position": 14000, "name": "VLV_POS_MAG.02"}, + {"type": "vlv", "position": 17000, "name": "VLV_POS_MAG.03"}, + {"type": "vlv", "position": 20000, "name": "VLV_POS_MAG.04"} + ] + }, + { + "start": {"x": 131200, "z": -4773}, + "chamber": {"type": "chamber"}, + "components": [ + {"type": "mrc", "position": 10000, "name": "MRC_POS_MAG.02"}, + {"type": "vlv", "position": 11000, "name": "VLV_POS_MAG.05"}, + {"type": "mrc", "position": 12000, "name": "MRC_POS_MAG.03"}, + {"type": "vlv", "position": 14000, "name": "VLV_POS_MAG.06"}, + {"type": "mrc", "position": 16000, "name": "MRC_POS_MAG.04"}, + {"type": "vlv", "position": 19000, "name": "VLV_POS_MAG.07"}, + {"type": "vlv", "position": 22000, "name": "VLV_POS_MAG.08"} + ] + }, + { + "start": {"x": 153500, "z": -1773}, + "bending": {"type": "exp", "label": "show", "name": "MagneDyn"}, + "chamber": {"type": "chamber"} + } + ] + }, + "servicearea": { + "sections": [ + { + "start": {"x": -185400, "y": 4000, "z": -8811}, + "components": [ + {"type": "fug", "position": 0, "name": "HVPS_KGSP.01", "devices":["FUG_KS"]}, + {"type": "rar2", "position": 1400, "name": "RAR2_KGSP.01", "devices":["EC-MOD-KGSP-01","PSFOC_KS"]}, + {"type": "rar1", "position": 2200, "name": "RAR1_KGSP.01", "devices":["PST_KS","PSK_KS"]}, + {"type": "camod", "position": 3000, "name": "CAMOD_KGSP.01"}, + {"type": "klystron", "position": 4500, "name": "TKLY_KGSP.01", "devices":["KS"]}, + {"type": "rllrf", "position": 5600, "name": "RLLRF_KGSP.01"}, + + {"type": "fug", "position": 6700, "name": "HVPS_KG01.01", "devices":["FUG_K01"]}, + {"type": "rar2", "position": 8100, "name": "RAR2_KG01.01", "devices": ["EC-MOD-KG01-01","PSFOC_K01","SPMO_KG01.01"]}, + {"type": "rar1", "position": 8900, "name": "RAR1_KG01.01", "devices":["PST_K01","PSK_K01"]}, + {"type": "camod", "position": 9750, "name": "CAMOD_KG01.01"}, + {"type": "klystron", "position": 11250, "name": "TKLY_KG01.01", "devices":["K01"]}, + {"type": "rllrf", "position": 12350, "name": "RLLRF_KG01.01"}, + + {"type": "rps", "position": 12950, "name": "RPS_KG01.01", "width": 800, "height": 2000, "depth": 800, "devices":[ + "PSCSOL_INJ.01", "PSTRMCQ_SPINJ.01","PSTRMCQ_SPINJ.02","PSCV_INJ.01","PSCH_INJ.01","PSCV_INJ.02","PSCH_INJ.02","PSQ_SPINJ.01","PSB_SPINJ.01","PSSOL_INJ.01","PSSOL_INJ.02","PSSOL_INJ.03","PSSOL_INJ.04","SW-PS-KG01.01" + ]}, + {"type": "rv", "position": 13550, "name": "RG_KG01.01", "devices":[ + "PSSIP_CTF.01","SIP_CTF.03","SIP_CTF.04", + "PSSIP_CTF.02","SIP_CTF.05","SIP_CTF.06", + "PSSIP_CTF.03","SIP_CTF.01","SIP_CTF.02","SIP_CTF.07","SIP_CTF.08", + "PSSIP_CTF.04","SIP_CTF.09","SIP_CTF.10", + "PSNIP_CTF.01","GIP_CTF.01", + "PSNIP_CTF.02","GIP_CTF.02", + "TPG_CTF.01","VGPE_CTF.01","VGPI_CTF.01","VGPE_CTF.02","VGPI_CTF.02", + "TPG_CTF.02","VGPE_CTF.03","VGPI_CTF.03","VGPE_CTF.04", + "IMG_CTF.01","VGBA_CTF.01","VGPR_CTF.01" + ]}, + {"type": "rc", "position": 14350, "name": "RC_KG01.01", "devices":["PLC MASTER_IN_KG01.01","PLC MASTER_MOD_KG01.01", "CMM-PS-KG01-01"]}, + {"type": "rv", "position": 14950, "name": "RV_KG01.01", "devices":[ + "PSSIP_KG01.01","GIP500_INJ.01","SIP75_SPINJ.01", + "PSSIP_KG01.02","SIP55_INJ.01","SIP75_INJ.01", + "PSSIP_KG01.03","SIP150_INJ.01","SIP75_INJ.02", + "PSNIP_KG01.01","GIP200_INJ.01", + "TPG_KG01.01","VGPE_INJ.01","VGPI_INJ.01","VGPE_INJ.02","VGPI_INJ.02", + "TPG_KG01.02","VGPE_INJ.03","VGPI_INJ.03","VGPE_INJ.04","VGPI_INJ.04", + "TPG_KG01.03","VGPE_SPINJ.01" + ]}, + + {"type": "rllrf", "position": 16400, "name": "RLLRF_KG02.01"}, + {"type": "klystron", "position": 17200, "name": "TKLY_KG02.01", "devices":["K02"]}, + {"type": "camod", "position": 18300, "name": "CAMOD_KG02.01"}, + {"type": "rar1", "position": 19800, "name": "RAR1_KG02.01", "devices":["PSK_K02","PST_K02"]}, + {"type": "rar2", "position": 20600, "name": "RAR2_KG02.01", "devices":["EC-MOD-KG02-01","PSFOC_K02","SPMO_KG02.01"]}, + {"type": "fug", "position": 21300, "name": "HVPS_KG02.01", "devices":["FUG_K02"]}, + + {"type": "rd", "position": 23500, "name": "RD_KG02.02"}, + {"type": "rd", "position": 24100, "name": "RD_KG02.01", "devices":[ + "EC-BPM-KG02-01","LIBERA_BPM_SPINJ.01","LIBERA_BPM_INJ.01","LIBERA_BPM_L0.01","LIBERA_BPM_LH.01","LIBERA_BPM_LH.02","LIBERA_BPM_LH.03_A","LIBERA_BPM_LH.03_B","LIBERA_BPM_LH.04","LIBERA_BPM_SPLH.01","LIBERA_BPM_LH.05","LIBERA_BPM_L01.01", + "YSCR_INJ.01","YSCR_INJ.02","BPM_SPINJ.01","YSCR_SPINJ.01","YSCR_INJ.03","BPM_INJ.01","BPM_L00.01","MSCR_L00.01","MSCR_LH.01","BPM_LH.01","BPM_LH.02","MSCR_LH.02","MSCR_LH.03","BPM_LH.03","BPM_LH.04","BPM_SPLH.01","MSCR_SPLH.01","BPM_LH.05","MSCR_LH.04","BPM_L01.01" + ]}, + {"type": "rc", "position": 25300, "name": "RC_KG02.01", "devices":["EC-PS-KG02-01","SPAC_KG02.01","CMM-PS-KG02-01"]}, + {"type": "rps", "position": 25900, "name": "RPS_KG02.01", "devices":[ + "PSQ_L00.01","PSQ_L00.02","PSCV_L00.01","PSCH_L00.01","PSCV_L00.02","PSCH_L00.02","PSCV_L00.03","PSCH_L00.03","PSCV_L00.04","PSCH_L00.04","PSCV_L00.05","PSCH_L00.05","PSCV_L00.06","PSCH_L00.06" + ]}, + {"type": "rps", "position": 26500, "name": "RPS_KG02.02", "width": 800, "height": 2000, "depth": 800, "devices":[ + "PSCID_LH.01","PSCID_LH.02","PSCID_LH.03","PSCID_LH.04","PSCV_LH.01","PSCH_LH.01","PSCV_LH.02","PSCH_LH.02","PSCV_LH.03","PSCH_LH.03","PSCV_LH.04","PSCH_LH.04", "PSTRMCB_SPLH.01","PSQ_LH.01","PSQ_LH.02","PSQ_LH.03", "PSQ_LH.04","PSQ_LH.05","PSQ_LH.06","PSQ_LH.07", "PSB_SPLH.01", "PSB_LH" + ]}, + {"type": "rps", "position": 27100, "name": "RPS_KG02.03", "devices":[ + "PSCV_L01.01","PSCH_L01.01","PSCV_L01.02","PSCH_L01.02", "PSCV_L01.03","PSCH_L01.03","PSCV_L01.04","PSCH_L01.04", "PSQ_L01.01","PSQ_L01.02","PSQ_L01.03","PSQ_L01.04" + ]}, + {"type": "rv", "position": 27700, "name": "RV_KG02.01", "devices":[ + "PSSIP_KG02.01","SIP20_L00.01","SIP20_L00.03", + "PSSIP_KG02.02","SIP20_L00.02","SIP20_L00.04", + "PSSIP_KG02.03","SIP55_L00.01","SIP55_L00.03", + "PSSIP_KG02.04","SIP55_L00.02","SIP55_L00.04", + "PSSIP_KG02.05","SIP75_L00.01","SIP75_L00.02", + "PSSIP_KG02.06","SIP75_L00.03","SIP75_L00.04", + "TPG_KG02.01","VGPE_L00.01","VGPI_L00.01","VGPE_L00.02" + ]}, + {"type": "rv", "position": 28500, "name": "RV_KG02.02", "devices":[ + "PSSIP_KG02.07","SIP300_L01.01","SIP300_L01.05", + "PSSIP_KG02.08","SIP300_L01.02","SIP300_L01.06", + "PSSIP_KG02.09","SIP300_L01.03","SIP300_L01.07", + "PSSIP_KG02.10","SIP300_L01.04","SIP300_L01.08", + "PSSIP_KG02.11","SIP75_L01.01","SIP75_L01.02", + "PSSIP_KG02.12","SIP75_L01.03","SIP75_L01.04", + "PSSIP_KG02.13","SIP75_L01.05","SIP75_L01.06", + "PSSIP_KG02.14","SIP75_L01.07","SIP75_L01.08", + "PSSIP_KG02.25","SIP55_LH.01","SIP55_LH.03", + "PSSIP_KG02.26","SIP55_LH.02","SIP75_SPLH.01", + "TPG_KG02.02","VGPE_LH.01","VGPI_LH.01","VGPE_LH.02", + "TPG_KG02.03","VGPE_SPLH.01", + "TPG_KG02.04","VGPE_L01.01","VGPI_L01.01","VGPE_L01.02","VGPI_L01.02", + "TPG_KG02.05","VGPE_L01.03","VGPI_L01.03","VGPE_L01.04","VGPI_L01.04" + + ]}, + {"type": "rid", "position": 29600, "name": "RID_KG02.01"}, + {"type": "rc", "position": 30350, "name": "RC_KG02.02", "devices":["EC-VAC-KG02-01","EC-ID-KG02-01"]}, + {"type": "rv", "position": 30950, "name": "RV_KG02.03", "devices":[ + "PSSIP_KG02.16","SIP20_XBL01.02","SIP20_XBL01.03", + "PSSIP_KG02.17","SIP40_XBL01.01","SIP40_XBL01.02", + "PSSIP_KG02.18","SIP20_XBL01.04","SIP40_XBL01.03", + "PSSIP_KG02.19","SIP20_XBL01.05","SIP20_XBL01.06", + "PSSIP_KG02.20","SIP20_XBL01.07","SIP20_XBL01.08", + "PSSIP_KG02.21","SIP_KXS.02","SIP_KXS.03","SIP_KXS.04", + "TPG_KG02.06","VGPE_XBL01.02","VGPI_XBL01.01","VGPE_XBL01.03" + ]}, + + {"type": "rllrf", "position": 32600, "name": "RLLRF_KG03.01"}, + {"type": "klystron", "position": 33300, "name": "TKLY_KG03.01", "devices":["K03"]}, + {"type": "camod", "position": 34500, "name": "CAMOD_KG03.01"}, + {"type": "rar1", "position": 36000, "name": "RAR1_KG03.01", "devices":["PST_K03","PSK_K03"]}, + {"type": "rar2", "position": 36800, "name": "RAR2_KG03.01", "devices": ["EC-MOD-KG01-03","PSFOC_K03"]}, + {"type": "fug", "position": 37600, "name": "HVPS_KG03.01"}, + {"type": "rd", "position": 39300, "name": "RD_KG03.01", "devices":[ + "BPM_L01.02","BPM_L01.03","BPM_L01.04","BPM_L01.05","CMM-BAM-KG03-01","LIBERA_BPM_L01.02","LIBERA_BPM_L01.03","LIBERA_BPM_L01.04","LIBERA_BPM_L01.05","EC-MSCR-KG03-01" + ]}, + {"type": "rd", "position": 39900, "name": "RD_KG03.02", "devices":[]}, + {"type": "rc", "position": 40500, "name": "RC_KG03.01", "devices":["SPAC_KG03", "KG03 YAMS 01"]}, + + {"type": "rar3", "position": 41800, "name": "RAR3_KG04.01", "devices":["YAMS-KG03-01"]}, + {"type": "fug", "position": 42600, "name": "HVPS_KG04.01"}, + {"type": "rllrf", "position": 44000, "name": "RLLRF_KG04.01"}, + {"type": "klystronx", "position": 44800, "name": "TKLY_KG04.01", "devices":["K04"]}, + {"type": "camod", "position": 46200, "name": "CAMOD_KG04.01"}, + {"type": "rar1", "position": 47700, "name": "RAR1_KG04.01", "devices":["PST_K04","PSK_K04"]}, + {"type": "rar2", "position": 48500, "name": "RAR2_KG04.01", "devices": [ + "EC-MOD-KG01-04","PSFOC_K04", + "PSSIP_KG02.15","SIP20_XBL01.01", + "PSSIP_KG04.01", "SIP02_KG04.01", + "PSSIP_KG04.02", "SIP02_KG04.02", + "PSSIP_KG04.03", "SIP02_KG04.03", + "PSSIP_KG04.04", "SIP02_KG04.04" + ]}, + + {"type": "rllrf", "position": 49400, "name": "RLLRF_KG05.01"}, + {"type": "klystron", "position": 50100, "name": "TKLY_KG05.01"}, + {"type": "camod", "position": 51200, "name": "CAMOD_KG05.01"}, + {"type": "rar1", "position": 52700, "name": "RAR1_KG05.01", "devices":["PST_K05","PSK_K05"]}, + {"type": "rar2", "position": 53500, "name": "RAR2_KG05.01", "devices": ["EC-MOD-KG01-05","PSFOC_K05"]}, + {"type": "fug", "position": 54300, "name": "HVPS_KG05.01"}, + + {"type": "rllrf", "position": 55800, "name": "RLLRF_KGXS.01"}, + {"type": "klystronx", "position": 56600, "name": "TKLY_KGXS.01"}, + {"type": "camod", "position": 58000, "name": "CAMOD_KGXS.01"}, + {"type": "rar1", "position": 59500, "name": "RAR1_KGXS.01"}, + {"type": "rar2", "position": 60300, "name": "RAR2_KGXS.01", "name2": "RAR2_KG05.02", "devices": [ + "PSSIP_KXS.01", "SIP_KXS.10", + "PSSIP_KXS.02", "SIP_KXS.11", + "PSSIP_KXS.03", "SIP_KXS.12", + "PSSIP_KXS.04", "SIP_KXS.01" + ]}, + {"type": "fug", "position": 61100, "name": "HVPS_KGXS.01"}, + + {"type": "rd", "position": 69500, "name": "RD_KG05.02", "devices": ["EC-BPM-KG05-01","BPM_BC01.01","BPM_BC01.02","BPM_BC01.03","BPM_BC01.04","BPM_SPBC01.01","BPM_BC01.05","LIBERA_BPM_BC01.01","LIBERA_BPM_BC01.02","LIBERA_BPM_BC01.03","LIBERA_BPM_BC01.04","LIBERA_BPM_SPBC01.01","LIBERA_BPM_BC01.05" + ]}, + {"type": "rc", "position": 70700, "name": "RC_KG05.02", "devices":["EC-PS-KG05-02","SPIN_KG05.02"]}, + {"type": "rps", "position": 71300, "name": "RPS_KG05.03", "width": 800, "height": 2000, "depth": 800, "devices":[ + "PSQ_BC01.08","PSQ_BC01.09","PSQ_BC01.10","PSQ_BC01.11", "PSTRMCB_SPBC.01", "PSQ_SPBC1.01", "PSQ_SPBC1.02", "PSB_SPBC1" + ]}, + {"type": "rps", "position": 71900, "name": "RPS_KG05.04", "devices":[ + "PSCV_L02.01","PSCH_L02.01","PSCV_L02.02","PSCH_L02.02", "PSCV_L02.03","PSCH_L02.03","PSCV_L02.04","PSCH_L02.04", "PSQ_L02.01","PSQ_L02.02","PSQ_L02.03","PSQ_L02.04" + ]}, + {"type": "rllrf", "position": 73000, "name": "RLLRF_KGST.01"}, + {"type": "klystron", "position": 73700, "name": "TKLY_KGST.01", "devices":["KGST"]}, + {"type": "camod", "position": 74800, "name": "RPST6_KG05.03"}, + {"type": "rc", "position": 76300, "name": "RC_KG05.03"}, + {"type": "rar1", "position": 76900, "name": "RAR1_KG05.03"}, + {"type": "rar2", "position": 77700, "name": "RAR2_KG05.03"}, + {"type": "fug", "position": 78500, "name": "HVPS_KGST.03"}, + + {"type": "rllrf", "position": 80300, "name": "RLLRF_KG06.01"}, + {"type": "klystron", "position": 81100, "name": "TKLY_KG06.01", "devices":["K06"]}, + {"type": "camod", "position": 82200, "name": "CAMOD_KG06.01"}, + {"type": "rar1", "position": 83700, "name": "RAR1_KG06.01", "devices":["PST_K06","PSK_K06","SPMO_KG06.01"]}, + {"type": "rar2", "position": 84500, "name": "RAR2_KG06.01", "devices":["EC-MOD-KG06-01","PSFOC_K06"]}, + {"type": "fug", "position": 85300, "name": "HVPS_KG06.01", "devices":["FUG_K06"]}, + {"type": "rc", "position": 87000, "name": "RC_KG06.01", "devices":[ + "SW-C-KG06-01","EC-CM-KG06-01","PSCM_SPLH.01","PSCM_SPBC1.01","PSCM_BC01.01","PSBPM_L02.01","PSBPM_L02.02","PSBPM_L02.03","PSBPM_L02.04","PSBPM_L03.01","PSBPM_L03.02","PSCM_BC02.01","PSCM_DBD.01","PSCM_TLS.01","LIBERA_BPM_L02.01","LIBERA_BPM_L02.02","LIBERA_BPM_L02.03","LIBERA_BPM_L02.04","LIBERA_BPM_L03.01","LIBERA_BPM_L03.02" + ]}, + + {"type": "rllrf", "position": 90000, "name": "RLLRF_KG07.01"}, + {"type": "klystron", "position": 90800, "name": "TKLY_KG07.01", "devices":["K07"]}, + {"type": "camod", "position": 91900, "name": "CAMOD_KG07.01"}, + {"type": "rar1", "position": 93400, "name": "RAR1_KG07.01", "devices":["PSK_K07","PST_K07","SPMO_KG07.01"]}, + {"type": "rar2", "position": 94200, "name": "RAR2_KG07.01", "devices":["EC-MOD-KG07-01","PSFOC_K07"] }, + {"type": "fug", "position": 95000, "name": "HVPS_KG07.01", "devices":["FUG_K07"]}, + {"type": "rd", "position": 98700, "name": "RD_KG07.01", "devices":[ + "BPM_BC02.01","BPM_BC02.02","LIBERA_BPM_BC02.01","LIBERA_BPM_BC02.02","EC-BPM-KG-01" + ]}, + {"type": "rc", "position": 99900, "name": "RC_KG07.01", "devices":["SPAC_K07"]}, + {"type": "rv", "position": 100500, "name": "RV_KG07.01", "devices":[ + "PSSIP_KG07.01","SIP300_L02.01","SIP300_L02.05", + "PSSIP_KG07.02","SIP300_L02.02","SIP300_L02.06", + "PSSIP_KG07.03","SIP300_L02.03","SIP300_L02.07", + "PSSIP_KG07.04","SIP300_L02.04","SIP300_L02.08", + "PSSIP_KG07.05","SIP75_L02.01","SIP75_L02.02", + "PSSIP_KG07.06","SIP75_L02.03","SIP75_L02.04", + "PSSIP_KG07.07","SIP75_L02.05","SIP75_L02.06", + "PSSIP_KG07.08","SIP75_L02.07","SIP75_L02.08", + "TPG_KG07.01","VGPE_L02.01","VGPI_L02.01","VGPE_L02.02","VGPI_L02.02", + "TPG_KG07.02","VGPE_L02.03","VGPI_L02.03","VGPE_L02.04", + "SPIN_KG07.01" + ]}, + {"type": "rv", "position": 101300, "name": "RV_KG07.02", "devices":[ + "PSSIP_KG07.09","SIP300_L03.01","SIP300_L03.03", + "PSSIP_KG07.10","SIP300_L03.02","SIP300_L03.04", + "PSSIP_KG07.11","SIP75_L03.01","SIP75_L03.02", + "PSSIP_KG07.12","SIP75_L03.03","SIP75_L03.04", + "PSSIP_KG07.13","SIP75_L03.05","SIP75_L03.06", + "PSSIP_KG07.14","SIP75_L03.07","SIP75_L03.08", + "PSSIP_KG07.15","SIP150_BC02.01", + "PSSIP_KG07.16","SIP150_BC02.02", + "TPG_KG07.03","VGPE_L03.01","VGPI_L03.01","VGPE_L03.02","VGPI_L03.02", + "TPG_KG07.04","VGPE_BC02.01","VGPI_BC02.01","VGPE_L02.04" + ]}, + {"type": "rc", "position": 102100, "name": "RC_KG07.02", "devices":["EC-PS-KG-01"]}, + {"type": "rps", "position": 102700, "name": "RPS_KG07.01", "devices":[ + "PSCV_L03.01", "PSCH_L03.01", "PSCV_L03.02", "PSCH_L03.02", "PSQ_L03.01", "PSQ_L03.02" + ]}, + + {"type": "rllrf", "position": 104400, "name": "RLLRF_KG08.01"}, + {"type": "klystron", "position": 105100, "name": "TKLY_KG08.01", "devices":["K08"]}, + {"type": "camod", "position": 106200, "name": "CAMOD_KG08.01"}, + {"type": "rar1", "position": 107700, "name": "RAR1_KG08.01", "devices":["PST_K08","PSK_K08"]}, + {"type": "rar2", "position": 108500, "name": "RAR2_KG08.01", "devices":["EC-MOD-KG08-01","PSFOC_K08"]}, + {"type": "fug", "position": 109300, "name": "HVPS_KG08.01", "devices":["FUG_K08"] }, + + {"type": "rllrf", "position": 111400, "name": "RLLRF_KG09.01"}, + {"type": "klystron", "position": 112100, "name": "TKLY_KG09.01", "devices":["K09"]}, + {"type": "camod", "position": 113200, "name": "CAMOD_KG09.01"}, + {"type": "rar1", "position": 114700, "name": "RAR1_KG09.01", "devices":["PST_K09","PSK_K09"]}, + {"type": "rar2", "position": 115500, "name": "RAR2_KG09.01", "devices":["EC-MOD-KG09-01","PSFOC_K09"]}, + {"type": "fug", "position": 116300, "name": "HVPS_KG09.01"}, + + {"type": "rd", "position": 118100, "name": "RD_KG09.01", "devices":[ + "MSCR_L03.01","MSCR_BC02.01","BPM_L04.01","MSCR_L04.01","BPM_L04.02","BPM_L04.03","BPM_L04.04","LIBERA_BPM_L04.01","LIBERA_BPM_L04.02","LIBERA_BPM_L04.03","LIBERA_BPM_L04.04","EC-CBLM-KG09-01" + ]}, + {"type": "rd", "position": 118700, "name": "RD_KG09.02"}, + {"type": "rc", "position": 119900, "name": "RC_KG09.01", "devices":["EC-PS-KG09-01", "SPIN_K09.01"]}, + {"type": "rps", "position": 120500, "name": "RPS_KG09.01", "devices":[ + "PSTRMCB_BC02.01", "PSTRMCB_BC02.02", "PSTRMCB_BC02.03", "PSTRMCB_BC02.04", "PSQ_BC02.01", "PSQ_BC02.02", "PSCV_BC02.01", "PSCH_BC02.01", "SPARE", "PSQ_BC02.03", "PSB_BC02" + ]}, + {"type": "rps", "position": 121100, "name": "RPS_KG09.02", "width": 800, "height": 2000, "depth": 800, "devices":[ + "PSCV_L04.01", "PSCH_L04.01", "PSCV_L04.02", "PSCH_L04.02", "PSCV_L04.03", "PSCH_L04.03", "PSCV_L04.04", "PSCH_L04.04", "PSCV_L04.05", "PSCH_L04.05" + ]}, + {"type": "rps", "position": 121700, "name": "RPS_KG09.03", "devices":[ + "PSCV_L04.06", "PSCH_L04.06", "PSCV_L04.07", "PSCH_L04.07", "PSQ_L04.01", "PSQ_L04.02", "PSQ_L04.06", "PSQ_L04.07", "PSQ_L04.03", "PSQ_L04.04", "PSQ_L04.05" + ]}, + {"type": "rv", "position": 122300, "name": "RV_KG09.01", "devices":[ + "PSSIP_KG09.01","SIP300_L04.01","SIP300_L04.06", + "PSSIP_KG09.02","SIP300_L04.02","SIP300_L04.07", + "PSSIP_KG09.03","SIP300_L04.03","SIP300_L04.08", + "PSSIP_KG09.04","SIP300_L04.04","SIP300_L04.09", + "PSSIP_KG09.05","SIP300_L04.05", + "PSSIP_KG09.06","SIP55_L04.01","SIP55_L04.04", + "PSSIP_KG09.07","SIP55_L04.02","SIP75_L04.27", + "PSSIP_KG09.08","SIP55_L04.03","SIP75_L04.28", + "PSNIP_KG09.01","GIP1000_L04.01" + ]}, + {"type": "rv", "position": 123100, "name": "RV_KG09.02", "devices":[ + "PSSIP_KG09.09","SIP75_L04.01","SIP75_L04.02", + "PSSIP_KG09.10","SIP75_L04.03","SIP75_L04.04", + "PSSIP_KG09.11","SIP75_L04.05","SIP75_L04.06", + "PSSIP_KG09.12","SIP75_L04.07","SIP75_L04.08", + "PSSIP_KG09.13","SIP75_L04.09","SIP75_L04.10", + "PSSIP_KG09.14","SIP75_L04.11","SIP75_L04.12", + "PSSIP_KG09.15","SIP75_L04.13","SIP75_L04.14", + "PSSIP_KG09.16","SIP75_L04.15","SIP75_L04.16", + "PSSIP_KG09.17","SIP75_L04.17","SIP75_L04.18", + "PSSIP_KG09.18","SIP75_L04.19","SIP75_L04.20" + ]}, + {"type": "rv", "position": 123900, "name": "RV_KG09.03", "devices":[ + "PSSIP_KG09.19","SIP150_L04.21","SIP75_L04.22", + "PSSIP_KG09.20","SIP75_L04.23","SIP75_L04.24", + "PSSIP_KG09.21","SIP75_L04.25","SIP75_L04.26", + "PSSIP_KG09.22","SIP75_L04.29","SIP75_L04.30", + "TPG_KG09.01","VGPE_L04.01","VGPI_L04.01","VGPE_L04.02","VGPI_L04.02", + "TPG_KG09.02","VGPE_L04.03","VGPI_L04.03","VGPE_L04.04","VGPI_L04.04", + "TPG_KG09.03","VGPE_L04.05","VGPI_L04.05","VGPE_L04.06", + "TPG_KG09.04","VGPE_L04.07","VGPI_L04.06","VGPE_L04.08", + "SPIN_KG09.02" + ]}, + {"type": "rrp", "position": 124400, "name": "RRP_KG09.01"}, + {"type": "rc", "position": 125300, "name": "RC_KG09.02", "devices":["KG09 YAMS 01", "SPAC_KG09"]}, + {"type": "camod", "position": 126000, "name": "RPST5_KG09.01"}, + + {"type": "rllrf", "position": 133600, "name": "RLLRF_KG10.01"}, + {"type": "klystron", "position": 134300, "name": "TKLY_KG10.01", "devices":["K10"]}, + {"type": "camod", "position": 135400, "name": "CAMOD_KG10.01"}, + {"type": "rar1", "position": 136900, "name": "RAR1_KG10.01", "devices":["PST_K10","PSK_K10"]}, + {"type": "rar2", "position": 137700, "name": "RAR2_KG10.01", "devices":["EC-MOD-KG10-01","PSFOC_K10"]}, + {"type": "fug", "position": 138500, "name": "HVPS_KG10.01"}, + + {"type": "rllrf", "position": 140600, "name": "RLLRF_KG11.01"}, + {"type": "klystron", "position": 141300, "name": "TKLY_KG11.01", "devices":["K11"]}, + {"type": "camod", "position": 142300, "name": "CAMOD_KG11.01"}, + {"type": "rar1", "position": 143800, "name": "RAR1_KG11.01", "devices":["PST_K11","PSK_K11"]}, + {"type": "rar2", "position": 144600, "name": "RAR2_KG11.01", "devices":["EC-MOD-KG11-01","PSFOC_K11"]}, + {"type": "fug", "position": 145400, "name": "HVPS_KG11.01"}, + + {"type": "rllrf", "position": 147600, "name": "RLLRF_KG12.01"}, + {"type": "klystron", "position": 148300, "name": "TKLY_KG12.01", "devices":["K12"]}, + {"type": "camod", "position": 149400, "name": "CAMOD_KG12.01"}, + {"type": "rar1", "position": 150900, "name": "RAR1_KG12.01", "devices":["PST_K12","PSK_K12"]}, + {"type": "rar2", "position": 151600, "name": "RAR2_KG12.01", "devices":["EC-MOD-KG12-01","PSFOC_K12"]}, + {"type": "fug", "position": 152400, "name": "HVPS_KG12.01"}, + + {"type": "rllrf", "position": 154700, "name": "RLLRF_KG13.01"}, + {"type": "klystron", "position": 155400, "name": "TKLY_KG13.01", "devices":["K13"]}, + {"type": "camod", "position": 156500, "name": "CAMOD_KG13.01"}, + {"type": "rar1", "position": 158000, "name": "RAR1_KG13.01", "devices":["PST_K13","PSK_K13"]}, + {"type": "rar2", "position": 158800, "name": "RAR2_KG13.01", "devices":["EC-MOD-KG13-01","PSFOC_K13"]}, + {"type": "fug", "position": 159600, "name": "HVPS_KG13.01"}, + + {"type": "rllrf", "position": 161800, "name": "RLLRF_KG14.01"}, + {"type": "klystron", "position": 162500, "name": "TKLY_KG14.01", "devices":["K14"]}, + {"type": "camod", "position": 163600, "name": "CAMOD_KG14.01"}, + {"type": "rar1", "position": 165100, "name": "RAR1_KG14.01", "devices":["PST_K14","PSK_K14"]}, + {"type": "rar2", "position": 165900, "name": "RAR2_KG14.01", "devices":["EC-MOD-KG14-01","PSFOC_K14"]}, + {"type": "fug", "position": 166700, "name": "HVPS_KG14.01"}, + + {"type": "rllrf", "position": 169000, "name": "RLLRF_KG15.01"}, + {"type": "klystron", "position": 169700, "name": "TKLY_KG15.01", "devices":["K15"]}, + {"type": "camod", "position": 170700, "name": "CAMOD_KG15.01"}, + {"type": "rar1", "position": 172200, "name": "RAR1_KG15.01", "devices":["PST_K15","PSK_K15"]}, + {"type": "rar2", "position": 173000, "name": "RAR2_KG15.01", "devices":["EC-MOD-KG15-01","PSFOC_K15"]}, + {"type": "fug", "position": 173800, "name": "HVPS_KG15.01"} + ] + }, + { + "start": {"x": 180000, "y": 4000, "z": -8811}, + "bending": {"rotateY": "PI"}, + "components": [ + ] + }, + { + "start": {"x": -178800, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KGSP", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -178800, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -169500, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG01", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -169500, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -152800, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG02", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -152800, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -143800, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG03", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -143800, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -136150, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG04", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -136150, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -105300, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG05", "length": -17000, "labelReverse": [-90, -17000, -1000]} + ] + }, + { + "start": {"x": -105300, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -95700, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG06", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -95700, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -81200, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG07", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -81200, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -74200, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG08", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -74200, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -52600, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG09", "labelReverse": [-90, -9000, -1000]} + ] + }, + { + "start": {"x": -52600, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -44900, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG10", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -44900, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -37600, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG11", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -37600, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -31400, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG12", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -31400, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -24400, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG13", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -24400, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -17100, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG14", "labelReverse": [-90, -1000, -1000]} + ] + }, + { + "start": {"x": -17100, "y": 4000, "z": -14000}, + "chamber": {"type": "wall"} + }, + { + "start": {"x": -4100, "y": 4000, "z": -8000}, + "components": [ + {"type": "label", "position": 2000, "name": "KG15", "labelReverse": [-90, -8000, -1000]} + ] + }, + { + "start": {"x": -4100, "y": 4000, "z": -14000} + }, + { + "start": {"x": -157929, "y": 4000, "z": -1811}, + "components": [ + + {"type": "rd", "position": 0, "name": "RD_KG05.01", "devices": ["SCRPH_BC01.01, EC-CBLM-KG05-01"]}, + {"type": "rps", "position": 600, "name": "RPS_KG05.01", "devices":[ + "PSCV_BC01.01","PSCH_BC01.01","PSCV_BC01.02","PSCH_BC01.02", "PSCV_BC01.03","PSCH_BC01.03","PSCV_BC01.04","PSCH_BC01.04", "PSCV_BC01.05","PSCH_BC01.05","PSCV_BC01.06","PSCH_BC01.06", "PSTRMCB_BC01.01","PSTRMCB_BC01.02","PSTRMCB_BC01.03","PSTRMCB_BC01.04", "PSQ_BC01.01","PSQ_BC01.02","PSQ_BC01.03","PSQ_BC01.06" + ]}, + {"type": "rps", "position": 1200, "name": "RPS_KG05.02", "width": 800, "height": 2000, "depth": 800, "devices":[ + "PSQ_BC01.04","PSQ_BC01.05","PSQ_BC01.07", "PSB_BC01" + ]}, + {"type": "rv", "position": 1800, "name": "RV_KG05.01", "devices":[ + "PSSIP_KG05.01","SIP150_BC01.01","SIP300_BC01.01", + "PSSIP_KG05.02","SIP150_BC01.02","SIP55_BC01.03", + "PSSIP_KG05.03","SIP55_BC01.01","SIP55_BC01.04", + "PSSIP_KG05.04","SIP55_BC01.02","SIP300_BC01.02", + "PSSIP_KG05.05","SIP75_BC01.01","SIP75_BC01.02", + "PSSIP_KG05.06","SIP75_BC01.03","SIP75_BC01.04", + "PSSIP_KG05.07","SIP75_BC01.05","SIP75_BC01.06", + "PSSIP_KG05.08","SIP55_SPBC01.01","SIP55_SPBC01.02", + "TPG_KG05.01","VGPE_BC01.01","VGPI_BC01.01","VGPE_BC01.02", + "TPG_KG05.02","VGPE_BC01.03","VGPE_BC01.04", + "TPG_KG05.03","VGPE_BC01.05","VGPI_BC01.02","VGPE_BC01.06", + "TPG_KG05.04","VGPE_SPBC01.01", + "TPG_KG05.05","VGPE_BC01.07","VGPI_BC01.03","VGPE_BC01.08","VGPI_BC01.04", + "SPIN_05.01" + ]}, + {"type": "rc", "position": 2600, "name": "RC_KG05.01", "devices":[ + "EC-PS-KG05-01", "PDU-RC-KG05-01", "KG05/YAMS/01", "SPMO_KG05.02", "SPAC_KG05" + ]} + + ] + }, + { + "start": {"x": -5929, "y": 4000, "z": -1811}, + "bending": {"rotateY": "PI"}, + "components": [ + ] + }, + + { + "start": {"x": -11200, "y": 4000, "z": -11600}, + "components": [ + {"type": "rv", "position": 400, "name": "RV_KG15.01", "width": 800, "height": 2000, "depth": 600, "devices":[ + "PSSIP_KG15.01","SIP300_TLS.01","SIP300_TLS.02", + "PSSIP_KG15.02","SIP55_TLS.01","SIP75_TLS.01", + "PSSIP_KG15.03","SIP75_DBD.01","SIP150_DBD.01", + "TPG_KG15.01","VGPE_TLS.01","VGPI_TLS.01","VGPE_TLS.02", + "TPG_KG15.02","VGPE_TLS.03", + "TPG_KG15.03","VGPE_DBD.01","VGPI_DBD.01","VGPE_TLS.02", + "SPIN_KG15.01" + ]}, + {"type": "rc", "position": 1400, "name": "RC_KG15.01", "devices":["EC-PS-KG15-01", "SPAC_KG15.02", "SPAC_KG15.01"]}, + {"type": "rd", "position": 2000, "name": "RD_KG15.01", "devices":[ + "BPM_L04.05","BPM_L04.06","BPM_L04.07","BPM_TLS.01","MSCR_TLS.01","BPM_DBD.01","MSCR_DBD.01","BPM_DBD.02","MSCR_DBD.02","MSCR_TLS.02","BPM_TLS.02","MSCR_TLS.03","BPM_TLS.03","EC-BPM-KG15-01","LIBERA_BPM_L04.05","LIBERA_BPM_L04.06","LIBERA_BPM_L04.07","LIBERA_BPM_TLS.01","LIBERA_BPM_DBD.01","LIBERA_BPM_DBD.02","LIBERA_BPM_TLS.02","LIBERA_BPM_TLS.03" + ]}, + {"type": "rps", "position": 3200, "name": "RPS_KG15.01", "devices":[ + "PSQ_TLS.01", "PSQ_TLS.02", "PSQ_TLS.03", "PSQ_TLS.04", "PSQ_TLS.05", "PSQ_TLS.06", "PSQ_TLS.07", "PSCV_TLS.01", "PSCH_TLS.01", "PSCV_TLS.02", "PSCH_TLS.02", "PSCV_TLS.03", "PSCH_TLS.03", "PSCV_DBD.01", "PSCH_DBD.01" + ]}, + {"type": "rps", "position": 3800, "name": "RPS_KG15.02", "devices":[ + "PSQ_DBD.01", "PSQ_DBD.02", "PSQ_DBD.03", "PSQ_DBD.04", "PSQ_DBD.05" + ]}, + {"type": "rpsb", "position": 5300, "name": "RPSB_KG15.03", "width": 1000, "height": 2100, "depth": 1000, "devices":["PSB_DBD"]} + ] + }, + { + "start": {"x": -1000, "y": 4000, "z": -11600}, + "bending": {"rotateY": "PI"}, + "components": [ + ] + }, + { + "start": {"x": -10600, "y": 4000, "z": -8611}, + "components": [ + {"type": "rllrf", "position": 800, "name": "RLLRF_KG16", "labelReverse": [90, 1500, 350]}, + {"type": "klystron", "position": 1400, "name": "TKLY_KG16", "labelReverse": [90, -1100, 350]} + ] + }, + { + "start": {"x": -7000, "y": 4000, "z": -8611}, + "components": [ + ] + }, + { + "start": {"x": -9000, "y": 4000, "z": -9011}, + "components": [ + {"type": "rar1", "position": 1500, "name": "RAR1_KG16", "labelReverse": [90, -1100, 100]} + ] + }, + { + "start": {"x": -9000, "y": 4000, "z": -8411}, + "components": [ + ] + }, + { + "start": {"x": -9400, "y": 4000, "z": -8411}, + "components": [ + {"type": "rack2", "position": 0, "name": "HVPS_KG16", "labelReverse": [-90, 2500, -200]} + ] + }, + { + "start": {"x": -9400, "y": 4000, "z": -9011}, + "components": [ + ] + }, + + + { + "start": {"x": 4000, "y": 4000, "z": -7600}, + "components": [ + {"type": "rps", "position": 300, "name": "RPS_SSA.01", "labelReverse": [90, -1200, 300], "devices":[ + "PSCV_SFEL01.01","PSCH_SFEL01.01","PSCV_SFEL01.02","PSCH_SFEL01.02", "PSCV_SFEL01.03","PSCH_SFEL01.03","PSCV_SFEL01.04","PSCH_SFEL01.04", "PSB_SCL-FEL1 ", "PSB_SFEL2" + ]}, + {"type": "rps", "position": 900, "name": "RPS_SSA.02", "labelReverse": [90, -1200, 300], "devices":[ + "PSCV_SFEL01.05","PSCH_SFEL01.05","PSCV_SFEL01.06","PSCH_SFEL01.06", "PSQ_SFEL01.01", "PSQ_SFEL01.07", "PSQ_SFEL02.01", "PSQ_SFEL02.02", "PSQ_SFEL02.04" + ]}, + {"type": "rps", "position": 1500, "name": "RPS_SSA.03", "labelReverse": [90, -1200, 300], "devices":[ + "PSCV_SCL.01","PSCH_SCL.01","PSCV_SCL.02","PSCH_SCL.02", "PSCV_SCL.03","PSCH_SCL.03","SPARE","PSQ_SCL.01", "PSQ_SCL.02","PSQ_SCL.03","PSQ_SCL.04","PSQ_SCL.05", "PSQ_SCL.06","PSQ_SCL.07","PSQ_SCL.08","PSQ_SCL.09" + ]}, + {"type": "rps", "position": 2100, "name": "RPS_SSA.04", "labelReverse": [90, -1200, 300], "devices":[ + "PSQ_SFEL01.02", "PSQ_SFEL01.03","PSQ_SFEL01.04","PSQ_SFEL01.05","PSQ_SFEL01.06", "PSQ_SFEL01.08","PSQ_SFEL01.09","PSQ_SFEL01.10","PSQ_SFEL01.11" + ]}, + {"type": "rps", "position": 2700, "name": "RPS_SSA.05", "labelReverse": [90, -1200, 300], "devices":[ + "PSCV_SFEL02.02","PSCH_SFEL02.02","PSCV_SFEL02.04","PSCH_SFEL02.04", "PSCV_SFEL02.01","PSCH_SFEL02.01","PSCV_SFEL02.03","PSCH_SFEL02.03", "PSTRMCB_SFEL02.01","SPARE","SPARE","PSQ_SFEL02.03", "PSQ_SFEL02.05","PSQ_SFEL02.06","PSQ_SFEL02.07","PSQ_SFEL02.08" + ]} + ] + }, + { + "start": {"x": 4000, "y": 4000, "z": -1811}, + "bending": {"rotateY": "PI"}, + "components": [ + ] + }, + { + "start": {"x": 6000, "y": 4000, "z": -7600}, + "components": [ + {"type": "rd", "position": -300, "name": "RD_SSA.01", "labelReverse": [90, 950, 300], "devices":[ + "BPM_SCL.01","BPM_SCL.02","BPM_SFEL01.01","BPM_SFEL01.02","BPM_SFEL01.03","BPM_SFEL01.04","BPM_SFEL02.01","BPM_SFEL02.02","EC-BPM-SSA-01","LIBERA_BPM_SCL.01","LIBERA_BPM_SCL.02","LIBERA_BPM_SFEL01.01","LIBERA_BPM_SFEL01.02","LIBERA_BPM_SFEL01.03","LIBERA_BPM_SFEL01.04","LIBERA_BPM_SFEL02.01" + ]}, + {"type": "rd", "position": 300, "name": "RD_SSA.02", "labelReverse": [90, 950, 300]}, + {"type": "rc", "position": 1500, "name": "RC_SSA.01", "labelReverse": [90, 950, 300]}, + {"type": "rc", "position": 2100, "name": "RC_SSA.03", "labelReverse": [90, 950, 300]}, + {"type": "rc", "position": 2700, "name": "RC_SSA.04", "labelReverse": [90, 950, 300]} + ] + }, + { + "start": {"x": 6000, "y": 4000, "z": -1811}, + "bending": {"rotateY": "PI"}, + "components": [ + ] + }, + { + "start": {"x": 8000, "y": 4000, "z": -7600}, + "components": [ + {"type": "rd", "position": -300, "name": "RD_SSA.03", "devices":[ + "MSCR_SCL.01","MSCR_SFEL01.01","CBPM_SFEL01.01","MSCR_SFEL01.02","CBPM_SFEL01.02","CBPM_SFEL01.03","MSCR_SFEL02.01","MSCR_SFEL02.02","EC-MSCR-SSA-01" + ]}, + {"type": "rd", "position": 300, "name": "RD_SSA.04", "devices":[ + "CBPM_SFEL02.01","CBPM_SFEL02.02","CBPM_SFEL02.03","EC-CBPM-SSA-01" + ]}, + {"type": "rv", "position": 900, "name": "RV_SSA.01", "devices":[ + "PSSIP_SSA.01","SIP55_SCL.01","SIP55_SCL.02", + "PSSIP_SSA.02","SIP300_SCL.01","SIP55_SCL.03", + "PSSIP_SSA.03","SIP55_SFEL01.01","SIP55_SFEL01.04", + "PSSIP_SSA.04","SIP55_SFEL01.02","SIP55_SFEL01.05", + "PSSIP_SSA.05","SIP55_SFEL01.03","SIP55_SFEL01.06", + "PSSIP_SSA.06","SIP300_SFEL01.01", "SIP150_SFEL01.01", + "TPG_SSA.01","VGPE_SCL.01","VGPI_SCL.01","VGPE_SCL.02", + "TPG_SSA.02","VGPE_SFEL01.01","VGPI_SFEL01.01","VGPE_SFEL01.02", + "TPG_SSA.03","VGPE_SFEL01.03", + "sds-vac-ssa-01" + ]}, + {"type": "rv", "position": 1700, "name": "RV_SSA.02", "width": 800, "height": 2000, "depth": 600, "devices":[ + "PSSIP_SSA.07","SIP300_SFEL02.01","SIP55_SFEL02.04", + "PSSIP_SSA.08","SIP55_SFEL02.01","SIP150_SFEL02.01", + "PSSIP_SSA.09","SIP55_SFEL02.02", + "TPG_SSA.04","VGPE_SFEL02.01","VGPI_SFEL02.01","VGPE_SFEL02.02", + "TPG_SSA.05","VGPE_SFEL02.03" + ]}, + {"type": "rc", "position": 3100, "name": "RC_SSA.02", "devices":["EC-PS-SSA-01","SSA YAMS 01", "SPIN_SSA_01"]} + ] + }, + { + "start": {"x": 8000, "y": 4000, "z": -1811}, + "bending": {"rotateY": "PI"}, + "components": [ + ] + }, + { + "start": {"x": 63500, "y": 4000, "z": -7000}, + "components": [ + {"type": "rps", "position": 30300, "name": "RPS_USA.01", "devices":[ + "PSTRMCW_FEL01.01","PSTRMCW_FEL01.02","PSCV_FEL01.01","PSCH_FEL01.01", "PSQ_FEL01.01","PSCID_FEL01.01","PSCID_FEL01.02","PSCID_FEL01.03","PSCID_FEL01.04", "PSCID_FEL01.05","PSCID_FEL01.06","PSCID_FEL01.07","PSCID_FEL01.08", "PSCID_FEL01.09","PSCID_FEL01.10","PSCID_FEL01.11","PSCID_FEL01.12" + ]}, + {"type": "rps", "position": 29700, "name": "RPS_USA.02", "devices":[ + "PSTRMCB_FEL01.01","PSTRMCB_FEL01.02","PSTRMCB_FEL01.03","PSTRMCB_FEL01.04","PSCID_FEL01.13","PSCID_FEL01.14","PSCID_FEL01.15","PSCID_FEL01.16", "PSCID_FEL01.17","PSCID_FEL01.18","PSCID_FEL01.19","PSCID_FEL01.20", "PSCID_FEL01.21","PSCID_FEL01.22","PSCID_FEL01.23","PSCID_FEL01.24", "PSCID_FEL01.25","PSCID_FEL01.26","PSCID_FEL01.27","PSCID_FEL01.28" + ]}, + {"type": "rps", "position": 29100, "name": "RPS_USA.03", "devices":[ + "PSCV_IUFEL01.01","PSCH_IUFEL01.01","PSCV_IUFEL01.02","PSCH_IUFEL01.02", "PSCV_IUFEL01.03","PSCH_IUFEL01.03","PSCV_IUFEL01.04","PSCH_IUFEL01.04", "PSQ_IUFEL01.01","PSQ_IUFEL01.02","PSQ_IUFEL01.03","PSQ_IUFEL01.04", "PSQ_IUFEL01.05","PSQ_IUFEL01.06","PSQ_IUFEL01.07","PSQ_IUFEL01.08", "PSQ_FEL02.01","PSQ_FEL02.02","PSQ_FEL02.03","PSQ_FEL02.04" + ]}, + {"type": "rps", "position": 28500, "name": "RPS_USA.04", "devices":[ + "PSCV_IUFEL01.05","PSCH_IUFEL01.05","PSCV_IUFEL01.06","PSCH_IUFEL01.06", "PSCV_IUFEL01.07","PSCH_IUFEL01.07","PSCV_IUFEL01.08","PSCH_IUFEL01.08", "PSTRMCB_FEL02.01","PSTRMCB_FEL02.01","PSTRMCB_FEL02.03","PSTRMCB_FEL02.04", "PSTRMCW_FEL02.01","PSTRMCW_FEL02.02","PSCV_FEL02.01","PSCH_FEL02.01", "PSCV_FEL02.02","PSCH_FEL02.02","PSCV_FEL02.03","PSCH_FEL02.03" + ]}, + {"type": "rps", "position": 27900, "name": "RPS_USA.05", "devices":[ + "PSCV_FEL02.04","PSCH_FEL02.04","PSTRMCW_FEL02.03","PSTRMCW_FEL02.04", "PSCID_FEL02.01","PSCID_FEL02.02","PSCID_FEL02.03","PSCID_FEL02.04","PSCID_FEL02.05","PSCID_FEL02.06","PSCID_FEL02.07","PSCID_FEL02.08" + ]}, + {"type": "rv", "position": 27100, "name": "RV_USA.01", "devices":[ + "PSSIP_USA.01","SIP55_FEL01.01","SIP55_IUFEL01.02","SIP55_IUFEL01.05","SIP55_IUFEL01.08", + "PSSIP_USA.02","GIP500_FEL01.01","SIP55_IUFEL01.03","SIP55_IUFEL01.06", + "PSSIP_USA.03","SIP55_FEL01.02","SIP55_IUFEL01.04","SIP55_IUFEL01.07", + "TPG_USA.01","VGPE_FEL01.01","VGPI_IUFEL01.01","VGPE_IUFEL01.01", + "TPG_USA.02","VGPE_IUFEL01.02","VGPI_IUFEL01.02","VGPE_IUFEL01.03" + + ]}, + {"type": "rc", "position": 26500, "name": "RC_USA.01", "devices":["EC-PS-USA-01","USA YAMS 02","USA YAMS 07","SPIN_USA_01"]}, + + {"type": "rid", "position": 25900, "name": "RID_USA.01", "devices":["ID_FEL02.01"]}, + {"type": "rid", "position": 25300, "name": "RID_USA.02", "devices":["ID_FEL02.02"]}, + {"type": "rid", "position": 24700, "name": "RID_USA.03", "devices":["ID_FEL02.03"]}, + {"type": "rid", "position": 24100, "name": "RID_USA.04", "devices":["ID_FEL01.01"]}, + {"type": "rid", "position": 23500, "name": "RID_USA.05", "devices":["ID_FEL02.04"]}, + + + {"type": "rc", "position": 21500, "name": "RPHOM_USA.01"}, + {"type": "rid", "position": 20900, "name": "RID_USA.07", "devices":["ID_FEL02.05"]}, + {"type": "rid", "position": 20300, "name": "RID_USA.08", "devices":["ID_FEL01.03"]}, + {"type": "rid", "position": 19700, "name": "RID_USA.09", "devices":["ID_FEL02.06"]}, + {"type": "rid", "position": 19100, "name": "RID_USA.10", "devices":["ID_FEL01.04"]}, + {"type": "rid", "position": 18500, "name": "RID_USA.11", "devices":["ID_FEL02.07"]}, + {"type": "rid", "position": 17900, "name": "RID_USA.12", "devices":["ID_FEL01.05"]}, + {"type": "rid", "position": 17300, "name": "RID_USA.13", "devices":["ID_FEL02.08"]}, + {"type": "rid", "position": 16700, "name": "RID_USA.14", "devices":["ID_FEL01.06"]}, + {"type": "rd", "position": 16100, "name": "RD_USA.01", "devices":[ + "BAM_SFEL01.01","CBPM_FEL01.01","CBPM_FEL01.02","CBPM_IUFEL01.02","EC-CBPM-USA-01" + ]}, + {"type": "rc", "position": 15500, "name": "RC_USA.02", "devices":["EC-MPS-USA-01","MAST MPS_USA_01"]}, + {"type": "rv", "position": 14700, "name": "RV_USA.02", "devices":[ + "PSSIP_USA.04","SIP55_FEL02.01","SIP55_IUFEL02.01","SIP55_FEL02.03","SIP55_FEL02.05", + "PSSIP_USA.05","SIP55_FEL02.02","SIP55_IUFEL02.02","SIP55_FEL02.04","SIP55_FEL02.06", + "PSSIP_USA.06","SIP55_IUFEL02.03","SIP55_IUFEL02.05","SIP55_IUFEL02.07","SIP55_IUFEL02.09", + "PSSIP_USA.07","SIP55_IUFEL02.04","SIP55_IUFEL02.06","SIP55_IUFEL02.08", + "TPG_USA.03","VGPE_FEL02.01","VGPI_IUFEL02.01","VGPE_FEL02.02", + "TPG_USA.04","VGPE_IUFEL02.01", + "TPG_USA.05","VGPE_IUFEL02.02","VGPI_IUFEL02.02","VGPE_FEL02.03","VGPI_IUFEL02.03", + "sds-vac-usa-02" + ]}, + + {"type": "rid", "position": 12700, "name": "RID_USA.15", "devices":["ID_FEL02.09"]}, + {"type": "rid", "position": 12100, "name": "RID_USA.16", "devices":["ID_FEL01.07"]}, + {"type": "rid", "position": 11500, "name": "RID_USA.17", "devices":["ID_FEL02.10"]}, + + {"type": "rid", "position": 10300, "name": "RID_USA.19", "devices":["ID_FEL02.11"]}, + {"type": "rc", "position": 9700, "name": "RPHOM_USA. 02"}, + {"type": "rd", "position": 9100, "name": "RD_USA.02", "devices":[ + "CBPM_IUFEL01.03","CBPM_IUFEL01.04","CBPM_IUFEL01.05","EC-IUFEL-USA-02"]}, + {"type": "rc", "position": 8500, "name": "RC_USA.03", "devices":["EC-ID-USA-01","MASTIN_USA.01"]}, + {"type": "rv", "position": 7700, "name": "RV_USA.03", "devices":[ + "PSSIP_USA.14","SIP75_MBD_FEL01.01","SIP55_MBD_FEL01.05", + "PSSIP_USA.15","SIP55_MBD_FEL01.02","SIP55_MBD_FEL01.06", + "PSSIP_USA.16","SIP55_MBD_FEL01.03","SIP55_MBD_FEL01.07", + "PSSIP_USA.17","SIP55_MBD_FEL01.04","SIP55_MBD_FEL01.08", + "PSSIP_USA.18","SIP55_MBD_FEL02.01","SIP55_MBD_FEL02.04", + "PSSIP_USA.19","SIP55_MBD_FEL02.02","SIP55_MBD_FEL02.05", + "PSSIP_USA.20","SIP55_MBD_FEL02.03", + "TPG_USA.06","VGPE_MBDFEL01.01","VGPI_MBDFEL01.01","VGPE_MBDFEL01.02", + "TPG_USA.07","VGPE_MBDFEL01.03","VGPI_MBDFEL01.02", + "TPG_USA.08","VGPE_MBDFEL02.01","VGPI_MBDFEL02.01","VGPE_MBDFEL02.02","VGPI_MBDFEL02.02", + "TPG_USA.09","VGPE_MBDFEL02.03", + "MASTIN_USA.01" + ]}, + + {"type": "rid", "position": 6500, "name": "RID_USA.21", "devices":["ID_FEL01.08"]}, + {"type": "rid", "position": 5900, "name": "RID_USA.22", "devices":["ID_FEL01.09"]}, + + {"type": "rd", "position": 4300, "name": "RD_USA.03", "devices":[ + "MSCR_FEL01.01","MSCR_EEHG_FEL01.01","MSCR_FEL01.02","MSCR_IUFEL01.02","MSCR_IUFEL01.03","MSCR_IUFEL01.04","MSCR_IUFEL01.06","MSCR_IUFEL01.08","MSCR_FEL02.01","MSCR_IUFEL02.02","MSCR_FEL02.02","MSCR_FEL02.03","MSCR_IUFEL02.03","MSCR_IUFEL02.05","MSCR_IUFEL02.07","MSCR_IUFEL02.08","MSCR_IUFEL02.09","EC-SE-USA-01","CMM-IUFEL-USA-01" + ]}, + {"type": "rc", "position": 3700, "name": "RC_USA.04", "devices":["EC-PS-USA-02","PDU-RC-USA-04"]}, + {"type": "rps", "position": 3100, "name": "RPS_USA.06", "devices":[ + "PSCID_FEL02.13","PSCID_FEL02.14","PSCID_FEL02.15","PSCID_FEL02.16", "PSCID_FEL02.17","PSCID_FEL02.18","PSCID_FEL02.19","PSCID_FEL02.20", "PSCID_FEL02.21","PSCID_FEL02.22","PSCID_FEL02.23","PSCID_FEL02.24", "PSCID_FEL02.25","PSCID_FEL02.26","PSCID_FEL02.27","PSCID_FEL02.28", "PSCID_FEL02.29","PSCID_FEL02.30","PSCID_FEL02.31","PSCID_FEL02.32", "PSCID_FEL02.33","PSCID_FEL02.34","PSCID_FEL02.35","PSCID_FEL02.36" + ]}, + {"type": "rps", "position": 2500, "name": "RPS_USA.07", "devices":[ + "PSCID_FEL02.37","PSCID_FEL02.38","PSCID_FEL02.39","PSCID_FEL02.40", "PSCID_FEL02.41","PSCID_FEL02.42","PSCID_FEL02.43","PSCID_FEL02.44", "PSCV_IUFEL02.01","PSCH_IUFEL02.01","PSCV_IUFEL02.02","PSCH_IUFEL02.02", "PSCV_IUFEL02.03","PSCH_IUFEL02.03","PSCV_IUFEL02.04","PSCH_IUFEL02.04" + ]}, + {"type": "rps", "position": 1900, "name": "RPS_USA.08", "devices":[ + "PSCV_IUFEL02.05","PSCH_IUFEL02.05","PSCV_IUFEL02.06","PSCH_IUFEL02.06", "PSCV_IUFEL02.07","PSCH_IUFEL02.07","PSCV_IUFEL02.08","PSCH_IUFEL02.08", "PSCV_IUFEL02.09","PSCH_IUFEL02.09","PSCV_IUFEL02.10","PSCH_IUFEL02.10", "PSQ_IUFEL02.01","PSQ_IUFEL02.02","PSQ_IUFEL02.03","PSQ_IUFEL02.04", "PSQ_IUFEL02.05","PSQ_IUFEL02.06","PSQ_IUFEL02.07","PSQ_IUFEL02.08", "PSQ_IUFEL02.09","PSQ_IUFEL02.10" + ]}, + {"type": "rd", "position": 1300, "name": "RD_USA.04", "devices":[ + "CBPM_IUFEL01.06","CBPM_IUFEL01.07","CBPM_IUFEL01.08","EC-CBPM-USA-02" + ]}, + {"type": "rc", "position": 700, "name": "RC_USA.05", "devices":["EC-VAC-USA-01","SPIN_USA.02"]}, + {"type": "rv", "position": -100, "name": "RV_USA.04", "devices":[ + "PSSIP_USA.21","SIP75_MBD.01","SIP150_MBD.02", + "PSSIP_USA.22","SIP150_MBD.01", + "TPG_USA.10","VGPE_MBD.01","VGPI_MBD.01","VGPE_MBD.02", + "sds-vac-usa-04" + ]} + ] + }, + { + "start": {"x": 33000, "y": 4000, "z": -7000}, + "bending": {"rotateY": "PI"}, + "components": [ + ] + }, + { + "start": {"x": 108000, "y": 100, "z": -1600}, + "components": [ + {"type": "rpsb", "position": 1000, "name": "RPS_ESA.02", "width": 800, "height": 2000, "depth": 800, "labelReverse": [90, 950, 300], "devices":[ + "PSB_MBDFEL01.01" + ]}, + {"type": "rpsb", "position": 2000, "name": "RPS_ESA.03", "width": 800, "height": 2000, "depth": 800, "labelReverse": [90, 950, 300], "devices":[ + "PSB_MBDFEL02.01" + ]}, + {"type": "rps", "position": 2300, "name": "RPS_ESA.04", "labelReverse": [90, 950, 300], "devices":[ + "sw-ps-esa-01","PSQ_MBDFEL01.01","PSQ_MBDFEL01.02","PSQ_MBDFEL01.03","PSQ_MBDFEL01.04", "PSQ_MBDFEL01.05","PSQ_MBDFEL01.06", "PSQ_MBDFEL02.01","PSQ_MBDFEL02.02","PSQ_MBDFEL02.03","PSQ_MBDFEL02.04", "PSQ_MBD.01","PSQ_MBD.02","PSQ_MBD.03","PSQ_MBD.04" + ]}, + {"type": "rc", "position": 2900, "name": "RC_ESA.01", "labelReverse": [90, 950, 300]} + ] + }, + { + "start": {"x": 108000, "y": 100, "z": 6000}, + "bending": {"rotateY": "PI"}, + "components": [ + ] + }, + { + "start": {"x": 110000, "y": 100, "z": -1400}, + "components": [ + {"type": "rps", "position": 300, "name": "RPS_ESA.05", "labelReverse": [90, 950, 300], "devices":[ + "sw-ps-esa-02","PSCV_MBDFEL01.01","PSCH_MBDFEL01.01","PSCV_MBDFEL01.02","PSCH_MBDFEL01.02", "PSCV_MBDFEL01.03","PSCH_MBDFEL01.03","PSCV_MBDFEL01.04","PSCH_MBDFEL01.04", "PSCV_MBDFEL02.01","PSCH_MBDFEL02.01","PSCH_MBDFEL02.02","PSCH_MBDFEL02.02", "PSCV_MBD.02","PSCH_MBD.02" + ]}, + {"type": "rc", "position": 900, "name": "RC_ESA.02", "labelReverse": [90, 950, 300], "devices":[ + "CMM-PS-ESA-01","sw-c-esa-02","ESA/YAMS/11","PDU-RC-ESA-02" + ]}, + {"type": "rv", "position": 1700, "name": "RV_ESA.01", "labelReverse": [90, 950, 300], "devices":[ + "PSSIP_ESA.05","SIP300_POS_F01.01","SIP300_POS_F01.02", + "PSSIP_ESA.06","SIP300_POS_F02.01","SIP300_POS_F02.02", + "PSSIP_ESA.07","SIP300_POS.01","SIP300_POS.03", + "PSSIP_ESA.08","SIP300_POS_02", + "MAX_ESA.05","VGFR_POS_F01.01","VGFR_POS_F01.02","VGFR_POS_F02.01","VGFR_POS_F02.02", + "MAX_ESA.06","VGFR_POS.01","VGPE_POS.01","VGPI_POS.01","VGFR_POS.02", + "MAX_ESA.07","VGFR_PFE.02","VGFR_I0_PFE.01","VGHP_G1_PFE.01","VGHP_G2_PFE.01","VGHP_G3_PFE.01","VGHP_G4_PFE.01", + "sds-vac-esa-01" + ]}, + {"type": "rv", "position": 2500, "name": "RV_ESA.02", "labelReverse": [90, 950, 300], "devices":[ + "PSSIP_ESA.01","SIP150_PFE_F01.01","SIP150_PFE_F01.02", + "PSSIP_ESA.02","SIP300_PFE_F01.01","SIP20_PFE_F01.01", + "PSSIP_ESA.03","SIP150_PFE_F02.01","SIP150_PFE_F02.02", + "PSSIP_ESA.04","SIP300_PFE_F02.01","SIP20_PFE_F02.01", + "TPG_ESA.01","VGPE_PFE_F01.01","VGPI_PFE_F01.01","VGPE_PFE_F01.02","VGPI_PFE_F01.02", + "TPG_ESA.02","VGPE_PFE_F01.03","VGPI_PFE_F01.03","VGPE_PFE_F01.04","VGPI_PFE_F01.04", + "TPG_ESA.03","VGPE_PFE_F01.05","VGPI_PFE_F01.05","VGPE_PFE_F01.06", + "MAX_ESA.01","VGCA_PFE_F01.01","VGFR_PFE_F01.01","VGFR_PFE.01", + "MAX_ESA.02","VGFR_PFE_F01.02","VGFR_PFE_F01.03","VGPI_PFE_F01.06","VGFR_PFE_F01.04","VGFR_PFE_F01.05", + "TPG_ESA.04","VGPE_PFE_F02.01","VGPI_PFE_F02.01","VGPE_PFE_F02.02","VGPI_PFE_F02.02", + "TPG_ESA.05","VGPE_PFE_F02.03","VGPI_PFE_F02.03","VGPE_PFE_F02.04","VGPI_PFE_F02.04", + "TPG_ESA.06","VGPE_PFE_F02.05","VGPI_PFE_F02.05","VGPE_PFE_F02.06", + "MAX_ESA.03","VGCA_PFE_F02.01","VGFR_PFE_F02.01", + "MAX_ESA.04","VGFR_PFE_F02.02","VGFR_PFE_F02.03","VGPI_PFE_F02.06","VGFR_PFE_F02.04","VGFR_PFE_F02.05", + "sds-esa-vac-02", "MASTIN_FE.01" + ]} + ] + }, + { + "start": {"x": 110000, "y": 100, "z": 6000}, + "bending": {"rotateY": "PI"}, + "components": [ + ] + }, + { + "start": {"x": 112000, "y": 100, "z": -1400}, + "components": [ + {"type": "rc", "position": 0, "name": "RC_ESA.03", "width": 800, "height": 2000, "depth": 800, "labelReverse": [90, 950, 300], "devices":[ + "SPAC_ESA.01","SPAC_ESA.02", "SPW_ESA.01", "pdu-rc-esa-03" + ]}, + {"type": "rv", "position": 600, "name": "RV_ESA.03", "labelReverse": [90, 950, 300]}, + {"type": "rc", "position": 1400, "name": "RC_ESA.04", "devices":["PDU-RC-ESA-04"], "width": 800, "height": 2000, "depth": 800, "labelReverse": [90, 950, 300], "devices":[ + "sw-c-esa-04", "pdu-rc-esa-04" + ]}, + {"type": "rd", "position": 2000, "name": "RD_ESA.01", "labelReverse": [90, 950, 300], "devices": [ + "sw-c-esa-05","sw-mscr-esa-01","sw-bpm-esa-01","ec-bpm-esa-01","CM_SFEL01.01", "CM_SFEL02.01", "CM_MBD_FEL01.01", "BPM_MBD_FEL01.01", "MSCR_MBD_FEL01.01", "BPM_MBD_FEL01.02", "BPM_MBD_FEL01.03", "CM_MBD_FEL02.01", "BPM_MBD_FEL02.01", "MSCR_MBD_FEL02.01", "BPM_MBD_FEL02.02", "BPM_MBD.01", "BPM_MBD.02", "BPM_MBD.03", "CM_MBD.01", "MSCR_MBD.01","EC-BPM-ESA-01","LIBERA_BPM_IUFEL01.01","LIBERA_BPM_MBD01.02","LIBERA_BPM_MBD02.01","LIBERA_BPM_MBD01.01","LIBERA_BPM_IUFEL02.02","LIBERA_BPM_MBD01.03","LIBERA_BPM_MBD02.02","LIBERA_BPM_MBD01","LIBERA_BPM_MBD02","LIBERA_BPM_MBD03" + ]} + ] + }, + { + "start": {"x": 112000, "y": 100, "z": 6000}, + "bending": {"rotateY": "PI"}, + "components": [ + ] + }, + { + "start": {"x": 114000, "y": 100, "z": -1400}, + "components": [ + {"type": "rps", "position": 300, "name": "RPS_ESA_PAD.01", "labelReverse": [40, 1250, 300], "devices":[ + "ESA/YAMS/01","ESA/YAMS/02","ESA/YAMS/03","ESA/YAMS/04","ESA/YAMS/05","ESA/YAMS/06","PDU-RPS-ESA-PAD-01" + ]}, + {"type": "rps", "position": 900, "name": "RPS_ESA_PAD.02", "labelReverse": [40, 1250, 300], "devices":[ + "ESA/YAMS/TF08","ESA/YAMS/TF09","ESA/YAMS/TF10","yams-esa-10","PDU-RPS-ESA-PAD-02" + ]}, + {"type": "rc", "position": 1500, "name": "RC_ESA_PAD.05", "labelReverse": [40, 1250, 300], "devices":[ + "CMM-PADRES-ESA-01","PDU-RC-ESA-05", "srv-ccd-padres-01" + ]} + ] + }, + { + "start": {"x": 114000, "y": 100, "z": 6000}, + "bending": {"rotateY": "PI"}, + "components": [ + ] + }, + { + "start": {"x": 116000, "y": 100, "z": -1600}, + "components": [ + {"type": "rtf", "position": 0, "name": "RTF_ESA.01", "width": 800, "height": 2000, "depth": 800, "devices":[ + "PLC TERAFERMI" + ]}, + {"type": "rc", "position": 900, "name": "RC_ESA_TF.02", "devices":[ + "ESA/YAMS/TF01","ESA/YAMS/TF02","ESA/YAMS/TF03","ESA/YAMS/TF04","ESA/YAMS/TF05","ESA/YAMS/TF06" + ]}, + {"type": "rc", "position": 1500, "name": "RC_ESA_TF.01", "width": 800, "height": 2000, "depth": 800, "devices":[ + "CMM-TF-ESA-01","PDU-RC-TF-01", "sw-c-tf-01", "sw-tf-esa-01" + ]} + ] + }, + { + "start": {"x": 116000, "y": 100, "z": 6000}, + "bending": {"rotateY": "PI"}, + "components": [ + ] + } + ] + } +} diff --git a/fermi_lattice.php b/fermi_lattice.php new file mode 100644 index 0000000..c0afe08 --- /dev/null +++ b/fermi_lattice.php @@ -0,0 +1,114 @@ +<?php +$f = file('./lattice/Fermi_CM_coord.csv'); // extracted from //sincro-share/Private/FERMI_CM/Fermi_CM.xls +$blmSrcs = array( + 'http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-srf-01.fcs.elettra.trieste.it:20000/f/radiation_protection/blm_master_linac.01(BlmConfiguration)', + 'http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-srf-01.fcs.elettra.trieste.it:20000/f/radiation_protection/blm_master_linac.02(BlmConfiguration)', + 'http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-srf-01.fcs.elettra.trieste.it:20000/f/radiation_protection/blm_master_uh.01(BlmConfiguration)' +); +$blm = array(); +foreach ($blmSrcs as $b) { + $data = json_decode(file_get_contents($b), false); + foreach ($data as $d) { + $k = explode('/BLM_', strtoupper($d)); + $end = substr($k[1], -2); + $v = ($end=='_L' || $end=='_R')? substr($k[1], 0, -2): (($end=='DN' || $end=='UP')? substr($k[1], 0, -3): $k[1]); + $blm[$k[1]] = $v; + } +} +$components = array( + "Q" => "quadrupolefermi", + "CBPM" => "bpm", + "BPM" => "bpm", + /*"ACCT0" => "cavitylinac", + "ACCT" => "cavitylinac", + "ACCBT" => "cavitylinac", + "ID" => "wiggler", + "UND" => "undulator",*/ + "CHV" => "correctorfermi", + "CH" => "correctorfermi", + "CV" => "correctorfermi" +); + +// ---------------------------------------------------------------- +// emit diff +function eval_diff($a, $b) { + $old_error_reporting = error_reporting(E_ALL); + require_once('../../lib/diff.php'); + error_reporting($old_error_reporting); + $diff = new diff; + $text = $diff->inline($b,$a,2); + echo '<h3>Differences between JSON lattice and references</h3>'.count($diff->changes).' changes'; + echo $text; +} + +function component_diff() { + global $latticeFile; + echo '<h3>Supported components</h3><table>'; + $json = json_decode(file_get_contents($latticeFile), true); + $comp = array(); + foreach ($json as $devname=>$device) { + foreach ($device as $kseg=>$segment) { + foreach ($segment['magnets'] as $m) $comp[$m['type']] = true; + } + } + foreach ($comp as $component=>$v) { + if (strpos($component, '_FLSC')!==false) continue; + echo "<tr><td>$component </td><td> ".(file_exists("./components/{$component}.js")? "OK": "missing")."</td></tr>\n"; + } + die("</table>"); +} + +$bending = array(); +$json = file('./fermi_lattice.json'); +foreach ($json as $r) if (strpos($r, "bending")!==false) { + $b = explode('"name": "', $r); + $n = explode('"', $b[1]); + $bending[$n[0]] = rtrim($r); +} +$buf = '{<br> "linac": [<br> {<br>'; +$table = '<head> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> +</head > +<table class="table table-hover table-striped"> +'; +$magnets = 0; +foreach($f as $i=>$r) { + if ($i<1) {continue;} + $c = explode(';', strtr($r, array(','=>'.'))); + $comp = explode('_', $c[0]); + if ($i==2) {$x = round($c[2]); $z = -round($c[3]); $buf .= ' "start": {"x": '.$x.', "z": '.($z+60000).'},<br> "chamber": {"type": "chamber"},<br> "magnets": [<br>'; } + if ($comp[0]=='B' && $c[1] != 'DRIFT') { + $x = round($c[2]); + $z = -round($c[3]); + if ($magnets>0) $buf = substr($buf, 0, strlen($buf)-5).'<br>'; + $buf .= ' ]<br> },<br> {<br> "start": {"x": '.$x.', "z": '.($z+60000).'},<br>'.$bending[$c[0]].'<br> "chamber": {"type": "chamber"},<br> "magnets": [<br>'; + if (($i = array_search($c[0], $blm))!==false) {$buf .= ' {"type": "blm", "position": 100, "name": "BLM_'.$i.'"},<br>'; unset($blm[$i]);} + if (($i = array_search($c[0], $blm))!==false) {$buf .= ' {"type": "blm", "position": 100, "name": "BLM_'.$i.'"},<br>'; unset($blm[$i]);} + $magnets = 0; + } + else if ($comp[0]!='DR' && !empty($comp[0])) { + $magnets++; + $name = $c[0]; + if (strpos($name, '(')!==false) {$n = explode('(', $c[0]); $name = trim($n[0]);} + $buf .= ' {"type": "'.strtr($comp[0], $components).'", "position": '.round(sqrt(($x-$c[2])**2+($z+$c[3])**2)).', "name": "'.$c[0].'"},<br>'; + if (($i = array_search($name, $blm))!==false) {$buf .= ' {"type": "blm", "position": '.round(sqrt(($x-$c[2])**2+($z+$c[3])**2)).', "name": "BLM_'.$i.'"},<br>'; unset($blm[$i]);} + if (($i = array_search($name, $blm))!==false) {$buf .= ' {"type": "blm", "position": '.round(sqrt(($x-$c[2])**2+($z+$c[3])**2)).', "name": "BLM_'.$i.'"},<br>'; unset($blm[$i]);} + } + $table .= "<tr><td>{$comp[0]}</dt><td>{$c[1]}</dt><td>".round($c[2])."</dt><td>".round($c[3])."</dt><td>".round($c[6]*1000)."</dt><td>$r</td></tr>\n"; +} +$buf = substr($buf, 0, strlen($buf)-5).'<br> ]<br> }<br> ]<br>}<br>'; +$table .= "</table>\n<br><br><br><br>"; +if ($_REQUEST['json']=='diff') { + $b = explode("\n", strtr($buf, array('<br>'=>"\n", '<pre>'=>'', '</pre>'=>'', "},\n ]"=>"}\n ]"))); + foreach ($b as $i=>$j) $b[$i] = rtrim($j); + eval_diff($json, $b); + component_diff(); +} +foreach ($blm as $k=>$v) { + echo "$k $v ".(strpos($buf, $v)===false? "NOK": "ok")."<br>\n"; +} + +if (isset($_REQUEST['table'])) echo "$table\n<br><br><br><br>"; +echo "<pre>$buf</pre>"; + +?> diff --git a/magnet.php b/magnet.php new file mode 100644 index 0000000..99d0699 --- /dev/null +++ b/magnet.php @@ -0,0 +1,292 @@ +<?php +if (empty($_REQUEST['component'])) { + $list = empty($_REQUEST['list'])? array(): explode(',', $_REQUEST['list']); + if (!empty($_REQUEST['machine'])) { + $f = json_decode(file_get_contents($_REQUEST['machine'].'_lattice.json'), true); + foreach($f as $facility) foreach($facility['sections'] as $sec) foreach($sec['components'] as $c) $l[$c['type']] = true; + $list = array_keys($l); + // print_r($l); exit(); + } + $f = scandir('./components/src'); + $background = empty($_REQUEST['background'])? '': " background-color: {$_REQUEST['background']};"; + echo "<div class='flex-container' style='display: flex; flex-direction: row; flex-wrap: wrap;$background'>\n"; + foreach($f as $file) { + if (strpos($file, 'bundle')!==false) continue; + if (isset($_REQUEST['svg'])) { + if (strpos($file, '.svg')===false) continue; + $comp = strtr($file, array('.svg'=>'')); + if (!empty($list) && !in_array($comp, $list)) continue; + echo "<div><img style='max-width: 250px;' src='./components/src/$file'><br><br>$file<br><br></div>"; + } + else { + if (strpos($file, '.js')===false) continue; + $comp = strtr($file, array('.js'=>'')); + if (!empty($list) && !in_array($comp, $list)) continue; + echo "<div style='text-align: center;'><a href='?component=$comp'><img style='max-width: 250px;' src='./components/preview/{$comp}_preview.jpg'><br>$comp</a></div>\n"; + } + } + die("</div>"); +} +?> +<!DOCTYPE html> +<html lang="en"> + <head> + <title>Components</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> + <style> + body { + background-color: #ccc; + color: #000; + } + + a { + color: #f00; + } + #c { + width: 100%; + height: 100%; + display: block; + } + </style> + </head> + + <body> + <canvas id="c"></canvas> + <div id="info" style='display: none'> + <a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> - map controls + <span id="timer" title="loading" style="display: none"><img src="../../egiga2m/img/timer.gif"></span> + camera position, x: <input id="cameraX" size="20" value="-7500"> y: <input id="cameraY" size="20" value="1500"> z: <input id="cameraZ" size="20" value="4500"> + camera rotation, x: <input id="rx" size="20" value="-0.6"> y: <input id="ry" size="20" value="-0.3"> z: <input id="rz" size="20" value="-0.2"> + cdebug <input id="cdebug" size="3" value="0"> + </div> + <div style="position: absolute; left: 5px; bottom: 5px;"> + <button onclick="document.location = './magnet.php?component=<?php echo $_REQUEST['component'];?>'">1x</button> + <button onclick="document.location = './magnet.php?component=<?php echo $_REQUEST['component'];?>&mul=2'">8x</button> + <button onclick="document.location = './magnet.php?component=<?php echo $_REQUEST['component'];?>&mul=5'">125x</button> + <button onclick="document.location = './magnet.php?component=<?php echo $_REQUEST['component'];?>&mul=10'">1000x</button> + <button onclick="document.location = './magnet.php?component=<?php echo $_REQUEST['component'];?>&mul=20'">8000x</button> + </div> + <script type="importmap"> + { + "imports": { + "three": "../../lib/node_modules/three/build/three.module.js", + "three/addons/": "../../lib/node_modules/three/examples/jsm/", + "components/": "./components/src/" + } + } + </script> + <script type="module"> + // coordinates in millimeters relative to the center of the ring + console.log('globalThis', globalThis, window, self, frames, Object); + + import * as THREE from 'three'; + import Stats from 'three/addons/libs/stats.module.js' + const raycaster = new THREE.Raycaster(); + const pointer = new THREE.Vector2(); + // const dipole = []; + window.quadrupole = []; + window.sextupole = []; + window.corrector = []; + let selectedObjects = []; + + const stats = new Stats(); + const statmode = document.location.search.indexOf('statmode=')>-1? document.location.search.split('statmode=')[1].split('&')[0]-0: 0; + stats.showPanel(statmode); // 0: fps, 1: ms, 2: mb, 3+: custom + document.body.appendChild(stats.dom); + + const obj3d = new THREE.Object3D(); + // import { GUI } from 'three/addons/libs/lil-gui.module.min.js'; + import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; + + import { MapControls } from 'three/addons/controls/OrbitControls.js'; + // import { RoundedBoxGeometry } from 'three/addons/geometries/RoundedBoxGeometry.js'; + import { <?php echo ($_REQUEST['component']=='ellipticaltube'? 'ellipticaltubeGeometry': $_REQUEST['component']); ?> } from 'components/<?php echo $_REQUEST['component']; ?>.js'; + + let camera, controls, scene, renderer; + let cx=-1500, cy=500, cz=4500, rx=-0.6, ry=-0.3, rz=-0.2, cdebug; + let composer, outlinePass; + const chamberMaterial = new THREE.MeshLambertMaterial({color: 0xc0c0c0}); + + init(); + //render(); // remove when using next line for animation loop (requestAnimationFrame) + animate(); + function moveCamera() { + if (cdebug != document.getElementById('cdebug').value) {cdebug = document.getElementById('cdebug').value; console.log(cdebug, camera); return;} + if (cx==document.getElementById('cameraX').value && cy==document.getElementById('cameraY').value && cz==document.getElementById('cameraZ').value && + rx==document.getElementById('rx').value && ry==document.getElementById('ry').value && rz==document.getElementById('rz').value) return; + rx = document.getElementById('rx').value; + ry = document.getElementById('ry').value; + rz = document.getElementById('rz').value; + cx = document.getElementById('cameraX').value; + cy = document.getElementById('cameraY').value; + cz = document.getElementById('cameraZ').value; + // camera.position.set( document.getElementById('cameraX').value, document.getElementById('cameraY').value, document.getElementById('cameraZ').value ); + console.log('moveCamera()'); + camera.position.set(cx,cy,cz); + camera.rotation.set(rx,ry,rz); + controls.update(); + window.scene = scene; + window.camera = camera; + window.controls = controls; + } + + function init() { + scene = new THREE.Scene(); + scene.background = new THREE.Color( 0xffffff ); + //scene.fog = new THREE.FogExp2( 0xcccccc, 0.0000002 ); + + const canvas = document.querySelector('#c'); + renderer = new THREE.WebGLRenderer({antialias: true, canvas, logarithmicDepthBuffer: true}); + + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( window.innerWidth, window.innerHeight ); + document.body.appendChild( renderer.domElement ); + + camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 0.001, 100000 ); + camera.position.set(-1500,500,4500); + camera.rotation.set(-0.6, -0.3, -0.2); + // camera.position.set( document.getElementById('cameraX').value, document.getElementById('cameraY').value, document.getElementById('cameraZ').value ); + + // controls + controls = new MapControls( camera, renderer.domElement ); + controls.enableDamping = true; // an animation loop is required when either damping or auto-rotation are enabled + controls.dampingFactor = 0.1; + controls.screenSpacePanning = false; + controls.minDistance = 0.01; + controls.maxDistance = 300000; + controls.maxPolarAngle = Math.PI / 2; + controls.update(); + + window.addEventListener( 'resize', onWindowResize ); + + if (document.location.search.indexOf('debug')>-1) { + var geometryDebug = new THREE.SphereGeometry(100, 32, 32); + var materialDebug = new THREE.MeshLambertMaterial({ color: 0x000000 }); + var meshDebug = new THREE.Mesh(geometryDebug, materialDebug); + meshDebug.position.set(0, 0, 0); + meshDebug.name = 'debug000'; + scene.add(meshDebug); + for (var c=1; c<=1000; c=c*10) { + geometryDebug = new THREE.SphereGeometry(50+100*c/2, 32, 32); + materialDebug = new THREE.MeshLambertMaterial({ color: 0xff0000 }); + meshDebug = new THREE.Mesh(geometryDebug, materialDebug); + meshDebug.position.set(1000*c, 0, 0); + meshDebug.name = 'debug100_'+c; + scene.add(meshDebug); + materialDebug = new THREE.MeshLambertMaterial({ color: 0x00ff00 }); + meshDebug = new THREE.Mesh(geometryDebug, materialDebug); + meshDebug.position.set(0, 1000*c, 0); + meshDebug.name = 'debug010_'+c; + scene.add(meshDebug); + materialDebug = new THREE.MeshLambertMaterial({ color: 0x0000ff }); + meshDebug = new THREE.Mesh(geometryDebug, materialDebug); + meshDebug.position.set(0, 0, 1000*c); + meshDebug.name = 'debug001_'+c; + scene.add(meshDebug); + materialDebug = new THREE.MeshLambertMaterial({ color: 0x800000 }); + meshDebug = new THREE.Mesh(geometryDebug, materialDebug); + meshDebug.position.set(-1000*c, 0, 0); + meshDebug.name = 'debug200_'+c; + scene.add(meshDebug); + materialDebug = new THREE.MeshLambertMaterial({ color: 0x008000 }); + meshDebug = new THREE.Mesh(geometryDebug, materialDebug); + meshDebug.position.set(0, -1000*c, 0); + meshDebug.name = 'debug020_'+c; + scene.add(meshDebug); + materialDebug = new THREE.MeshLambertMaterial({ color: 0x000080 }); + meshDebug = new THREE.Mesh(geometryDebug, materialDebug); + meshDebug.position.set(0, 0, -1000*c); + meshDebug.name = 'debug002_'+c; + scene.add(meshDebug); + } + } + camera.position.set(1, 100, 100); + camera.rotation.set(-1.5497719738079266e-16, -1.164613656151594, -1.4236759551018105e-16); + camera.updateMatrixWorld(true); + cx = 0; + + if (document.location.search.indexOf('wiggler')>-1) { + scene.add(wiggler(1300)); + } + /*else if (document.location.search.indexOf('cavity')>-1) { + scene.add(cavity(5000,0.5,500,8000)); + }*/ + // if (document.location.search.indexOf('envelope')>-1) magnet = envelopeMaster; + else if (document.location.search.indexOf('ellipticaltube')>-1) { + const envelopegeometry = ellipticaltubeGeometry(5,10,10,5,10,50); + console.log('envelopegeometry', envelopegeometry); + const envelopematerial = new THREE.MeshBasicMaterial({color: 0x00f0f0, transparent: true, opacity: 0.2, side: THREE.DoubleSide,}); + + const envelopemesh = new THREE.Mesh( envelopegeometry, envelopematerial ); + envelopemesh.position.set(500, 500, 500); + envelopemesh.scale.setX(100); + envelopemesh.scale.setY(100); + envelopemesh.scale.setZ(100); + envelopemesh.rotateY(Math.PI/2); + envelopemesh.rotateZ(Math.PI/2); + scene.add(envelopemesh); + + const envelopegeometry2 = ellipticaltubeGeometry(10,5,6,8,10,50); + const envelopemesh2 = new THREE.Mesh( envelopegeometry2, envelopematerial ); + envelopemesh2.position.set(1500, 500, 500); + envelopemesh2.scale.setX(100); + envelopemesh2.scale.setY(100); + envelopemesh2.scale.setZ(100); + envelopemesh2.rotateY(Math.PI/2); + envelopemesh2.rotateZ(Math.PI/2); + scene.add(envelopemesh2); + } + else if (document.location.search.indexOf('mul=')>-1) { + const component = <?php echo $_REQUEST['component']; ?>(); + const dist = document.location.search.indexOf('dist=')>-1? document.location.search.split('dist=')[1].split('&')[0]: 3000; + const mul = document.location.search.split('mul=')[1].split('&')[0]; + for (let i=0; i<mul; i++) { + for (let j=0; j<mul; j++) { + for (let k=0; k<mul; k++) { + const c = component.clone(); + c.position.set(dist*i, dist*j, dist*k); + scene.add(c); + } + } + } + } + else { + const component = <?php echo $_REQUEST['component']; ?>(); + scene.add(component); + } + + const dirLight1 = new THREE.DirectionalLight( 0xffffff ); + dirLight1.position.set( 1, 1, 1 ); + scene.add( dirLight1 ); + + const dirLight2 = new THREE.DirectionalLight( 0x888888 ); + dirLight2.position.set( - 1, - 1, - 1 ); + scene.add( dirLight2 ); + + const ambientLight = new THREE.AmbientLight( 0x555555 ); + scene.add( ambientLight ); + } + + function onWindowResize() { + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); + renderer.setSize( window.innerWidth, window.innerHeight ); + } + + function animate() { + requestAnimationFrame( animate ); + stats.begin(); + moveCamera(); + controls.update(); // only required if controls.enableDamping = true, or if controls.autoRotate = true + render(); + stats.end(); + // composer.render(); + } + + function render() { + renderer.render(scene, camera); + } + </script> + </body> +</html> diff --git a/open.svg b/open.svg new file mode 100644 index 0000000..9530c8f --- /dev/null +++ b/open.svg @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 24 24" width="512" height="512" style="background-color:#000000;"> +<path fill="#00c040" d="m20.475,23H0V4C0,2.346,1.346,1,3,1h3.236l4,2h7.764c1.654,0,3,1.346,3,3v4h3.021l-3.547,13Zm-16.109-2h14.582l2.455-9H7.216l-2.851,9Zm-2.365,0h.268l3.483-11h13.249v-4c0-.551-.448-1-1-1h-8.236l-4-2h-2.764c-.552,0-1,.449-1,1v17Z"/> +</svg> diff --git a/panther.js b/panther.js new file mode 100644 index 0000000..8763708 --- /dev/null +++ b/panther.js @@ -0,0 +1,923 @@ +// jshint esversion: 6 + import * as THREE from 'three'; + import Stats from 'three/addons/libs/stats.module.js'; + import {GUI} from 'three/addons/libs/lil-gui.module.min.js'; + import {OrbitControls} from 'three/addons/controls/OrbitControls.js'; + import {MapControls} from 'three/addons/controls/MapControls.js'; + import {EffectComposer} from 'three/addons/postprocessing/EffectComposer.js'; + import {RenderPass} from 'three/addons/postprocessing/RenderPass.js'; + import {OutlinePass} from 'three/addons/postprocessing/OutlinePass.js'; + + import {ellipticaltubeGeometry} from 'components/ellipticaltube.js'; + import {chamber} from 'components/chamber.js'; + import {wall} from 'components/wall.js'; + import * as componentCreator from 'bundle'; + import {conf} from './panther_conf.js'; + import * as blmres from './blm.js'; + + let firstUrl = true; + let historytime = + new Date(); + function setUrl(name, value) { + let t = + new Date(); + if (t - historytime < 200) return; + historytime = t; + parameters[name] = value; + const pp = []; + for (let i in parameters) {pp.push(i+'='+parameters[i]);} + const url = document.location.origin+document.location.pathname+'?'+pp.join('&').replace('=undefined', ''); + if (firstUrl) window.history.pushState({"html":'panther.php',"pageTitle":'PAnTHer'},"", url); + else window.history.replaceState({"html":'panther.php',"pageTitle":'PAnTHer'},"", url); + firstUrl = false; + } + function compLink(event) { + window.open(document.getElementById("compdb").href, '_blank').focus(); + event.stopPropagation(); + return false; + } + const pa = document.location.search.replace('?','').split('&'); + const parameters = {}; + for (let i=0; i<pa.length; i++) {const p = pa[i].split('='); parameters[p[0]] = p[1];} + + let cameraStarted = false; + const machineCaseSensitive = document.location.search.indexOf('machine=')>-1? document.location.search.split('machine=')[1].split('&')[0]: conf.default_machine; + const machine = machineCaseSensitive.toLowerCase(); + const latticeFile = document.location.href.split('?')[0].split('/').slice(0,-1).join('/')+'/'+machine+'_lattice.json'; + window.names = []; + window.alias = []; + let lattice; + let dipoleNum = 0; + const raycaster = new THREE.Raycaster(); + const pointer = new THREE.Vector2(); + const component = []; + const facilities = []; + const status = []; + let selectedObjects = []; + let found = false; + const vlv = document.location.search.indexOf('vlv')>-1; + const vlvs = []; + const ps = document.location.search.indexOf('ps')>-1; + const demo = document.location.search.indexOf('demo')>-1 || document.location.search.indexOf('machine=elettra2')>-1; + if (demo) document.getElementById('demo').style.display = 'block'; + let camera, controls, scene, renderer; + let composer, outlinePass; + let tooltipObject = null; + let x1, y1, z1, x2, y2, z2, rx1, ry1, rz1, rx2, ry2, rz2, tang, alpha, d, den; + const envelopeMaterial = new THREE.MeshBasicMaterial({color: 0x00f0f0, transparent: true, opacity: 0.5, side: THREE.DoubleSide,}); + let envelopeCounter = 0, envelopeIndex=0; + let envelopeSrc = ''; + const envelopeMesh = []; + const envelopeSize = []; + const envelopeFactorX = 5000000; + const envelopeFactorY = 10000000; + const envelopeNum = 1286; + const envelopeOffset = 83; + const bpm = {radius: 100, srv: './bpm.php', mesh: {}}; + const bpmMesh = {}; + const bpmReferenceMesh = {}; + const bpmPoints = {}; + const bpmSkip = {}; + const bpmIndex = {}; + const bpmData = {}; + let fast = document.location.search.indexOf('fast')>-1? document.location.search.split('fast')[1].split('&')[0].split(','): false; + let premium = document.location.search.indexOf('premium')>-1? document.location.search.split('premium')[1].split('&')[0].split(','): false; + const blm = {oldIndex: null, reader: false, acqTime: null}; + let latticenodes = 0; + const Ydefault = 100; + let params = {machine: machineCaseSensitive, search: '', envelopeNum: 0, backgroundColor: '#777777'}; + let fel1 = false; + let fel2 = false; + if (machine.indexOf('fermi')>-1) { + fetch(conf.rchan+'srv-tango-srf-01:20000/f/access_control/safety/Undulator_access_state').then((response) => {return response.json();}).then((fel) => { + fel1 = fel[5] == 1; + fel2 = fel[6] == 1; + }); + } + const gui = new GUI(); + gui.add(params, 'machine', conf.machineList).onChange(function() {toggleMachine(params.machine);}); + params.mode = document.location.search.indexOf('fast')>-1? 'fast': document.location.search.indexOf('premium')>-1? 'premium': 'plus'; + gui.add(params, 'mode', conf.modes).onChange(function() {toggleParam('mode', params.mode);}); + params.vlv = document.location.search.indexOf('vlv')>-1; + gui.add(params, 'vlv').name('vlv & bst').onChange(function() {toggleParam('vlv');}); + params.ps = document.location.search.indexOf('ps')>-1; + gui.add(params, 'ps').onChange(function() {toggleParam('ps');}); + gui.title('PAnTHer - controls'); + gui.add(params, 'search'); // .onKeyup(function() {console.log('search');}); + gui.addColor(params, 'backgroundColor').onChange(function() {toggleParam('backgroundColor');}); + const debugcamera = document.location.search.indexOf('debugcamera')>-1; + if (debugcamera) $('body').append('<div class="debug" style="top: 0; position: fixed;"> x: <input size="5" id="x"/>, y: <input size="5" id="y"/>, z: <input size="5" id="z"/>, cx: <input size="5" id="cx"/>, cy: <input size="5" id="cy"/>, cz: <input size="5" id="cz"/>'); + const highlight = document.location.search.indexOf('highlight=')==-1? []: document.location.search.split('highlight=')[1].split('&')[0].split(','); + params.highlightScale = document.location.search.indexOf('highlightScale=')==-1? (highlight.length? 0.5: 1): document.location.search.split('highlightScale=')[1].split('&')[0]-0; + params.highlightShrink = document.location.search.indexOf('highlightShrink=')==-1? 0.2: document.location.search.split('highlightShrink=')[1].split('&')[0]-0; + const stats = new Stats(); + // window.stats = stats; + if (document.location.search.indexOf('stats')>-1) { + stats.showPanel(0); // 0: fps, 1: ms, 2: mb, 3+: custom + document.body.appendChild(stats.dom); + } + export function bpm_reference(action) { + const name = $('.name:contains("bpmReference")').parent().select('.widget').children().eq(1).children('input').val(); + if (action=='save') fetch(bpm.srv+'?save='+name+'&content='+JSON.stringify(bpmData)).then((response) => {return response.text();}).then((res) =>{alert(res=='OK'? 'BPM reference saved': res);}); + else fetch(bpm.srv+'?open='+name).then((response) => {return response.json();}).then((res) =>{ + for (let facility in res) { + // if (facility=='bts') use https://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/fb/bts/traj/SensorReferenceValues + bpmIndex[facility] = lattice[facility].bpm.offset; + const path = bpmPath(res[facility], facility); + const skiplen = lattice[facility].bpm.skip? lattice[facility].bpm.skip.length: 0; + const bpmGeometry = new THREE.TubeGeometry(path, lattice[facility].bpm.length-1-skiplen, bpm.radius, 16, (typeof lattice[facility].sections[0].chamber)!='undefined'); + const material = new THREE.MeshBasicMaterial({color: 0x00ff80, transparent: true, opacity: 0.5,}); + bpmReferenceMesh[facility] = new THREE.Mesh(bpmGeometry, material); + facilities[facility].add(bpmReferenceMesh[facility]); + } + }); + } + window.bpmreference = bpm_reference; + function updateBpm(data, facility) { + console.log('updateBpm(), data:', data, ', facility:', facility, ', bpmMesh', bpmMesh); + bpmData[facility] = data; + bpmMesh[facility].geometry.dispose(); + bpmIndex[facility] = lattice[facility].bpm.offset; + const path = bpmPath(data, facility); + const len = lattice[facility].bpm.length-1-(typeof lattice[facility].bpm.skip=='undefined'? 0: lattice[facility].bpm.skip.length); + const bpmGeometry = new THREE.TubeGeometry(path, len, bpm.radius, 16, (typeof lattice[facility].sections[0].chamber)!='undefined'); + bpmMesh[facility].geometry = bpmGeometry.clone(); + bpmMesh[facility].geometry.computeVertexNormals(); + bpmMesh[facility].geometry.normalsNeedUpdate = true; + bpmMesh[facility].geometry.verticesNeedUpdate = true; + bpmMesh[facility].geometry.dynamic = true; + data = null; + } + function readBpm(facility) { + console.log('readBpm()', facility,lattice[facility].bpm.pos); + if (document.location.search.indexOf('bpm=')>-1) { + if(bpmPoints[facility]) { + const data = [new Array(bpmPoints[facility].length+bpmSkip[facility].length).fill(1), new Array(bpmPoints[facility].length+bpmSkip[facility].length).fill(1)]; + data[0][document.location.search.split('bpm=')[1].split('&')[0]] = 8; + for (let i=0; i<bpmSkip[facility].length; i++) {data[0].splice(bpmSkip[facility][i]+1, 1); data[1].splice(bpmSkip[facility][i]+1, 1);} + updateBpm(data, facility); + } + } + else fetch(lattice[facility].bpm.pos) + .then((response) => {return response.json();}) + .then((data) => { + for (let i=0; i<bpmSkip[facility].length; i++) {data[0].splice(bpmSkip[facility][i]+1, 1); data[1].splice(bpmSkip[facility][i]+1, 1);} + updateBpm(data, facility); + }); + } + function readBpms() { + for (let facility in lattice) { if (lattice[facility].bpm) readBpm(facility);} + } + function bpmPath(data, facility) { + let len = lattice[facility].bpm.length - bpmSkip[facility].length; + if (len>bpmPoints[facility].length) len = bpmPoints[facility].length; + // if (data!=-1) + console.log('bpmDbg', len, facility, data, bpmPoints[facility].length); + const bpmCurve = []; + for (let i=0; i<len; i++) { + const j = (i + 1) % len; + const tx = document.location.search.indexOf('radial')==-1? bpmPoints[facility][i][0].x + Math.sin(Math.atan(bpmPoints[facility][i][1])+Math.PI*0.5*bpmPoints[facility][i][2])*1000*(data[0]? data[0][j]: 1): bpmPoints[facility][i][0].x * (1+(data[0]? data[0][j]*0.02*params.bpmZoomX: 0)); + const ty = Ydefault + bpmPoints[facility][i][0].y + (data[1]? data[1][j]*1000*params.bpmZoomY: 0); + const tz = document.location.search.indexOf('radial')==-1? bpmPoints[facility][i][0].z + Math.cos(Math.atan(bpmPoints[facility][i][1])+Math.PI*0.5*bpmPoints[facility][i][2])*1000*(data[0]? data[0][j]: 1): bpmPoints[facility][i][0].z * (1+(data[0]? data[0][j]*0.02*params.bpmZoomX: 0)); + // console.log(i, facility, bpmCurve); + bpmCurve.push(new THREE.Vector3(tx, ty, tz)); + } + return new THREE.CatmullRomCurve3(bpmCurve); + } + let bpmInited = false; + function bpmAdd(facility) { + console.log('bpmDbg(), facility:', facility); + if (lattice[facility] && lattice[facility].bpm && (document.location.search.indexOf('&bpm')>-1 || document.location.search.indexOf('?bpm')>-1)) { + bpmIndex[facility] = lattice[facility].bpm.offset; + const path = bpmPath(-1, facility); + const skiplen = lattice[facility].bpm.skip? lattice[facility].bpm.skip.length: 0; + const bpmGeometry = new THREE.TubeGeometry(path, lattice[facility].bpm.length-1-skiplen, bpm.radius, 16, (typeof lattice[facility].sections[0].chamber)!='undefined'); + const material = new THREE.MeshBasicMaterial({color: 0x8000ff, transparent: true, opacity: 0.5,}); + bpmMesh[facility] = new THREE.Mesh(bpmGeometry, material); + facilities[facility].add(bpmMesh[facility]); + if (!bpmInited) {bpmInited=true; readBpms(); if (document.location.search.indexOf('bpm=')==-1) setInterval(readBpms, 3000);} + } + console.log('bpmDbg(), bpmMesh:', bpmMesh, bpmMesh[facility]); + } + + init(); + export function setShrink(v) {console.log(params.highlightShrink, v); params.highlightShrink = v; toggleParam('highlightShrink', v); } + window.shrink = setShrink; + function mytoggle() {console.log('mytoggle()', this); toggleParam(this.property+(this.property.indexOf('highlight')==-1? '=hide': ''), this.value);} // https://lil-gui.georgealways.com/#Controller#onChange + function initIndex(lattice) { + const index = []; + for (let l in lattice.conf.index) { + let servicearea = false; + for (let i in lattice.servicearea.sections) { + for (let j in lattice.servicearea.sections[i].components) { + if (lattice.conf.index[l]==lattice.servicearea.sections[i].components[j].name) {servicearea = true;} + } + } + const cmd = 'window.findComponent('+"'"+lattice.conf.index[l]+"'"+', '+(servicearea? 'true': 'false')+')'; + index.push('<button onclick="'+cmd+'">'+l+'</button>'); + } + $('body').append('<div style="position: absolute; left: 5px; bottom: 5px;">'+index.join(' ')+'</div>'); + } + fetch(latticeFile).then((response) => {return response.json();}).then((flattice) => { + lattice = flattice; + const blmfacilities = ['']; + const machineFolder = gui.addFolder('toggle facility'); + if (Object.keys(lattice).length>1) { + const serviceareadefault = document.location.search.indexOf('servicearea')>-1 && document.location.search.indexOf('servicearea=')==-1; + for (let i in lattice) { + if (i=='conf') { + params[i] = false; + continue; + } + params[i] = document.location.search.indexOf(i+'=hide')==-1 && !(serviceareadefault && document.location.search.indexOf(i)==-1); + if (i=='servicearea' && document.location.search.indexOf(i)==-1) params[i] = false; + machineFolder.add(params, i).onChange(mytoggleFacility); + if (lattice[i].blm) {blmfacilities.push(i);} + console.log('fetch()', latticeFile, i, params[i]); + if (lattice[i].bpm && (typeof params.bpm == 'undefined')) { + params.bpm = document.location.search.indexOf('&bpm')>-1 || document.location.search.indexOf('?bpm')>-1; gui.add(params, 'bpm').onChange(function() {toggleParam('bpm');}); + if (params.bpm) { + params.bpmZoomX = 1; + gui.add(params, 'bpmZoomX', 0.1, 10); + params.bpmZoomY = 1; + gui.add(params, 'bpmZoomY', 0.1, 10); + params.bpmReference = '2GeV'; + gui.add(params, 'bpmReference'); + const ref = $('.name:contains("bpmReference")').parent().select('.widget').children().eq(1); + ref.append("<img src='./save.svg' style='height:20px; margin: 2px; cursor: pointer;' onClick='window.bpmreference(\"save\")'>"); + ref.append("<img src='./open.svg' style='height:20px; margin: 2px; cursor: pointer;' onClick='window.bpmreference(\"open\")'>"); + } + } + if (lattice[i].envelope) {envelopeMenu(params, gui, i);} + } + } + if (document.location.search.indexOf('servicearea')>-1 && document.location.search.indexOf('servicearea=')==-1) { + for (let i in lattice) { + if (document.location.search.indexOf(i)==-1); + } + } + machineFolder.close(); + if (Object.keys(blmfacilities).length>1) {blmres.menu(lattice, blmfacilities, params, gui, blm, componentCreator);} + const highlightFolder = gui.addFolder('highlight components'); + for (let j in componentCreator) { + if (j.indexOf('Update')>-1) continue; + const k = 'highlight_'+j; + params[k] = typeof highlight == 'object' && highlight.includes(j); highlightFolder.add(params, k).name(j).onChange(mytoggle); + } + highlightFolder.close(); + if (document.location.search.indexOf('highlight=')>-1) { + gui.add(params, 'highlightScale', 0.1, 0.8, 0.01).onFinishChange(event => {toggleParam('highlightScale',event);}); + } + params.gotoAdmin = function() {document.location = './admin.php';}; + gui.add(params, 'gotoAdmin').name('Admin'); + $('#ui-id-1').css('z-index', 10000000); + if (document.location.search.indexOf('highlight=')>-1) {$('<div><iframe style="width: 100%;height:250px;" src="../misc/gauge.html?dark&r2only=1&r=100&ringwidth=58&max=1&throttlingPeriod=50&apply=shrink&val='+params.highlightShrink+'"></iframe></div>').insertBefore('.function');} + for (let i in lattice) {if (i!='conf') initLattice(lattice[i].sections, i);} + if (vlv) { + fetch(conf.vlvSrcUrl, {cache: "no-store"}).then((response) => {return response.text();}).then((data) => { + const vlvSrc = data.toUpperCase().substring(14).split(','); + for (let i=0; i<vlvs.length; i++) { + for (let j=0; j<vlvSrc.length; j++) { + const name = vlvSrc[j].split('/')[3]; + if (vlvs[i].name.indexOf(name)>-1) {vlvs[i].vlvsrc = vlv; vlvs[i].vlvindex = j;} + // conf.bstmap.base + if (vlvSrc[j].split('/')[2]=="ACCESS_CONTROL" && i>39 && i<41) console.log('bst', j, vlvSrc[j], conf.bstmap.base, vlvs[i].name); + if (vlvSrc[j].split('/')[2].indexOf(conf.bstmap.base)>-1) { + if (conf.bstmap[vlvs[i].name] && conf.bstmap[vlvs[i].name].indexOf(vlvSrc[j].split('/')[4])>-1) {vlvs[i].vlvsrc = 'bst'; vlvs[i].vlvindex = j;} + } + } + } + console.log('vlvSrc', data, vlvSrc, conf.bstmap, vlvs); + }); + setInterval(updateVlv, 1000); + } + params.goto2D = function() {document.location = './panther2d.php?machine='+params.machine;}; + gui.add(params, 'goto2D').name('2D'); + if (document.location.search.indexOf('search=')>-1) findComponent(document.location.search.split('search=')[1].split('&')[0], false); + if (lattice.conf && lattice.conf.index) initIndex(lattice); + console.log(lattice, facilities); + if (ps) { + fetch(conf.stateSrcUrl, {cache: "no-store"}).then((response) => {return response.text();}).then((data) => { + const statSrc = data.toUpperCase().split(','); + for (let j=0; j<statSrc.length; j++) { + statSrc[j] = statSrc[j].split('/')[3].replace('PS', ''); + // if (statSrc[j].split('/')[1]=='POWER_SUPPLY') statSrc[j] = statSrc[j].split('/')[2].replace('PS', ''); + } + for (let i=0; i<status.length; i++) { + for (let j=0; j<statSrc.length; j++) { + if (status[i].name.indexOf(statSrc[j])>-1) {status[i].statsrc = ps; status[i].statindex = j;} + } + } + console.log('statSrc', statSrc, status); + }); + setInterval(updateStatus, 1000); + } + }); + function showStatus(i, stat) { + if (stat == 0 || stat == 'null' || stat == '' || stat == 'ON' || stat == 'RUNNING') {status[i].visible = false;} + else {status[i].visible = true; status[i].material.color.set(conf.stateLabelColor[stat]);} + // console.log(i, status[i], stat); + } + function clearStatus() { + for (let i=0; i<status.length; i++) { + if (status[i].statsrc==ps) showStatus(i, 0); + } + } + function updateStatus() { + fetch(conf.stateUrl, {cache: "no-store"}).then((response) => {return response.text();}).then((data) => { + // console.log(data); + const statVal = data.split(';'); + for (let i=0; i<status.length; i++) { + if (status[i].statsrc==ps) { + if (status[i].statindex) showStatus(i, statVal[status[i].statindex]); + // if (status[i].name.indexOf('PSCH_B25')>-1) console.log(statVal, status, status[i].name, i, 'statindex: '+status[i].statindex, 'statVal: '+statVal[status[i].statindex]); + } + } + setTimeout(clearStatus, 600); + }); + } + for (let i=0; i<envelopeNum; i++) { envelopeSize[i] = 500;} + function updateEnvelopeCenters(data) { + for (let i=0; i<envelopeMesh.length; i++) { + x1 = (i+envelopeOffset) % envelopeNum; + x2 = (i+envelopeOffset+1) % envelopeNum; + const direction = false; //!envelopeMesh[i].mydirection; + const width = envelopeMesh[i].width; + envelopeMesh[i].geometry.dispose(); + const envelopeGeometry = ellipticaltubeGeometry(envelopeFactorX*params.envelopeZoomX*data[0][direction? x2: x1],envelopeFactorY*params.envelopeZoomY*data[1][direction? x2: x1], envelopeFactorX*params.envelopeZoomX*data[0][direction? x1: x2],envelopeFactorY*params.envelopeZoomY*data[1][direction? x1: x2], width); + envelopeMesh[i].geometry = envelopeGeometry.clone(); + envelopeMesh[i].geometry.computeVertexNormals(); + envelopeMesh[i].geometry.normalsNeedUpdate = true; + envelopeMesh[i].geometry.verticesNeedUpdate = true; + envelopeMesh[i].geometry.dynamic = true; + } + data = null; + } + function envelopeMenu(params, gui, i) { + envelopeSrc = lattice[i].envelope.src; + params.envelope = document.location.search.indexOf('envelope')>-1; + gui.add(params, 'envelope').onChange(function() {toggleParam('envelope');}); + if (document.location.search.indexOf('envelope')>-1) { + params.envelopeZoomX = 1; + gui.add(params, 'envelopeZoomX', 0.1, 10); + params.envelopeZoomY = 1; + gui.add(params, 'envelopeZoomY', 0.1, 10); + if (document.location.search.indexOf('envelope=debug')>-1) {params.envelopeDebug = 0; gui.add(params, 'envelopeDebug', 0, envelopeNum-1, 1);} + } + } + function readEnvelope() { + // console.log('envelopeSrc', envelopeSrc); + if (document.location.search.indexOf('envelope=debug')>-1) { + const arr = Array(envelopeNum).fill(0.00001); arr[params.envelopeDebug] = 0.00015; + updateEnvelopeCenters([arr, arr]); + } + else fetch(envelopeSrc) + .then((response) => {return response.json();}) + .then((eventData) => { + updateEnvelopeCenters(eventData); + }); + } + if (document.location.search.indexOf('envelope')>-1) { + readEnvelope(); + setInterval(readEnvelope, 1200); + } + function appendEnvelope(facility, i, distanceFromBendingCenter, width, size1, size2, tang, direction) { + if (tang==-Infinity) tang = -1e12; + if (tang==Infinity) tang = 1e12; + const x1 = i; + const z1 = i+1; + const d = distanceFromBendingCenter; + const den = Math.sqrt(tang*tang+1) * direction; + const envelopeGeometry = ellipticaltubeGeometry(size1,size2, size1,size2, width); + envelopeMesh[envelopeIndex] = new THREE.Mesh(envelopeGeometry, envelopeMaterial); + envelopeMesh[envelopeIndex].mydirection = direction>0; + envelopeMesh[envelopeIndex].width = width; + envelopeMesh[envelopeIndex].position.set(lattice[facility].sections[i].start.x + tang*d / den, Ydefault, lattice[facility].sections[i].start.z + d / den); + envelopeMesh[envelopeIndex].rotateY(Math.atan(tang)); + facilities[facility].add(envelopeMesh[envelopeIndex]); + envelopeIndex++; + } + function envelopeAdd(flattice, i, j, facility, direction) { + if (document.location.search.indexOf('envelope')>-1 && flattice[j].bending && flattice[j].bending.lengthIndex && lattice[facility].envelope) { + let envelopePos = 0; + const stop = j==23? flattice[23].bending.lengthIndex + envelopeNum: flattice[j].bending.lengthIndex; + for (let e=flattice[(j+23)%24].bending.lengthIndex; e<stop; e++) { + let envelopeLen = lattice[facility].envelope.length[e % envelopeNum]; + appendEnvelope(facility, i, envelopePos, envelopeLen*direction, envelopeSize[envelopeCounter+1], envelopeSize[envelopeCounter], tang, direction); + envelopeCounter++; + envelopePos += envelopeLen * (e==flattice[j].bending.lengthIndex? 0.5: 1); + } + } + } + // status + const normalMaterial = new THREE.MeshBasicMaterial({ color: 0xffff66}); + const sphereGeometry = new THREE.SphereGeometry(300, 10, 10); + + function appendComponent(facility, i, m, tang, direction, y=Ydefault) { + if (tang==-Infinity) tang = -1e12; + if (tang==Infinity) tang = 1e12; + let magnet = lattice[facility].sections[i].components[m].type; + if (componentCreator[magnet+'fast'] && (fast==false || fast.indexOf(magnet)>-1)) magnet = magnet+'fast'; + if (componentCreator[magnet+'premium'] && (premium==false || premium.indexOf(magnet)>-1)) magnet = magnet+'premium'; + if (componentCreator[magnet]) { + const myname = lattice[facility].sections[i].components[m].name; + const mycomp = componentCreator[magnet](lattice[facility].sections[i].components[m]); + mycomp.name = lattice[facility].sections[i].components[m].name; + const id = extractId(myname); + const d = lattice[facility].sections[i].components[m].position; + const den = Math.sqrt(tang*tang+1) * direction; + const offset = lattice[facility].sections[i].components[m].offset3d? lattice[facility].sections[i].components[m].offset3d: [0, 0, 0]; + mycomp.position.set(params.highlightScale*(lattice[facility].sections[i].start.x + tang*d / den) + offset[0], y + offset[1], params.highlightScale*(lattice[facility].sections[i].start.z + d / den + offset[2])); + if (mycomp.rotatedX) {mycomp.rotateZ(Math.atan(-tang));} else mycomp.rotateY(Math.atan(tang)); + window.names.push(lattice[facility].sections[i].components[m].name); + if (lattice[facility].sections[i].components[m].devices) { + // console.log('mycomp.devices',lattice[facility].sections[i].components[m].devices); + for (let j=0; j<lattice[facility].sections[i].components[m].devices.length; j++) {names.push(lattice[facility].sections[i].components[m].devices[j]); alias.push([myname,lattice[facility].sections[i].components[m].devices[j]]);} + } + if (id[1]) {window.names.push(id[1]); alias.push(id);} + mycomp.magnetType = magnet; + if (lattice[facility].sections[i].components[m].href) mycomp.href = lattice[facility].sections[i].components[m].href; + if (highlight.length && !highlight.find(element => element == magnet)) {mycomp.scale.set(params.highlightShrink, params.highlightShrink, params.highlightShrink);} + facilities[facility].add(mycomp); + if (magnet=='blm') {blmres.append(blm, facility, mycomp, direction);} + if (magnet=='vlv') {vlvs.push({'comp': mycomp, 'name': mycomp.name, 'type': magnet});} + if (magnet=='bst') {vlvs.push({'comp': mycomp, 'name': mycomp.name, 'type': magnet});} + + if (mycomp.ps) { + for (let pi=0; pi<mycomp.ps.length; pi++) { + const sphere = new THREE.Mesh(sphereGeometry,normalMaterial.clone()); + sphere.position.set(params.highlightScale*(lattice[facility].sections[i].start.x + tang*d / den) - 50 + 50*pi, y+350, params.highlightScale*(lattice[facility].sections[i].start.z + d / den)); + sphere.name = mycomp.ps[pi].replace('PS','') + '_status'; + sphere.facility = facility; + sphere.visible = false; + status.push(sphere); + facilities[facility].add(sphere); + } + } + else { + const sphere = new THREE.Mesh(sphereGeometry,normalMaterial.clone()); + sphere.position.set(params.highlightScale*(lattice[facility].sections[i].start.x + tang*d / den), y+350, params.highlightScale*(lattice[facility].sections[i].start.z + d / den)); + sphere.name = mycomp.name+'_status'; + sphere.visible = false; + status.push(sphere); + facilities[facility].add(sphere); + } + return mycomp.position; + } + } + function extractId(name) { + if (name.indexOf('(')>-1) { + let tok = name.split('('); + return [tok[0].replaceAll('.','_').replaceAll(' ','_'), tok[1].replaceAll('.','_').replaceAll(' ','_').replaceAll(')','')]; + } + return [name.replaceAll('.','_').replaceAll(' ','_'), false]; + } + + function initLattice(flattice, facility) { + console.log('initLattice()', flattice, facility); + if (lattice[facility] && lattice[facility].bpm) {bpmPoints[facility] = []; bpmSkip[facility] = []; bpmData[facility] = [];} + facilities[facility] = new THREE.Object3D(); + for (let i=0; i<flattice.length; i++) { + if (document.location.search.indexOf('maxlatticenodes=')>-1 && document.location.search.split('maxlatticenodes=')[1].split('&')[0]<latticenodes) break; else latticenodes++; + let j = (i+1) % flattice.length; + let k = (i+2) % flattice.length; + const y = typeof flattice[j].start.y == 'undefined'? Ydefault: flattice[j].start.y + Ydefault; + tang = (flattice[j].start.x-flattice[i].start.x)/(flattice[j].start.z-flattice[i].start.z); + const segmentLen = params.highlightScale*Math.sqrt((flattice[j].start.x-flattice[i].start.x)*(flattice[j].start.x-flattice[i].start.x) + (flattice[j].start.z-flattice[i].start.z)*(flattice[j].start.z-flattice[i].start.z)); + if (flattice[j].chamber && (flattice[j].chamber.type=='chamber' || flattice[j].chamber.type=='wall')) { + const chamberMesh = flattice[j].chamber.type=='chamber'? chamber(segmentLen+15): wall(segmentLen+15); + const yy = typeof flattice[i].start.y=='undefined' || typeof flattice[j].start.y=='undefined'? Ydefault: params.highlightScale*(flattice[j].start.y+flattice[i].start.y)/2; + chamberMesh.position.set(params.highlightScale*(flattice[j].start.x+flattice[i].start.x)/2, yy, params.highlightScale*(flattice[j].start.z+flattice[i].start.z)/2); + if (chamberMesh.rotatedX) {chamberMesh.rotateZ(Math.atan(-tang));} else chamberMesh.rotateY(Math.atan(tang)); + chamberMesh.scale.set(params.highlightScale, 1, params.highlightScale); + chamberMesh.magnetType = flattice[j].chamber.type; + facilities[facility].add(chamberMesh); + } + let bendingType = flattice[j].bending? flattice[j].bending.type: ''; + if (componentCreator[bendingType+'fast'] && (fast==false || fast.indexOf(bendingType)>-1)) bendingType = bendingType+'fast'; + if (componentCreator[bendingType+'premium'] && (premium==false || premium.indexOf(bendingType)>-1)) bendingType = bendingType+'premium'; + if (document.location.search.indexOf('components=hide')==-1 && flattice[j].bending && bendingType && typeof componentCreator[bendingType]!== 'undefined') { + component[dipoleNum] = flattice[j].bending.length? componentCreator[bendingType](flattice[j].bending.length): componentCreator[bendingType](); + component[dipoleNum].position.set(params.highlightScale*flattice[j].start.x, y-params.highlightScale*100, params.highlightScale*flattice[j].start.z); + component[dipoleNum].name = flattice[j].bending.name; + const a1 = Math.atan2((flattice[j].start.z-flattice[i].start.z), (flattice[j].start.x-flattice[i].start.x)); + const a2 = Math.atan2((flattice[k].start.z-flattice[j].start.z),(flattice[k].start.x-flattice[j].start.x)); + alpha = (a1 + a2)/2; + if (a1>0 && a2<0) alpha += Math.PI; + component[dipoleNum].rotateY(3*Math.PI/2-alpha); + if (highlight.length && !highlight.find(element => (element == 'bending' || element == bendingType))) {component[dipoleNum].scale.set(params.highlightShrink, params.highlightShrink, params.highlightShrink);} + component[dipoleNum].magnetType = bendingType; + facilities[facility].add(component[dipoleNum]); + if (1 || flattice[j].bending.label && flattice[j].bending.label=='show') { + const div = document.createElement('div'); + facilities[facility].add(component[dipoleNum]); + div.id = 'B' + dipoleNum; // 'B'+i; // flattice[j].bending.name; // + div.classList = [facility]; + div.style.cssText = 'position: absolute; color: white;'; + div.innerHTML = flattice[j].bending.name; + document.body.appendChild(div); + dipoleNum++; + } + window.names.push(flattice[j].bending.name); + } + const direction = (flattice[j].start.z<flattice[i].start.z /*!= flattice[j].start.x<=flattice[i].start.x*/)? -1: 1; + if (document.location.search.indexOf('components=hide')==-1) if (flattice[i].components) for (let m=0; m<flattice[i].components.length; m++) { + const position = appendComponent(facility, i, m, tang, direction, y); + if (flattice[i].components[m].type=='bpm' && (document.location.search.indexOf('&bpm')>-1 || document.location.search.indexOf('?bpm')>-1) && lattice[facility].bpm) { + if (lattice[facility].bpm.skip && (lattice[facility].bpm.skip.indexOf(flattice[i].components[m].name)>-1)) {bpmSkip[facility].push(bpmPoints[facility].length);} + else bpmPoints[facility].push([position.clone(), tang, direction]); + } + } + envelopeAdd(flattice, i, j, facility, direction); + } + + // console.log('vlvs', vlvs); console.log('facilities', facilities, 'names', window.names.join(';')); + bpmAdd(facility); + facilities[facility].name = facility; + scene.add(facilities[facility]); + // console.log('mytoggleFacility()', facility, params[facility], 'names', names); + if (!params[facility]) mytoggleFacility(false, facility); + } + function updateVlv() { + fetch(conf.vlvUrl, {cache: "no-store"}).then((response) => {return response.text();}).then((data) => { + const vlvVal = data.split(';'); + vlvVal[0] = vlvVal[0].split(':')[1]; + // console.log(conf.vlvUrl, vlvVal, vlvs); + for (let i=0; i<vlvs.length; i++) { + if (vlvs[i].type=='vlv') componentCreator.vlvUpdate(vlvs[i].comp, vlvVal[vlvs[i].vlvindex]=='CLOSED'? 'yellow': (vlvVal[vlvs[i].vlvindex]=='OPENED'? 'limegreen': 'grey')); + if (vlvs[i].type=='bst') { + if (typeof vlvVal[vlvs[i].vlvindex] != 'string') continue; + const val = vlvVal[vlvs[i].vlvindex].split(','); + componentCreator.bstUpdate(vlvs[i].comp, val[0]=='true'? 'limegreen': (val[1]=='true'? 'yellow': 'grey')); + } + } + }); + } + let cameraStep=0; + let cameraUpdate = null; + let focusPos = new THREE.Vector3(); + const numSteps = 15; + function stepCamera(x, y, z, rx, ry, rz) { + if (debugcamera) {$('#x').val(x); $('#y').val(y); $('#z').val(z); $('#cx').val(rx); $('#cy').val(ry); $('#cz').val(rz);} + camera.position.set(x, y, z); + camera.lookAt(rx, ry, rz); + // controls.target.set(x, y, z); + // scene.rotation.set(rx, ry, rz); + // camera.updateProjectionMatrix(); + renderer.render(scene, camera); + // composer.render(); + } + function updateCameraMatrix() { + camera.updateProjectionMatrix(); + scene.updateMatrixWorld(); + console.log('updateCameraMatrix()', camera); + } + function updateCamera() { + cameraStep = cameraStep>3? cameraStep-1: (cameraStep>1? cameraStep-0.5: cameraStep-0.25); + stepCamera(x2-(x2-x1)*cameraStep/numSteps, y2-(y2-y1)*cameraStep/numSteps, z2-(z2-z1)*cameraStep/numSteps, rx2-(rx2-rx1)*cameraStep/numSteps, ry2-(ry2-ry1)*cameraStep/numSteps, rz2-(rz2-rz1)*cameraStep/numSteps); + // console.log('updateCamera()', cameraStep, numSteps, camera.rotation, camera); + if (cameraStep<=0) {clearInterval(cameraUpdate); cameraUpdate = null; setTimeout(updateCameraMatrix, 2000);} + } + export function findComponent(name, outline=true) { + if (cameraStep>0) return; + if (name==null) name = document.getElementById('sname').value; + for (let i=0; i<alias.length; i++) if (alias[i][1]==name) name = alias[i][0]; + document.getElementById('sname').value = name; + outlinePass.selectedObjects = []; + for (let facility in scene.children) { + for (let comp in scene.children[facility].children) { + if (scene.children[facility].children[comp].name==name) { + const dist = scene.children[facility].name=='servicearea'? 7000: 1000; + facilities[scene.children[facility].name].visible = true; // make facility visible + // transverse lil menu and check facility checkbox + const menu = $('.allow-touch-styles').children(); + for (let i=0; i<menu.length; i++) { + if (menu[i].innerHTML=='toggle facility') { + // $('.allow-touch-styles').children().eq(3).children().eq(4).children().eq(1).children().attr('checked', true) + const fac = menu.eq(i+1).children(); + for (let j=0; j<fac.length; j++) { + if (fac.eq(j).children()[0].innerHTML==scene.children[facility].name) { + fac.eq(j).children().eq(1).children().attr('checked', true); + break; + } + } + break; + } + } + found = true; + const selectedObject = scene.children[facility].children[comp]; + if (outline) {outlinePass.selectedObjects = [selectedObject]; addSelectedObject(selectedObject);} + renderer.render(scene, camera); + x1 = camera.position.x; + y1 = camera.position.y; + z1 = camera.position.z; + x2 = scene.children[facility].children[comp].position.x+dist*Math.sign(scene.children[facility].children[comp].position.x); + y2 = scene.children[facility].children[comp].position.y+dist*Math.sign(scene.children[facility].children[comp].position.y); + z2 = scene.children[facility].children[comp].position.z+dist*Math.sign(scene.children[facility].children[comp].position.z); + console.log("findComponent()", name, selectedObject, x1, x2, scene.children[facility].children[comp].position, scene.children[facility]); + const lookat = (new THREE.Vector3(0, 0, -20000)).applyQuaternion(camera.quaternion).add(camera.position); // https://stackoverflow.com/questions/27957645/three-js-find-the-current-lookat-of-a-camera + rx1 = lookat.x; + ry1 = lookat.y; + rz1 = lookat.z; + rx2 = scene.children[facility].children[comp].position.x; + ry2 = scene.children[facility].children[comp].position.y; + rz2 = scene.children[facility].children[comp].position.z; + if (debugcamera) {$('#x').val(x1); $('#y').val(y1); $('#z').val(z1); $('#cx').val(rx1); $('#cy').val(ry1); $('#cz').val(rz1);} + cameraStep = numSteps; + updateCamera(); + if (cameraUpdate == null) cameraUpdate = setInterval(updateCamera, 100); + } + } + } + } + window.findComponent = findComponent; + $(function() {$(".sname").autocomplete({source: names, close: function(event, ui) {findComponent($('#sname').val()); }, select: function(event, ui) {findComponent(ui.item.value); return false;}});}); + + function addSelectedObject(object) { + // console.log("addSelectedObject()", object, outlinePass.selectedObjects); + selectedObjects = []; + selectedObjects.push(object); + } + + function checkOutline(selectedObject) { + raycaster.setFromCamera(pointer, camera); + addSelectedObject(selectedObject); + outlinePass.selectedObjects = selectedObjects; + } + + if (navigator.userAgent.indexOf('Firefox/63')==-1) document.onclick = handleMouseMove; + function handleMouseMove(event) { + let j=1; + const debug = document.location.search.indexOf('debug=')>-1? document.location.search.split('debug=')[1].split('&')[0].split(','): ''; + if (debug.indexOf(''+j++)>-1) console.log('handleMouseMove(), event',event); + pointer.x = (event.clientX / window.innerWidth) * 2 - 1; + pointer.y = - ((28+event.clientY) / (window.innerHeight)) * 2 + 1; + if (debug.indexOf(''+j++)>-1) console.log('handleMouseMove(), pointer',pointer); + raycaster.setFromCamera(pointer, camera); + const intersects = raycaster.intersectObjects(scene.children); + if (debug.indexOf(''+j++)>-1) console.log('handleMouseMove(), intersects',intersects); + window.tooltipObject = tooltipObject = null; + document.getElementById('tooltipFrame').src = document.getElementById('compdb').href = ''; + document.getElementById('compdb').style.display = 'inline'; + document.getElementById('tooltip').style.display = 'none'; + document.getElementById('tooltipFrame').width = '500px'; + if (debug.indexOf(''+j++)>-1) console.log('handleMouseMove(), tooltipObject',tooltipObject); + if (!found) outlinePass.selectedObjects = selectedObjects = []; + found = false; + if (typeof intersects[0] == 'undefined') return; + let selectedObject = intersects[0].object.parent; + for (let i=intersects.length-1; i>=0; i--) { + if (debug.indexOf(''+j++)>-1) console.log('handleMouseMove(), i',i); + let visible = true; + let tobj = intersects[i].object; + // https://discourse.threejs.org/t/how-to-check-if-mesh-ancestor-is-visible-in-canvas/42494/5 + while (tobj !== scene) { + if (tobj.visible == false) visible = false; + tobj = tobj.parent; + } + if (debug.indexOf(''+j++)>-1) console.log('handleMouseMove(), tobj',tobj); + if (visible == false) continue; + // console.log("handleMouseMove()", event, intersects[i].object); + if (intersects[i].object.parent.name.length==0 && intersects[i].object.parent.parent.name.length==0) continue; + if (debug.indexOf(''+j++)>-1) console.log('handleMouseMove(), intersects[i].object',intersects[i].object); + if (intersects[i].object.parent.href) { + window.tooltipObject = tooltipObject = intersects[i].object.parent; + document.getElementById('tooltipFrame').src = demo? './magnetdemo.html?'+intersects[i].object.parent.href.split('?')[1]: intersects[i].object.parent.href; + document.getElementById('compdb').style.display = 'none'; + } + else if (intersects[i].object.href) { + window.tooltipObject = tooltipObject = intersects[i].object; + document.getElementById('tooltipFrame').src = demo? './magnetdemo.html?'+intersects[i].object.href.split('?')[1]: intersects[i].object.href; + document.getElementById('compdb').href = conf.compdb + intersects[i].object.name; + document.getElementById('compname').innerHTML = intersects[i].object.name; + } + else if (intersects[i].object.magnetType) { + window.tooltipObject = tooltipObject = intersects[i].object; + document.getElementById('tooltipFrame').src = conf.tooltipApp+'?s='+(demo? 'knobdemo': intersects[i].object.magnetType.replace('fast', '').replace('premium', ''))+'¶m='+intersects[i].object.name; + document.getElementById('compdb').href = conf.compdb+intersects[i].object.name; + document.getElementById('compname').innerHTML = intersects[i].object.name; + } + else if (intersects[i].object.parent.magnetType) { + window.tooltipObject = tooltipObject = intersects[i].object.parent; + document.getElementById('tooltipFrame').src = conf.tooltipApp+'?s='+(demo? 'knobdemo': intersects[i].object.parent.magnetType.replace('fast', '').replace('premium', ''))+'¶m='+intersects[i].object.parent.name; + document.getElementById('compdb').href = conf.compdb+intersects[i].object.parent.name; + document.getElementById('compname').innerHTML = intersects[i].object.parent.name; + } + else if (intersects[i].object.parent.parent.magnetType) { + document.getElementById('tooltipFrame').height = '320px'; + window.tooltipObject = tooltipObject = intersects[i].object.parent.parent; + selectedObject = intersects[i].object.parent.parent; + document.getElementById('tooltipFrame').src = conf.tooltipAppNormal+'?s='+(demo? 'knobdemo': intersects[i].object.parent.parent.magnetType.replace('fast', '').replace('premium', ''))+'¶m='+intersects[i].object.parent.parent.name; + document.getElementById('compdb').href = conf.compdb+intersects[i].object.parent.parent.name; + document.getElementById('compname').innerHTML = intersects[i].object.parent.parent.name; + } + else { + window.tooltipObject = tooltipObject = intersects[i].object.parent; + document.getElementById('tooltipFrame').src = conf.tooltipApp+'?s=label¶m='+intersects[i].object.parent.name; + document.getElementById('compdb').href = conf.compdb+intersects[i].object.parent.name; + document.getElementById('compname').innerHTML = intersects[i].object.parent.name; + } + if (debug.indexOf(''+j++)>-1) console.log('handleMouseMove(), src',document.getElementById('tooltipFrame').src, ', href',document.getElementById('compdb').href); + const name = document.getElementById('compname').innerHTML; + document.getElementById('compdb').removeAttribute("disabled"); + if (name.indexOf('_B')>-1 || name.indexOf('_P')>-1 || (name.indexOf('_S')>-1 && name.indexOf('_SFEL')==-1 && name.indexOf('_SP')==-1 && name.indexOf('_SC')==-1)) document.getElementById('compdb').setAttribute("disabled", true); + document.getElementById('compname').innerHTML = document.getElementById('compname').innerHTML.replace('RTBPM','BPM'); + document.getElementById('compdb').href = document.getElementById('compdb').href.replace('RTBPM','BPM').split(' ')[0].split('%')[0]; + if (document.getElementById('tooltipFrame').src.indexOf('?s=beamline')>-1) { + document.getElementById('compdb').href = 'http://adam.elettra.trieste.it/projects/blcs/beamwatch/'; + document.getElementById('compname').innerHTML = document.getElementById('compname').innerHTML + ' in ADAM Beamwatch'; + } + } + // console.log('handleMouseMove()', intersects, document.getElementById('tooltipFrame').src); + if (selectedObject.parent && selectedObject.parent.type && selectedObject.parent.type == "Scene") return; // avoid selecting everything + checkOutline(selectedObject); + renderer.render(scene, camera); + if (debug.indexOf(''+j++)>-1) console.log('handleMouseMove(), compdb',document.getElementById("compdb")); + document.getElementById("compdb").addEventListener("click", compLink); // https://j11y.io/javascript/debug-jquery-events-with-listhandlers/ + } + + animate(); + function moveCamera() { + const cameraPos = (document.location.search.indexOf('camera=')>-1)? document.location.search.split('camera=')[1].split('&')[0].split(','): [-22000, 7200, 70000, -0.1, -0.3, -0.03]; + if (debugcamera) {$('#x').val(camera.position.x); $('#y').val(camera.position.y); $('#z').val(camera.position.z); $('#cx').val(camera.rotation.x); $('#cy').val(camera.rotation.y); $('#cz').val(camera.rotation.z);} + if (cameraStarted) {if (debugcamera) setUrl('camera', camera.position.x+','+camera.position.y+','+camera.position.z+','+camera.rotation.x+','+camera.rotation.y+','+camera.rotation.z); return;} + console.log('moveCamera()', camera.rotation); + cameraStarted = true; + camera.position.set(cameraPos[0]*params.highlightScale, cameraPos[1]*params.highlightScale, cameraPos[2]*params.highlightScale); + camera.rotation.set(cameraPos[3],cameraPos[4],cameraPos[5]); + } + + function init() { + scene = new THREE.Scene(); + scene.background = new THREE.Color(document.location.search.indexOf('background=')>-1? document.location.search.split('background=')[1].split('&')[0]: 0x777777); + + const canvas = document.querySelector('#c'); + renderer = new THREE.WebGLRenderer({antialias: false, canvas, logarithmicDepthBuffer: true}); + + renderer.setPixelRatio(window.devicePixelRatio); + renderer.setSize(window.innerWidth, window.innerHeight); + document.body.appendChild(renderer.domElement); + const fov = document.location.search.indexOf('fov=')>-1? document.location.search.split('fov=')[1].split('&')[0]-0: 45; + camera = new THREE.PerspectiveCamera(fov, window.innerWidth / window.innerHeight, 0.001, 1000000); + // controls + if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) controls = new MapControls(camera, renderer.domElement); + else { + controls = new OrbitControls(camera, renderer.domElement); + controls.mouseButtons.LEFT = THREE.MOUSE.PAN; + controls.mouseButtons.RIGHT = THREE.MOUSE.ROTATE; + controls.keyPanSpeed = 1000; + } + console.log('controls', controls); + // https://threejs.org/docs/#examples/en/controls/OrbitControls + // https://stackoverflow.com/questions/61519164/three-js-orbitcontrols-panning-and-scene-rotation?rq=3 + // https://github.com/pmndrs/drei/issues/186 + // controls.enableDamping = true; + controls.enableDamping = false; // an animation loop is required when either damping or auto-rotation are enabled + controls.dampingFactor = 0.1; + controls.screenSpacePanning = false; + controls.minDistance = 0.01; + controls.maxDistance = 300000; + controls.maxPolarAngle = Math.PI / 2; + // controls.update(); + + window.addEventListener('resize', onWindowResize); + camera.updateMatrixWorld(true); + + const dirLight1 = new THREE.DirectionalLight(0xffffff, 3); + dirLight1.position.set(1, 1, 1); + scene.add(dirLight1); + const dirLight2 = new THREE.DirectionalLight(0x888888, 3); + dirLight2.position.set(-1, -1, -1); + scene.add(dirLight2); + const ambientLight = new THREE.AmbientLight(0xffffff, 2); + scene.add(ambientLight); + + // postprocessing (derived from https://github.com/mrdoob/three.js/blob/master/examples/webgl_postprocessing_outline.html) + composer = new EffectComposer(renderer); + const renderPass = new RenderPass(scene, camera); + composer.addPass(renderPass); + outlinePass = new OutlinePass(new THREE.Vector2(window.innerWidth, window.innerHeight), scene, camera); + outlinePass.edgeStrength = 100; + outlinePass.edgeGlow = 0.2; + outlinePass.edgeThickness = 6; + outlinePass.pulsePeriod = 2; + outlinePass.visibleEdgeColor.set('#700080'); + outlinePass.hiddenEdgeColor.set('#400050'); + composer.addPass(outlinePass); + console.log('scene', scene, 'controls', controls, 'camera', camera); + } + function onWindowResize() { + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); + renderer.setSize(window.innerWidth, window.innerHeight); + } + function animate() { + requestAnimationFrame(animate); + if (document.location.search.indexOf('stat')>-1) stats.begin(); + moveCamera(); + // controls.update(); // only required if controls.enableDamping = true, or if controls.autoRotate = true + render(); + composer.render(); + if (document.location.search.indexOf('stat')>-1) stats.end(); + } + function render() { + const width = window.innerWidth, height = window.innerHeight; + const widthHalf = width / 2, heightHalf = height / 2; + if (dipoleNum>0) renderer.render(scene, camera); + for (let dipoleIndex=0; dipoleIndex<dipoleNum; dipoleIndex++) if (typeof component[dipoleIndex] != 'undefined' && document.getElementById('B'+(dipoleIndex))) { + const pos = component[dipoleIndex].position.clone(); + pos.project(camera); + const frustum = new THREE.Frustum(); + const matrix = new THREE.Matrix4().multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse); + frustum.setFromProjectionMatrix(matrix); + const dist = Math.abs(camera.position.x-component[dipoleIndex].position.x)+Math.abs(camera.position.y-component[dipoleIndex].position.y)+Math.abs(camera.position.z-component[dipoleIndex].position.z); + const facility = document.getElementById('B'+(dipoleIndex)).className; + document.getElementById('B'+(dipoleIndex)).style.display = (frustum.containsPoint(component[dipoleIndex].position) && facilities[facility].visible && dist>140 && dist<40000*params.highlightScale)? 'block': 'none'; + document.getElementById('B'+(dipoleIndex)).style.top = (-(pos.y * heightHalf) + heightHalf - 20)+'px'; + document.getElementById('B'+(dipoleIndex)).style.left = ((pos.x * widthHalf ) + widthHalf + 15)+'px'; + } + blmres.render(blm, params, componentCreator, camera, THREE); + if (typeof tooltipObject !== 'undefined' && tooltipObject != null) { + let pos2 = window.tooltipObject.position.clone(); + pos2.project(camera); + const frustum = new THREE.Frustum(); + const matrix = new THREE.Matrix4().multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse); + frustum.setFromProjectionMatrix(matrix); + document.getElementById('tooltip').style.display = (frustum.containsPoint(tooltipObject.position))? 'block': 'none'; + let top = (-(pos2.y * heightHalf) + heightHalf ); + if (window.innerHeight - top < 400) top = window.innerHeight - 400; + document.getElementById('tooltip').style.top = top+'px'; + document.getElementById('tooltip').style.left = ((pos2.x * widthHalf ) + widthHalf + 25)+'px'; + } + } + function updateUrl(param, value) { + let url = document.location.href; + if (url.indexOf(param)==-1) url = url + (url.indexOf('?')==-1? '?': '&') + param + '=' + value; + else { + const a = url.split(param+'='); + const b = a[1].split('&'); + url = a[0] + param + '=' + value + (b.length>1? '&' + b[1]: ''); + } + window.history.pushState({"html":'panther.php',"pageTitle":'PAnTHer'},"", url); + } + function mytoggleFacility(value, facility=false) { + if (!facility) facility = this.property; + console.log('facilities', facilities, facility); + facilities[facility].visible = value; + } + export function toggleMachine(machine) { + if (document.location.search.indexOf('machine=')==-1) document.location = document.location.href + (document.location.href.indexOf('?')==-1? '?': '&') + 'machine='+machine; + let search = document.location.search.split('machine=')[1].split('&')[0]; + document.location = document.location.href.replace('machine='+search, 'machine='+machine); + } + export function toggleParam(name, value) { + if (name=='backgroundColor') {scene.background = new THREE.Color(params.backgroundColor);return;} + const urlparam = {}; + let search = document.location.search.replace('?', '').split('&'); + if (search[0]=='') search.splice(0,1); + for (let i=0; i<search.length; i++) {const s = search[i].split('='); urlparam[s[0]] = s.length>1? s[1]: undefined;} + if (name.indexOf('highlight_')>-1) { + const hname = name.split('ighlight_')[1]; + if (!highlight.includes(hname)) highlight.push(hname); else highlight.splice(highlight.indexOf(hname), 1); + urlparam.highlight = highlight.join(','); + search=[]; + for (let i in urlparam) search.push(i+(typeof urlparam[i]!='undefined'? '='+urlparam[i]: '')); + } + else if (name.indexOf('highlight')>-1) { + if (name=='highlightShrink') { + updateUrl(name, params.highlightShrink); + for (let i=0; i<scene.children.length; i++) { + for (let j=0; j<scene.children[i].children.length; j++) { + if (!highlight.find(element => element == scene.children[i].children[j].magnetType)) + if (scene.children[i].children[j].magnetType != 'chamber') scene.children[i].children[j].scale.set(params.highlightShrink, params.highlightShrink, params.highlightShrink); + } + } + return; + } + urlparam[name] =value; + search=[]; + for (let i in urlparam) search.push(i+(typeof urlparam[i]!='undefined'? '='+urlparam[i]: '')); + } + else if (search.includes(name)) { + search.splice(search.indexOf(name), 1); + } + else { + search.push(name); + } + if (search.indexOf("highlight=")>-1) {for (let j=search.length-1; j>=0; j--) if (search[j].indexOf("highlight")>-1) search.splice(j, 1);} + if (name=='mode') { + if (search.indexOf(value)>-1 || (value=='plus' && search.indexOf('fast')==-1 && search.indexOf('premium')==-1)) return; + search = search.filter(item => item !== 'fast' && item !== 'premium' && item !== 'mode'); + if (value!='plus') search.push(value); + } + const res = search.join('&'); + document.location = document.location.href.split('?')[0]+(res.length? '?'+res: ''); + } + window.mytoggle = toggleParam; + if (demo) { + $('.lil-gui').css({'top': '120px', 'right': '1px'}); + $( "body" ).append('<div class="lil-gui allow-touch-styles root autoPlace" style="top: 0px;right: 1px;height: 120px;background-color: black;"></div>'); + } + const sstring = $('.controller.string').children().eq(1).children().eq(0); + sstring.attr('id', 'sname'); + sstring.attr('name', 'sname'); + sstring.addClass("form-control sname"); + if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) gui.close(); diff --git a/panther.php b/panther.php new file mode 100644 index 0000000..968f271 --- /dev/null +++ b/panther.php @@ -0,0 +1,85 @@ +<?php + $machine = empty($_REQUEST['machine'])? 'elettra': strtolower($_REQUEST['machine']); + $mode = isset($_REQUEST['fast'])? 'fast': (isset($_REQUEST['premium'])? 'premium': ''); + $mode = !empty($_REQUEST['fast'])? 'all': $mode; + file_put_contents('./logs'.date('Y').'.txt', date('Y-m-d H:i:s').' '.$_SERVER['REMOTE_ADDR'].'_'.$_SERVER['HTTP_X_FORWARDED_FOR'].' - '.$_SERVER['QUERY_STRING'].PHP_EOL , FILE_APPEND | LOCK_EX); +?> +<!DOCTYPE html> +<html lang="en"> + <head> + <title>PAnTHer</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> + + <!-- + Firefox seems to not like having scripts that come in before the importmap + https://discourse.threejs.org/t/solved-importmaps-broken-on-firefox-which-now-supports-importmaps/48413/5 + --> + <script type="importmap"> + { + "imports": { + "three": "./threejs/three.module.js", + "three/addons/": "./threejs/", + "components/": "./components/src/", + "bundle": "./components/bundle_<?php echo $machine.$mode;?>.js" + } + } + </script> + <script>; + const client = '<?php echo gethostbyaddr($_SERVER['REMOTE_ADDR']);?>'.split('.')[0]; + const fermi = ['do','re','mi','fa','sol','la','si'].indexOf(client)>-1? '?machine=fermi': ''; + if (navigator.userAgent.indexOf('Firefox/63')>-1) document.location = './ff63/'+fermi; + </script> + + <style> + body { + background-color: #333333; + color: #000; + margin: 0px; + } + a { + color: #f00; + } + #c { + width: 100%; + height: 100%; + display: block; + } + .blm { + display: none; + } + .blmVal { + background-color: white; + padding: 2px; + color: black; + border-radius: 5px; + } + </style> + + <link rel="stylesheet" href="../lib/jquery/jquery-ui.min.css"> + <script src="../lib/jquery/jquery.min.js" type="text/javascript"></script> + <script src="../lib/jquery/jquery-ui.min.js" type="text/javascript"></script> + </head> + + <body style="overflow: hidden;"> + <canvas id="c" style="margin-top: -15px;"></canvas> + <div id="demo" style="position: absolute; display: none; top: 0px; right: -8px; z-index: 10000;" <?php + if ($_REQUEST['machine']=='elettra2') echo 'title="click me for Lattice source" onClick="document.location=\'https://drive.elettra.eu/group/268/\';"'; ?>> + <svg width="150px" height="150px" viewBox="0 0 100 100" class="icon" version="1.1" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0 h70 l30 30 v70 z" stroke="black" stroke-width="2" fill="red"></path> + <text transform="rotate(45)" x="43" y="-30" font-weight="bold" fill="white">DEMO</text> + <text transform="rotate(45)" x="14" y="-6" font-size="70%" fill="white"> all numbers are random</text> + </svg></div> + <script type="module" src="./panther.js"></script> + <div id='tooltip' style='position:absolute; display:none; z-index: 100000000;'> + <div style='width: 490px; background-color: white; padding:5px; border-width: 3px; border-color: blue; border-top-left-radius: 5px; border-top-right-radius: 5px;'><button id='compdb'>find component <span id='compname'/> on components DB</button></div> + <iframe id='tooltipFrame' style="border:0; position:absolute; background:transparent; " width="240px" height="220px" src=''></iframe> + </div> + <div id='application' style='display:none; position:absolute; left:0; top:0; bottom:0; width:22%; max-width:600px; z-index: 10000;'> + <iframe id='applicationFrame' style="border:0; position:absolute; width: 100%; height: 200px;" src=''></iframe> + </div> + <div id='notice' style='display:<?php echo $_REQUEST['machine']=='elettra2'? 'block': 'none';?>; position:absolute; right:5px; bottom:5px; max-width:600px; z-index: 10000;'> + Data source <a href='https://drive.elettra.eu/group/268/'>https://drive.elettra.eu/group/268/</a> + </div> + </body> +</html> diff --git a/panther2d.js b/panther2d.js new file mode 100644 index 0000000..1f5f94a --- /dev/null +++ b/panther2d.js @@ -0,0 +1,654 @@ +// jshint esversion: 6 + let gui = new lil.GUI(); + let hideTimeout = false; + let svg; + let zoom = 1; + let oldZoom = 1; + let panZoomPanther; + let foundAnimate = 1; + let foundScale = 1.05; + let myPanZoomTimer = null; + let historytime = + new Date(); + let fel1 = false; + let fel2 = false; + const panZoomTime = 500; + const facilities = ['']; + const names = []; + const serviceareanames = []; + const alias = []; + let maxZoom = 230; + const status = []; + const point = {x: 0, y: 0}; + const pa = document.location.search.replace('?','').split('&'); + const parameters = {}; + const state = document.location.search.indexOf('ps')>-1; + const vlv = document.location.search.indexOf('vlv')>-1; + const vlvs = []; + for (let i=0; i<pa.length; i++) {const p = pa[i].split('='); parameters[p[0]] = p[1];} + const machineCaseSensitive = document.location.search.indexOf('machine=')>-1? document.location.search.split('machine=')[1].split('&')[0]: 'elettra'; + const machine = machineCaseSensitive.toLowerCase(); + //https://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-srf-01.fcs.elettra.trieste.it:20000/f/access_control/safety/Undulator_access_state -> 5 FEL1, 6 FEL2 + if (machine.indexOf('fermi')>-1) { + fetch(conf.rchan+'srv-tango-srf-01:20000/f/access_control/safety/Undulator_access_state').then((response) => {return response.json();}).then((fel) => { + fel1 = fel[5] == 1; + fel2 = fel[6] == 1; + }); + } + const latticeFile = document.location.href.split('?')[0].split('/').slice(0,-1).join('/')+'/'+machine+'_lattice.json'; + const params = {machine: machineCaseSensitive.toLowerCase(), search: '', backgroundColor: '#333333'}; + gui.title('PAnTHer - controls'); + // if (navigator.userAgent.indexOf('Firefox/63')>-1) {$( "body" ).append('<button id="starter" style="align: center;height: 500px; width: 95%;background-color: #449944; font-size: 100px;" onClick="mystart()">START</button>');} + function mystart() { + panZoomPanther = svgPanZoom('#panther', {beforeZoom: myZoom, fit: false, contain: false}); + $("#sname").on("keydown", searchText); + $('#starter').hide(); + } + // Polyfill for parentNode.replaceChildren() + if (typeof Element.prototype.replaceChildren !== 'function') { + Object.defineProperty(Element.prototype, 'replaceChildren', { + configurable: true, + writable: true, + value: function replaceChildren(...nodes) { + // Remove all existing child nodes + while (this.firstChild) { + this.removeChild(this.firstChild); + } + // Append new DOM objects + this.append(...nodes); + } + }); + } + function toggleMachine(machine) { + document.location = document.location.href.split('?')[0] + '?machine='+machine; + /*if (document.location.search.indexOf('machine=')==-1) document.location = document.location.href + (document.location.href.indexOf('?')==-1? '?': '&') + 'machine='+machine; + let search = document.location.search.split('machine=')[1].split('&')[0]; + document.location = document.location.href.replace('machine='+search, 'machine='+machine);*/ + } + function compLink(event) { + console.log('compLink()', event, document.getElementById("compdb").href); + window.open(document.getElementById("compdb").href, '_blank').focus(); + event.stopPropagation(); + return false; + } + function searchText(e) { + console.log('searchText()', e, e.keyCode || e.which, $("#sname").val().toUpperCase().replace('.','_')); + if (e.keyCode == 13) findComponent($("#sname").val().toUpperCase().replace('.','_')); + // return -1; + } + if (navigator.userAgent.indexOf('Firefox/63')==-1) {gui.add(params, 'machine', conf.machineList).onChange(function() {toggleMachine(params.machine);});} + gui.add(params, 'search'); + gui.addColor(params, 'backgroundColor').onChange(function() {toggleParam('backgroundColor');}); + params.vlv = document.location.search.indexOf('vlv')>-1; + gui.add(params, 'vlv').name('vlv & bst').onChange(function() {toggleParam('vlv');}); + params.ps = document.location.search.indexOf('ps')>-1; + gui.add(params, 'ps').onChange(function() {toggleParam('ps');}); + const sstring = $('.controller.string').children().eq(1).children().eq(0); + sstring.attr('id', 'sname'); + sstring.attr('name', 'sname'); + sstring.addClass("form-control sname"); + function findComponent(name) { + let servicearea = false; + console.log('lattice', lattice); + if (lattice.servicearea) for (let i in lattice.servicearea.sections) { + for (let j in lattice.servicearea.sections[i].components) { + if (name.replace('.', '_')==lattice.servicearea.sections[i].components[j].name.replace('.', '_')) {servicearea = true;} + for (let k in lattice.servicearea.sections[i].components[j].devices) { + if (name==lattice.servicearea.sections[i].components[j].devices[k]) {servicearea = true;} + } + } + } + console.trace(name, servicearea, document.location.search.indexOf('servicearea'), document.location.search.indexOf('search='+name)); // return; + if ((servicearea != document.location.search.indexOf('servicearea')>-1) && document.location.search.indexOf('search='+name)==-1) { + document.location = './panther2d.php?machine='+machine+'&search='+name+(servicearea? '&servicearea': ''); + } + if (name==null) name = document.getElementById('sname').value; + for (let i=0; i<alias.length; i++) if (alias[i][1]==name) name = alias[i][0]; + document.getElementById('sname').value = name; + if (typeof $('#'+name)[0] == 'undefined') return; + console.log(name, window.innerWidth/2, $('#'+name)[0].getCTM().e, $('#'+name)[0].getCTM().f); + // panZoomPanther.zoomAtPoint(10, {x: window.innerWidth/2 - $('#'+name)[0].getCTM().e, y: window.innerHeight/2 - $('#'+name)[0].getCTM().f}) + panZoomPanther.zoom(10); + // leave a delay between zoom and pan + setTimeout(mypan, 1200, name); + } + function mypan(name) { + $('.label').show(); + const x = window.innerWidth/2 - $('#'+name)[0].getCTM().e + panZoomPanther.getPan().x; + const y = window.innerHeight/2 - $('#'+name)[0].getCTM().f + panZoomPanther.getPan().y; + const m = $("svg")[0].getTransformToElement($('#'+name)[0]); + panZoomPanther.pan({x: x, y: y}); + setTimeout(pinhide, 100, name, $('#'+name).eq(0).attr('transform')); + } + function pinhide(name, transform) { + console.log(foundAnimate, foundScale); + foundAnimate *= foundScale; + if (foundAnimate>1.5) foundScale = 0.95; + if (foundAnimate<1) {foundScale = 1.05; foundAnimate = 1;} else setTimeout(pinhide, 100, name, transform); + $('#'+name).eq(0).attr('transform',transform+',scale('+foundAnimate+')'); + } + // $(function() {$(".sname").autocomplete({source: names, close: function(event, ui) {findComponent($('#sname').val()); }, select: function(event, ui) {findComponent(ui.item.value); return false;}});}); + $(function() {$(".sname").autocomplete({source: names, select: function(event, ui) {findComponent(ui.item.value); return false;}});}); + function toggleParam(name) { + if (name=='backgroundColor') {$('body').css('backgroundColor', params.backgroundColor); return;} + const urlparam = {}; + let search = document.location.search.replace('?', '').split('&'); + if (search[0]=='') search.splice(0,1); + const i=search.indexOf(name); + if (i==-1) search.push(name); else search.splice(i,1); + const res = search.join('&'); + document.location = document.location.href.split('?')[0]+(res.length? '?'+res: ''); + } + async function subscribe() { + let response = await fetch("./misc/talk.php?read"); + if (response.status == 502) { + await subscribe(); + } else if (response.status != 200) { + // An error - let's show it + mylog('subscribe() ERROR ', response.statusText); + // Reconnect in one second + await new Promise(resolve => setTimeout(resolve, 1000)); + await subscribe(); + } else { + // Get and show the message + let message = await response.text(); + mylog('subscribe()', message); + highlightobjects(message); + // Call subscribe() again to get the next message + await subscribe(); + } + } + // subscribe(); + + function mylog(...args) { + if (document.location.search.indexOf('debug')>-1) $('#debug').html($('#debug').html()+JSON.stringify(args).replaceAll(':',': ').replaceAll(',',', ')+'\n'); + else {console.trace.apply(null, args);} + } + function initIndex(lattice) { + const index = []; + for (let l in lattice.conf.index) { + if (l=='start') continue; + const cmd = "findComponent('"+lattice.conf.index[l].replace('.','_')+"')"; + index.push('<button onclick="'+cmd+'">'+l+'</button>'); + } + $('body').append('<div style="position: absolute; left: 5px; bottom: 5px;">'+index.join(' ')+'</div>'); + } + function init() { + fetch(latticeFile).then((response) => {return response.json();}).then((flattice) => { + lattice = flattice; + if (Object.keys(lattice).length>0) { + for (let i in lattice) {if (i!='conf') facilities.push(i);} + for (let i in lattice) { + if (i == 'conf') continue; + // logic XOR https://stackoverflow.com/questions/2335979/is-there-anyway-to-implement-xor-in-javascript + if ((document.location.search.indexOf('servicearea')==-1) != (i=='servicearea')) initLattice(lattice[i].sections, i); else initSearch(lattice[i].sections, i); + } + if (document.location.search.indexOf('servicearea')>-1) initSearch(lattice.servicearea.sections, 'servicearea'); + if (typeof blm != 'undefined') blmMenu(lattice, facilities, params); + if (typeof bpmData != 'undefined') bpmMenu(lattice, facilities, params); + params.gotoAdmin = function() {document.location = './admin.php';}; + gui.add(params, 'gotoAdmin').name('Admin'); + params.goto3D = function() {document.location = './panther.php?machine='+params.machine;}; gui.add(params, 'goto3D').name('3D'); + if (lattice.conf && lattice.conf.index) initIndex(lattice); + } + $('.scale').attr('transform', "scale(2)"); + // {$('<div><iframe style="width: 100%;height:250px;" src="../misc/gauge.html?dark&r1only=1&r=100&max=360&throttlingPeriod=50&apply=rotate&val='+0+'"></iframe></div>').insertBefore('.function');} + // panZoomPanther = svgPanZoom('#panther', {beforeZoom: myZoom, fit: false, contain: false}); // https://github.com/bastienmoulia/svg-pan-zoom-rotate + // if( /Android|webOS|iPhone|iPad|Mac|Macintosh|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { + if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { + panZoomPanther = svgPanZoom('#panther', { + zoomEnabled: true, + controlIconsEnabled: false, + fit: 0, + center: 1, + maxZoom: maxZoom*2, + customEventsHandler: eventsHandler, + //beforeZoom: myZoom, + }); + } + else { + panZoomPanther = svgPanZoom('#panther', { + zoomEnabled: true, + zoomScaleSensitivity: 0.3, + controlIconsEnabled: false, + fit: false, + center: false, + minZoom: 0.2, + maxZoom: maxZoom, + beforePan: myPan, + beforeZoom: myZoom, + }); + } + if (document.location.search.indexOf('debug')>-1) { + $('#tooltip').show(); + $('#tooltip').css('width', '100%'); + $('#tooltip').html('<textarea id="debug" style="height: 100px; width:100%;"></textarea>'); + } + let pan = [window.innerWidth/2, window.innerHeight/2]; + if (document.location.search.indexOf('pan=')>-1) pan = document.location.search.split('pan=')[1].split('&')[0].split(','); + if (document.location.search.indexOf('search=')>-1) findComponent(document.location.search.split('search=')[1].split('&')[0]); + else { + const zoom = document.location.search.indexOf('zoom=')>-1? document.location.search.split('zoom=')[1].split('&')[0]-0: 0.5; + panZoomPanther.zoom(zoom); + setTimeout(panZoomPanther.pan, 600, {x: pan[0], y: pan[1]}); + } + if (state) { + fetch(conf.stateSrcUrl, {cache: "no-store"}).then((response) => {return response.text();}).then((data) => { + const statSrc = data.toUpperCase().split('.').join('_').split(','); + for (let j=0; j<statSrc.length; j++) { + // if (statSrc[j].split('/')[2]=='POWER_SUPPLY' || statSrc[j].split('/')[2]=='INJECTION' || statSrc[j].split('/')[2]=='EXTRACTION') + statSrc[j] = statSrc[j].split('/')[3].replace('PS', ''); + } + for (let i=0; i<status.length; i++) { + if (status[i].name.indexOf('KICK')>-1) console.log('KICK state', i, status[i].name, statSrc); + for (let j=0; j<statSrc.length; j++) { + if (status[i].name.indexOf(statSrc[j])>-1) {status[i].statsrc = state; status[i].statindex = j;} + } + } + // console.log('statSrc', data, statSrc, status); + }); + setInterval(updateStatus, 1000); + } + if (vlv) { + for (let i in conf.bstmap) { if (i.indexOf('.')>-1) conf.bstmap[i.replace('.','_')] = conf.bstmap[i];} + fetch(conf.vlvSrcUrl, {cache: "no-store"}).then((response) => {return response.text();}).then((data) => { + const vlvSrc = data.toUpperCase().substring(14).split(','); + for (let i=0; i<vlvs.length; i++) { + for (let j=0; j<vlvSrc.length; j++) { + const name = vlvSrc[j].split('/')[3].replace('.','_'); + if (vlvs[i].name.replace('.','_').indexOf(name)>-1) {vlvs[i].vlvsrc = state; vlvs[i].vlvindex = j; vlvs[i].type = 'vlv';} + if (vlvSrc[j].split('/')[2].indexOf(conf.bstmap.base)>-1) { + if (conf.bstmap[vlvs[i].name] && conf.bstmap[vlvs[i].name].indexOf(vlvSrc[j].split('/')[4])>-1) { + vlvs[i].vlvsrc = 'bst'; vlvs[i].vlvindex = j; vlvs[i].type = 'bst'; + } + } + } + } + //console.log('vlvSrc', data, vlvSrc, vlvs); + }); + setInterval(updateVlv, 1000); + } + $("#sname").on("keydown", searchText); + }); + } + function showStatus(i, stat) { + if (stat == 0 || stat == 'null' || stat == '' || stat == 'ON' || stat == 'RUNNING' || (!fel1 && $('#'+status[i].name)[0].classList[0]=='fel1') || (!fel2 && $('#'+status[i].name)[0].classList[0]=='fel2')) {$('#'+status[i].name).hide();} + else {$('#'+status[i].name).show(); document.getElementById(status[i].name).style.fill = conf.stateLabelColor[stat];} + // console.log(i, status[i], stat); + } + function clearStatus() { + $('.ps').hide(); + } + function updateStatus() { + fetch(conf.stateUrl, {cache: "no-store"}).then((response) => {return response.text();}).then((data) => { + const statVal = data.split(';'); + // console.log(conf.stateUrl, statVal, status); + for (let i=0; i<status.length; i++) { + if (status[i].statsrc==state) { + if (status[i].statindex) showStatus(i, statVal[status[i].statindex]); + // console.log(statVal, status, status[i].name, i, status[i].statindex, statVal[status[i].statindex]); + } + } + setTimeout(clearStatus, 600); + }); + } + function updateVlv() { + fetch(conf.vlvUrl, {cache: "no-store"}).then((response) => {return response.text();}).then((data) => { + const vlvVal = data.split(':')[1].split(';'); + // console.log('updateVlv()', conf.vlvUrl, vlvVal, vlvs); + for (let i=0; i<vlvs.length; i++) { + if (vlvs[i].type=='vlv') $('#'+vlvs[i].name).css('fill', vlvVal[vlvs[i].vlvindex]=='CLOSED'? 'yellow': (vlvVal[vlvs[i].vlvindex]=='OPENED'? 'limegreen': 'grey')); + if (vlvs[i].type=='bst') { + if (typeof vlvVal[vlvs[i].vlvindex] != 'string') continue; + const val = vlvVal[vlvs[i].vlvindex].split(','); + // console.log('updateVlv(): ', i, vlvs[i], vlvs[i].type, vlvs[i].vlvindex, vlvVal[vlvs[i].vlvindex], '#'+vlvs[i].name, vlvs[i].comp, val[0]=='true'? 'limegreen': (val[1]=='true'? 'yellow': 'grey')); + $('#'+vlvs[i].name).css('fill', val[0]=='true'? 'limegreen': (val[1]=='true'? 'yellow': 'grey')); + } + } + }); + } + function rescale(x) {return x;} + String.prototype.replaceAt = function(index, replacement) { + return this.substring(0, index) + replacement + this.substring(index + replacement.length); + }; + function evalId(base) { + if (base.indexOf('.')>-1) return base; + return base.replaceAt(base.lastIndexOf('_'), '.').replace('RTBPM','BPM'); + } + function openTooltip(event) { + if (document.location.search.indexOf('debug')==-1) { + const type = this.href? this.href.baseVal.replace('#',''): (this.id.indexOf('BLM')>-1 || this.id.indexOf('BERGOZ')>-1? 'blm': '???'); + mylog('openTooltip()',type, this.id, event, event.clientY); + $('#tooltip').css('left', event.clientX+30); + $('#tooltip').css('top', event.clientY+30); + document.getElementById('tooltipFrame').src = conf.tooltipApp+'?s='+type.replace('fast', '')+'¶m='+this.id; + console.log('openTooltip(event)', type.toLowerCase(), type.toLowerCase().indexOf('beamline')); + document.getElementById('tooltip').style.display = 'block'; + if (hideTimeout!==false) clearTimeout(hideTimeout); + hideTimeout = setTimeout(hideTooltip, 120000); + document.getElementById('compdb').style.display = (type.indexOf('rv')==0 || type.indexOf('rc')==0 || type.indexOf('rid')==0 || type.indexOf('rd')==0 || type.indexOf('rps')==0 || type.indexOf('plc')==0)? 'none': 'block'; + const id = evalId(this.id); + document.getElementById('compname').innerHTML = id; + document.getElementById('compdb').href = conf.compdb + id; + document.getElementById("compdb").addEventListener("click", compLink); + if (type.toLowerCase().indexOf('beamline')>-1) { + document.getElementById('compdb').href = 'http://adam.elettra.trieste.it/projects/blcs/beamwatch/'; + document.getElementById('compdb').innerHTML = 'search '+this.id+' in ADAM Beamwatch'; + } + else if (machine=='elettra') document.getElementById('compdb').setAttribute("disabled", true); + event.stopPropagation(); + } + else { + for (let l in lattice) { + if (l=='confg') continue; + let servicearea = false; + for (let i in lattice[l].sections) { + for (let j in lattice[l].sections[i].components) { + if (this.id==lattice[l].sections[i].components[j].name.replace('.', '_')) {mylog('openTooltip()', lattice[l].sections[i].components[j], lattice[l].sections[i].components[j].position-document.location.search.split('offset=')[1].split('&')[0]);} + } + } + } + } + } + function hideTooltip() { + if (hideTimeout!==false) clearTimeout(hideTimeout); + hideTimeout = false; + // mylog('hideTooltip'); + if (document.location.search.indexOf('debug')==-1) { + document.getElementById('tooltipFrame').src = ''; + document.getElementById('tooltip').style.display = 'none'; + } + } + function transformLabel(x, y, beta, labelReverse) { + if (typeof labelReverse == 'object') return "translate("+rescale(x)+" "+rescale(y)+") rotate("+(beta+labelReverse[0])+") translate("+labelReverse[1]+" "+labelReverse[2]+")"; + return labelReverse==180? "translate("+rescale(x)+" "+rescale(y)+") rotate("+(beta-90)+") translate(1800 100)": + "translate("+rescale(x)+" "+rescale(y)+") rotate("+(beta+90)+") translate("+(labelReverse? -250: 250)+" "+(labelReverse? 200: 300)+")"; + } + function appendLabel(id, labelclass, display, x, y, beta, labelReverse) { + if ((beta+3600)%360 <180 && typeof labelReverse != 'object') labelReverse = [-90, -250, -100]; + appendSvg("text", { + id: id+'label', + class: labelclass, + x:0, y:0, style:"display: "+display, fill:"white", stroke:"#eeeeee","stroke-width":10, "font-family":"Arial", "font-size":200, "font-weight":"bold", + "text-anchor": (labelReverse? "end": "start"), + transform: transformLabel(x, y, beta, labelReverse) + }, false, id); + } + function appendLabel2(param, labelclass, display, x, y, beta, labelReverse) { + const id = param.name; + const fontsize = labelclass.indexOf('bl')>-1? 800: 500; + console.log("appendLabel2()",param, labelclass, display, x, y, beta, labelReverse); + if (labelclass.indexOf('bl')>-1 && typeof labelReverse != 'object') { + labelReverse = [180, 17000, param.type=='beamlineUp'? -500: +800]; + if ((beta+3690)%360 < 180) labelReverse = [0, -14000, param.type=='beamlineUp'? 1000: -300]; + } + else if ((beta+3600)%360 < 180 && typeof labelReverse != 'object') labelReverse = [-90, -250, -100]; + appendSvg("text", { + id: id+'label', + class: labelclass, + x:0, y:0, style:"display: block", fill:"red", stroke:"pink","stroke-width":10, "font-family":"Arial", "font-size":fontsize, "font-weight":"bold", + "text-anchor": (labelReverse? "end": "start"), + transform: transformLabel(x, y, beta, labelReverse) + }, false, id); + } + function appendSvg(tagName, attrib, onClickCall=false, text=false, myclass=false) { + const elem = document.createElementNS("http://www.w3.org/2000/svg", tagName); + if (onClickCall) elem.addEventListener("click", onClickCall, false); + if (text) { + const textNode = document.createTextNode(text); + elem.appendChild(textNode); + } + const jelem = $(elem); + if (myclass) {/*mylog(elem, jelem, myclass);*/ elem.classList.add(myclass);} + for (let i in attrib) { + jelem.attr(i, attrib[i]); + } + $("svg").append(jelem); + } + function appendSearch(component, facility) { + // mylog('appendSearch()',component, facility); + if (component) { + const comp = component.type.replace('booster', ''); + if (comp && comp!=' ' && $('#'+comp)[0]) { + const id = extractId(component.name); + names.push(id[0]); + if (facility=='servicearea') serviceareanames.push(id[0]); + if (component.devices) { + for (let j=0; j<component.devices.length; j++) {names.push(component.devices[j]); alias.push([id[0],component.devices[j]]);} + } + } + } + } + function appendComponent(components, x0, y0, x1, y1, facility) { + const dx = x1 - x0; + const dy = y1 - y0; + const d = Math.sqrt(dx*dx + dy*dy); + const beta = 180*Math.atan2(y0-y1, x0-x1)/Math.PI; + if (components) for (let i=0; i<components.length; i++) { + const comp = components[i].type.replace('booster', ''); + let x = x0+components[i].position/d*dx; + let y = y0+components[i].position/d*dy; + if (components[i].offset2d) {x += components[i].offset2d[0]; y += components[i].offset2d[1];} + if (typeof blm != 'undefined' && comp=='blm') { + const name = components[i].name.replace('BPM','BLM'); + // mylog('appendComponent(), ', name, blm.obj); + blm.obj.push(name); + blm.dir.push(beta); + appendSvg("rect", {id:name, name:name, x:0, y:0, width:40, height:40, rx:20, ry:20, transform:"translate("+rescale(x)+" "+rescale(y)+") rotate("+(name.indexOf('_L')>-1? beta + 180: beta)+")"}, openTooltip, false, "blm"); + } + if (typeof bpmData != 'undefined' && comp=='bpm') { + // mylog('appendComponent()',components[i], x0, y0, x1, y1, beta, facility, 180*Math.atan2(y0-y1, x0-x1)/Math.PI); + bpmData[facility].obj.push(components[i].name); + bpmData[facility].dir.push(beta); + bpmData[facility].pos.push([rescale(x), rescale(y)]); + } + if (typeof bpmData != 'undefined' && comp=='corrector') { + corr[facility].obj.push(components[i].name); + corr[facility].dir.push(beta); + corr[facility].pos.push([x, y]); + } + if ($('#'+comp)[0]) { + // mylog('components['+i+']',components[i]); + const id = extractId(components[i].name); + const section = components[i].name.indexOf('_')>-1? components[i].name.split('_')[1].split('.')[0]+' ': ''; + const offset = components[i].type == 'beamlineUp'? "-2100 -3500": "0 -200"; + const transform = "translate("+rescale(x)+" "+rescale(y)+") rotate("+(beta+180)+") translate("+offset+")"; + appendSvg("use", {href:"#"+comp, id: id[0], name:components[i].name, class: comp+' '+section+facility, style:"cursor: pointer", transform:transform}, openTooltip); + if (components[i].type == 'label' || components[i].type == 'beamlineDown' || components[i].type == 'beamlineUp') + appendLabel2(components[i], section+facility, 'none', x, y, beta, components[i].labelReverse); + else + appendLabel(components[i].name, comp+' label '+section+facility, 'none', x, y, beta, components[i].labelReverse); + names.push(id[0]); + if (components[i].devices) { + for (let j=0; j<components[i].devices.length; j++) {names.push(components[i].devices[j]); alias.push([id[0],components[i].devices[j]]);} + } + if (id[1]) {names.push(id[1]); alias.push(id);} + if (state) { + if (components[i].ps) { + for (let pi=0; pi<components[i].ps.length; pi++) { + const name = components[i].ps[pi].replace('PS','').replace('.','_') + '_status'; + status.push({name: name}); + appendSvg('circle', {id: name, class: facility+' ps', style:"display: none", cx: 150+pi*100, cy: 200, transform:transform, r: 80, stroke: 10, strokeColor: 'blue', fill: 'gray'}, false, false, 'status'); + } + } + else { + status.push({name: id[0]+'_status'}); + appendSvg('circle', {id: id[0]+'_status', class: facility+' ps', style:"display: none", cx: 200, cy: 200, transform:transform, r: 80, stroke: 10, strokeColor: 'blue', fill: 'gray'}, false, false, 'status'); + } + if (components[i].name.toUpperCase().indexOf('KICK')>-1) console.log('PS: ', components[i].name, components[i].name.toUpperCase().indexOf('KICK'), status); + } + if (vlv && (components[i].type == 'vlv' || components[i].type == 'bst')) { + // appendSvg('rect', {id: id[0]+'_disable', style:"display: none", x: x+75, y: y-90, width: 50, height: 200, stroke: 10, fill: 'black'}, false, false, 'vlvs'); + vlvs.push({name: id[0], type: components[i].type}); + } + } + } + } + if (!String.prototype.replaceAll) { + String.prototype.replaceAll = function(search, replace) { + return this.split(search).join(replace); + }; + } + function extractId(name) { + if (name.indexOf('(')>-1) { + let tok = name.split('('); + return [tok[0].replaceAll('.','_').replaceAll(' ','_').replace(/_+$/, ''), tok[1].replaceAll('.','_').replaceAll(' ','_').replaceAll(')','').replace(/_+$/, '')]; + } + // .replace(/_+$/, '') => https://stackoverflow.com/questions/8141718/how-to-trim-specific-characters-from-the-end-of-the-javascript-string + return [name.replaceAll('.','_').replaceAll(' ','_').replace(/_+$/, ''), false]; + } + function highlightobjects(objclass) { + $("use").css('opacity',0.3); + $("text").css('opacity',0.3); + $("."+objclass).css('opacity',1); + } + function magnifyobjects(objclass) { + $("text").css('opacity',0.15); + $("text."+objclass).css('opacity',1); + $('.scale').attr('transform', "scale(1) translate(90,100)"); + let x = -40; + let y = -40; + let s = 3; + if (objclass=="vlv") {x = -50; y = -50; s = 5;} + $('.'+objclass+'scale').attr('transform', "scale("+s+") translate("+x+","+y+")"); + } + function initSearch(sections, facility) { + for (i=0; i<sections.length; i++) { // if(i>1) break; + // if (sections[i].bending && sections[i].bending.type) {appendSearch(sections[i].bending, facility);} + if (typeof sections[i].components == 'object') for (let j=0; j<sections[i].components.length; j++) appendSearch(sections[i].components[j], facility); + } + } + function initLattice(sections, facility) { + if (document.location.search.indexOf('facility=')>-1 && facility!=document.location.search.split('facility=')[1].split('&')[0]) return; + if (typeof bpmData != 'undefined') { + bpmData[facility] = {obj: [], dir: [], pos: []}; + corr[facility] = {obj: [], dir: [], pos: []}; + } + // vacuum chamber + let d = ''; + let m = true; + let wall = false; + for (let i=0; i<sections.length; i++) { + d = d + (m? 'M ': ' L ')+rescale(sections[i].start.x)+' '+rescale(sections[i].start.z); + if (i<sections.length-1 && typeof sections[i+1].chamber == 'undefined') {m = true;} else if (i<sections.length-1 && sections[i+1].chamber.type=="chamber") {m = false;} + if (i<sections.length-1 && typeof sections[i+1].chamber != 'undefined' && sections[i+1].chamber.type=="wall") wall = true; + } + if (sections[0].chamber && sections[0].chamber.type=='chamber') d = d + ' Z'; + console.log('sections', sections); + if (d!='') { + if (wall) appendSvg("path", {d: d, fill: "none", stroke: "#990000", "stroke-dasharray": "200 200", "stroke-width": 50, id:"wall"+facility}); + else appendSvg("path", {d: d, fill: "none", stroke: "#999999", "stroke-width": 20, id:"chamber"+facility}); + } + let j = 0; + let i = sections.length - 1; + let k = sections.length - 2; + let alpha = 180/Math.PI*Math.atan2(sections[j].start.z-sections[i].start.z, sections[j].start.x-sections[i].start.x); + for (i=0; i<sections.length; i++) { // if(i>1) break; + j = (i + 1) % sections.length; + k = (i + sections.length - 1) % sections.length; + let beta = 180/Math.PI*Math.atan2(sections[j].start.z-sections[i].start.z, sections[j].start.x-sections[i].start.x); + let gamma = (beta+alpha)/2; + if (sections[k] && sections[j].start.z<sections[i].start.z && sections[i].start.z>sections[k].start.z) gamma = gamma + 180; + if (alpha>beta && gamma<0) gamma = gamma + 180; + if (sections[i].bending && sections[i].bending.type) { + const section = sections[i].bending.name.indexOf('_')>-1? sections[i].bending.name.split('_')[1].split('.')[0]+' ': ''; + appendSvg("use", {href:"#"+sections[i].bending.type.replace('dipolefermi','bending'), id:sections[i].bending.name, class: 'bending '+section+facility, style:"cursor: pointer", transform:"translate("+rescale(sections[i].start.x)+" "+rescale(sections[i].start.z)+") rotate("+gamma+") translate(-600 -200)"}, openTooltip); + appendLabel(sections[i].bending.name, 'bending '+section+facility, 'block', sections[i].start.x, sections[i].start.z, gamma+180, sections[i].bending.labelReverse); + // appendSvg("text", {id:sections[i].bending.name+'label', class: 'bending '+section+facility, x:0, y:0, fill:"white", stroke:"#888888","stroke-width":10, "font-family":"Arial", "font-size":300, "font-weight":"bold", transform:"translate("+rescale(sections[i].start.x)+" "+rescale(sections[i].start.z)+") rotate("+gamma+") translate(-600 -250)"}, false, sections[i].bending.name); + } + alpha = beta; + appendComponent(sections[i].components, sections[i].start.x, sections[i].start.z, sections[j].start.x, sections[j].start.z, facility); + } + if (typeof bpmData != 'undefined') bpmInit(facility); + } + $(document).ready(function() { + $("svg").attr('height', window.innerHeight+'px'); + init(); + }); + + var eventsHandler; + let myhammer; + eventsHandler = { + haltEventListeners: ['touchstart', 'touchend', 'touchmove', 'touchleave', 'touchcancel','tap', 'pinch','pinchstart','pinchmove'], + init: function(options) { + var instance = options.instance, initialScale = 1, pannedX = 0, pannedY = 0; + // mylog('init', options, panZoomPanther); + myhammer = Hammer(options.svgElement, { + inputClass: Hammer.SUPPORT_POINTER_EVENTS ? Hammer.PointerEventInput : Hammer.TouchInput + }); + myhammer.get('pinch').set({enable: true}); + myhammer.on('panstart panmove', function(ev){ + if (ev.type === 'panstart') { + pannedX = 0; + pannedY = 0; + } + panZoomPanther.panBy({x: ev.deltaX - pannedX, y: ev.deltaY - pannedY}); + pannedX = ev.deltaX; + pannedY = ev.deltaY; + }); + myhammer.on('pinchstart pinchmove', function(ev){ + if (ev.type === 'pinchstart') { + initialScale = panZoomPanther.getZoom(); + panZoomPanther.zoomAtPoint(initialScale * ev.scale, {x: ev.center.x, y: ev.center.y}, zoom, ev.scale); + // mylog(''); mylog('panZoomPanther.zoomAtPoint('+(initialScale * ev.scale)+', {x: '+ev.center.x+', y: '+ev.center.y+'})'); + } + if (ev.type === 'pinchmove') { + oldZoom = zoom; + zoom = initialScale * ev.scale; + // mylog('zoom', zoom, ev.center.x); + point.x = ev.center.x; + visibleX = 0 - point.x/zoom; + visibleWidth = document.getElementById('panther').clientWidth/zoom; + } + panZoomPanther.zoomAtPoint(initialScale * ev.scale, {x: ev.center.x, y: ev.center.y}); + zoom = panZoomPanther.getZoom(); + if (zoom>2) $('.label').show(); else $('.label').hide(); + // mylog('panZoomPanther.zoomAtPoint('+(initialScale * ev.scale)+', {x: '+ev.center.x+', y: '+ev.center.y+'})', zoom, ev.scale); + }); + options.svgElement.addEventListener('touchmove', function(e){e.preventDefault(); }); + }, + destroy: function(){ + myhammer.destroy(); + } + }; + function myPanZoomDelayed(event) { + if (event) event.preventDefault(); + visibleX = 0 - point.x/zoom; + visibleWidth = document.getElementById('panther').clientWidth/zoom; + // mylog('myPanZoomDelayed, event', event, 'point', point, 'zoom:', zoom, 'visibleX', visibleX, 'visibleWidth', visibleWidth); + myPanZoomTimer = null; + oldZoom = zoom; + } + let firstUrl = true; + function setUrl(name, value) { + let t = + new Date(); + if (t - historytime < 100) return; + historytime = t; + parameters[name] = value; + const pp = []; + for (let i in parameters) {pp.push(i+'='+parameters[i]);} + const url = document.location.origin+document.location.pathname+'?'+pp.join('&').replaceAll('=undefined', '').replace('search=','s='); + // console.log('setUrl()',name, value, url); + if (firstUrl) window.history.pushState({"html":'panther2d.php',"pageTitle":'PAnTHer'},"", url); + else window.history.replaceState({"html":'panther2d.php',"pageTitle":'PAnTHer'},"", url); + firstUrl = false; + } + function myPan(oldPan, newPan) { + setUrl('pan', Math.round(newPan.x*100)/100+','+Math.round(newPan.y*100)/100); + point.x = newPan.x; + point.y = newPan.y; + if (myPanZoomTimer == null && document.location.search.indexOf('&autoPanZoom')==-1) myPanZoomTimer = setTimeout(myPanZoomDelayed, panZoomTime); + // mylog('myPan', p,q); + } + function myZoom(oldScale, newScale) { + setUrl('zoom', Math.round(newScale*100)/100); + zoom = newScale; + if (newScale>2) $('.label').show(); else $('.label').hide(); + if (myPanZoomTimer == null && document.location.search.indexOf('&autoPanZoom')==-1) myPanZoomTimer = setTimeout(myPanZoomDelayed, panZoomTime); + // mylog('myZoom', zoom); + } +/* +https://github.com/dagrejs/dagre-d3/issues/202 +*/ +SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function(elem) { + return elem.getScreenCTM().inverse().multiply(this.getScreenCTM()); +}; diff --git a/panther2d.php b/panther2d.php new file mode 100644 index 0000000..e4f190b --- /dev/null +++ b/panther2d.php @@ -0,0 +1,47 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <title>PAnTHer</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> + <link rel="stylesheet" href="../lib/jquery/jquery-ui.min.css"> + <script src="../lib/jquery/jquery.min.js" type="text/javascript"></script> + <script src="../lib/jquery/jquery-ui.min.js" type="text/javascript"></script> + <script src="../lib/node_modules/three/examples/jsm/libs/lil-gui-0.19.min.js"></script> + </head> + <body style="overflow: hidden; background-color: #333333;"> + <style> + .vlv {fill: white;} + .bst {fill: white;} + .blm {display: none;} + .lil-gui.autoPlace {z-index: 1 !important;} + </style> + <div id='pin' style='position:absolute; display:none;'> + <img src='./pin.svg'> + </div> + <div id='tooltip' style='position:absolute; display:none;'> + <div style='width: 490px; background-color: white; padding:5px; border-width: 3px; border-color: blue; border-top-left-radius: 5px; border-top-right-radius: 5px;'><button id='compdb'>search in <b>components</b> DB <span id='compname'/></button></div> + <iframe id='tooltipFrame' style="border:0; position:absolute; background:transparent; " width="500px" height="220px" src=''></iframe> + </div> + <div onClick="hideTooltip()"> + <?php + $machine = empty($_REQUEST['machine'])? 'elettra': strtolower($_REQUEST['machine']); + file_put_contents('./logs2d'.date('Y').'.txt', date('Y-m-d H:i:s').' '.$_SERVER['REMOTE_ADDR'].'_'.$_SERVER['HTTP_X_FORWARDED_FOR'].' - '.$_SERVER['QUERY_STRING'].PHP_EOL , FILE_APPEND | LOCK_EX); + $f = file_get_contents("./panther_conf.js"); + echo "\n<script>\n".strtr($f, array('export '=>''))."</script>\n"; + $f = file_get_contents("./components/bundle_{$machine}2d.svg"); + if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox/63') !== false) $f = strtr($f, array('fill="url(#Pattern)"'=>'fill="#a6a4c9"')); + echo $f; + ?> + </div> + <div id='notice' style='display:<?php echo $_REQUEST['machine']=='elettra2'? 'block': 'none';?>; position:absolute; right:5px; bottom:5px; max-width:600px; z-index: 10000;'> + Data source <a href='https://drive.elettra.eu/group/268/' target="_blank">https://drive.elettra.eu/group/268/</a> + </div> + <script type="text/javascript" src="../spa/js/svg-pan-zoom.min.js"></script> + <!--script type="text/javascript" src="./svg-pan-zoom-rotate.js"></script--> + <script type="text/javascript" src="../spa/js/hammer.min.js"></script> + <script type="text/javascript" src="./blm2d.js"></script> + <script type="text/javascript" src="./bpm2d.js"></script> + <script type="text/javascript" src="./panther2d.js"></script> + </body> +</html> diff --git a/panther_conf.js b/panther_conf.js new file mode 100644 index 0000000..80fcdd2 --- /dev/null +++ b/panther_conf.js @@ -0,0 +1,7 @@ + export const conf = { + default_machine: 'elettra', + machineList: ['elettra', 'elettra2', 'fermi', 'esrf','nsls2'], + tooltipApp: "<your_URL_for_tooltip_app_with_parameters_s=screen¶m=otherparam>", + tooltipAppNormal: '<URL_of_alternative_tooltip_app>', + rchan: "<your_URL_for_reading_the_field>src=" + }; diff --git a/panther_lattice.json b/panther_lattice.json new file mode 100644 index 0000000..37b1fbe --- /dev/null +++ b/panther_lattice.json @@ -0,0 +1,133 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://luciozambon.altervista.org/app/panther_lattice.json", + "title": "PAnTHer", + "description": "Schema of the lattice file needed by PAnTHer", + "type": "object", + "patternProperties": { + "^.*$": { + "description": "identifier of a part of the accelerator, any unique string is valid", + "type": "object", + "properties": { + "sections": { + "description": "Stright sections only", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "type": "object", + "properties": { + "x": {"type": "number"}, + "z": {"type": "number"} + }, + "required": [ "x", "z" ] + }, + "bending": { + "type": "object", + "properties": { + "type": {"type": "string"}, + "length": {"type": "number"}, + "label": {"type": "string"}, + "rotateY": {"type": "string"}, + "lengthIndex": {"type": "number"}, + "name": {"type": "string"} + } + }, + "chamber": { + "description": "Vacuum chamber towards the start position of the previous element of array (or towards the last element in the case of the first element)", + "type": "object", + "properties": { + "type": {"type": "string"} + }, + "required": [ "type" ] + }, + "components": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": {"type": "string"}, + "position": {"type": "number","description": "distance in millimeters from the start position"}, + "name": {"type": "string"} + }, + "required":["type","position","name"] + } + } + } + } + }, + "servicearea": { + "description": "racks in service areas", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "type": "object", + "properties": { + "x": {"type": "number"}, + "y": {"type": "number"}, + "z": {"type": "number"} + }, + "required": [ "x", "y", "z" ] + }, + "components": { + "description": "racks or other objects", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": {"type": "string"}, + "position": {"type": "number","description": "distance in millimeters from the start position"}, + "name": {"type": "string"}, + "size": { + "type": "object", + "properties": { + "dx": {"type": "number"}, + "dy": {"type": "number"}, + "dz": {"type": "number"} + } + } + }, + "required":["type","position","name"] + } + } + } + } + }, + "blm": { + "description": "Beam Loss Monitors", + "type": "object", + "properties": { + "confsrc": {"type": "string"}, + "datasrc": {"type": "string"}, + "skip": {"type": "string"} + }, + "required":["confsrc","datasrc"] + }, + "bpm": { + "description": "Beam Position Monitors", + "type": "object", + "properties": { + "pos": {"type": "string"}, + "rms": {"type": "string"}, + "length": {"type": "integer"}, + "offset": {"type": "integer"}, + "skip": {"type": "array","items": {"type": "string"}} + }, + "required":["pos","length","offset"] + }, + "envelope": { + "description": "Beam Statistical envelope", + "type": "object", + "properties": { + "src": {"type": "string"}, + "length": {"type": "array", "items": {"type": "number"}} + }, + "required":["src","length"] + } + } + } + } +} diff --git a/save.svg b/save.svg new file mode 100644 index 0000000..f90fa03 --- /dev/null +++ b/save.svg @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="512" height="512" style="background-color:#000000;"> +<path fill="#00c040" d="M19,0H3A3,3,0,0,0,0,3V24H24V5ZM7,2H17V6H7ZM22,22H2V3A1,1,0,0,1,3,2H5V8H19V2.828l3,3Z"/> +</svg> diff --git a/updater.php b/updater.php new file mode 100644 index 0000000..e485767 --- /dev/null +++ b/updater.php @@ -0,0 +1,152 @@ +<?php +function logdata($request, $filename) { + $timestamp = isset($_REQUEST['timestamp'])? $_REQUEST['timestamp']: time(); + $data = $timestamp.':'.strtr($_REQUEST[$request],array('nan'=>'null')); + $f = file_put_contents('/run/panther/'.$filename, $data); + $debug = ''; + if (isset($_REQUEST['debug'])) $debug = ", filename: $filename, written $f bytes\n"; + if ($f==strlen($data)) die("OK$debug"); + die("ERROR: cannot write data, written $f bytes VS ".strlen($data)); +} +if (isset($_REQUEST['check']) && !empty($_REQUEST['filename'])) { +echo '<!doctype html> +<html lang="en"> + <head> + <title>PAnTHer admin</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="stylesheet" href="../lib/bootstrap/bootstrap.min.css"> + <script src="../lib/bootstrap/jquery.js"></script> + <script src="../lib/bootstrap/bootstrap.min.js"></script> + </head> + <body> +<style> + td {vertical-align: top;} +</style> +'; + list($ts, $srcStr) = explode(':', file_get_contents('http://puma-01.elettra.eu/panther/updater.php?read&filename='.$_REQUEST['filename'].'.src'),2); + $src = explode(',', $srcStr); + if (isset($_REQUEST['debug'])) {echo "<pre>"; print_r($src); echo "</pre><br>";} + list($ts, $dataStr) = explode(':', file_get_contents('http://puma-01.elettra.eu/panther/updater.php?read&filename='.$_REQUEST['filename']),2); + $data = explode(';', $dataStr); + if (!empty($_REQUEST['check'])) { + $period = $_REQUEST['check'] - 0; + if ($period < 1) $period = 2; + echo "<meta http-equiv='refresh' content='$period' >\n"; + } + echo date('Y-m-d H:i:s', $ts/1000)."<br>\n<table class='table table-striped table-hover'>\n"; + foreach ($data as $i=>$v) { + echo "<tr><td> $i </td><td> ".strtr($v, [','=>'<br>'])." </td><td> {$src[$i]} </td></tr>\n"; + } + die('</table>'); +} +if (isset($_REQUEST['read']) && !empty($_REQUEST['filename'])) { + if ($_REQUEST['filename']=='preinjector.100.bpm') { + list($trash, $f) = explode(':', file_get_contents('/run/panther/elettra.100.bpm')); + $d = explode(';', $f); + die("[[".implode(',', array_slice($d, 0, 7)).'],['.implode(',', array_slice($d, 7, 7))."]]"); + } + if ($_REQUEST['filename']=='preinjector.100.bpm.src') { + list($trash, $f) = explode(':', file_get_contents('/run/panther/elettra.100.bpm.src'), 2); + $d = explode(',', $f); + die("[[".implode(',', array_slice($d, 0, 7)).'],['.implode(',', array_slice($d, 7, 7))."]]"); + } + if ($_REQUEST['filename']=='bts.100.bpm') { + list($trash, $f) = explode(':', file_get_contents('/run/panther/elettra.100.bpm')); + $d = explode(';', $f); + die("[[".implode(',', array_slice($d, 14, 10)).'],['.implode(',', array_slice($d, 24, 10))."]]"); + } + if ($_REQUEST['filename']=='bts.100.bpm.src') { + list($trash, $f) = explode(':', file_get_contents('/run/panther/elettra.100.bpm.src'), 2); + $d = explode(',', $f); + die("[[".implode(',', array_slice($d, 14, 10)).'],['.implode(',', array_slice($d, 24, 10))."]]"); + } + if ($_REQUEST['filename']=='sr.100.bpm') { + list($trash, $f) = explode(':', file_get_contents('/run/panther/elettra.100.bpm')); + $d = explode(';', $f); + die("[[".$d[34].'],['.$d[35]."]]"); + } + if ($_REQUEST['filename']=='sr.100.bpm.src') { + $f = file_get_contents('http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/feedback/profile_s-%3EGetGofBpmNames'); + if (isset($_REQUEST['debug'])) print_r($f); + $d = json_decode(strtr($f, [',""'=>'', '"LGBPM_S2.1","LGBPM_S2.2",'=>'', '"LGBPM_S7.1","LGBPM_S7.2",'=>''])); + $h = $v = []; + foreach ($d as $name) { + $h[] = "srv-tango-sre-01:20000/sr/feedback/$name/HorPos"; + $v[] = "srv-tango-sre-01:20000/sr/feedback/$name/VerPos"; + } + die('[['.implode(',', $h).'],['.implode(',', $v).']]'); + } + if ($_REQUEST['filename']=='elettra.100.bpm') { + header('Content-Type: application/json'); + list($trash, $f) = explode(':', strtr(file_get_contents('/run/panther/elettra.100.bpm'), array('e '=>'e'))); + $d = explode(';', $f); + die("{\"preinjector\":{\"x\":[".implode(',', array_slice($d, 0, 7)).'],"y":['.implode(',', array_slice($d, 7, 7))."]},\"bts\":{\"x\":[".implode(',', array_slice($d, 14, 10)).'],"y":['.implode(',', array_slice($d, 24, 10))."]},\"sr\":{\"x\":[".$d[34].'],"y":['.$d[35]."]}}"); + } + if ($_REQUEST['filename']=='elettra.100.bpm.src') { + $f = file_get_contents('http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/feedback/profile_s-%3EGetGofBpmNames'); + $d = json_decode(strtr($f, [',""'=>'', '"LGBPM_S2.1","LGBPM_S2.2",'=>'', '"LGBPM_S7.1","LGBPM_S7.2",'=>''])); + $h = $v = []; + foreach ($d as $name) { + $h[] = "srv-tango-sre-01:20000/sr/feedback/$name/HorPos"; + $v[] = "srv-tango-sre-01:20000/sr/feedback/$name/VerPos"; + } + list($trash, $f) = explode(':', file_get_contents('/run/panther/elettra.100.bpm.src'), 2); + $d = explode(',', $f); + die("[[".implode(',', array_slice($d, 0, 7)).','.implode(',', array_slice($d, 14, 10)).','.implode(',', $h).'],['.implode(',', array_slice($d, 7, 7)).','.implode(',', array_slice($d, 24, 10)).','.implode(',', $v)."]]"); + } + if ($_REQUEST['filename']=='fermi.1000.vlv') { + list($trash, $f) = explode(':', file_get_contents('/run/panther/padres.1000.vlv')); + die(file_get_contents('/run/panther/fermi.1000.vlv').';'.$f); + } + if ($_REQUEST['filename']=='fermi.1000.vlv.src') { + list($trash, $f) = explode(':', file_get_contents('/run/panther/padres.1000.vlv.src'),2); + die(file_get_contents('/run/panther/fermi.1000.vlv.src').','.$f); + } + if ($_REQUEST['filename']=='elettra.1000.vlv') { + $f = explode(';', file_get_contents('/run/panther/elettra.1000.vlv')); + foreach ($f as $i=>$l) { + if (substr_count($l, ',')>15) { + $k = explode(',', $l); + $f[$i] = "UNKNOWN"; + if ($k[0]=='true') $f[$i] = "OPENED"; + if ($k[1]=='true') $f[$i] = "CLOSED"; + } + } + die(implode(';', $f)); + } + if ($_REQUEST['filename']=='elettra.1000.vlv.src') { + die(strtr(file_get_contents('/run/panther/elettra.1000.vlv.src'), array('rpcbridge/rpc2tangobridge'=>'sr', '_STAT_RF'=>'/state'))); + } + if (!empty($_REQUEST['read']) || $_REQUEST['read']==='0') { + $f = explode(';',file_get_contents('/run/panther/'.$_REQUEST['filename'])); + if ($_REQUEST['read']==='0') list($trash, $f[0]) = explode(':', $f[0]); + header('Content-Type: application/json'); + $factor = 2000000000000; + $x = $z = []; + $v = explode(',', $f[$_REQUEST['read']-0]); + for ($i=0; $i<96; $i++) {$x[] = $v[$i*15] * $factor + (rand(0,2000)-1000)/10000; $z[] = ($v[$i*15] * $factor + (rand(0,2000)-1000)/10000)/4;} + die("[[".implode(',', $x).'],['.implode(',', $z)."]]"); + die("[[{$f[$_REQUEST['read']-0]}],[{$f[$_REQUEST['read']+1]}]]"); + } + readfile('/run/panther/'.$_REQUEST['filename']); + exit(); +} +if ($_SERVER['REMOTE_ADDR'] == '192.168.205.106' || $_SERVER['REMOTE_ADDR']=='192.168.205.25' || $_SERVER['REMOTE_ADDR'] == '192.168.205.149' || $_SERVER['REMOTE_ADDR'] == '192.168.205.157' || $_SERVER['REMOTE_ADDR'] == '192.168.205.158' || $_SERVER['REMOTE_ADDR'] == '192.168.205.159' || $_SERVER['REMOTE_ADDR'] == '192.168.205.166') { + if (empty($_REQUEST['data']) && $_REQUEST['data']!=='0' && empty($_REQUEST['src']) && empty($_REQUEST['stat'])) die("ERROR: empty data\n"); + if (strlen($_REQUEST['data'])>2000000) die("ERROR: data too long: ".strlen($_REQUEST['data'])." bytes\n"); + $filename = isset($_REQUEST['filename'])? strtr($_REQUEST['filename'],array("'"=>'')): 'data.txt'; + if (!empty($_REQUEST['stat'])) {logdata('stat', $filename.'.stat');} + if (!empty($_REQUEST['src'])) {logdata('src', $filename.'.src');} + if ($filename=='stat' || $filename=='src') die("ERROR: invalid filename: $filename\n"); + logdata('data', $filename); + exit(); +} +function multiply($factor, $array) { + foreach ($array as $key => $value) { + $array[$key]=$value*$factor; + } + return $array; +} +print_r($_SERVER); +?> -- GitLab