public virtual void start(SCApplication _app)
        {
            scApp     = _app;
            reportBLL = _app.ReportBLL;
            lineBLL   = _app.LineBLL;
            line      = scApp.getEQObjCacheManager().getLine();

            line.addEventHandler(nameof(LineService), nameof(line.Currnet_Park_Type), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.Currnet_Cycle_Type), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.Secs_Link_Stat), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.Redis_Link_Stat), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.DetectionSystemExist), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.IsEarthquakeHappend), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.IsAlarmHappened), PublishLineInfo);

            line.addEventHandler(nameof(LineService), nameof(line.HasSeriousAlarmHappend), CheckLightAndBuzzer);
            line.addEventHandler(nameof(LineService), nameof(line.HasWarningHappend), CheckLightAndBuzzer);
            //line.addEventHandler(nameof(LineService), nameof(line.CurrntVehicleModeAutoRemoteCount), PublishLineInfo);
            //line.addEventHandler(nameof(LineService), nameof(line.CurrntVehicleModeAutoLoaclCount), PublishLineInfo);
            //line.addEventHandler(nameof(LineService), nameof(line.CurrntVehicleStatusIdelCount), PublishLineInfo);
            //line.addEventHandler(nameof(LineService), nameof(line.CurrntVehicleStatusErrorCount), PublishLineInfo);
            //line.addEventHandler(nameof(LineService), nameof(line.CurrntCSTStatueTransferCount), PublishLineInfo);
            //line.addEventHandler(nameof(LineService), nameof(line.CurrntCSTStatueWaitingCount), PublishLineInfo);
            //line.addEventHandler(nameof(LineService), nameof(line.CurrntHostCommandTransferStatueAssignedCount), PublishLineInfo);
            //line.addEventHandler(nameof(LineService), nameof(line.CurrntHostCommandTransferStatueWaitingCounr), PublishLineInfo);
            line.LineStatusChange += Line_LineStatusChange;

            line.LongTimeNoCommuncation += Line_LongTimeNoCommuncation;
            line.TimerActionStart();
            //Section 的事務處理
            List <ASECTION> sections = scApp.SectionBLL.cache.GetSections();

            foreach (ASECTION section in sections)
            {
                section.VehicleLeave += SectionVehicleLeave;
            }
            List <AADDRESS> addresses = scApp.AddressesBLL.cache.GetAddresses();

            foreach (AADDRESS address in addresses)
            {
                address.VehicleRelease += AddressVehicleRelease;
            }
            var commonInfo = scApp.getEQObjCacheManager().CommonInfo;

            commonInfo.addEventHandler(nameof(LineService), BCFUtility.getPropertyName(() => commonInfo.MPCTipMsgList),
                                       PublishTipMessageInfo);
        }
        public void start(SCApplication _app)
        {
            scApp     = _app;
            reportBLL = _app.ReportBLL;
            lineBLL   = _app.LineBLL;
            line      = scApp.getEQObjCacheManager().getLine();

            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.MCSCommandAutoAssign), PublishTransferInfo);


            initPublish(line);
        }
Example #3
0
        public void start(SCApplication _app)
        {
            scApp     = _app;
            reportBLL = _app.ReportBLL;
            lineBLL   = _app.LineBLL;
            line      = scApp.getEQObjCacheManager().getLine();

            line.addEventHandler(nameof(LineService), nameof(line.Host_Control_State), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.SCStats), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.Currnet_Park_Type), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.Currnet_Cycle_Type), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.Secs_Link_Stat), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.Redis_Link_Stat), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.DetectionSystemExist), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.IsEarthquakeHappend), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.IsAlarmHappened), PublishLineInfo);
            line.LineStatusChange += Line_LineStatusChange;
        }
