本文整理汇总了C#中FALibrary.Sequence.FASequence.AddWatcher方法的典型用法代码示例。如果您正苦于以下问题:C# FASequence.AddWatcher方法的具体用法?C# FASequence.AddWatcher怎么用?C# FASequence.AddWatcher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FALibrary.Sequence.FASequence
的用法示例。
在下文中一共展示了FASequence.AddWatcher方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterSequence
public override void RegisterSequence(FASequenceManager aSequenceManager)
{
PrintLabel = new FASequence(aSequenceManager);
AttachLabel = new FASequence(aSequenceManager);
AttachSpecialLabel = new FASequence(aSequenceManager);
PrintLabel.AddWatcher(
delegate()
{
if (Equipment.EquipmentManager.Instance.MainEquip.DoorUnit.LabelPrinterRightDoorCloseCheck.IsOff)
IsPrinterDoorOpenForLabelCheck = true;
});
}
示例2: MakeDetectLightCurtanSensor
private void MakeDetectLightCurtanSensor(FASequence seq, FAPartOnOffSensor sensor, FATime warningDelayTime, string alarmPropertyName)
{
string windowName = string.Empty;
seq.AddWatcher(
delegate
{
if (sensor.IsOff)
{
Manager.MessageWindowManager.Instance.CloseWindow(windowName);
}
});
seq.Steps.Add("LoopHead", new StepInfo());
seq.Steps.Add("ConfirmElapsedTime", new StepInfo());
seq.Steps.Add("ConfirmSafetySensorOff", new StepInfo());
seq.Steps["LoopHead"].StepIndex = seq.AddItem(
delegate(FASequence actor, TimeSpan time)
{
if (sensor.IsOn)
{
SuspendedFromState = Equipment.State;
actor.NextStep();
}
});
seq.Steps["ConfirmElapsedTime"].StepIndex = seq.AddItem(
delegate(FASequence actor, TimeSpan time)
{
if (sensor.IsOff)
{
Manager.MessageWindowManager.Instance.CloseWindow(windowName);
actor.NextStep();
}
else if (warningDelayTime.Time < time)
{
int alarmNo = 0;
Type type = this.GetType();
var info = type.GetProperty(alarmPropertyName);
if (info == null)
alarmNo = 0;
else
{
try
{
alarmNo = (int)info.GetValue(this, null);
}
catch
{
}
}
string defaultAlarmName = "DetectedLightCurtan";
var alarm = Utility.AlarmUtility.GetAlarm(alarmNo, defaultAlarmName);
Manager.MessageWindowManager.Instance.Show(Equipment, defaultAlarmName, out windowName, alarm, string.Empty, true);
Equipment.SetSuspend();
actor.NextStep("ConfirmSafetySensorOff");
}
});
seq.AddItem("LoopHead");
seq.Steps["ConfirmSafetySensorOff"].StepIndex = seq.AddItem(
delegate(FASequence actor, TimeSpan time)
{
if (sensor.IsOff)
{
Equipment.ReleaseSuspend();
actor.NextStep();
}
});
seq.AddItem("LoopHead");
}
示例3: MakeLowerPrinterCharging
private void MakeLowerPrinterCharging(FASequence seq, VT5080.SubUnits.FAPrinterUnit printerUnit, FALabelPrinterModule printerModule)
{
seq.AddWatcher(
delegate
{
if (seq.IsStartable())
{
if (printerUnit.LowerPrinterDoorLock.Status ==
printerUnit.LowerPrinterDoorLock.StatusList.Lock)
printerUnit.LowerDoorOpenSwitchLamp.DoTurnOff(this);
else
printerUnit.LowerDoorOpenSwitchLamp.DoTurnOn(this);
}
else
return;
if (VT5080Equipment.State == VT5080Equipment.StateStop ||
VT5080Equipment.State == VT5080Equipment.StateRun ||
VT5080Equipment.State == VT5080Equipment.StateRundown)
{
if (printerUnit.LowerDoorOpenSwitch.IsOn ||
printerModule.LowerPrinterStatus == FALabelPrinterModule.PrinterStatus.ChargingPaper)
{
seq.Start();
}
}
});
seq.Steps.Add("ConfirmChargingable", new StepInfo());
seq.Steps.Add("ConfirmDoorOpenCheck", new StepInfo());
seq.Steps["ConfirmChargingable"].StepIndex =
seq.AddItem(
delegate(FASequence actor, TimeSpan time)
{
if (printerModule.PrintLabel.IsStartable() ||
printerModule.LowerPrinterStatus == FALabelPrinterModule.PrinterStatus.ChargingPaper)
{
printerModule.LowerPrinterStatus = FALabelPrinterModule.PrinterStatus.ChargingPaper;
printerUnit.LowerDoorOpenSwitchLamp.DoTurnOn(actor);
printerUnit.LowerPrinterDoorLock.DoTurnOff(actor);
printerUnit.LowerPrinterStackerLock.DoTurnOff(actor);
actor.NextStep();
}
else if (TimeBlinkLampTime.Time < time)
{
if (printerUnit.LowerDoorOpenSwitchLamp.IsOn)
printerUnit.LowerDoorOpenSwitchLamp.DoTurnOff(actor);
else
printerUnit.LowerDoorOpenSwitchLamp.DoTurnOn(actor);
actor.NextStep("ConfirmChargingable");
}
});
seq.Steps["ConfirmDoorOpenCheck"].StepIndex = seq.AddItem(
delegate(FASequence actor, TimeSpan time)
{
if (printerUnit.LowerPrinterDoorCloseSensor.IsOff)
actor.NextStep();
});
seq.AddItem(new FATime(FATimeType.second, 1));
seq.AddItem(
delegate(FASequence actor, TimeSpan time)
{
if (printerUnit.LowerPrinterDoorCloseSensor.IsOn)
actor.NextStep();
});
seq.AddItem(new FATime(FATimeType.second, 1));
seq.AddItem(
delegate(object obj)
{
printerUnit.LowerPrinterDoorLock.DoTurnOn(this);
printerUnit.LowerPrinterStackerLock.DoTurnOn(this);
});
seq.AddItem(
delegate(FASequence actor, TimeSpan time)
{
if (printerUnit.LowerPrinterDoorLock.Status == printerUnit.LowerPrinterDoorLock.StatusList.Lock &&
printerUnit.LowerPrinterStackerLock.Status == printerUnit.LowerPrinterStackerLock.StatusList.Lock)
{
printerModule.LowerPrinterStatus = FALabelPrinterModule.PrinterStatus.None;
actor.NextStep();
}
else if (TimeDoorLockTimeout.Time < time)
{
int alarm = 0;
if (printerUnit.LowerPrinterDoorLock.Status != printerUnit.LowerPrinterDoorLock.StatusList.Lock)
alarm = AlarmLowerPrinterDoorLockFail;
else
alarm = AlarmLowerPrinterStackerLockFail;
printerUnit.LowerPrinterDoorLock.DoTurnOff(actor);
printerUnit.LowerPrinterStackerLock.DoTurnOff(actor);
string windowName = string.Empty;
var alarmObj = Utility.AlarmUtility.GetAlarm(alarm, "DOOR WARNING");
Manager.MessageWindowManager.Instance.Show(Equipment, "DOOR WARNING", out windowName, alarmObj, printerModule.Name, false);
actor.NextStep("ConfirmDoorOpenCheck");
}
});
//.........这里部分代码省略.........
示例4: CreateSequence
public void CreateSequence(FASequenceManager aSequenceManager)
{
Object thisLock = new Object();
lock (thisLock)
{
if (_sequence == null)
{
_sequence = new FASequence(aSequenceManager);
_sequence.AddWatcher(IsTimeout);
}
}
}