コード例 #1
0
        public static NodeDiscreteInput 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 FieldBool(false));
            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.BOOL),
                                    new FieldBool(false), new FieldConstant(FieldDataType.DataTypeEnum.BOOL, false)));
            //Add Children here: mutableChildren.Add(SomeChild);

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

            return(Builder);
        }
コード例 #2
0
 public DiscreteInputItem(ISolutionItem parent, NodeDiscreteInput discreteInput)
     : base(parent, string.Empty)
 {
     SetIconFromBitmap(Resources.Images.On);
     onIcon = Icon;
     SetIconFromBitmap(Resources.Images.Off);
     offIcon = Icon;
     ContextMenu = extensionService.Sort(contextMenu);
     DiscreteInput = discreteInput;
     runtimeService.ValueChanged += new ValueChangedHandler(runtimeService_ValueChanged);
     runtimeService.RegisterValueWatcher(this, DiscreteInput.Signal);
 }
コード例 #3
0
        public static NodeDiscreteInput 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 FieldBool(false));
            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.BOOL),
                new FieldBool(false), new FieldConstant(FieldDataType.DataTypeEnum.BOOL,false)));
            //Add Children here: mutableChildren.Add(SomeChild);

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

            return Builder;
        }