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> /// True if the step is contained in the active steps set. /// Used while checking the sfc transitions. /// </summary> public bool IsStepActive(SfcStep step) { return(ActiveSteps.Contains(step)); }