From 81455c6d6261c0535d1dc85148141d6df71b684c Mon Sep 17 00:00:00 2001 From: SysAdmin Date: Thu, 5 Jan 2023 14:53:50 -0500 Subject: [PATCH] improving the info display --- geo.js | 103 +++++++++++++++++++++++++------------- index.html | 144 ++++++++++++++++++++++++++++++++++++++--------------- test.py | 60 ++++++++++++---------- 3 files changed, 208 insertions(+), 99 deletions(-) diff --git a/geo.js b/geo.js index 6fd5f6e..735e60f 100644 --- a/geo.js +++ b/geo.js @@ -23,11 +23,11 @@ function distance(xy1, xy2){ let colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"]; -let color = { +let color = { //[on, off] BeamPipe : ['red', 'grey'], - Dipole : ['gold', '#CDCD5B'], + Dipole : ['gold', '#DEDE6C'], Deflector : ['Orange', '#228522'], - Qpole : ['#7F7FFF', '#8F8FBC'], + Qpole : ['#4E4EEE', '#8F8FBC'], Detector : ['Yellow', '#8B8B0A'], LINAC : ['Cyan', '#44AAAA'], Tandem : [ '#782F40', '#CEB888'], @@ -137,7 +137,7 @@ class multiBeamLine extends basicShape{ this.clear(); let ctx = this.layer.getContext('2d'); if(isDashed){ - ctx.setLineDash([4,4]); + ctx.setLineDash([8,8]); ctx.lineDashOffset = -this.offset; ctx.strokeStyle = this.color[0]; }else{ @@ -149,8 +149,8 @@ class multiBeamLine extends basicShape{ } march(){ - this.offset+=1; - if( this.offset > 8) this.offset = 0; + this.offset+=2; + if( this.offset > 16) this.offset = 0; this.draw(true); //setTimeout(this.march.bind(this), 20); } @@ -552,43 +552,51 @@ let beamLineHaHa; //============================== Draw +var destination = 'Gamma'; -for( const ele in beamLineHaHa){ - beamLineHaHa[ele].draw(false); -} +function DisableAllDetector(){ -for( const ele in sourceLine){ - sourceLine[ele].draw(true); -} - -targetRoom1.dipole.draw(true); -targetRoom1.fan.draw(true); -targetRoom1.upperLine.q1a.draw(true); -targetRoom1.upperLine.df1a.draw(true); -targetRoom1.upperLine.GammaStation.draw(false); -targetRoom1.upperLine.Catrina.draw(false); -targetRoom1.lowerLine.q1c.draw(false); -targetRoom1.lowerLine.df1c.draw(false); - -for( const ele in targetRoom2){ - try{ - targetRoom2[ele].draw(false); - }catch(err){ - for( const haha in targetRoom2[ele]){ - try{ - targetRoom2[ele][haha].draw(false); - }catch(err){ - for( const kaka in targetRoom2[ele][haha]){ - targetRoom2[ele][haha][kaka].draw(false); + for( const ele in beamLineHaHa){ + beamLineHaHa[ele].draw(false); + } + + for( const ele in sourceLine){ + sourceLine[ele].draw(true); + } + + for( const ele in targetRoom1){ + try{ + targetRoom1[ele].draw(false); + }catch(err){ + for( const haha in targetRoom1[ele]){ + try{ + targetRoom1[ele][haha].draw(false); + }catch(err){ + + } + } + } + } + + for( const ele in targetRoom2){ + try{ + targetRoom2[ele].draw(false); + }catch(err){ + for( const haha in targetRoom2[ele]){ + try{ + targetRoom2[ele][haha].draw(false); + }catch(err){ + for( const kaka in targetRoom2[ele][haha]){ + targetRoom2[ele][haha][kaka].draw(false); + } } } } } } -var destination = 'Gamma'; - function EnableDetector(){ + DisableAllDetector(); if( destination == 'Gamma' ) targetRoom1.upperLine.GammaStation.draw(true); if( destination == 'Catrina') targetRoom1.upperLine.Catrina.draw(true); if( destination == 'RESOLUT') targetRoom2.ResolutLine.Resolut.draw(true); @@ -596,6 +604,33 @@ function EnableDetector(){ if( destination == 'SPS') targetRoom2.lowerLine.SplitPoleLine.SPS.draw(true); if( destination == 'Clarion2') targetRoom2.lowerLine.ClarionLine.Clarion2.draw(true); + if( destination == 'Gamma' || destination == 'Catrina'){ + for( const ele in targetRoom1){ + try{ + targetRoom2[ele].draw(true); + }catch(err){ + } + } + } + + if( destination == 'RESOLUT' || destination == 'Anasen' || destination == 'SPS' || destination == 'Clarion2'){ + for( const ele in targetRoom2){ + try{ + targetRoom2[ele].draw(true); + }catch(err){ + } + } + } + + if( destination == 'RESOLUT'){ + for( const ele in targetRoom2.ResolutLine){ + try{ + targetRoom2.ResolutLine[ele].draw(true); + }catch(err){ + } + } + } + } function lineMotion(){ diff --git a/index.html b/index.html index 6536aa9..1e83507 100644 --- a/index.html +++ b/index.html @@ -54,11 +54,38 @@ z-index: 3; } - #text{ + #BeamInfo{ + color: orange; + position:absolute; + font-size: 100px; + top : 25%; + left : 35%; + z-index:1001; + } + + #SrcInfo{ + color: white; + position:absolute; + font-size: 15px; + bottom : 9.6%; + right : 10%; + z-index:1001; + } + + #TandemInfo{ + color: white; + position:absolute; + font-size: 15px; + bottom : 35%; + right : 10%; + z-index:1001; + } + + #footnote{ color: aqua; position:absolute; - top : 20%; - left : 45%; + bottom : 2%; + right : 1%; width: 100; height: 100; z-index:1001; @@ -68,9 +95,16 @@ -
-
+
+ +
+ +
+
+
+
+ @@ -79,64 +113,94 @@ Your browser doe snot support HTML canvas Your browser doe snot support HTML canvas -=================== - -Isotope: C12 -PreAcceleration: 120.0 kV -Inflector: 3.70 A -LEB Voltage: -2.62 V -LEB feedback: 0.090 V -Tandem Pot.: 7.126 MV -Beam Energy: 50.000 MeV -Beam Charge: 6 -Frac. Charge: 0.044 -Beta: 0.0943 -Analyzing Magnet: 6813.81 G -Beam Line: RESOLUT -