private CompiledBooleanSignal booleanSignal(NodeSignal signal, SignalTable signalTable) { var signalAddress = signalTable.GetBooleanSignalAddress(signal); var compiledSignal = new CompiledBooleanSignal(false, signalAddress, signalTable.BooleanAddressBits); return(compiledSignal); }
private CompiledBooleanSignal booleanSignal(NodeSignalIn signalIn, SignalTable signalTable) { if (signalIn.SignalId != null) { var signalAddress = signalTable.GetBooleanSignalAddress(signalIn); var compiledSignal = new CompiledBooleanSignal(true, signalAddress, signalTable.BooleanAddressBits); return(compiledSignal); } else if (signalIn.Literal != null) { var literal = signalIn.Literal; if (literal.DataType != FieldDataType.DataTypeEnum.BOOL) { throw new Exception("Signal should be a BOOL."); } var literalValue = (bool)(literal.Value); return(new CompiledBooleanSignal(literalValue)); } else { throw new Exception("Expecting one of SignalIn.SignalId or SignalIn.Literal to be non-null"); } }