GUI/MainForm.cs
changeset 422 0fe7d6e91094
parent 421 055a9ec117d2
child 431 0e46e3ca812a
     1.1 --- a/GUI/MainForm.cs	Sun Aug 18 21:44:08 2013 +0000
     1.2 +++ b/GUI/MainForm.cs	Sun Aug 25 19:13:35 2013 +0000
     1.3 @@ -67,6 +67,7 @@
     1.4      private HttpServer server;
     1.5  
     1.6      private UserOption logSensors;
     1.7 +    private UserRadioGroup loggingInterval;
     1.8      private Logger logger;
     1.9  
    1.10      private bool selectionDragging = false;
    1.11 @@ -283,7 +284,31 @@
    1.12        };
    1.13  
    1.14        logSensors = new UserOption("logSensorsMenuItem", false, logSensorsMenuItem,
    1.15 -        settings);      
    1.16 +        settings);
    1.17 +
    1.18 +      loggingInterval = new UserRadioGroup("loggingInterval", 0,
    1.19 +        new[] { log1sMenuItem, log2sMenuItem, log5sMenuItem, log10sMenuItem,
    1.20 +        log30sMenuItem, log1minMenuItem, log2minMenuItem, log5minMenuItem, 
    1.21 +        log10minMenuItem, log30minMenuItem, log1hMenuItem, log2hMenuItem, 
    1.22 +        log6hMenuItem},
    1.23 +        settings);
    1.24 +      loggingInterval.Changed += (sender, e) => {
    1.25 +        switch (loggingInterval.Value) {
    1.26 +          case 0: logger.LoggingInterval = new TimeSpan(0, 0, 1); break;
    1.27 +          case 1: logger.LoggingInterval = new TimeSpan(0, 0, 2); break;
    1.28 +          case 2: logger.LoggingInterval = new TimeSpan(0, 0, 5); break;
    1.29 +          case 3: logger.LoggingInterval = new TimeSpan(0, 0, 10); break;
    1.30 +          case 4: logger.LoggingInterval = new TimeSpan(0, 0, 30); break;
    1.31 +          case 5: logger.LoggingInterval = new TimeSpan(0, 1, 0); break;
    1.32 +          case 6: logger.LoggingInterval = new TimeSpan(0, 2, 0); break;
    1.33 +          case 7: logger.LoggingInterval = new TimeSpan(0, 5, 0); break;
    1.34 +          case 8: logger.LoggingInterval = new TimeSpan(0, 10, 0); break;
    1.35 +          case 9: logger.LoggingInterval = new TimeSpan(0, 30, 0); break;
    1.36 +          case 10: logger.LoggingInterval = new TimeSpan(1, 0, 0); break;
    1.37 +          case 11: logger.LoggingInterval = new TimeSpan(2, 0, 0); break;
    1.38 +          case 12: logger.LoggingInterval = new TimeSpan(6, 0, 0); break;
    1.39 +        }
    1.40 +      };
    1.41  
    1.42        InitializePlotForm();
    1.43