Esempio n. 1
0
 public NodePageCollection SetLogicRoot(FieldBool LogicRoot)
 {
     if (LogicRoot == null)
     {
         throw new ArgumentNullException(m_LogicRootName);
     }
     return new NodePageCollection(this.SetField(new FieldIdentifier(m_LogicRootName), LogicRoot), ChildCollection);
 }
 public NodeRuntimeApplication SetExecuteOnStartup(FieldBool ExecuteOnStartup)
 {
     if (ExecuteOnStartup == null)
     {
         throw new ArgumentNullException(m_ExecuteOnStartupName);
     }
     return new NodeRuntimeApplication(this.SetField(new FieldIdentifier(m_ExecuteOnStartupName), ExecuteOnStartup), ChildCollection);
 }
 public NodeRuntimeApplication SetTryMode(FieldBool TryMode)
 {
     if (TryMode == null)
     {
         throw new ArgumentNullException(m_TryModeName);
     }
     return new NodeRuntimeApplication(this.SetField(new FieldIdentifier(m_TryModeName), TryMode), ChildCollection);
 }
 public static NodeRuntimeApplication BuildWith(
     FieldIdentifier Code, FieldGuid TypeId, FieldGuid RuntimeId,
     FieldString Address, FieldBase64 Configuration, FieldBool ExecuteOnStartup,
     NodePageCollection Logic, NodeDeviceConfiguration DeviceConfiguration)
 {
     var rta = NodeRuntimeApplication.BuildWith(
             Code, TypeId, RuntimeId, Address, Configuration, ExecuteOnStartup);
     rta = rta.SetLogic(Logic);
     return rta.SetDeviceConfiguration(DeviceConfiguration);
 }
        public static NodeRuntimeApplication BuildWith(
            FieldIdentifier Code, FieldGuid TypeId, FieldGuid RuntimeId,
            FieldString Address, FieldBase64 Configuration, FieldBool ExecuteOnStartup)
        {
            //build fields
            Dictionary<FieldIdentifier, FieldBase> mutableFields =
                new Dictionary<FieldIdentifier, FieldBase>();
            mutableFields.Add(new FieldIdentifier(m_CodeName), Code);
            mutableFields.Add(new FieldIdentifier(m_TypeIdName), TypeId);
            mutableFields.Add(new FieldIdentifier(m_RuntimeIdName), RuntimeId);
            mutableFields.Add(new FieldIdentifier(m_AddressName), Address);
            mutableFields.Add(new FieldIdentifier(m_ConfigurationName), Configuration);
            mutableFields.Add(new FieldIdentifier(m_ExecuteOnStartupName), ExecuteOnStartup);
            mutableFields.Add(new FieldIdentifier(m_TryModeName), new FieldBool(false));
            //Add Fields here: mutableFields.Add(new FieldIdentifier("Code"), Code);

            //build children
            KeyedNodeCollection<NodeBase> mutableChildren =
                new KeyedNodeCollection<NodeBase>();
            var pc = NodePageCollection.BuildWith(
                    new FieldPageCollectionName(m_LogicName)
                );
            pc = pc.SetLogicRoot(new FieldBool(true));
            mutableChildren.Add(pc);
            mutableChildren.Add(
                NodeDeviceConfiguration.BuildWith(
                    new ReadOnlyCollection<NodeDriver>(new Collection<NodeDriver>())
                ));
            //Add Children here: mutableChildren.Add(SomeChild);

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

            return Builder;
        }
Esempio n. 6
0
 public NodeAnalogInput SetForced(FieldBool Forced)
 {
     if (Forced == null)
     {
         throw new ArgumentNullException(m_ForcedName);
     }
     return new NodeAnalogInput(this.SetField(new FieldIdentifier(m_ForcedName), Forced), ChildCollection);
 }
Esempio n. 7
0
 public NodeDiscreteInput SetForcedValue(FieldBool ForcedValue)
 {
     if (ForcedValue == null)
     {
         throw new ArgumentNullException(m_ForcedValueName);
     }
     return new NodeDiscreteInput(this.SetField(new FieldIdentifier(m_ForcedValueName), ForcedValue), ChildCollection);
 }
Esempio n. 8
0
 public NodeDriver SetRunning(FieldBool Running)
 {
     if (Running == null)
     {
         throw new ArgumentNullException(m_RunningName);
     }
     return new NodeDriver(this.SetField(new FieldIdentifier(m_RunningName), Running), ChildCollection);
 }