GUI/MainForm.cs
changeset 421 055a9ec117d2
parent 420 46c056e76130
child 422 0fe7d6e91094
     1.1 --- a/GUI/MainForm.cs	Sun Aug 11 21:26:56 2013 +0000
     1.2 +++ b/GUI/MainForm.cs	Sun Aug 18 21:44:08 2013 +0000
     1.3 @@ -150,6 +150,8 @@
     1.4          wmiProvider = new WmiProvider(computer);
     1.5        }
     1.6  
     1.7 +      logger = new Logger(computer);
     1.8 +
     1.9        plotColorPalette = new Color[13];
    1.10        plotColorPalette[0] = Color.Blue;
    1.11        plotColorPalette[1] = Color.OrangeRed;
    1.12 @@ -281,8 +283,7 @@
    1.13        };
    1.14  
    1.15        logSensors = new UserOption("logSensorsMenuItem", false, logSensorsMenuItem,
    1.16 -        settings);
    1.17 -      logger = new Logger(computer);
    1.18 +        settings);      
    1.19  
    1.20        InitializePlotForm();
    1.21  
    1.22 @@ -497,6 +498,7 @@
    1.23        Close();
    1.24      }
    1.25  
    1.26 +    private int delayCount = 0;
    1.27      private void timer_Tick(object sender, EventArgs e) {
    1.28        computer.Accept(updateVisitor);
    1.29        treeView.Invalidate();
    1.30 @@ -508,8 +510,12 @@
    1.31        if (wmiProvider != null)
    1.32          wmiProvider.Update();
    1.33  
    1.34 -      if (logSensors.Value)
    1.35 +
    1.36 +      if (logSensors.Value && delayCount >= 4)
    1.37          logger.Log();
    1.38 +
    1.39 +      if (delayCount < 4)
    1.40 +        delayCount++;
    1.41      }
    1.42  
    1.43      private void SaveConfiguration() {