Exemple #1
0
        public VariableInfo(NodeId nodeId, string displayName)
        {
            InitializeClass(nodeId, displayName);

            this._value = NullDataValue;
        }
Exemple #2
0
        public void NewDataValue(DataValue dv)
        {
            var builtInType = dv?.WrappedValue.TypeInfo?.BuiltInType;

            switch (builtInType)
            {
            case BuiltInType.Null:
                this._value = new NullDataValue(dv);
                break;

            case BuiltInType.Boolean:
                this._value = new BooleanDataValue(dv);
                break;

            case BuiltInType.SByte:
                this._value = new SByteDataValue(dv);
                break;

            case BuiltInType.Byte:
                this._value = new ByteDataValue(dv);
                break;

            case BuiltInType.Int16:
                this._value = new Int16DataValue(dv);
                break;

            case BuiltInType.UInt16:
                this._value = new UInt16DataValue(dv);
                break;

            case BuiltInType.Int32:
                this._value = new Int32DataValue(dv);
                break;

            case BuiltInType.UInt32:
                this._value = new UInt32DataValue(dv);
                break;

            case BuiltInType.Int64:
                this._value = new Int64DataValue(dv);
                break;

            case BuiltInType.UInt64:
                this._value = new UInt64DataValue(dv);
                break;

            case BuiltInType.Float:
                this._value = new FloatDataValue(dv);
                break;

            case BuiltInType.Double:
                this._value = new DoubleDataValue(dv);
                break;

            case BuiltInType.String:
                this._value = new StringDataValue(dv);
                break;

            case BuiltInType.DateTime:
                this._value = new DateTimeDataValue(dv);
                break;

            default:
                this._value = new NullDataValue(dv);
                break;
            }

            this.RaisePropertyChanged("Value");
            this.RaisePropertyChanged("BoolValue");
            this.RaisePropertyChanged("PreparedValue");
            this.RaisePropertyChanged("Type");
            this.RaisePropertyChanged("FormatSelectedItem");
            this.RaisePropertyChanged("Formats");
            this.RaisePropertyChanged("FormatIsEnabled");
            this.RaisePropertyChanged("StatusCode");
            this.RaisePropertyChanged("ServerTimestamp");
            this.RaisePropertyChanged("SourceTimestamp");
        }