public bool IsInMaintainDeviceRangeOfAddress(BLL.SegmentBLL segmentBLL, string adrID)
            {
                string adr_id          = SCUtility.Trim(adrID, true);
                var    maintain_device = eqObjCacheManager.getAllEquipment().
                                         Where(device => device is IMaintainDevice).
                                         ToList();

                foreach (IMaintainDevice device in maintain_device)
                {
                    ASEGMENT device_segment = segmentBLL.cache.GetSegment(device.DeviceSegment);
                    //除了第一段的from address以外其他要屬於該Segment的Address
                    string[] segment_of_section_from_address = device_segment.Sections.
                                                               Where(sec => sec != device_segment.Sections.First()).
                                                               Select(section => section.FROM_ADR_ID.Trim()).ToArray();
                    //除了最後一段的to address以外其他要屬於該Segment的Address
                    string[] segment_of_section_to_address = device_segment.Sections.
                                                             Where(sec => sec != device_segment.Sections.Last()).
                                                             Select(section => section.TO_ADR_ID.Trim()).ToArray();

                    string[] segment_include_address = segment_of_section_from_address.Concat(segment_of_section_to_address).ToArray();
                    if (segment_include_address.Contains(adr_id))
                    {
                        return(true);
                    }
                }
                return(false);
            }
            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);
            }
예제 #3
0
            public bool IsInMaintainDeviceRangeOfSection(BLL.SegmentBLL segmentBLL, string sectionID)
            {
                string sectiin_id      = SCUtility.Trim(sectionID, true);
                var    maintain_device = eqObjCacheManager.getAllEquipment().
                                         Where(device => device is IMaintainDevice).
                                         ToList();

                foreach (IMaintainDevice device in maintain_device)
                {
                    ASEGMENT device_segment     = segmentBLL.cache.GetSegment(device.DeviceSegment);
                    string[] segment_of_section = device_segment.Sections.Select(section => section.SEC_ID.Trim()).ToArray();
                    if (segment_of_section.Contains(sectiin_id))
                    {
                        return(true);
                    }
                }
                return(false);
            }
예제 #4
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;
        }