public override void RegisterSequence(FASequenceManager aSequenceManager)
        {
            TimeSealingBoxTimeout = new FATime(FATimeType.second, 30);
            TimeBoxLoadingTimeout = new FATime(FATimeType.second, 30);

            LoadingBox = new FASequence(aSequenceManager);
            SealingBox = new FASequence(aSequenceManager);
            MoveBoxToInletStartPos = new FASequence(aSequenceManager);
            InletBox = new FASequence(aSequenceManager);
            Charging = new FASequence(aSequenceManager);
        }
        //------------------------------------------------------------------------
        public MainEquipment()
        {
            SWInfo = Forms.Main.WindowVersionInfo.Version;
            InitialStackerSequence = new FASequence(SubSequenceManager);
            InitialStackerExceptSequence = new FASequence(SubSequenceManager);

            TimeDoorLockTimeout = new FATime(FATimeType.second, 3);
            _ioSwitchingTimer.Tick += OnIOSwitchingTick;
            _ioSwitchingTimer.Interval = new TimeSpan(0, 0, 0, 0, IO_SWITCHING_INTERVAL);
            _ioSwitchingTimer.Start();

            OnStatusChanged += StatusChangedEventHandler;
        }
        public FASmallBoxInletModule()
        {
            AlarmLargeBoxExistOnBoxOutlet = 2002001;
            AlarmSmallBoxArrivalFail = 2002002;
            AlarmSmallBoxPickVacuumFail = 2002003;
            AlarmSmallBoxVacuumErrorAfterBoxPickUp = 2002004;
            AlarmSmallBoxOutFail = 2002005;
            AlarmIncorrectElevatorPosition = 2002006;
            AlarmBandNotChecked = 2002007;
            AlarmSmallBoxVacuumErrorAfterBoxTurn = 2002008;
            AlarmSmallBoxInsertFail = 2002009;

            TimeSmallBoxArrivalTimeout = new FATime(FATimeType.second, 10);
            TimeSmallBoxPickTimeout = new FATime(FATimeType.second, 10);
            TimeSmallBoxOutTimeout = new FATime(FATimeType.second, 10);
        }
        public FABoxOutletModule()
        {
            AlarmSealingFail = 2005001;
            AlarmBoxLoadingFail = 2005002;
            AlarmSmallBoxUnloadingFail = 2005003;
            AlarmLargeBoxArrivalToStopPosFail = 2005004;
            AlarmBoxSealingMachinePowerOff = 2005005;
            AlarmFailBoxInSealingMachine = 2005006;
            AlarmBoxExistInSealingMachine = 2005007;
            AlarmLargeBoxSealingMachineByPassUpFail = 2005008;
            AlarmLargeBoxSealingMachineTapePosDownFail = 2005009;
            AlarmLargeBoxOutFail = 2005010;
            AlarmLargeBoxLayFail = 2005011;

            TimeSealingBoxTimeout = new FATime(FATimeType.second, 10);
            TimeBoxLoadingTimeout = new FATime(FATimeType.second, 10);
            TimeBoxOutTimeout = new FATime(FATimeType.second, 10);
            TimeLargeBoxArrivalToStopPosTimeout = new FATime(FATimeType.second, 15);
            TimeSmallBoxInSealingMachineTimeout = new FATime(FATimeType.second, 5);
        }
        public FASmallBoxLoadingModule()
        {
            AlarmBoxReceiveFailFromVT5071 = 2001001;
            AlarmBoxArrivalInStopPos = 2001002;
            AlarmBoxDropFailFromByPassStacker = 2001003;
            AlarmSamsungLabelScanFail = 2001004;
            AlarmFailReceiveDataFromECServer = 2001005;
            AlarmScanCompletedEmptyBox = 2001006;
            AlarmBoxCountDiscord = 2001007;
            AlarmVIDInfoDiscord = 2001008;
            AlarmBoxSequenceDiscord = 2001009;
            AlarmPartNoDiscord = 2001010;
            AlarmLotIDDiscord = 2001011;
            AlarmEmptyBoxLoadingTimeout = 2001012;
            AlarmSpecialLabelScanFail = 2001013;
            AlarmLabelCountIsNotCorrect = 2001014;

            TimeBoxReceiveFromVT5071Timeout = new FATime(FATimeType.second, 10);
            TimeBoxArrivalInStopPosTimeout = new FATime(FATimeType.second, 10);
            TimeBoxDropFromByPassStackerTimeout = new FATime(FATimeType.second, 3);
        }
        public FAPrinterModule()
        {
            AlarmPrinterCloseNotOk = 2003001;
            AlarmLabelReleaseFail = 2003002;
            AlarmLabelVacuumFail = 2003003;
            AlarmLabelPickerVacuumDetectedAfterAttach = 2003004;
            AlarmNotRemovedLabel = 2003005;
            AlarmLabelPrinterOnlineError = 2003006;
            AlarmLabelPrinterBufferOverflowError = 2003007;
            AlarmLabelPrinterHeadOpenError = 2003008;
            AlarmLabelPrinterPaperOutError = 2003009;
            AlarmLabelPrinterRibbonOutError = 2003010;
            AlarmLabelPickerVacuumNoDetectedPreAttach = 2003011;
            AlarmLabelSensorOnPrePrinting = 2003012;
            AlarmLabelVacuumOnPrePrinting = 2003013;
            AlarmNotDoorOpenForLabelCheck = 2003014;

            TimeLabelReleaseTimeout = new FATime(FATimeType.second, 10);
            TimeLabelVacuumTimeout = new FATime(FATimeType.second, 10);
            TimeLabelVacuumOffDelayTime = new FATime(FATimeType.second, 1);

            AddPreStartInterlock(PreStartInterlockDoorOpenForLabelCheck);
        }
        public FAPartMemoryBaseGeneric(FASequenceManager aSequenceManager)
        {
            TurnOnTimeout = new FATime(FATimeType.second, 5);
            TurnOffTimeout = new FATime(FATimeType.second, 5);

            _turnOnAction.SetActionMethod(DoTurnOn);
            _turnOffAction.SetActionMethod(DoTurnOff);

            _turnOnAction.CreateSequence(aSequenceManager);
            _turnOffAction.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");
        }
        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");
        }
        public void LoadTimer(XElement xml)
        {
            foreach (XElement item in xml.Elements())
            {
                string name = item.Element("Name").Value.Trim();
                string strValue = item.Element("Value").Value.Trim();
                string type = item.Element("Type").Value.Trim();

                double value = 0;
                if (double.TryParse(strValue, out value) == false)
                    throw new Exception("값이 올바르지 않습니다.");
                FATime time = new FATime(type, value);
                FAReflection.SetPropertyValue(this, name, time);
            }
        }
 public FATimeSequenceItem(FATimeType type, double time)
 {
     TimeObject = new FATime(type, time);
 }