@@ -31,11 +31,11 @@ public class LhcInfoObj implements Serializable {
3131 public String LHCFillingSchemeName ;
3232 public int IP2_NO_COLLISIONS ;
3333 public int NO_BUNCHES ;
34- public ArrayList <floatTS > beamEnergyHist ;
35- public ArrayList <floatTS > LHCBetaStarHist ;
36- public ArrayList <strTS > beamModeHist ;
37- public ArrayList <strTS > FillingSchemeHist ;
38- public ArrayList <strTS > ActiveFillingSchemeHist ;
34+ public ArrayList <TimestampedFloat > beamEnergyHist ;
35+ public ArrayList <TimestampedFloat > LHCBetaStarHist ;
36+ public ArrayList <TimestampedString > beamModeHist ;
37+ public ArrayList <TimestampedString > FillingSchemeHist ;
38+ public ArrayList <TimestampedString > ActiveFillingSchemeHist ;
3939 private float beamEnergy ;
4040 private float LHCBetaStar ;
4141
@@ -53,11 +53,11 @@ public LhcInfoObj(long date, int no, String part1, String part2, String fs, int
5353 IP2_NO_COLLISIONS = p2col ;
5454 NO_BUNCHES = nob ;
5555
56- beamModeHist = new ArrayList <strTS >();
57- FillingSchemeHist = new ArrayList <strTS >();
58- beamEnergyHist = new ArrayList <floatTS >();
59- LHCBetaStarHist = new ArrayList <floatTS >();
60- ActiveFillingSchemeHist = new ArrayList <strTS >();
56+ beamModeHist = new ArrayList <TimestampedString >();
57+ FillingSchemeHist = new ArrayList <TimestampedString >();
58+ beamEnergyHist = new ArrayList <TimestampedFloat >();
59+ LHCBetaStarHist = new ArrayList <TimestampedFloat >();
60+ ActiveFillingSchemeHist = new ArrayList <TimestampedString >();
6161
6262 endedTime = -1 ;
6363 beamEnergy = -1 ;
@@ -69,7 +69,7 @@ public LhcInfoObj(long date, int no, String part1, String part2, String fs, int
6969 LHCTotalNonInteractingBuchesBeam2 = LHCTotalNonInteractingBuchesBeam1 ;
7070 LHCBetaStar = -1 ;
7171
72- strTS ts1 = new strTS (date , fs + " *" );
72+ TimestampedString ts1 = new TimestampedString (date , fs + " *" );
7373 FillingSchemeHist .add (ts1 );
7474
7575 }
@@ -111,7 +111,7 @@ public String history() {
111111 ans = ans + " History:: Beam Mode\n " ;
112112
113113 for (int i = 0 ; i < beamModeHist .size (); i ++) {
114- strTS a1 = beamModeHist .get (i );
114+ TimestampedString a1 = beamModeHist .get (i );
115115 ans = ans + " - " + AliDip2BK .myDateFormat .format (a1 .time ) + " " + a1 .value + "\n " ;
116116 }
117117 }
@@ -120,7 +120,7 @@ public String history() {
120120 ans = ans + " History:: Filling Scheme \n " ;
121121
122122 for (int i = 0 ; i < FillingSchemeHist .size (); i ++) {
123- strTS a1 = FillingSchemeHist .get (i );
123+ TimestampedString a1 = FillingSchemeHist .get (i );
124124 ans = ans + " - " + AliDip2BK .myDateFormat .format (a1 .time ) + " " + a1 .value + "\n " ;
125125 }
126126 }
@@ -129,7 +129,7 @@ public String history() {
129129 ans = ans + " History:: Active Filling Scheme \n " ;
130130
131131 for (int i = 0 ; i < ActiveFillingSchemeHist .size (); i ++) {
132- strTS a1 = ActiveFillingSchemeHist .get (i );
132+ TimestampedString a1 = ActiveFillingSchemeHist .get (i );
133133 ans = ans + " - " + AliDip2BK .myDateFormat .format (a1 .time ) + " " + a1 .value + "\n " ;
134134 }
135135 }
@@ -138,7 +138,7 @@ public String history() {
138138 ans = ans + " History:: Beam Energy\n " ;
139139
140140 for (int i = 0 ; i < beamEnergyHist .size (); i ++) {
141- floatTS a1 = beamEnergyHist .get (i );
141+ TimestampedFloat a1 = beamEnergyHist .get (i );
142142 ans = ans + " - " + AliDip2BK .myDateFormat .format (a1 .time ) + " " + a1 .value + "\n " ;
143143 }
144144 }
@@ -147,7 +147,7 @@ public String history() {
147147 ans = ans + " History:: LHC Beta Star\n " ;
148148
149149 for (int i = 0 ; i < LHCBetaStarHist .size (); i ++) {
150- floatTS a1 = LHCBetaStarHist .get (i );
150+ TimestampedFloat a1 = LHCBetaStarHist .get (i );
151151 ans = ans + " - " + AliDip2BK .myDateFormat .format (a1 .time ) + " " + a1 .value + "\n " ;
152152 }
153153 }
@@ -160,15 +160,15 @@ public LhcInfoObj clone() {
160160 IP2_NO_COLLISIONS , NO_BUNCHES );
161161
162162 @ SuppressWarnings ("unchecked" )
163- ArrayList <strTS > bmh = (ArrayList <strTS >) beamModeHist .clone ();
163+ ArrayList <TimestampedString > bmh = (ArrayList <TimestampedString >) beamModeHist .clone ();
164164 @ SuppressWarnings ("unchecked" )
165- ArrayList <strTS > fsh = (ArrayList <strTS >) FillingSchemeHist .clone ();
165+ ArrayList <TimestampedString > fsh = (ArrayList <TimestampedString >) FillingSchemeHist .clone ();
166166 @ SuppressWarnings ("unchecked" )
167- ArrayList <floatTS > eh = (ArrayList <floatTS >) beamEnergyHist .clone ();
167+ ArrayList <TimestampedFloat > eh = (ArrayList <TimestampedFloat >) beamEnergyHist .clone ();
168168 @ SuppressWarnings ("unchecked" )
169- ArrayList <floatTS > bsh = (ArrayList <floatTS >) LHCBetaStarHist .clone ();
169+ ArrayList <TimestampedFloat > bsh = (ArrayList <TimestampedFloat >) LHCBetaStarHist .clone ();
170170 @ SuppressWarnings ("unchecked" )
171- ArrayList <strTS > afsh = (ArrayList <strTS >) ActiveFillingSchemeHist .clone ();
171+ ArrayList <TimestampedString > afsh = (ArrayList <TimestampedString >) ActiveFillingSchemeHist .clone ();
172172
173173 n .beamModeHist = bmh ;
174174 n .FillingSchemeHist = fsh ;
@@ -235,7 +235,7 @@ public boolean verifyAndUpdate(long time, int fillNumber, String fs, int ip2c, i
235235
236236 public void addNewAFS (long time , String fs ) {
237237
238- strTS ts2 = new strTS (time , fs );
238+ TimestampedString ts2 = new TimestampedString (time , fs );
239239 ActiveFillingSchemeHist .add (ts2 );
240240
241241 }
@@ -251,15 +251,14 @@ public void addNewFS(long time, String fs, boolean isInPIB) {
251251 // the same ="+ fs);
252252 // } else {
253253 String nfs = fs ;
254- if (isInPIB )
255- nfs = nfs + " *" ;
256- strTS ts2 = new strTS (time , nfs );
254+ if (isInPIB ) nfs = nfs + " *" ;
255+ TimestampedString ts2 = new TimestampedString (time , nfs );
257256 FillingSchemeHist .add (ts2 );
258257 // }
259258 }
260259
261260 public void setBeamMode (long date , String mode ) {
262- strTS nv = new strTS (date , mode );
261+ TimestampedString nv = new TimestampedString (date , mode );
263262 beamModeHist .add (nv );
264263 // System.out.println ( " Added beam mode "+ mode);
265264 }
@@ -275,7 +274,7 @@ public float getLHCBetaStar() {
275274 public void setEnergy (long date , float v ) {
276275
277276 if (beamEnergyHist .size () == 0 ) {
278- floatTS v1 = new floatTS (date , v );
277+ TimestampedFloat v1 = new TimestampedFloat (date , v );
279278 beamEnergyHist .add (v1 );
280279 beamEnergy = v ;
281280 return ;
@@ -285,15 +284,15 @@ public void setEnergy(long date, float v) {
285284 if (re < AliDip2BK .DIFF_ENERGY ) {
286285 return ;
287286 } else {
288- floatTS v1 = new floatTS (date , v );
287+ TimestampedFloat v1 = new TimestampedFloat (date , v );
289288 beamEnergyHist .add (v1 );
290289 beamEnergy = v ;
291290 }
292291 }
293292
294293 public void setLHCBetaStar (long date , float v ) {
295294 if (LHCBetaStarHist .size () == 0 ) {
296- floatTS v1 = new floatTS (date , v );
295+ TimestampedFloat v1 = new TimestampedFloat (date , v );
297296 LHCBetaStarHist .add (v1 );
298297 LHCBetaStar = v ;
299298 return ;
@@ -303,7 +302,7 @@ public void setLHCBetaStar(long date, float v) {
303302 if (re < AliDip2BK .DIFF_BETA ) {
304303 return ;
305304 } else {
306- floatTS v1 = new floatTS (date , v );
305+ TimestampedFloat v1 = new TimestampedFloat (date , v );
307306 LHCBetaStarHist .add (v1 );
308307 LHCBetaStar = v ;
309308 }
@@ -314,7 +313,7 @@ public String getBeamMode() {
314313 if (beamModeHist .size () == 0 ) {
315314 return null ;
316315 }
317- strTS last = beamModeHist .get (beamModeHist .size () - 1 );
316+ TimestampedString last = beamModeHist .get (beamModeHist .size () - 1 );
318317 return last .value ;
319318 }
320319
@@ -343,7 +342,7 @@ public long getStableBeamStart() {
343342
344343 for (int i = 0 ; i < beamModeHist .size (); i ++) {
345344
346- strTS a1 = beamModeHist .get (i );
345+ TimestampedString a1 = beamModeHist .get (i );
347346
348347 if (a1 .value .equalsIgnoreCase (stableBeamName )) {
349348 ans = a1 .time ;
@@ -367,7 +366,7 @@ public long getStableBeamStop() {
367366
368367 for (int i = beamModeHist .size () - 1 ; i >= 0 ; i --) {
369368
370- strTS a1 = beamModeHist .get (i );
369+ TimestampedString a1 = beamModeHist .get (i );
371370 if (a1 .value .equalsIgnoreCase (stableBeamName )) {
372371 idx = i ;
373372 break ;
@@ -384,7 +383,7 @@ public long getStableBeamStop() {
384383 return endedTime ;
385384 }
386385 }
387- strTS a2 = beamModeHist .get (idx + 1 );
386+ TimestampedString a2 = beamModeHist .get (idx + 1 );
388387
389388 long sbstop = a2 .time ;
390389
@@ -399,7 +398,7 @@ public int getStableBeamDuration() {
399398 return 0 ;
400399
401400 if (beamModeHist .size () == 1 ) {
402- strTS a1 = beamModeHist .get (0 );
401+ TimestampedString a1 = beamModeHist .get (0 );
403402 if (a1 .value .equalsIgnoreCase (stableBeamName ) && (endedTime > 0 )) {
404403 long dt = endedTime - a1 .time ;
405404 int ans = (int ) (dt / 1000 );
@@ -417,14 +416,14 @@ public int getStableBeamDuration() {
417416
418417 for (int i = 0 ; i < (beamModeHist .size () - 1 ); i ++) {
419418
420- strTS a1 = beamModeHist .get (i );
421- strTS a2 = beamModeHist .get (i + 1 );
419+ TimestampedString a1 = beamModeHist .get (i );
420+ TimestampedString a2 = beamModeHist .get (i + 1 );
422421 if (a1 .value .equalsIgnoreCase (stableBeamName )) {
423422 sum = sum + (a2 .time - a1 .time );
424423 }
425424 }
426425
427- strTS a3 = beamModeHist .get (beamModeHist .size () - 1 ); // last entry
426+ TimestampedString a3 = beamModeHist .get (beamModeHist .size () - 1 ); // last entry
428427
429428 if (a3 .value .equalsIgnoreCase (stableBeamName ) && (endedTime > 0 )) {
430429
0 commit comments