private SensorCloud.Sensor getSensor(SensorCloud.Device device) { var sensor = device.GetSensor(this.DPDeviceID.ToString()); return sensor; }
private SensorCloud.Sensor addSensor(SensorCloud.Device device, Device DPDevice) { SensorCloud.Sensor sensor = null; if (!device.HasSensor(this.DPDeviceID.ToString())) { sensor = device.AddSensor(this.DPDeviceID.ToString(), DPDevice.Name, DPDevice.ProductType.Name, DPDevice.SerialNumber); } else { sensor = getSensor(device); } return sensor; }
private SensorCloud.Channel getChannel(SensorCloud.Sensor sensor, string channelID) { SensorCloud.Channel channel = sensor.GetChannel(channelID); return channel; }
private SensorCloud.Channel addChannel(SensorCloud.Sensor sensor, string channelID, string label, string description) { SensorCloud.Channel channel = null; if (!sensor.HasChannel(channelID)) { channel = sensor.AddChannel(channelID, label, description); } return channel; }