コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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");
            }
        }
コード例 #3
0
        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");
            }
        }
コード例 #4
0
 public SgetDatapointDefinition(Guid id, string uri, UicDataType dataType, string label, string description)
 {
     Id          = id;
     Label       = label;
     Description = description;
     Uri         = uri;
     DataType    = dataType;
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 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;
 }