private void Sec_obj_VehicleLeave(object sender, string vhID)
        {
            App.SCApplication app      = App.SCApplication.getInstance();
            ASECTION          section  = sender as ASECTION;
            AVEHICLE          leave_vh = app.VehicleBLL.cache.getVehicle(vhID);

            if (!ControlSections.Contains(SCUtility.Trim(leave_vh.CUR_SEC_ID, true)))
            {
                string Vh_id = string.Empty;
                if (CurrentVhs.TryRemove(vhID, out Vh_id))
                {
                }
            }

            //判斷是否所有車子都已經不再該管制道路中了。
            var vhs = app.VehicleBLL.cache.loadAllVh();

            foreach (AVEHICLE vh in vhs)
            {
                string vh_current_section = Common.SCUtility.Trim(vh.CUR_SEC_ID, true);
                if (ControlSections.Contains(vh_current_section))
                {
                    LogHelper.Log(logger: logger, LogLevel: LogLevel.Info, Class: nameof(TrafficControlInfo), Device: "OHx",
                                  Data: $"vh:{vhID} is leave sec:{section.SEC_ID},but vh:{vh.VEHICLE_ID} in traffic contorl:{ID} of control section:{vh_current_section}," +
                                  $"can't notify section clear event.",
                                  VehicleID: vhID);
                    return;
                }
            }
            TrafficControlSectionIsClear?.Invoke(this, vhID);
        }
Ejemplo n.º 2
0
        public void start(SCApplication _app)
        {
            LineBLL        = _app.LineBLL;
            CMDBLL         = _app.CMDBLL;
            VehicleBLL     = _app.VehicleBLL;
            MapBLL         = _app.MapBLL;
            SegmentBLL     = _app.SegmentBLL;
            SectionBLL     = _app.SectionBLL;
            PortStationBLL = _app.PortStationBLL;
            ReportBLL      = _app.ReportBLL;
            VehicleService = _app.VehicleService;
            LineService    = _app.LineService;

            RouteGuide = _app.RouteGuide;

            NodeBLL = _app.NodeBLL;
            app     = _app;
        }