Example #1
0
 public Message()
 {
     upPath  = null;
     rpRs    = null;
     apRs    = null;
     olPath  = null;
     overlap = null;
 }
Example #2
0
        public Message(int rank, Message basem = null)
        {
            Rank = rank;
            if (null != basem)
            {
                upPath = basem.upPath;
                rpRs   = basem.rpRs;
                apRs   = basem.apRs;
                olPath = basem.olPath;

                overlap = basem.overlap;
            }
        }
Example #3
0
 //BMGR-0022 get route by route.orgSig = becon.input_orignsig
 private void UpdateRsList(List <RouteSegment> routeLst,GENERIC_SYSTEM_PARAMETERS.IMPLEMENTATION_BEACON_BLOCK_MODE.BM_BEACON beaconIbbm)
 {
     RsList.Clear();
     foreach (RouteSegment route in routeLst)//get route segment
     {
         if (route.m_OrgSig.ID == SignalInfo.ID)
         {
             RouteSegment newRoute = route.DeepClone();
             if (Sys.Reopening == m_ibbmIn.Type)//BMGR-0026 only reopen signal of the beacon use overlap
             {
                 newRoute.CalOverlap(beaconIbbm);
             }
             RsList.Add(newRoute);
         }
     }
 }
Example #4
0
        void test_RouteSegment()
        {
            Prepare.ReloadGlobalSydb(".//input//Routes_fromHHHT2.xml");
            {
                var          sydbroute = sydb.routeInfoList.Find(x => x.ID == 224);//this route has no points
                RouteSegment newr      = new RouteSegment(sydbroute);
                Debug.Assert(newr.m_PtLst.Count == 0);
            }

            {                                                                       //check length for oginal route
                var          sydbroute = sydb.routeInfoList.Find(x => x.ID == 231); //this route has points
                RouteSegment newr      = new RouteSegment(sydbroute);

                List <string> pnames = new List <string>()
                {
                    "P01D-N","P07D-R","P09D-R"
                };                              //the pts in route 231
                int i = 0;
                foreach (var p in newr.m_PtLst) //check for route get points info
                {
                    Debug.Assert(pnames[i] == p.getNamePosStr());
                    ++i;
                }
                Debug.Assert((626856 - 615248 + 41374 - 26856) == newr.GetLength());
            }

            {                                                                            //check length for the splitted routes
                var            sydbroute    = sydb.routeInfoList.Find(x => x.ID == 183); //this route has Spacing_Signal_ID_List
                RouteSegConfig SyDBRouteCfg = new RouteSegConfig(sydb);
                clearlist(SyDBRouteCfg);
                SyDBRouteCfg.splitRoute(sydbroute);
                SyDBRouteCfg.m_RouteSpacing_routeLst.AddRange(SyDBRouteCfg.m_Spacing_routeLst);
                int[] lengths = { 1170639 - 906 - (1058617 - 747),1058617 - 747 - (1041880 - 747),(1041880 - 747) - (963697 + 176) };//length for the splitted route
                int   i       = 0;
                foreach (var r in SyDBRouteCfg.m_RouteSpacing_routeLst)
                {
                    Debug.Assert(lengths [i] == r.GetLength());
                    ++i;
                }
            }
        }
Example #5
0
        void test_generateRouteSegments()
        {
            Prepare.ReloadGlobalSydb(".//input//Routes_fromHHHT2.xml");
            RouteSegConfig SyDBRouteCfg = new RouteSegConfig(sydb);//this will call RouteSegConfig.generateRouteSegments()

            Debug.Assert(true == SyDBRouteCfg.generateRouteSegments());

            int count      = 0;
            int splitcount = 0;

            foreach (var r in sydb.routeInfoList)
            {
                if (r.IsValidBMRoute())
                {
                    RouteSegment route = SyDBRouteCfg.m_RouteSpacing_routeLst.Find(x => x.m_OrgSig.ID == r.Origin_Signal_ID && x.RouteInfo().ID == r.ID);
                    Debug.Assert(null != route);
                    ++count;
                    splitcount = splitcount + r.Spacing_Signal_ID_List.Signal_ID.Count;
                    foreach (int id in r.Spacing_Signal_ID_List.Signal_ID)
                    {
                        route = SyDBRouteCfg.m_Spacing_routeLst.Find(x => x.m_OrgSig.ID == id && x.RouteInfo().ID == r.ID);
                        Debug.Assert(null != route);
                    }


                    route.CalOverlap(null);

                    GENERIC_SYSTEM_PARAMETERS.SIGNALS.SIGNAL dstsig = (GENERIC_SYSTEM_PARAMETERS.SIGNALS.SIGNAL)MethodHelper.InvokePrivateMember(route,"DstSig");
                    if (null != dstsig.Overlap_ID)
                    {
                        Debug.Assert(null != route.m_overlap);
                    }
                    else
                    {
                        Debug.Assert(null == route.m_overlap);
                    }
                }
            }
            Debug.Assert(count == SyDBRouteCfg.m_RouteSpacing_routeLst.Count());
            Debug.Assert(splitcount == SyDBRouteCfg.m_Spacing_routeLst.Count());
        }
