Exemplo n.º 1
0
        public RfidMonitor(RFID rfid, ILoggerDisplay display)
        {
            _rfid = rfid;
            _display = display;

            _rfid.CardIDReceived += RfidCardIdReceived;
        }
        public StatusMessageMonitor(Relay_X1 relayX1, ILoggerDisplay loggerDisplay)
        {
            _relayX1 = relayX1;
            _loggerDisplay = loggerDisplay;
            _username = "******" + Globals.UserName.ToLower();

            // Check status messages every x seconds
            _statusCheckTimer = new Gadgeteer.Timer(StatusCheckInterval);
            _statusCheckTimer.Tick += StatusCheckTimerTick;
        }
Exemplo n.º 3
0
        public Monitor(TemperatureReader temperatureReader, ILoggerDisplay loggerDisplay)
        {
            _temperatureReader = temperatureReader;
            _temperatureReader.MeasurementComplete += TemperatureReaderMeasurementComplete;
            _temperatureReader.LightLevelMeasurementComplete += _temperatureReader_LightLevelMeasurementComplete;
            _loggerDisplay = loggerDisplay;
            _timer = new Timer(new TimeSpan(0, 0, 1, 0));
            _timer.Tick += _timer_Tick;

            Pressure = "2";
            _hasPressure = true;
        }
Exemplo n.º 4
0
        public TemperatureReader(TemperatureHumidity temperatureHumidity, LightSensor lightSensor, ILoggerDisplay loggerDisplay)
        {
            if (temperatureHumidity == null) throw new ArgumentNullException("temperatureHumidity");
            if (lightSensor == null) throw new ArgumentNullException("lightSensor");
            if (loggerDisplay == null) throw new ArgumentNullException("loggerDisplay");

            _temperatureHumidity = temperatureHumidity;
            _lightSensor = lightSensor;
            _temperatureHumidity.MeasurementComplete += TemperatureHumidityMeasurementComplete;

            _loggerDisplay = loggerDisplay;

            // Take measurement on timer tick
            // and hence update UI and Monitor.
            _temperatureCheckTimer.Tick += TemperatureCheckTimerTick;
        }