Ejemplo n.º 1
3
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceResult"/> class.
 /// </summary>
 /// <param name="code">A code.</param>
 /// <param name="symbolicId">A symbolicId.</param>
 /// <param name="namespaceUri">A namespaceUri.</param>
 /// <param name="localizedText">A localizedText.</param>
 /// <param name="additionalInfo">AdditionalInfo.</param>
 /// <param name="innerResult">An innerResult</param>
 public ServiceResult(StatusCode code, string symbolicId = null, string namespaceUri = null, LocalizedText localizedText = null, string additionalInfo = null, ServiceResult innerResult = null)
 {
     this.StatusCode = code;
     this.SymbolicId = symbolicId;
     this.NamespaceUri = namespaceUri;
     this.LocalizedText = localizedText;
     this.AdditionalInfo = additionalInfo;
     this.InnerResult = innerResult;
 }
Ejemplo n.º 2
0
 public Variant(LocalizedText value)
 {
     this.Value           = value;
     this.Type            = VariantType.LocalizedText;
     this.ArrayDimensions = null;
 }
        public virtual void Decode(IDecoder decoder) {
            decoder.PushNamespace("http://opcfoundation.org/UA/2008/02/Types.xsd");
			Value = decoder.ReadInt64("Value");
			DisplayName = decoder.ReadLocalizedText("DisplayName");
			Description = decoder.ReadLocalizedText("Description");
            decoder.PopNamespace();
        }
        public virtual void Decode(IDecoder decoder) {
            decoder.PushNamespace("http://opcfoundation.org/UA/2008/02/Types.xsd");
			Name = decoder.ReadString("Name");
			DataType = decoder.ReadNodeId("DataType");
			ValueRank = decoder.ReadInt32("ValueRank");
			ArrayDimensions = decoder.ReadUInt32Array("ArrayDimensions");
			Description = decoder.ReadLocalizedText("Description");
            decoder.PopNamespace();
        }
        public virtual void Decode(IDecoder decoder) {
            decoder.PushNamespace("http://opcfoundation.org/UA/2008/02/Types.xsd");
			NamespaceUri = decoder.ReadString("NamespaceUri");
			UnitId = decoder.ReadInt32("UnitId");
			DisplayName = decoder.ReadLocalizedText("DisplayName");
			Description = decoder.ReadLocalizedText("Description");
            decoder.PopNamespace();
        }
        public virtual void Decode(IDecoder decoder) {
            decoder.PushNamespace("http://opcfoundation.org/UA/2008/02/Types.xsd");
			StartTime = decoder.ReadDateTime("StartTime");
			CurrentTime = decoder.ReadDateTime("CurrentTime");
			State = decoder.ReadEnumeration<ServerState>("State");
			BuildInfo = decoder.ReadEncodable<BuildInfo>("BuildInfo");
			SecondsTillShutdown = decoder.ReadUInt32("SecondsTillShutdown");
			ShutdownReason = decoder.ReadLocalizedText("ShutdownReason");
            decoder.PopNamespace();
        }
        public override void Decode(IDecoder decoder) {
			base.Decode(decoder);
            decoder.PushNamespace("http://opcfoundation.org/UA/2008/02/Types.xsd");
			IsAbstract = decoder.ReadBoolean("IsAbstract");
			Symmetric = decoder.ReadBoolean("Symmetric");
			InverseName = decoder.ReadLocalizedText("InverseName");
            decoder.PopNamespace();
        }
 public override void Deserialize(Variant[] fields)
 {
     base.Deserialize(fields);
     this.AckedState = fields[9].GetValueOrDefault<LocalizedText>();
     this.ConfirmedState = fields[10].GetValueOrDefault<LocalizedText>();
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Confirms a condition.
        /// </summary>
        /// <param name="channel">The channel.</param>
        /// <param name="condition">an AcknowledgeableCondition.</param>
        /// <param name="comment">a comment.</param>
        /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
        public static async Task <StatusCode> ConfirmAsync(this IRequestChannel channel, AcknowledgeableCondition condition, LocalizedText comment = null)
        {
            if (condition == null)
            {
                throw new ArgumentNullException(nameof(condition));
            }

            var response = await channel.CallAsync(new CallRequest
            {
                MethodsToCall = new[]
                {
                    new CallMethodRequest
                    {
                        ObjectId       = condition.ConditionId,
                        MethodId       = NodeId.Parse(MethodIds.AcknowledgeableConditionType_Confirm),
                        InputArguments = new Variant[] { condition.EventId, comment } // ?? new LocalizedText(string.Empty) }
                    }
                }
            });

            return(response.Results[0].StatusCode);
        }
Ejemplo n.º 10
0
 public override void Deserialize(Variant[] fields)
 {
     base.Deserialize(fields);
     this.ActiveState = fields[12].GetValueOrDefault <LocalizedText>();
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Confirms a condition.
        /// </summary>
        /// <param name="condition">an AcknowledgeableCondition.</param>
        /// <param name="comment">a comment.</param>
        /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
        public async Task <StatusCode> ConfirmAsync(AcknowledgeableCondition condition, LocalizedText comment = null)
        {
            if (condition == null)
            {
                throw new ArgumentNullException(nameof(condition));
            }

            if (this.State != CommunicationState.Opened)
            {
                return(StatusCodes.BadServerNotConnected);
            }

            return(await this.InnerChannel.ConfirmAsync(condition, comment));
        }
Ejemplo n.º 12
0
 public Variant(LocalizedText[] value)
 {
     this.Value = value;
     this.Type = VariantType.LocalizedText;
     this.ArrayDimensions = new int[value.Rank];
     for (int i = 0; i < value.Rank; i++)
     {
         this.ArrayDimensions[i] = value.GetLength(i);
     }
 }
Ejemplo n.º 13
0
 public Variant(LocalizedText value)
 {
     this.Value = value;
     this.Type = VariantType.LocalizedText;
     this.ArrayDimensions = null;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceResult"/> class.
 /// </summary>
 /// <param name="code">A code.</param>
 /// <param name="symbolicId">A symbolicId.</param>
 /// <param name="namespaceUri">A namespaceUri.</param>
 /// <param name="localizedText">A localizedText.</param>
 /// <param name="additionalInfo">AdditionalInfo.</param>
 /// <param name="innerResult">An innerResult</param>
 public ServiceResult(StatusCode code, string symbolicId = null, string namespaceUri = null, LocalizedText localizedText = null, string additionalInfo = null, ServiceResult innerResult = null)
 {
     this.StatusCode     = code;
     this.SymbolicId     = symbolicId;
     this.NamespaceUri   = namespaceUri;
     this.LocalizedText  = localizedText;
     this.AdditionalInfo = additionalInfo;
     this.InnerResult    = innerResult;
 }
Ejemplo n.º 15
0
 public override void Deserialize(Variant[] fields)
 {
     base.Deserialize(fields);
     this.ActiveState = fields[11].GetValueOrDefault<LocalizedText>();
 }