public void InitializeSfcSteps(ProgrammableLogicController pu) { SoonActiveSteps = new HashSet <SfcStep>(); ActiveSteps = new HashSet <SfcStep>(); SoonInactiveSteps = new HashSet <SfcStep>(); InactiveSteps = new HashSet <SfcStep>(); var controlMap = new Dictionary <int, SfcStep>(SfcEntity.Patches.Count); foreach (PatchEntity entry in SfcEntity.Patches) { if (entry.ContainsRealStep()) { SfcStep step = new SfcStep(entry); InactiveSteps.Add(step); if (entry.SfcStepType == StepType.StartingStep) { SoonActiveSteps.Add(step); } controlMap.Add(entry.Key, step); } } ControlMap = controlMap; foreach (var step in InactiveSteps) { step.Initialise(pu); } }
/// <summary> /// Parses the diagram and sets up the transitions reached by this step. /// </summary> public void Initialise(ProgrammableLogicController pu) { AssignActionsFrom(pu.SfcProgramData.SfcEntity.Lookup(Id), pu); _transitions = Sources.CollectTransitionSources(this, pu); foreach (SfcTransition transition in _transitions) { Destinations.AssignTransitionDestinations(transition, pu.SfcProgramData); } }
public SfcProgram(ProgrammableLogicController plc) { Plc = plc; }