Example #6
0
        public RouteSegment DeepClone()
        {
            RouteSegment newR = new RouteSegment(this.OrgSig.ID,this.DstSig.ID,this.m_BlkLst,this.RouteInfo);

            return(newR);
        }
Example #7
0
        void test_RouteSegmentLenVariantPts()
        {
            Prepare.ReloadGlobalSydb(".//input//RouteLength_fromTestLine.xml");
            Dictionary <int, int[]> routes = new Dictionary <int, int[]>()
            {
                //id                //ptnum     //length
                { 234, new int[] { 13, 451833 - 393833 + 600100 - 592163 + 611317 - 606247 + 4000 + 626856 - 611317 + 632996 - 626856 + 961697 - 632996 } },
                { 233, new int[] { 8, 451833 - 393833 + 600100 - 592163 + 611317 - 606247 + 4000 + 626856 - 611317 + 632996 - 626856 + 641374 - 632996 } },
                { 50, new int[] { 5, 451833 - 446833 + 604100 - 592163 + 641374 - 605177 } },
                { 400, new int[] { 0, 1197376 - 1115639 + 240000 } },
                { 401, new int[] { 0, 1197376 - 1115639 + 240000 } },
                { 402, new int[] { 0, 1197376 - 1115639 + 240000 } },
                { 403, new int[] { 0, 1197376 - 1115639 + 240000 } },
                { 404, new int[] { 0, 1197376 - 1115639 + 240000 } },
                { 405, new int[] { 0, 1197376 - 1115639 + 240000 } },
                { 445, new int[] { 2, 1035200 - 1000000 } },
                { 61, new int[] { 2, 613473 - 842 - 485281 } },
                { 66, new int[] { 2, 613473 - 842 - 485281 } },
            };

            Dictionary <string, string[]> pts = new Dictionary <string, string[]>()
            {
                //NAME                       //ORIEN
                { "P02D", new string[] { Sys.Divergent } },
                { "P20D", new string[] { Sys.Divergent } },
                { "P08D", new string[] { Sys.Convergent } },
                { "P21D", new string[] { Sys.Convergent } },
                { "P10D", new string[] { Sys.Convergent } },
                { "P14D", new string[] { Sys.Convergent } },
                { "P09D", new string[] { Sys.Divergent } },
                { "P07D", new string[] { Sys.Convergent } },
                { "P01D", new string[] { Sys.Convergent } },
                { "P16D", new string[] { Sys.Divergent } },
                { "P18D", new string[] { Sys.Convergent } },
                { "P02E", new string[] { Sys.Divergent } },
                { "P20E", new string[] { Sys.Convergent } },
                { "P01E", new string[] { Sys.Convergent } },
                { "P08B", new string[] { Sys.Divergent } },
                { "P02B", new string[] { Sys.Convergent } },
                { "P12D", new string[] { Sys.Convergent } },
                { "P06D", new string[] { Sys.Divergent } },
            };

            haschecked = false;
            foreach (var r in sydb.routeInfoList)
            {
                RouteSegment route = new RouteSegment(r);

                if (route.GetPointLstFromBlkLst() == false)
                {
                    haschecked = true;
                }

                foreach (var pt in route.m_PtLst)
                {
                    Debug.Assert(pts[pt.Point.Name][0] == pt.Orientation);
                }

                List <Variant> vlist = new List <Variant>();
                Debug.Assert(route.CalVariants(vlist, false) == true);
                Debug.Assert(vlist.Count == routes[(int)(r.ID)][0] * 2);

                Debug.Assert(route.GetLength() == routes[(int)(r.ID)][1]);
            }

            Debug.Assert(haschecked == true);//if the route of pt more than 10, retur false
        }
Example #8
0
 public static bool AddNewRoute(this RouteSegConfig instance,bool isSplitRoute,RouteSegment rs)
 {
     return((bool)MethodHelper.InvokePrivateMethod <RouteSegConfig>(instance,"AddNewRoute",new object[] { isSplitRoute,rs }));
 }
Example #9
0
 public static GENERIC_SYSTEM_PARAMETERS.ROUTES.ROUTE RouteInfo(this RouteSegment instance)
 {
     return((GENERIC_SYSTEM_PARAMETERS.ROUTES.ROUTE)MethodHelper.InvokePrivateMember(instance,"RouteInfo"));
 }