예제 #1
0
        private void GetCargoList()
        {
            ICargoService  cargoService  = new CargoService(employee.Username, employee.Password);
            ISensorService sensorService = new SensorService(employee.Username, employee.Password);
            List <Cargo>   cargos        = cargoService.All();
            List <Sensor>  sensors       = sensorService.All();
            Sensor         sensor        = sensors.Single(s => s.Sensor_name == SelectedDevice.ID.ToString());

            CargoList = new ObservableCollection <Cargo>(cargos.Where(c => c.Sensor_id == sensor.Sensor_id));
        }
예제 #2
0
        private void GetSensor()
        {
            ISensorService sensorService = new SensorService(employee.Username, employee.Password);

            dataSensor = new SensorData()
            {
                Sensor       = sensorService.All().Single(s => s.Sensor_name == device.ID.ToString()),
                Temperature  = 0,
                Gyroscope    = 0,
                Acceleration = 0,
                Humidity     = 0,
                Light        = 0,
                Magnetism    = 0,
                Pressure     = 0
            };
        }