Example #4
0
 /// <summary>
 /// Registers the event.
 /// </summary>
 private void registerEvent()
 {
     try
     {
         EventHandleId = this.Name;
         line.addEventHandler(EventHandleId, nameof(line.SegmentPreDisableExcuting), SegmentPreDisableExcute);
         ISMControl.addHandshakeTimeoutErrorHandler(mplcHandshakeTimeout);
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception:");
     }
 }
        private void initialEvent()
        {
            ALINE line = scApp.getEQObjCacheManager().getLine();

            line.addEventHandler(this.Name
                                 , BCFUtility.getPropertyName(() => line.ServiceMode)
                                 , (s1, e1) =>
            {
                Adapter.Invoke((obj) =>
                {
                    switch (line.ServiceMode)
                    {
                    case SCAppConstants.AppServiceMode.None:
                        lbl_isMaster.BackColor = Color.Gray;
                        break;

                    case SCAppConstants.AppServiceMode.Active:
                        lbl_isMaster.BackColor = Color.Green;
                        break;

                    case SCAppConstants.AppServiceMode.Standby:
                        lbl_isMaster.BackColor = Color.Yellow;
                        break;
                    }
                }, null);
            });
            line.addEventHandler(this.Name
                                 , BCFUtility.getPropertyName(() => line.Secs_Link_Stat)
                                 , (s1, e1) =>
            {
                lbl_hostconnAndMode.BackColor =
                    line.Secs_Link_Stat == SCAppConstants.LinkStatus.LinkOK ? Color.Green : Color.Gray;
            }
                                 );
            line.addEventHandler(this.Name
                                 , BCFUtility.getPropertyName(() => line.Host_Control_State)
                                 , (s1, e1) =>
            {
                SetHostControlState(line.Host_Control_State);
            }
                                 );
            //line.addEventHandler(this.Name
            //, BCFUtility.getPropertyName(() => line.TSCStateMachine)
            //     , (s1, e1) =>
            //     {
            //         SetSCState(line.Host_Control_State);
            //     }
            //     );
            line.addEventHandler(this.Name
                                 , BCFUtility.getPropertyName(() => line.Redis_Link_Stat)
                                 , (s1, e1) =>
            {
                lbl_RediStat.BackColor =
                    line.Redis_Link_Stat == SCAppConstants.LinkStatus.LinkOK ? Color.Green : Color.Gray;
            }
                                 );
            line.addEventHandler(this.Name
                                 , BCFUtility.getPropertyName(() => line.IsEarthquakeHappend)
                                 , (s1, e1) =>
            {
                lbl_earthqualeHappend.BackColor =
                    line.IsEarthquakeHappend ? Color.Red : Color.Gray;
                //if (line.IsEarthquakeHappend)
                //{
                //    aLARMs[0].ALAM_CODE = "AE001";
                //    aLARMs[0].ALAM_DESC = "An earthquake has occurred !!!";
                //    aLARMs[0].ALAM_LVL = "Alarm";
                //    aLARMs[0].EQPT_ID = "MCP";
                //    aLARMs[0].RPT_DATE_TIME = DateTime.Now.ToString(SCAppConstants.DateTimeFormat_19);
                //}
                //else
                //{
                //    aLARMs[0].ALAM_CODE = "";
                //    aLARMs[0].ALAM_DESC = "";
                //    aLARMs[0].ALAM_LVL = "";
                //    aLARMs[0].EQPT_ID = "";
                //    aLARMs[0].RPT_DATE_TIME = "";
                //}
                //Adapter.Invoke((obj) =>
                //{
                //    if (line.IsEarthquakeHappend)
                //        tbcList.SelectedIndex = 4;
                //    dgv_Alarm.Refresh();
                //}, null);
            }
                                 );
            line.addEventHandler(this.Name
                                 , BCFUtility.getPropertyName(() => line.DetectionSystemExist)
                                 , (s1, e1) =>
            {
                lbl_detectionSystemExist.BackColor =
                    line.DetectionSystemExist == SCAppConstants.ExistStatus.Exist ? Color.Green : Color.Gray;
            }
                                 );
            scApp.getNatsManager().Subscriber(SCAppConstants.NATS_SUBJECT_CURRENT_ALARM, SetCurrentAlarm);

            sc.App.SystemParameter.AutoOverrideChange += SystemParameter_AutoOverrideChange;
        }
Example #6
0
        public void start(SCApplication _app)
        {
            scApp     = _app;
            reportBLL = _app.ReportBLL;
            lineBLL   = _app.LineBLL;
            line      = scApp.getEQObjCacheManager().getLine();

            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.Host_Control_State), PublishLineInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.SCStats), PublishLineInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.Secs_Link_Stat), PublishLineInfo);

            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.CurrentPortStateChecked), PublishOnlineCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.CurrentStateChecked), PublishOnlineCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.EnhancedVehiclesChecked), PublishOnlineCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.TSCStateChecked), PublishOnlineCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.UnitAlarmStateListChecked), PublishOnlineCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.EnhancedTransfersChecked), PublishOnlineCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.EnhancedCarriersChecked), PublishOnlineCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.LaneCutListChecked), PublishOnlineCheckInfo);

            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.MCSConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.RouterConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT1ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT2ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT3ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT4ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT5ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT6ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT7ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT8ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT9ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT10ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT11ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT12ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT13ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.OHT14ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.MTLConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.MTSConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.MTS2ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.HID1ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.HID2ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.HID3ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.HID4ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.Adam1ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.Adam2ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.Adam3ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.Adam4ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP1ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP2ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP3ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP4ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP5ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP6ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP7ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP8ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP9ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP10ConnectionSuccess), PublishPingCheckInfo);
            //initPublish(line);
        }
