Exemplo n.º 1
0
        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
        }
Exemplo n.º 2
0
        public XmlVisitor GetCombinedSectionsNode()
        {
            XmlVisitor Node = XmlVisitor.Create("Combined_sections", null);

//BMGR-0048 red signal has <Combined_sections />

            if (null != upPath)
            {//BMGR-0070
                AddCombinSectionNode(ref Node, "Upstream_section", upPath.GetUpstreamPathName());
                UpSection = upPath.GetUpstreamPathName();
            }

            if (null != rpRs)
            {//BMGR-0077
                AddCombinSectionNode(ref Node, "Reopening_section", rpRs.GetName());
                RpSection = rpRs.GetName();
            }

            if (null != apRs)
            {//BMGR-0078
                AddCombinSectionNode(ref Node, "Approach_section", apRs.GetName());
                ApSection = apRs.GetName();
            }

            //BMGR-0079
            if (null != olPath)
            {
                AddCombinSectionNode(ref Node, "Overlap_section", olPath.GetOverlapPathName());
                OlSection = olPath.GetOverlapPathName();
            }
            else if (null != overlap)
            {
                AddCombinSectionNode(ref Node, "Overlap_section", overlap.GetSigname());
                OlSection = overlap.GetSigname();
            }

            return(Node);
        }