if (machine.indexOf('simulator_')>-1){latticeFile=document.location.href.split('?')[0].split('/').slice(0,-1).join('/')+'/'+'simulator.php?lattice&machine='+machine.split('simulator_')[1];}
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');}
if (document.location.search.indexOf('highlight=')>-1){$('<div><iframe style="width: 100%;height:250px;" src="./spa/gauge.html?dark&r2only=1&r=100&ringwidth=58&max=1&throttlingPeriod=50&apply=shrink&val='+params.highlightShrink+'"></iframe></div>').insertBefore('.function');}
for (letiinlattice){if (i!='conf')initLattice(lattice[i].sections,i);}
for (letiinlattice){if (i!='conf')initLattice(lattice[i].sections,i);}
for (letj=0;j<lattice[facility].sections[i].components[m].embedded.length;j++){names.push(lattice[facility].sections[i].components[m].embedded[j]);alias.push([myname,lattice[facility].sections[i].components[m].embedded[j]]);}
for (letj=0;j<lattice[facility].sections[i].components[m].embedded.length;j++){names.push(lattice[facility].sections[i].components[m].embedded[j]);alias.push([myname,lattice[facility].sections[i].components[m].embedded[j]]);}
}
}
if (id[1]){window.names.push(id[1]);alias.push(id);}
if (id[1]){window.names.push(id[1]);alias.push(id);}
if (lattice[facility].sections[i].components[m].href)mycomp.href=lattice[facility].sections[i].components[m].href;
if (m>-1&&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);}
if (highlight.length&&!highlight.find(element=>element==magnet)){mycomp.scale.set(params.highlightShrink,params.highlightShrink,params.highlightShrink);}
facilities[facility].add(mycomp);
facilities[facility].add(mycomp);
compBuffer[magnet][l].mycomp=mycomp;
compBuffer[magnet][l].mycomp=mycomp;
...
@@ -544,12 +555,13 @@
...
@@ -544,12 +555,13 @@
if (magnet=='blm'){blmres.append(blm,facility,mycomp,direction);}
if (magnet=='blm'){blmres.append(blm,facility,mycomp,direction);}
if (magnet=='vlv'){vlvs.push({'comp':mycomp,'name':mycomp.name,'type':magnet});}
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 (magnet=='bst'){vlvs.push({'comp':mycomp,'name':mycomp.name,'type':magnet});}
if (Math.abs(den)>0.00001){
if (Math.abs(den)>0.00001&&document.location.search.indexOf('nops')==-1){
if (mycomp.ps){
if (mycomp.name.indexOf('CHV_S')>-1)console.log(mycomp,i,m,lattice[facility].sections[i].components[m]);
for (letpi=0;pi<mycomp.ps.length;pi++){
if (typeoflattice[facility].sections[i].components[m].ps=="object"){
for (letpi=0;pi<lattice[facility].sections[i].components[m].ps.length;pi++){
if (highlight.length&&!highlight.find(element=>(element=='bending'||element==bendingType))){component[dipoleNum].scale.set(params.highlightShrink,params.highlightShrink,params.highlightShrink);}
if (1||flattice[j].bending.label&&flattice[j].bending.label=='show'){
component[dipoleNum].rotateY(3*Math.PI/2-alpha);
constdiv=document.createElement('div');
if (highlight.length&&!highlight.find(element=>(element=='bending'||element==bendingType))){component[dipoleNum].scale.set(params.highlightShrink,params.highlightShrink,params.highlightShrink);}
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=='vlv')componentCreator.vlvUpdate(vlvs[i].comp,vlvVal[vlvs[i].vlvindex]=='CLOSED'?'red':(vlvVal[vlvs[i].vlvindex]=='OPENED'?'limegreen':'grey'));
if (vlvs[i].type=='bst'){
if (vlvs[i].type=='bst'){
if (typeofvlvVal[vlvs[i].vlvindex]!='string')continue;
if (typeofvlvVal[vlvs[i].vlvindex]!='string')continue;