Example #7
0
        public void start(SCApplication _app)
        {
            scApp     = _app;
            reportBLL = _app.ReportBLL;
            lineBLL   = _app.LineBLL;
            line      = scApp.getEQObjCacheManager().getLine();

            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.Host_Control_State), PublishLineInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.SCStats), PublishLineInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.Secs_Link_Stat), PublishLineInfo);

            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.CurrentPortStateChecked), PublishOnlineCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.CurrentStateChecked), PublishOnlineCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.EnhancedVehiclesChecked), PublishOnlineCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.TSCStateChecked), PublishOnlineCheckInfo);
            //line.addEventHandler(nameof(ConnectionInfoService), nameof(line.UnitAlarmStateListChecked), PublishOnlineCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.EnhancedTransfersChecked), PublishOnlineCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.EnhancedCarriersChecked), PublishOnlineCheckInfo);
            //line.addEventHandler(nameof(ConnectionInfoService), nameof(line.LaneCutListChecked), PublishOnlineCheckInfo);

            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.MCSConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.RouterConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV1ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV2ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV3ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV4ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV5ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV6ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV7ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV8ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV9ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV10ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV11ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV12ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV13ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AGV14ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.ChargePLCConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.ADAM1ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.ADAM2ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.ADAM3ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.ADAM4ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.ADAM5ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP1ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP2ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP3ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP4ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP5ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP6ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP7ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP8ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP9ConnectionSuccess), PublishPingCheckInfo);
            line.addEventHandler(nameof(ConnectionInfoService), nameof(line.AP10ConnectionSuccess), PublishPingCheckInfo);

            initPublish(line);
        }
        public void start(SCApplication _app)
        {
            scApp     = _app;
            reportBLL = _app.ReportBLL;
            lineBLL   = _app.LineBLL;
            line      = scApp.getEQObjCacheManager().getLine();

            line.addEventHandler(nameof(LineService), nameof(line.Host_Control_State), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.SCStats), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.Currnet_Park_Type), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.Currnet_Cycle_Type), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.Secs_Link_Stat), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.Redis_Link_Stat), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.DetectionSystemExist), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.IsEarthquakeHappend), PublishLineInfo);
            line.addEventHandler(nameof(LineService), nameof(line.IsAlarmHappened), PublishLineInfo);
            line.LineStatusChange += Line_LineStatusChange;

            line.setFourColorLightByHostControlMode();
            CheckRedLightAndBuzzer(null, null);
            line.addEventHandler(nameof(LineService), nameof(line.SCStats), CheckRedLightAndBuzzer);
            line.addEventHandler(nameof(LineService), nameof(line.HasSeriousAlarmHappend), CheckRedLightAndBuzzer);
            line.addEventHandler(nameof(LineService), nameof(line.HasSpecifySeriousAlarmHappend), CheckRedLightAndBuzzer);
        }
        private void initialEvent()
        {
            ALINE line = scApp.getEQObjCacheManager().getLine();

            line.addEventHandler(this.Name
                                 , BCFUtility.getPropertyName(() => line.ServiceMode)
                                 , (s1, e1) =>
            {
                Adapter.Invoke((obj) =>
                {
                    switch (line.ServiceMode)
                    {
                    case SCAppConstants.AppServiceMode.None:
                        lbl_isMaster.BackColor = Color.Gray;
                        break;

                    case SCAppConstants.AppServiceMode.Active:
                        lbl_isMaster.BackColor = Color.Green;
                        break;

                    case SCAppConstants.AppServiceMode.Standby:
                        lbl_isMaster.BackColor = Color.Yellow;
                        break;
                    }
                }, null);
            });
            line.addEventHandler(this.Name
                                 , BCFUtility.getPropertyName(() => line.Secs_Link_Stat)
                                 , (s1, e1) =>
            {
                lbl_hostconnAndMode.BackColor =
                    line.Secs_Link_Stat == SCAppConstants.LinkStatus.LinkOK ? Color.Green : Color.Gray;
            }
                                 );
            line.addEventHandler(this.Name
                                 , BCFUtility.getPropertyName(() => line.Host_Control_State)
                                 , (s1, e1) =>
            {
                SetHostControlState(line.Host_Control_State);
            }
                                 );
            //line.addEventHandler(this.Name
            //, BCFUtility.getPropertyName(() => line.TSCStateMachine)
            //     , (s1, e1) =>
            //     {
            //         SetSCState(line.Host_Control_State);
            //     }
            //     );
            line.addEventHandler(this.Name
                                 , BCFUtility.getPropertyName(() => line.Redis_Link_Stat)
                                 , (s1, e1) =>
            {
                lbl_RediStat.BackColor =
                    line.Redis_Link_Stat == SCAppConstants.LinkStatus.LinkOK ? Color.Green : Color.Gray;
            }
                                 );
            //line.addEventHandler(this.Name
            //, BCFUtility.getPropertyName(() => line.IsEarthquakeHappend)
            //    , (s1, e1) =>
            //    {
            //        lbl_earthqualeHappend.BackColor =
            //        line.IsEarthquakeHappend ? Color.Red : Color.Gray;
            //    }
            //    );
            //line.addEventHandler(this.Name
            //    , BCFUtility.getPropertyName(() => line.DetectionSystemExist)
            //        , (s1, e1) =>
            //        {
            //            lbl_detectionSystemExist.BackColor =
            //            line.DetectionSystemExist == SCAppConstants.ExistStatus.Exist ? Color.Green : Color.Gray;
            //        }
            //        );
            //scApp.getNatsManager().Subscriber(SCAppConstants.NATS_SUBJECT_CURRENT_ALARM, SetCurrentAlarm);
            line.AlarmListChange += SetCurrentAlarm;

            sc.App.SystemParameter.AutoOverrideChange += SystemParameter_AutoOverrideChange;

            mainform.BCApp.addRefreshUIDisplayFun(this.Name, delegate(object o) { BCUtility.updateUIDisplayByAuthority(mainform.BCApp, this); }); //B0.02
            BCUtility.updateUIDisplayByAuthority(mainform.BCApp, this);                                                                           //B0.02
        }
        private void initialLineEvent()
        {
            event_id = this.Name;
            ALINE line = mainForm.BCApp.SCApplication.getEQObjCacheManager().getLine();

            line.addEventHandler(event_id, nameof(line.CurrntVehicleModeAutoRemoteCount)
                                 , (s1, e1) =>
            {
                Adapter.Invoke((obj) =>
                {
                    lab_auto_remote_value.Text = line.CurrntVehicleModeAutoRemoteCount.ToString();
                }, null);
            });
            line.addEventHandler(event_id, nameof(line.CurrntVehicleModeAutoLoaclCount)
                                 , (s1, e1) =>
            {
                Adapter.Invoke((obj) =>
                {
                    lbl_auto_local_value.Text = line.CurrntVehicleModeAutoLoaclCount.ToString();
                }, null);
            });
            line.addEventHandler(event_id, nameof(line.CurrntVehicleStatusIdelCount)
                                 , (s1, e1) =>
            {
                Adapter.Invoke((obj) =>
                {
                    lbl_idle_value.Text = line.CurrntVehicleStatusIdelCount.ToString();
                }, null);
            });
            line.addEventHandler(event_id, nameof(line.CurrntVehicleStatusErrorCount)
                                 , (s1, e1) =>
            {
                Adapter.Invoke((obj) =>
                {
                    lbl_error_value.Text = line.CurrntVehicleStatusErrorCount.ToString();
                }, null);
            });
            line.addEventHandler(event_id, nameof(line.CurrntCSTStatueTransferCount)
                                 , (s1, e1) =>
            {
                Adapter.Invoke((obj) =>
                {
                    lbl_transfer_count.Text = line.CurrntCSTStatueTransferCount.ToString();
                }, null);
            });
            line.addEventHandler(event_id, nameof(line.CurrntCSTStatueWaitingCount)
                                 , (s1, e1) =>
            {
                Adapter.Invoke((obj) =>
                {
                    lbl_cst_wating_count.Text = line.CurrntCSTStatueWaitingCount.ToString();
                }, null);
            });
            line.addEventHandler(event_id, nameof(line.CurrntHostCommandTransferStatueAssignedCount)
                                 , (s1, e1) =>
            {
                Adapter.Invoke((obj) =>
                {
                    lbl_assigned_count.Text = line.CurrntHostCommandTransferStatueAssignedCount.ToString();
                }, null);
            });
            line.addEventHandler(event_id, nameof(line.CurrntHostCommandTransferStatueWaitingCounr)
                                 , (s1, e1) =>
            {
                Adapter.Invoke((obj) =>
                {
                    lbl_host_cmd_wating_count.Text = line.CurrntHostCommandTransferStatueWaitingCounr.ToString();
                }, null);
            });
        }