private void ConfirmArrivalBox(FASequence actor, TimeSpan time) { string windowName = string.Empty; if (ManualMode) { if (LoadingUnit.StopSensor.IsOn) { if (Unloading.IsStartable() || Unloading.State == SequenceState.Suspended) { LoadingUnit.ConveyorMotor.Stop.Execute(actor); } actor.NextStep(); } else if (TimeLoadingTimeout.Time < time) { if (RetryInfoLoading.IncreaseCount() == false) { string defaultName = "Fail Loading T/K Box From Front Machine."; var alarm = Utility.AlarmUtility.GetAlarm(AlarmLoadingFail, "Fail Loading T/K Box From Front Machine."); Manager.MessageWindowManager.Instance.Show(Equipment, defaultName, out windowName, alarm, string.Empty, true); actor.Suspend(); Equipment.RequestStop(); } actor.NextStep("ConfirmArrivalBox"); } else LoadingUnit.ConveyorMotor.Run.Execute(actor); } else { if (LoadingUnit.StopSensor.IsOn) ArrivedBox = true; //if (ArrivedBox && Unloading.IsStartable()) // LoadingUnit.ConveyorMotor.Stop.Execute(actor); if (InterfaceUnit.AMTInterfaceTransferSignal.IsOff && ArrivedBox) { var now = DateTime.Now; if (LastLoadingTime != DateTime.MinValue) { Tact = now - LastLoadingTime; string path = System.IO.Path.Combine(Manager.LogManager.LOG_ROOT_PATH, Equipment.Name, "TactTime"); Manager.LogManager.Instance.WriteCSVLog(path, string.Empty, Tact, "\t"); } LastLoadingTime = now; InterfaceUnit.AMTInterfaceRequstCheck.Off.Execute(this); InterfaceUnit.AMTInterFaceTransferCheck.Off.Execute(this); ManualMode = false; RetryInfoArrivedBox.ClearCount(); actor.NextStep(); } else if (TimeLoadingTimeout.Time < time) { if (RetryInfoLoading.IncreaseCount() == false) { LoadingUnit.ConveyorMotor.Stop.Execute(actor); if (ArrivedBox == false) { string defaultName = "Fail Loading T/K Box From Front Machine."; var alarm = Utility.AlarmUtility.GetAlarm(AlarmLoadingFail, "Fail Loading T/K Box From Front Machine."); Manager.MessageWindowManager.Instance.Show(Equipment, defaultName, out windowName, alarm, string.Empty, true); actor.Suspend(); Equipment.RequestStop(); } else if (InterfaceUnit.AMTInterfaceTransferSignal.IsOff == false) { RaiseAlarm(actor, AlarmFrontMachineTerminateSignalNotOff); } actor.NextStep("ConfirmArrivalBox"); } else actor.NextStep("ArrivalBoxCvDelay"); } else if (ArrivedBox == false) LoadingUnit.ConveyorMotor.Run.Execute(actor); } }
private void ShowAlarmToMessageBox(FASequence seq, string defaultName, int alarmNo, out string windowName, string moreMsg) { seq.Suspend(); var alarm = Utility.AlarmUtility.GetAlarm(AlarmBoxLoadingFail, defaultName); Manager.MessageWindowManager.Instance.Show(Equipment, defaultName, out windowName, alarm, moreMsg, true); BandingUnit.VirtualDoorOpenSwitch.DoTurnOn(this); }