Example #1
0
        public VariantPoint(PointInfo point, string variantPos, string switchPos) : base(VAR_TYPE.E_POINT, -1, string.Format("{0}_{1}", point.Point.Name, variantPos[0]))
        {
            if (Sys.Normal != variantPos && Sys.Reverse != variantPos)
            {
                throw new Exception($"create Variant Error: invalid variant pos[{variantPos}]!");
            }

            pointVariantPos = variantPos;
            m_pt            = point;

            value = point.GetVariantValue(variantPos, switchPos);
        }
Example #2
0
        //BMGR-0069 cal ol points info by block link
        private void GeneratePathPtList(GENERIC_SYSTEM_PARAMETERS.BLOCKS.BLOCK curB,string dir,string pos,ref List <PointInfo> ptList)
        {
            int nextID = SyDB.GetNextBlkID(curB,dir,pos);

            if (nextID == curB.ID)//there is a coo, then change dir
            {
                dir    = SyDB.GetReverseDir(dir);
                nextID = SyDB.GetNextBlkID(curB,dir,pos);
            }

            if (-1 != m_Ol.Overlap_Block_ID_List.Block_ID.FindIndex(x => nextID == Convert.ToInt32(x.Value)))
            {
                var nextB = (GENERIC_SYSTEM_PARAMETERS.BLOCKS.BLOCK)Sys.GetNode(nextID,SyDB.GetInstance().blockInfoList.Cast <Node>().ToList());
                if (null != curB.Point_ID && null != nextB.Point_ID && curB.Point_ID == nextB.Point_ID)
                {//get a valid point
                    var       pt     = (GENERIC_SYSTEM_PARAMETERS.POINTS.POINT)Sys.GetNode((int)curB.Point_ID,SyDB.GetInstance().pointInfoList.Cast <Node>().ToList());
                    PointInfo ptInfo = new PointInfo(pt,SyDB.GetPosByBlocks(curB,nextB),SyDB.GetOrientByBlocks(curB,nextB),PointLocation.Overlap,this.m_Ol);
                    ptList.Add(ptInfo);
                }
                //go on search next
                GeneratePathPtList(nextB,dir,pos,ref ptList);
            }
        }
Example #3
0
        //BMGR-0024
        //the blockList is in order of direction
        public bool GetPointLstFromBlkLst()
        {
            m_PtLst.Clear();
            if (0 == m_BlkLst.Count)
            {
                TraceMethod.Record(TraceMethod.TraceKind.ERROR,$"route[{Info}] include no block, original route[{RouteInfo.Info}]\n");
                return(false);
            }

            for (int i = 0; i < m_BlkLst.Count - 1; ++i)
            {
                GENERIC_SYSTEM_PARAMETERS.BLOCKS.BLOCK preBlock  = m_BlkLst[i];
                GENERIC_SYSTEM_PARAMETERS.BLOCKS.BLOCK nextBlock = m_BlkLst[i + 1];
                if (preBlock.Point_ID == nextBlock.Point_ID && null != preBlock.Point_ID)
                {//BMGR-0025 cal point info by block link
                    var point = (GENERIC_SYSTEM_PARAMETERS.POINTS.POINT)Sys.GetNode((int)preBlock.Point_ID,SyDB.GetInstance().pointInfoList.Cast <Node>().ToList());

                    PointInfo objpt = new PointInfo(point,
                                                    SyDB.GetPosByBlocks(preBlock,nextBlock),
                                                    SyDB.GetOrientByBlocks(preBlock,nextBlock),
                                                    PointLocation.Route,
                                                    this.RouteInfo);

                    m_PtLst.Add(objpt);
                }
            }
            if (10 < m_PtLst.Count())
            {
                TraceMethod.Record(TraceMethod.TraceKind.ERROR,$"points in route[{Info}] is more than 10.\n");
                foreach (PointInfo pt in m_PtLst)
                {
                    TraceMethod.RecordInfo(pt.Info);
                }
                return(false);
            }
            return(true);
        }