Example #1
0
        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);
        }
Example #2
0
 public NodeAnalogInput SetInputName(FieldSignalName InputName)
 {
     if (InputName == null)
     {
         throw new ArgumentNullException(m_InputNameName);
     }
     return(new NodeAnalogInput(this.SetField(new FieldIdentifier(m_InputNameName), InputName), ChildCollection));
 }
Example #3
0
 public NodeSignal SetSignalName(FieldSignalName SignalName)
 {
     if (SignalName == null)
     {
         throw new ArgumentNullException(m_SignalNameName);
     }
     return(new NodeSignal(this.SetField(new FieldIdentifier(m_SignalNameName), SignalName), ChildCollection));
 }
 public NodeStringOutput SetOutputName(FieldSignalName OutputName)
 {
     if (OutputName == null)
     {
         throw new ArgumentNullException(m_OutputNameName);
     }
     return(new NodeStringOutput(this.SetField(new FieldIdentifier(m_OutputNameName), OutputName), ChildCollection));
 }
Example #5
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);
        }
Example #6
0
 public NodeAnalogInput SetInputName(FieldSignalName InputName)
 {
     if (InputName == null)
     {
         throw new ArgumentNullException(m_InputNameName);
     }
     return new NodeAnalogInput(this.SetField(new FieldIdentifier(m_InputNameName), InputName), ChildCollection);
 }
Example #7
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 NodeDiscreteOutput SetOutputName(FieldSignalName OutputName)
 {
     if (OutputName == null)
     {
         throw new ArgumentNullException(m_OutputNameName);
     }
     return new NodeDiscreteOutput(this.SetField(new FieldIdentifier(m_OutputNameName), OutputName), ChildCollection);
 }