GUI/SoundGraphDisplay.cs
branchMiniDisplay
changeset 439 06369ace500d
parent 438 f590956d3234
child 442 782b48689513
     1.1 --- a/GUI/SoundGraphDisplay.cs	Sat Apr 13 00:43:25 2013 +0200
     1.2 +++ b/GUI/SoundGraphDisplay.cs	Sun Apr 14 22:38:41 2013 +0200
     1.3 @@ -36,7 +36,8 @@
     1.4          private List<SensorFrontView> list = new List<SensorFrontView>();
     1.5          private SoundGraph.Server iServer;
     1.6  
     1.7 -        private int nextSensorToDisplay=0;
     1.8 +        private int iNextSensorToDisplay=0;
     1.9 +        private int iTickCounter=0;
    1.10  
    1.11  
    1.12          public SoundGraphDisplay(IComputer computer, PersistentSettings settings,
    1.13 @@ -112,7 +113,7 @@
    1.14  
    1.15          public void Redraw()
    1.16          {
    1.17 -            //TODO: construct our two lines of texts, scroll or alternate sensors
    1.18 +            //Update all sensors from our front view
    1.19              foreach (SensorFrontView sensor in list)
    1.20              {
    1.21                  sensor.Update();
    1.22 @@ -122,18 +123,22 @@
    1.23              //Alternate between sensors 
    1.24              if (list.Count > 0)
    1.25              {
    1.26 -                SetText(list[nextSensorToDisplay].iFirstLine, list[nextSensorToDisplay].iSecondLine);
    1.27 -                nextSensorToDisplay++;
    1.28 +                //Display current sensor on our FrontView display
    1.29 +                SetText(list[iNextSensorToDisplay].iFirstLine, list[iNextSensorToDisplay].iSecondLine);
    1.30 +                iTickCounter++;
    1.31 +                if (iTickCounter==2) //Move to the next sensor only every second tick
    1.32 +                {
    1.33 +                    iTickCounter = 0;
    1.34 +                    iNextSensorToDisplay++;
    1.35 +                }
    1.36              }
    1.37  
    1.38 -            if (nextSensorToDisplay == list.Count)
    1.39 +            if (iNextSensorToDisplay == list.Count)
    1.40              {
    1.41                  //Go back to first sensor
    1.42 -                nextSensorToDisplay = 0;
    1.43 +                iNextSensorToDisplay = 0;
    1.44              }
    1.45  
    1.46 -
    1.47 -            //
    1.48              
    1.49          }
    1.50  
    1.51 @@ -157,7 +162,7 @@
    1.52                  list.Add(new SensorFrontView(this, sensor, balloonTip, settings, unitManager));
    1.53                  //UpdateMainIconVisibilty();
    1.54                  settings.SetValue(new Identifier(sensor.Identifier, "FrontView").ToString(), true);
    1.55 -                nextSensorToDisplay = 0;
    1.56 +                iNextSensorToDisplay = 0;
    1.57              }
    1.58  
    1.59          }
    1.60 @@ -165,7 +170,7 @@
    1.61          public void Remove(ISensor sensor)
    1.62          {
    1.63              Remove(sensor, true);
    1.64 -            nextSensorToDisplay = 0;
    1.65 +            iNextSensorToDisplay = 0;
    1.66          }
    1.67  
    1.68          private void Remove(ISensor sensor, bool deleteConfig)