Esempio n. 1
0
 /// <summary>
 /// Manages a sensor data server request.
 /// </summary>
 /// <param name="Actor">Actor causing the request to be made.</param>
 /// <param name="Nodes">Array of nodes to read. Can be null or empty, if reading a sensor that is not a concentrator.</param>
 /// <param name="Types">Field Types to read.</param>
 /// <param name="Fields">Fields to read.</param>
 /// <param name="From">From what time readout is to be made. Use <see cref="DateTime.MinValue"/> to specify no lower limit.</param>
 /// <param name="To">To what time readout is to be made. Use <see cref="DateTime.MaxValue"/> to specify no upper limit.</param>
 /// <param name="OnFieldsReported">Callback method when fields are reported.</param>
 /// <param name="OnErrorsReported">Callback method when errors are reported.</param>
 /// <param name="State">State object passed on to callback methods.</param>
 public InternalReadoutRequest(string Actor, ThingReference[] Nodes, FieldType Types, string[] Fields, DateTime From, DateTime To,
                               InternalReadoutFieldsEventHandler OnFieldsReported, InternalReadoutErrorsEventHandler OnErrorsReported, object State)
     : base(string.Empty, null, string.Empty, Actor, Nodes, Types, Fields, From, To, DateTime.MinValue, string.Empty, string.Empty, string.Empty)
 {
     this.onFieldsReported = OnFieldsReported;
     this.onErrorsReported = OnErrorsReported;
     this.state            = State;
 }
Esempio n. 2
0
        /// <summary>
        /// Performs an internal readout.
        /// </summary>
        /// <param name="Actor">Actor causing the request to be made.</param>
        /// <param name="Nodes">Array of nodes to read. Can be null or empty, if reading a sensor that is not a concentrator.</param>
        /// <param name="Types">Field Types to read.</param>
        /// <param name="Fields">Fields to read.</param>
        /// <param name="From">From what time readout is to be made. Use <see cref="DateTime.MinValue"/> to specify no lower limit.</param>
        /// <param name="To">To what time readout is to be made. Use <see cref="DateTime.MaxValue"/> to specify no upper limit.</param>
        /// <param name="OnFieldsReported">Callback method when fields are reported.</param>
        /// <param name="OnErrorsReported">Callback method when errors are reported.</param>
        /// <param name="State">State object passed on to callback methods.</param>
        /// <returns>Request object.</returns>
        public InternalReadoutRequest DoInternalReadout(string Actor, ThingReference[] Nodes, FieldType Types, string[] Fields, DateTime From, DateTime To,
                                                        InternalReadoutFieldsEventHandler OnFieldsReported, InternalReadoutErrorsEventHandler OnErrorsReported, object State)
        {
            InternalReadoutRequest Request = new InternalReadoutRequest(Actor, Nodes, Types, Fields, From, To, OnFieldsReported, OnErrorsReported, State);

            this.OnExecuteReadoutRequest?.Invoke(this, Request);

            return(Request);
        }