Example #1
0
        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);
            }
        }
Example #2
0
 /// <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);
     }
 }
Example #3
0
 public SfcProgram(ProgrammableLogicController plc)
 {
     Plc = plc;
 }