public bool IsPortInSpecifiedSegment(BLL.SectionBLL sectionBLL, string portID, string segmentID)
            {
                APORTSTATION aPORTSTATION = getPortStation(portID);
                ASECTION     aSECTION     = sectionBLL.cache.GetSectionsByAddress(aPORTSTATION.ADR_ID.Trim()).First();

                return(SCUtility.isMatche(aSECTION.SEG_NUM, segmentID));
            }
            public bool CheckSegmentInActiveByPortID(BLL.SegmentBLL segmentBLL, BLL.SectionBLL sectionBLL, string port_id)
            {
                bool         SegmentInActive = true;
                APORTSTATION aPORTSTATION    = getPortStation(port_id);
                ASECTION     aSECTION        = sectionBLL.cache.GetSectionsByAddress(aPORTSTATION.ADR_ID.Trim()).First();

                SegmentInActive = segmentBLL.cache.IsSegmentActive(aSECTION.SEG_NUM);
                return(SegmentInActive);
            }
 public void registeredControlSectionLeaveEvent(BLL.SectionBLL sectionBLL)
 {
     foreach (string section_id in ControlSections)
     {
         ASECTION sec_obj = sectionBLL.cache.GetSection(section_id);
         sec_obj.VehicleLeave += Sec_obj_VehicleLeave;
         sec_obj.VehicleEntry += Sec_obj_VehicleEntry;
     }
     //再多註冊Entry Section的Entry event,這樣可以提早發現有人準備跑進被管制的區域了
     foreach (var entry_section_info in EntrySectionInfos)
     {
         ASECTION sec_obj = sectionBLL.cache.GetSection(entry_section_info.ReserveSectionID);
         sec_obj.VehicleEntry += Sec_obj_VehicleEntry;
     }
 }
            public List <APORTSTATION> loadAllPortBySegmentID(string segment_id, BLL.SectionBLL sectionBLL)
            {
                List <APORTSTATION> port_stations = null;
                List <ASECTION>     sections      = sectionBLL.cache.loadSectionsBySegmentID(segment_id);
                List <string>       adrs_from     = sections.Select(sec => sec.FROM_ADR_ID.Trim()).ToList();
                List <string>       adrs_to       = sections.Select(sec => sec.TO_ADR_ID.Trim()).ToList();
                List <string>       adrs          = adrs_from.Concat(adrs_to).Distinct().ToList();

                var all_port_station = CacheManager.getALLPortStation();
                var query            = from port in all_port_station
                                       where adrs.Contains(SCUtility.Trim(port.ADR_ID))
                                       orderby port.PORT_ID
                                       select port;

                return(query.ToList());
            }
示例#5
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;
        }