Exemplo n.º 1
0
        public LoggerController(LoggerGui loggerGui)
        {
            this.loggerGui = loggerGui;
            secTicker = new Services.Ticker(1000);
            modeSecTicker = new Services.Ticker(1000);
            measurementSecTicker = new Services.Ticker(1000);
            clock = new Services.Clock();

            // Listen to ButtonClick Events in GUI.
            loggerGui.modeButtonClick += OnModeButtonClick;
            loggerGui.startStopEvent += OnStartStopEvent;
            // Listen to Tick Events of Ticker.
            secTicker.tick += OnTick;
            modeSecTicker.tick += OnTick;
            measurementSecTicker.tick += OnTick;

            // Create new mode manager and listen to its Events.
            modeManager = new Services.ModeManager();
            modeManager.newActiveModeEvent += OnNewActiveModeEvent;
            // Initialize all modes in gui.
            loggerGui.InitializeModes(modeManager);

            // Disable all mode buttons at start of software.
            loggerGui.EnableModeButtons(false);
            loggerGui.EnableStartStopButtons(true);
            loggerGui.ResetModeCounters();
            loggerGui.ResetTimeInMode();
            loggerGui.ResetLog();

            // Start the ticker to get current time
            secTicker.StartTicker();
        }
Exemplo n.º 2
0
        public LoggerController(LoggerGui loggerGui)
        {
            this.loggerGui       = loggerGui;
            secTicker            = new Services.Ticker(1000);
            modeSecTicker        = new Services.Ticker(1000);
            measurementSecTicker = new Services.Ticker(1000);
            clock = new Services.Clock();

            // Listen to ButtonClick Events in GUI.
            loggerGui.modeButtonClick += OnModeButtonClick;
            loggerGui.startStopEvent  += OnStartStopEvent;
            // Listen to Tick Events of Ticker.
            secTicker.tick            += OnTick;
            modeSecTicker.tick        += OnTick;
            measurementSecTicker.tick += OnTick;

            // Create new mode manager and listen to its Events.
            modeManager = new Services.ModeManager();
            modeManager.newActiveModeEvent += OnNewActiveModeEvent;
            // Initialize all modes in gui.
            loggerGui.InitializeModes(modeManager);

            // Disable all mode buttons at start of software.
            loggerGui.EnableModeButtons(false);
            loggerGui.EnableStartStopButtons(true);
            loggerGui.ResetModeCounters();
            loggerGui.ResetTimeInMode();
            loggerGui.ResetLog();

            // Start the ticker to get current time
            secTicker.StartTicker();
        }