public static EventObservationSpec FromSensor(ISensor sensor) { var obsSpec = sensor.GetObservationSpec(); var shape = obsSpec.Shape; var dimProps = obsSpec.DimensionProperties; var dimInfos = new EventObservationDimensionInfo[shape.Length]; for (var i = 0; i < shape.Length; i++) { dimInfos[i].Size = shape[i]; dimInfos[i].Flags = (int)dimProps[i]; } var builtInSensorType = (sensor as IBuiltInSensor)?.GetBuiltInSensorType() ?? Sensors.BuiltInSensorType.Unknown; return(new EventObservationSpec { SensorName = sensor.GetName(), CompressionType = sensor.GetCompressionSpec().SensorCompressionType.ToString(), BuiltInSensorType = (int)builtInSensorType, ObservationType = (int)obsSpec.ObservationType, DimensionInfos = dimInfos, }); }
public static EventObservationSpec FromSensor(ISensor sensor) { var shape = sensor.GetObservationShape(); var dimInfos = new EventObservationDimensionInfo[shape.Length]; for (var i = 0; i < shape.Length; i++) { dimInfos[i].Size = shape[i]; // TODO copy flags when we have them } return(new EventObservationSpec { SensorName = sensor.GetName(), CompressionType = sensor.GetCompressionType().ToString(), DimensionInfos = dimInfos, }); }
public static EventObservationSpec FromSensor(ISensor sensor) { var shape = sensor.GetObservationShape(); var dimInfos = new EventObservationDimensionInfo[shape.Length]; for (var i = 0; i < shape.Length; i++) { dimInfos[i].Size = shape[i]; // TODO copy flags when we have them } var builtInSensorType = (sensor as IBuiltInSensor)?.GetBuiltInSensorType() ?? Sensors.BuiltInSensorType.Unknown; return(new EventObservationSpec { SensorName = sensor.GetName(), CompressionType = sensor.GetCompressionType().ToString(), BuiltInSensorType = (int)builtInSensorType, DimensionInfos = dimInfos, }); }