private SGetCloudMapperDataType Translate(UicDataType dataType) { switch (dataType) { case UicDataType.String: return(SGetCloudMapperDataType.String); case UicDataType.Integer: return(SGetCloudMapperDataType.Int); case UicDataType.Double: return(SGetCloudMapperDataType.Double); case UicDataType.Byte: return(SGetCloudMapperDataType.Unknown); case UicDataType.Gps: return(SGetCloudMapperDataType.Gps); case UicDataType.Picture: return(SGetCloudMapperDataType.Unknown); case UicDataType.Bool: return(SGetCloudMapperDataType.Boolean); case UicDataType.Unknown: return(SGetCloudMapperDataType.Unknown); default: throw new ArgumentOutOfRangeException(nameof(dataType), dataType, null); } }
private int GetM2mgoDataTypeOf(UicDataType type) { switch (type) { case UicDataType.Unknown: return((int)SensorDataType.Unknown); case UicDataType.Integer: return((int)SensorDataType.Integer); case UicDataType.Double: return((int)SensorDataType.Double); case UicDataType.Bool: return((int)SensorDataType.Boolean); case UicDataType.Gps: return((int)SensorDataType.Gps); case UicDataType.String: return((int)SensorDataType.String); default: throw new ArgumentOutOfRangeException("type"); } }
public string GetRandomValueOf(UicDataType type) { switch (type) { case UicDataType.Unknown: return("Unknown"); case UicDataType.Integer: int intResult = _random.Next(-100, 100); return(intResult.ToString(CultureInfo.InvariantCulture)); case UicDataType.Double: double doubleResult = _random.Next(-100, 100) + _random.NextDouble(); return(doubleResult.ToString("F3", CultureInfo.InvariantCulture)); case UicDataType.Bool: bool boolResult = ((_random.Next() % 2) == 0); return(boolResult.ToString(CultureInfo.InvariantCulture)); case UicDataType.Gps: return(""); case UicDataType.String: return(RandomString(5)); default: throw new ArgumentOutOfRangeException("type"); } }
public SgetDatapointDefinition(Guid id, string uri, UicDataType dataType, string label, string description) { Id = id; Label = label; Description = description; Uri = uri; DataType = dataType; }
public AttributeDefinitionImpl(Guid Id, string Label, string Description, UicDataType DataType, string Uri) { this.Id = Id; this.Label = Label; this.Description = Description; this.DataType = DataType; this.Uri = Uri; }
public SgetCommandDefinition(Guid id, string uri, string label, string command, UicDataType dataType, string description, DatapointDefinition relatedDatapoint, string[] tags) { Label = label; Command = command; DataType = dataType; Description = description; RelatedDatapoint = relatedDatapoint; Tags = tags; Uri = uri; Id = id; }