コード例 #1
0
        private CompiledNumericSignal numericSignal(NodeSignal signal, SignalTable signalTable)
        {
            var signalAddress  = signalTable.GetNumericSignalAddress(signal);
            var compiledSignal = new CompiledNumericSignal(false, signalAddress, signalTable.NumericAddressBits);

            return(compiledSignal);
        }
コード例 #2
0
 private CompiledNumericSignal numericSignal(NodeSignalIn signalIn, SignalTable signalTable)
 {
     if (signalIn.SignalId != null)
     {
         var signalAddress  = signalTable.GetNumericSignalAddress(signalIn);
         var compiledSignal = new CompiledNumericSignal(true, signalAddress, signalTable.NumericAddressBits);
         return(compiledSignal);
     }
     else if (signalIn.Literal != null)
     {
         var literal = signalIn.Literal;
         if (literal.DataType != FieldDataType.DataTypeEnum.NUMBER)
         {
             throw new Exception("Signal should be a NUMBER.");
         }
         var literalValue = Convert.ToDecimal(literal.Value);
         return(new CompiledNumericSignal(literalValue));
     }
     else
     {
         throw new Exception("Expecting one of SignalIn.SignalId or SignalIn.Literal to be non-null");
     }
 }