@@ -32,7 +32,7 @@ namespace microdata {
3232
3333 return "E," + config . measurements + "," + config . inequality + "," + config . comparator
3434 }
35-
35+
3636 const enum GUI_STATE {
3737 SENSOR_SELECT ,
3838 SENSOR_SELECT_CONFIG_ROW ,
@@ -55,7 +55,7 @@ namespace microdata {
5555 "Period Event" , // PERIOD_OR_EVENT; Add space to account for the line that separates them when drawn - this is drawn as a switch.
5656 "Done" // DONE
5757 ]
58-
58+
5959 const GUI_TEXT_EVENT_CONFIG = [ "choose inequality" , "compared against" ]
6060 const enum GUI_TEXT_EVENT_INDEX {
6161 INEQUALITY ,
@@ -110,7 +110,7 @@ namespace microdata {
110110
111111 for ( let i = 0 ; i < this . sensors . length ; i ++ ) {
112112 this . sensorConfigIsSet . push ( false )
113- this . sensorConfigs . push ( { measurements : 10 , period : 1000 , inequality : null , comparator : null } ) // Defaults per sensor
113+ this . sensorConfigs . push ( { measurements : 10 , period : 1000 , inequality : null , comparator : null } ) // Defaults per sensor
114114
115115 this . guiConfigValues [ i ] = GUI_PERIOD_DEFAULTS
116116 }
@@ -138,13 +138,13 @@ namespace microdata {
138138 for ( let i = 0 ; i < this . sensors . length ; i ++ ) {
139139 if ( ! this . sensorConfigIsSet [ i ] ) {
140140 // Reset GUI state:
141- this . configurationIndex = CONFIG_ROW . MEASUREMENT_QTY
142- this . eventOrPeriodIndex = 0
143- this . guiState = GUI_STATE . SENSOR_SELECT
141+ this . configurationIndex = CONFIG_ROW . MEASUREMENT_QTY
142+ this . eventOrPeriodIndex = 0
143+ this . guiState = GUI_STATE . SENSOR_SELECT
144144 return
145145 }
146146 }
147-
147+
148148 this . app . popScene ( )
149149
150150 if ( this . nextSceneEnum == CursorSceneEnum . DistributedLogging ) {
@@ -200,7 +200,7 @@ namespace microdata {
200200 }
201201 this . guiState = GUI_STATE . SENSOR_SELECT_CONFIG_ROW
202202 break ;
203- }
203+ }
204204 }
205205 break
206206 }
@@ -268,7 +268,7 @@ namespace microdata {
268268 // basic.showNumber(this.guiConfigValues[this.sensorIndex][this.eventOrPeriodIndex])
269269 }
270270 break ;
271- }
271+ }
272272 }
273273 }
274274 this . update ( )
@@ -296,11 +296,11 @@ namespace microdata {
296296 }
297297 case CONFIG_ROW . PERIOD_OR_EVENT : {
298298 if ( this . currentConfigMode == CONFIG_MODE . EVENT ) {
299- if ( this . eventOrPeriodIndex == GUI_TEXT_EVENT_INDEX . COMPARATOR ) {
299+ if ( this . eventOrPeriodIndex == GUI_TEXT_EVENT_INDEX . COMPARATOR ) {
300300 if ( this . guiConfigValues [ this . sensorIndex ] [ this . eventOrPeriodIndex ] - 1 < this . sensors [ this . sensorIndex ] . getMinimum ( ) )
301301 this . guiConfigValues [ this . sensorIndex ] [ this . eventOrPeriodIndex ] = this . sensors [ this . sensorIndex ] . getMaximum ( )
302302 else
303- this . guiConfigValues [ this . sensorIndex ] [ this . eventOrPeriodIndex ] -= 1
303+ this . guiConfigValues [ this . sensorIndex ] [ this . eventOrPeriodIndex ] -= 1
304304 }
305305 else if ( this . eventOrPeriodIndex == GUI_TEXT_EVENT_INDEX . INEQUALITY ) {
306306 const qty = sensorEventSymbols . length
@@ -312,7 +312,7 @@ namespace microdata {
312312 this . guiConfigValues [ this . sensorIndex ] [ this . eventOrPeriodIndex ] = Math . max ( this . guiConfigValues [ this . sensorIndex ] [ this . eventOrPeriodIndex ] - 1 , 0 )
313313 }
314314 break ;
315- }
315+ }
316316 }
317317 }
318318 this . update ( )
@@ -339,7 +339,7 @@ namespace microdata {
339339 else if ( this . currentConfigMode == CONFIG_MODE . EVENT )
340340 this . eventOrPeriodIndex = ( ( ( this . eventOrPeriodIndex - 1 ) % qty ) + qty ) % qty
341341 break ;
342- }
342+ }
343343 }
344344 }
345345 this . update ( )
@@ -365,14 +365,14 @@ namespace microdata {
365365 else if ( this . currentConfigMode == CONFIG_MODE . EVENT )
366366 this . eventOrPeriodIndex = ( this . eventOrPeriodIndex + 1 ) % GUI_TEXT_EVENT_CONFIG . length
367367 break ;
368- }
368+ }
369369 }
370370 }
371371 this . update ( )
372372 }
373373 )
374374 }
375-
375+
376376 update ( ) {
377377 Screen . fillRect (
378378 Screen . LEFT_EDGE ,
@@ -449,15 +449,15 @@ namespace microdata {
449449 //-----------------------
450450
451451 let periodEventStart = Screen . HALF_HEIGHT
452-
452+
453453 // Push to just above Done if Measurements selected, if selected push to just below Measurements:
454454 if ( this . guiState == GUI_STATE . SENSOR_MODIFY_CONFIG_ROW ) {
455455 if ( this . configurationIndex == CONFIG_ROW . MEASUREMENT_QTY )
456456 periodEventStart = Screen . HEIGHT - ( Screen . HEIGHT * 0.3046 ) // -39
457457 else
458458 periodEventStart = yStart + font . charHeight + ( Screen . HEIGHT * 0.08593 ) // + 11 // yStart + font.charHeight + (Screen.HEIGHT * 0.08593)
459459 }
460-
460+
461461 screen ( ) . fillRect (
462462 0 ,
463463 periodEventStart ,
@@ -474,16 +474,16 @@ namespace microdata {
474474 7 // green
475475 ) // Coloured border ontop
476476
477-
477+
478478 //-----------------------------------------------
479479 // Period text & block: Draw as an on/off switch:
480480 //-----------------------------------------------
481481
482482 // Draw as an on-off switch:
483483 const periodBlockColour = ( this . currentConfigMode == CONFIG_MODE . PERIOD ) ? 7 : 1 // Green vs White
484- const eventBlockColour = ( this . currentConfigMode == CONFIG_MODE . EVENT ) ? 7 : 1 // Green vs White
485- const periodTextColour = 15
486- const eventTextColour = 15
484+ const eventBlockColour = ( this . currentConfigMode == CONFIG_MODE . EVENT ) ? 7 : 1 // Green vs White
485+ const periodTextColour = 15
486+ const eventTextColour = 15
487487
488488 screen ( ) . fillRect (
489489 0 ,
@@ -492,7 +492,7 @@ namespace microdata {
492492 font . charHeight + ( Screen . HEIGHT * 0.07 ) , // 9
493493 periodBlockColour
494494 ) // Coloured border ontop
495-
495+
496496 screen ( ) . print (
497497 "Period" ,
498498 headerX - 2 ,
@@ -522,7 +522,7 @@ namespace microdata {
522522 font . charHeight + ( Screen . HEIGHT * 0.07 ) , // 9 // Screen.HEIGHT * 0.1328, // 17,
523523 eventBlockColour
524524 ) // Coloured border ontop
525-
525+
526526 screen ( ) . print (
527527 " Event" , // Space for "Period" + " " (3 spaces)
528528 headerX - 2 ,
@@ -625,7 +625,7 @@ namespace microdata {
625625 yWindowStart + ( Screen . HEIGHT * 0.0468 ) , // 6
626626 15 // black
627627 )
628-
628+
629629 const measurementsText = this . sensorConfigs [ this . sensorIndex ] . measurements . toString ( )
630630 screen ( ) . printCenter (
631631 measurementsText ,
@@ -634,7 +634,7 @@ namespace microdata {
634634 )
635635
636636 screen ( ) . drawRect (
637- Screen . HALF_WIDTH - ( ( measurementsText . length * font . charWidth ) >> 1 ) - 4 ,
637+ Screen . HALF_WIDTH - ( ( measurementsText . length * font . charWidth ) >> 1 ) - 4 ,
638638 yWindowStart + ( Screen . HEIGHT * 0.1640 ) , // 21
639639 ( measurementsText . length * font . charWidth ) + 8 ,
640640 ( Screen . HEIGHT * 0.1093 ) , // 13
@@ -643,10 +643,10 @@ namespace microdata {
643643
644644 break ;
645645 }
646-
646+
647647 case CONFIG_ROW . PERIOD_OR_EVENT : {
648- const yPeriodOrEventWindowStart = periodEventStart + font . charHeight
649-
648+ const yPeriodOrEventWindowStart = periodEventStart + font . charHeight
649+
650650 screen ( ) . fillRect (
651651 2 ,
652652 yPeriodOrEventWindowStart + ( Screen . HEIGHT * 0.0859 ) , // 11
@@ -688,7 +688,7 @@ namespace microdata {
688688 switch ( this . eventOrPeriodIndex ) {
689689 case 0 :
690690 screen ( ) . drawRect (
691- Screen . HALF_WIDTH - ( ( expression . length * font . charWidth ) >> 1 ) + ( ( sensor . getName ( ) . length + 1 ) * font . charWidth ) - 4 ,
691+ Screen . HALF_WIDTH - ( ( expression . length * font . charWidth ) >> 1 ) + ( ( sensor . getName ( ) . length + 1 ) * font . charWidth ) - 4 ,
692692 Screen . HALF_HEIGHT + ( Screen . HEIGHT * 0.09375 ) , // 12
693693 ( inequalitySymbol . length * font . charWidth ) + 8 ,
694694 Screen . HEIGHT * 0.109 , // 14
@@ -698,14 +698,14 @@ namespace microdata {
698698
699699 case 1 :
700700 screen ( ) . drawRect (
701- Screen . HALF_WIDTH - ( ( expression . length * font . charWidth ) >> 1 ) + ( ( sensor . getName ( ) + " " + inequalitySymbol + " " ) . length * font . charWidth ) - 4 ,
701+ Screen . HALF_WIDTH - ( ( expression . length * font . charWidth ) >> 1 ) + ( ( sensor . getName ( ) + " " + inequalitySymbol + " " ) . length * font . charWidth ) - 4 ,
702702 Screen . HALF_HEIGHT + ( Screen . HEIGHT * 0.09375 ) , // 12
703703 ( inequalityOperand . length * font . charWidth ) + 8 ,
704704 Screen . HEIGHT * 0.109 , // 13
705705 5 // yellow
706706 )
707707 break ;
708-
708+
709709 default :
710710 break ;
711711 }
@@ -728,7 +728,7 @@ namespace microdata {
728728 for ( let col = 0 ; col < this . guiConfigValues [ this . sensorIndex ] . length ; col ++ ) {
729729 if ( col == this . eventOrPeriodIndex ) {
730730 screen ( ) . drawRect (
731- Screen . HALF_WIDTH - ( ( periodConfigString . length * font . charWidth ) >> 1 ) + ( distance * font . charWidth ) - 4 ,
731+ Screen . HALF_WIDTH - ( ( periodConfigString . length * font . charWidth ) >> 1 ) + ( distance * font . charWidth ) - 4 ,
732732 Screen . HALF_HEIGHT + ( Screen . HEIGHT * 0.0625 ) , // 8
733733 ( this . guiConfigValues [ this . sensorIndex ] [ this . eventOrPeriodIndex ] . toString ( ) . length * font . charWidth ) + 8 ,
734734 ( Screen . HEIGHT * 0.1171 ) , // 15
@@ -768,7 +768,7 @@ namespace microdata {
768768 font . charHeight + ( Screen . HEIGHT * 0.0703 ) , // 9
769769 15 // black
770770 )
771-
771+
772772 screen ( ) . fillRect (
773773 1 ,
774774 headerY + ( row * rowSize ) - ( Screen . HEIGHT * 0.023437 ) , // 3
@@ -788,7 +788,7 @@ namespace microdata {
788788 6
789789 ) // Highlight selected in blue
790790 }
791- }
791+ }
792792
793793 screen ( ) . print (
794794 this . sensors [ row ] . getName ( ) ,
@@ -799,4 +799,4 @@ namespace microdata {
799799 }
800800 }
801801 }
802- }
802+ }
0 commit comments