コード例 #1
0
ファイル: ModuleBase.cs プロジェクト: nsuchold/Mediator.Net
        /// <summary>
        /// Called by <see cref="Connection.ReadVariablesSync"/> in order to get the latest value of specific variables,
        /// potentially triggering time consuming downstream read requests.
        /// Any exception is considered an error and leads to module restart.
        /// </summary>
        /// <param name="origin">Information about the originator/initiator of this read request</param>
        /// <param name="variables">The variables to read</param>
        /// <param name="timeout">Optional timeout</param>
        public virtual Task <VTQ[]> ReadVariables(Origin origin, VariableRef[] variables, Duration?timeout)
        {
            var now  = Timestamp.Now;
            var vtqs = variables.Select(v => VTQ.Make(DataValue.Empty, now, Quality.Bad)).ToArray();

            return(Task.FromResult(vtqs));
        }
コード例 #2
0
ファイル: VTQ.cs プロジェクト: ifakFAST/Mediator.Net
 public VTQ ToVTQ() => VTQ.Make(this);