Example #1
0
        public RouteSegment(GENERIC_SYSTEM_PARAMETERS.ROUTES.ROUTE route)
        {
            m_BlkLst = new List <GENERIC_SYSTEM_PARAMETERS.BLOCKS.BLOCK>();
            foreach (int blkID in route.Block_ID_List.Block_ID)
            {
                var blk = (GENERIC_SYSTEM_PARAMETERS.BLOCKS.BLOCK)Sys.GetNode(blkID,SyDB.GetInstance().blockInfoList.Cast <Node>().ToList());
                m_BlkLst.Add(blk);
            }

            SetRouteSegment(route.Origin_Signal_ID,route.Destination_Signal_ID,route);
        }
Example #2
0
        private void SetRouteSegment(int orgID,int dstID,GENERIC_SYSTEM_PARAMETERS.ROUTES.ROUTE route)
        {
            this.RouteInfo = route;
            GENERIC_SYSTEM_PARAMETERS.SIGNALS.SIGNAL orgSig = SyDB.GetInstance().signalInfoList.Find(x => x.ID == orgID);
            GENERIC_SYSTEM_PARAMETERS.SIGNALS.SIGNAL dstSig = SyDB.GetInstance().signalInfoList.Find(x => x.ID == dstID);

            if (null == orgSig || null == dstSig)
            {
                throw new Exception($"sydb error:{route.Info} create RouteSegment error. can't find orgsig[{orgID}] or dstsig[{dstID}] in sydb.Signal");
            }

            OrgSig = orgSig;
            DstSig = dstSig;

            if (0 == m_BlkLst.Count())
            {
                throw new Exception($"sydb error:{Info} error. has no block in route");
            }
            m_PtLst = new List <PointInfo>();
            GetPointLstFromBlkLst();
        }
Example #3
0
 public RouteSegment(int orgID,int dstID,List <GENERIC_SYSTEM_PARAMETERS.BLOCKS.BLOCK> blkList,GENERIC_SYSTEM_PARAMETERS.ROUTES.ROUTE route)
 {
     m_BlkLst = new List <GENERIC_SYSTEM_PARAMETERS.BLOCKS.BLOCK>();
     m_BlkLst.AddRange(blkList);
     SetRouteSegment(orgID,dstID,route);
 }
Example #4
0
 public static bool splitRoute(this RouteSegConfig instance,GENERIC_SYSTEM_PARAMETERS.ROUTES.ROUTE route)
 {
     return((bool)MethodHelper.InvokePrivateMethod <RouteSegConfig>(instance,"splitRoute",new object[] { route }));
 }