Example #1
0
 /// <summary>
 /// The value that should be output to the actual hardware
 /// and takes the forced status into account.  Threadsafe.
 /// </summary>
 public Decimal GetValue(NodeRuntimeApplication runtimeApplication)
 {
     if (runtimeApplication == null)
     {
         throw new ArgumentNullException();
     }
     if (Forced.BoolValue)
     {
         return((Decimal)ForcedValue.Value);
     }
     else
     {
         var nValue = SignalIn.GetValue(runtimeApplication);
         if (nValue != null && nValue.DataType.DataType == FieldDataType.DataTypeEnum.NUMBER)
         {
             return((Decimal)nValue.Value);
         }
         else
         {
             return((Decimal)FieldDataType.DefaultValue(FieldDataType.DataTypeEnum.NUMBER));
         }
     }
 }
 /// <summary>
 /// The value that should be output to the actual hardware
 /// and takes the forced status into account.  Threadsafe.
 /// </summary>
 public bool GetValue(NodeRuntimeApplication runtimeApplication)
 {
     if (runtimeApplication == null)
     {
         throw new ArgumentNullException();
     }
     if (Forced.BoolValue)
     {
         return(ForcedValue.BoolValue);
     }
     else
     {
         var nValue = SignalIn.GetValue(runtimeApplication);
         if (nValue != null && nValue.DataType.DataType == FieldDataType.DataTypeEnum.BOOL)
         {
             return((bool)nValue.Value);
         }
         else
         {
             return(false);
         }
     }
 }