/// <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;
 }
Esempio 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>();
 }
Esempio 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);
        }
Esempio n. 10
0
 public override void Deserialize(Variant[] fields)
 {
     base.Deserialize(fields);
     this.ActiveState = fields[12].GetValueOrDefault <LocalizedText>();
 }
Esempio 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));
        }
Esempio 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);
     }
 }
Esempio n. 13
0
 public Variant(LocalizedText value)
 {
     this.Value = value;
     this.Type = VariantType.LocalizedText;
     this.ArrayDimensions = null;
 }
Esempio 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;
 }
 public override void Deserialize(Variant[] fields)
 {
     base.Deserialize(fields);
     this.ActiveState = fields[11].GetValueOrDefault<LocalizedText>();
 }