public FACognexDataMan(FASequenceManager aSequenceManager) { ConnectAction = new FAPartAction(); ConnectAction.SetActionMethod(Connect); ConnectAction.CreateSequence(aSequenceManager); var seq = ConnectAction.Sequence; seq.AddItem(Disconnect); seq.AddItem(ConfirmConnect); }
public FAPartMemoryBaseGeneric(FASequenceManager aSequenceManager) { TurnOnTimeout = new FATime(FATimeType.second, 5); TurnOffTimeout = new FATime(FATimeType.second, 5); PulseOnAction = new FAPartAction(); PulseOffAction = new FAPartAction(); _turnOnAction.SetActionMethod(DoTurnOn); _turnOffAction.SetActionMethod(DoTurnOff); PulseOnAction.SetActionMethod(DoTurnOn); PulseOffAction.SetActionMethod(DoTurnOff); _turnOnAction.CreateSequence(aSequenceManager); _turnOffAction.CreateSequence(aSequenceManager); PulseOnAction.CreateSequence(aSequenceManager); PulseOffAction.CreateSequence(aSequenceManager); _turnOnAction.Sequence.OnStart += OnStartOnAction; _turnOnAction.Sequence.Steps.Add("Start", new StepInfo()); _turnOnAction.Sequence.Steps.Add("ConfirmTurnOn", new StepInfo()); _turnOnAction.Sequence.Steps.Add("Retry", new StepInfo()); _turnOnAction.Sequence.Steps["Start"].StepIndex = _turnOnAction.Sequence.AddItem(_turnOnAction.ExecuteForSequence); _turnOnAction.Sequence.Steps["ConfirmTurnOn"].StepIndex = _turnOnAction.Sequence.AddItem(ConfirmTurnOn); _turnOnAction.Sequence.AddItem(TerminateSequence); _turnOnAction.Sequence.Steps["Retry"].StepIndex = _turnOnAction.Sequence.AddItem(_turnOffAction.Execute); _turnOnAction.Sequence.AddItem(new FATime(FATimeType.second, 2)); _turnOnAction.Sequence.AddItem("Start"); _turnOffAction.Sequence.OnStart += OnStartOffAction; _turnOffAction.Sequence.Steps.Add("Start", new StepInfo()); _turnOffAction.Sequence.Steps.Add("ConfirmTurnOff", new StepInfo()); _turnOffAction.Sequence.Steps.Add("Retry", new StepInfo()); _turnOffAction.Sequence.Steps["Start"].StepIndex = _turnOffAction.Sequence.AddItem(_turnOffAction.ExecuteForSequence); _turnOffAction.Sequence.Steps["ConfirmTurnOff"].StepIndex = _turnOffAction.Sequence.AddItem(ConfirmTurnOff); _turnOffAction.Sequence.AddItem(TerminateSequence); _turnOffAction.Sequence.Steps["Retry"].StepIndex = _turnOffAction.Sequence.AddItem(_turnOnAction.Execute); _turnOffAction.Sequence.AddItem(new FATime(FATimeType.second, 2)); _turnOffAction.Sequence.AddItem("Start"); PulseOnAction.Sequence.AddItem(_turnOnAction.Execute); PulseOnAction.Sequence.AddItem(PulseTime); PulseOnAction.Sequence.AddItem(_turnOffAction.Execute); PulseOnAction.Sequence.AddTerminate(); PulseOffAction.Sequence.AddItem(_turnOffAction.Execute); PulseOffAction.Sequence.AddItem(PulseTime); PulseOffAction.Sequence.AddItem(_turnOnAction.Execute); PulseOffAction.Sequence.AddTerminate(); }
private void MakeScan(FASequenceManager aSequenceManager) { Scan = new FAPartAction(); Scan.CreateSequence(aSequenceManager); Scan.SetActionMethod(TriggerOn); var seq = Scan.Sequence; seq.OnStart += delegate { JudgeOk = false; TriggerOff(this); }; seq.OnStop += delegate { TriggerOff(this); }; seq.OnTerminate += delegate { TriggerOff(this); }; seq.AddItem((object obj) => JudgeOk = false); seq.AddItem(TimeScanStartDelay); seq.AddItem(TriggerOff); seq.AddItem(TriggerOn); seq.AddItem( delegate(FASequence actor, TimeSpan time) { if (Result == true) { JudgeOk = true; actor.NextStep(); } else if (TimeScanTimeout.Time < time) { JudgeOk = false; actor.NextStep(); } }); }