Exemple #1
0
        public static NodeAnalogInput BuildWith(FieldIdentifier Code, FieldString Address, FieldSignalName InputName)
        {
            //build fields
            Dictionary <FieldIdentifier, FieldBase> mutableFields =
                new Dictionary <FieldIdentifier, FieldBase>();

            mutableFields.Add(new FieldIdentifier(m_CodeName), Code);
            mutableFields.Add(new FieldIdentifier(m_AddressName), Address);
            mutableFields.Add(new FieldIdentifier(m_ForcedName), new FieldBool(false));
            mutableFields.Add(new FieldIdentifier(m_ForcedValueName), new FieldConstant(FieldDataType.DataTypeEnum.NUMBER, FieldDataType.DefaultValue(FieldDataType.DataTypeEnum.NUMBER)));
            mutableFields.Add(new FieldIdentifier(m_InputNameName), InputName);
            //Add Fields here: mutableFields.Add(new FieldIdentifier(m_CodeName), Code);

            //build children
            KeyedNodeCollection <NodeBase> mutableChildren =
                new KeyedNodeCollection <NodeBase>();

            mutableChildren.Add(NodeSignal.BuildWith(
                                    InputName, new FieldDataType(FieldDataType.DataTypeEnum.NUMBER),
                                    new FieldBool(false), new FieldConstant(FieldDataType.DataTypeEnum.NUMBER, FieldDataType.DefaultValue(FieldDataType.DataTypeEnum.NUMBER))));
            //Add Children here: mutableChildren.Add(SomeChild);

            //build node
            NodeAnalogInput Builder = new NodeAnalogInput(
                new ReadOnlyDictionary <FieldIdentifier, FieldBase>(mutableFields),
                new ReadOnlyCollection <NodeBase>(mutableChildren));

            return(Builder);
        }
        public static NodeSignal BuildWith(FieldSignalName SignalName,
                                           FieldDataType DataType, FieldBool Forced,
                                           FieldConstant ForcedValue)
        {
            //build fields
            Dictionary <FieldIdentifier, FieldBase> mutableFields =
                new Dictionary <FieldIdentifier, FieldBase>();

            mutableFields.Add(new FieldIdentifier(m_SignalIdName), new FieldGuid());
            mutableFields.Add(new FieldIdentifier(m_SignalNameName), SignalName);
            mutableFields.Add(new FieldIdentifier(m_ForcedName), Forced);
            mutableFields.Add(new FieldIdentifier(m_ForcedValueName), ForcedValue);
            mutableFields.Add(new FieldIdentifier(m_CommentName), new FieldString());
            //Add Fields here: mutableFields.Add(new FieldIdentifier(m_CodeName), Code);

            //build children
            KeyedNodeCollection <NodeBase> mutableChildren =
                new KeyedNodeCollection <NodeBase>();

            mutableChildren.Add(NodeValue.BuildWith(DataType));
            //Add Children here: mutableChildren.Add(SomeChild);

            //build node
            NodeSignal Builder = new NodeSignal(
                new ReadOnlyDictionary <FieldIdentifier, FieldBase>(mutableFields),
                new ReadOnlyCollection <NodeBase>(mutableChildren));

            return(Builder);
        }
Exemple #3
0
 public NodeAnalogInput SetSignal(NodeSignal NewSignal)
 {
     if (NewSignal == null)
     {
         throw new ArgumentNullException(m_SignalName);
     }
     return(m_Signal.Set(NewSignal));
 }