//BMGR-0022 public bool GetRouteSegments(RouteSegConfig SyDBRouteCfg,GENERIC_SYSTEM_PARAMETERS.IMPLEMENTATION_BEACON_BLOCK_MODE.BM_BEACON beaconIbbm) { //use SigTypeFunc instead of Type_function, the values are similar if (Sys.TYPEFUNC_SPACING == SignalInfo.Signal_Type_Function) { UpdateRsList(SyDBRouteCfg.m_Spacing_routeLst,beaconIbbm); if (1 != RsList.Count()) { TraceMethod.RecordInfo($"Original Signal[{SignalInfo.Info}] find routesegment error, the route num={RsList.Count()} of Spacing Signal should be 1!"); return(false); } } else if (Sys.TYPEFUNC_ROUTESPACING == SignalInfo.Signal_Type_Function) { UpdateRsList(SyDBRouteCfg.m_RouteSpacing_routeLst,beaconIbbm); if (RsList.Count() < 1 || RsList.Count() > 10) { TraceMethod.RecordInfo($"Original Signal[{SignalInfo.Info}] find routesegment error, the route num={RsList.Count()} of Route Spacing Signal should be [1,10]!"); return(false); } } else { TraceMethod.RecordInfo($"Original Signal[{SignalInfo.Info}] SigTypeFunc={SignalInfo.Signal_Type_Function} is unknow!"); return(false); } return(true); }
public string GenerateMessage(BEACON Beacon, int LineID, Message Msg) { this.msg = Msg; this.bibbm = Beacon.m_ibbmInfo; this.BMB_Distance_Unitcm = Beacon.BMB_Distance_cm; setValue(LineID, Beacon.m_layoutInfo); return(GenerateMessage()); }
public string m_Type; // add to save IBBM beacon type public BEACON(IBeaconInfo BInfo, GENERIC_SYSTEM_PARAMETERS.IMPLEMENTATION_BEACON_BLOCK_MODE.BM_BEACON ibbm) { m_layoutInfo = BInfo; m_ibbmInfo = ibbm; m_UpstreamLst = new List <PathInfo>(); m_AppOrgSigLst = new List <OriginSignal>(); //todo now this must be called here //ibbm.GetBeaconType(); m_Type = ibbm.GetBeaconType(); }
//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); } } }
public bool CalOverlap(GENERIC_SYSTEM_PARAMETERS.IMPLEMENTATION_BEACON_BLOCK_MODE.BM_BEACON ibbm) { //BMGR-0026 if (null != DstSig.Overlap_ID)//get overlap { var ol = (GENERIC_SYSTEM_PARAMETERS.OVERLAPS.OVERLAP)Sys.GetNode((int)DstSig.Overlap_ID,SyDB.GetInstance().overlapInfoList.Cast <Node>().ToList()); m_overlap = new ObjOverlap(ol,DstSig); //BMGR-0067 if (false == m_overlap.GeneratePath(ibbm)) { TraceMethod.RecordInfo($"RouteSegment {Info} generate overlap path error!"); return(false); } } else { m_overlap = null; } return(true); }
public void test_overlapAPI() { Prepare.ReloadGlobalSydb(".//input//overlapsSydb_FromHHHT2.xml"); ObjOverlap ovelap = new ObjOverlap(null, null); Debug.Assert(true == ovelap.GeneratePath(null)); Debug.Assert(ovelap.GetSigname() == "Null"); Dictionary <string, string[]> validoverlaps = new Dictionary <string, string[]>() { //overlap //dstSig //ibbm //variant num //olpathInfo { "O_S0101", new string[] { "S0101", "VB0101", "0", "" } }, { "O_S0102", new string[] { "S0102", "VB0102", "0", "" } }, { "O_S0103", new string[] { "S0103", "VB0103", "0", "S0103" } }, { "O_S0107", new string[] { "S0107", "VB0107", "2", "S0107|P0101-N S0107|P0101-R" } }, { "O_S0107_N", new string[] { "S0107", "VB0107", "2", "S0107|P0101-N" } }, { "O_S0107_R", new string[] { "S0107", "VB0107", "2", "S0107|P0101-R" } }, { "O_S0107_NOIN", new string[] { "S0107", "VB0107E", "2", "S0107|P0101-R" } }, { "O_X0109", new string[] { "X0109", "VB0109", "6", "X0109|P0105-R|P0103-R|P0102-R" } }, { "O_S0304", new string[] { "S0304", "VB0304", "4", "S0304|P0302-N|P0602-N S0304|P0302-N|P0602-R" } }, { "O_S0304_NOIN", new string[] { "S0304", "VB0304E", "4", "S0304|P0302-N|P0602-R" } }, { "O_S1101_N", new string[] { "S1101", "VB1101", "4", "S1101|P1101-N|P1103-N" } }, { "O_S1101_R", new string[] { "S1101", "VB1101", "2", "S1101|P1101-R" } }, { "O_S0608", new string[] { "S0608", "VB0608", "6", "S0608|P0606-N|P0608-N|P0610-R S0608|P0606-R" } } }; #region check for valid ovelap { foreach (var ol in sydb.overlapInfoList) { if (validoverlaps.ContainsKey(ol.Name)) { string signame = validoverlaps[ol.Name][0]; GENERIC_SYSTEM_PARAMETERS.SIGNALS.SIGNAL sig = (GENERIC_SYSTEM_PARAMETERS.SIGNALS.SIGNAL)Sys.GetNode(signame,sydb.signalInfoList.Cast <Node>().ToList()); ObjOverlap overlap = new ObjOverlap(ol,sig); Debug.Assert(overlap.GetSigname() == signame); GENERIC_SYSTEM_PARAMETERS.IMPLEMENTATION_BEACON_BLOCK_MODE.BM_BEACON inb = (GENERIC_SYSTEM_PARAMETERS.IMPLEMENTATION_BEACON_BLOCK_MODE.BM_BEACON)Sys.GetNode(validoverlaps[ol.Name][1],sydb.ibbmInfoList.Cast <Node>().ToList()); Debug.Assert(true == overlap.GeneratePath(inb)); Debug.Assert(validoverlaps[ol.Name][3] == Prepare.getXmlNodeStr(overlap.GetXmlNode(),"/Path/@NAME")); List <Variant> vlist = new List <Variant>(); Debug.Assert(true == overlap.CalVariants(vlist)); Debug.Assert(vlist.Count.ToString() == validoverlaps[ol.Name][2]); haschecked = true; } } Debug.Assert(haschecked == true); haschecked = false; } #endregion }
//BMGR-0067 //dst sig -> start blk //start blk, blk list, end overlap blk lst -> path list public bool GeneratePath(GENERIC_SYSTEM_PARAMETERS.IMPLEMENTATION_BEACON_BLOCK_MODE.BM_BEACON input) { if ("" == m_switchPos)//no path will generate { return(true); } if (0 == m_Ol.Overlap_Switch_ID_List.Switch_ID.Count) { //this ol has no point, so only 1 path with no point. PathInfo path = new PathInfo(m_sig); m_pathLst.Add(path); } else { if (null == m_sig || false == m_sig.checkDirection()) { TraceMethod.RecordInfo($"GeneratePath error, {Info} sig[{GetSigname()}] is invalid !"); return(false); } if (0 == m_Ol.Overlap_Block_ID_List.Block_ID.Count) { TraceMethod.RecordInfo($"GeneratePath error, {Info} Overlap_Block_ID_List is empty!"); return(false); } foreach (string pos in Sys.PointPositions) { if (m_switchPos == pos || "Either" == m_switchPos) { var startB = (GENERIC_SYSTEM_PARAMETERS.BLOCKS.BLOCK)Sys.GetNode((int)m_Ol.Overlap_Block_ID_List.Block_ID[0],SyDB.GetInstance().blockInfoList.Cast <Node>().ToList()); List <PointInfo> pathPtList = new List <PointInfo>(); GeneratePathPtList(startB,m_sig.Direction,pos,ref pathPtList); if (0 == pathPtList.Count) { PathInfo new1Path = new PathInfo(m_sig); m_pathLst.Add(new1Path); break;//get no point, then won't be able to has 2 path } else { PathInfo newPath = new PathInfo(m_sig,pathPtList); m_pathLst.Add(newPath); } } } if ("Either" == m_switchPos && 2 == m_pathLst.Count()) { foreach (PathInfo path in m_pathLst) { foreach (PointInfo pt in path.pointList) { if (pt.Orientation == Sys.Divergent) { //check the point-pos of first divergent point if (-1 == input.getInputRank(pt.Point.Name,pt.Position)) { //point-pos not in IBBM, then only reverse path m_pathLst.RemoveAt(0); } break; } } break; } if (2 == m_pathLst.Count()) { if (m_pathLst[0].GetOverlapPathName() == m_pathLst[1].GetOverlapPathName()) { m_pathLst.RemoveAt(1); } } } } return(true); }