Пример #1
0
 public SensorProcessor(Sensor Sensor)
 {
     DeviceNumber = 0;
     TransmissionType = 0;
     _Sensor = Sensor;
     Status = SensorStatus.Disconnected;
 }
Пример #2
0
        public void Search()
        {
            if (_Sensor == null)
            {
                _Sensor = SensorFactory.GetSensor(_SensorType);
            }
            if (_Sensor.Status == SensorStatus.Disconnected)
            {
                // Consoldate this with actual sensor and processor status
                _Sensor.Search();

            }
        }
Пример #3
0
 public void Initialise(SensorType deviceType)
 {
     _SensorType = deviceType;
     _Sensor = SensorFactory.GetSensor(_SensorType);
     _Sensor.SensorStatusChanged += new SensorStatusChangedHandler(StatusChanged);
     _Sensor.SensorMessage += new SensorMessageHandler(SensorMessageReceived);
     Name = _Sensor.Name;
 }
Пример #4
0
 // Unlike Initialise, Reinit takes serialized valuesa
 public void Reinitialise()
 {
     _Sensor = SensorFactory.GetSensor(_SensorType);
     // Do any pairing
     _Sensor.DeviceNumber = this.DeviceNumber;
     _Sensor.TransmissionType = this.TransmissionType;
     _Sensor.SensorStatusChanged += new SensorStatusChangedHandler(StatusChanged);
     _Sensor.SensorMessage += new SensorMessageHandler(SensorMessageReceived);
 }
Пример #5
0
        public void Disconnect()
        {
            if (_Sensor == null)
            {
                _Sensor = SensorFactory.GetSensor(_SensorType);
            }

            if (_Sensor.Status == SensorStatus.Connected)
            {
                _Sensor.Disconnect();
            }
        }