Esempio n. 1
0
        private void JudgeSection(StringData orgsection, List <string> ptList, List <string> sigList)
        {
            if (null == orgsection)
            {
                return;
            }
            string section = orgsection.ToString();

            if (!string.IsNullOrEmpty(section))
            {
                List <string> splits = section.Split('|').ToList();
                foreach (string node in splits)
                {
                    //道岔定位
                    if (node.EndsWith("-N"))
                    {
                        string name = node.Substring(0, node.IndexOf("-N"));
                        GENERIC_SYSTEM_PARAMETERS.POINTS.POINT point = (GENERIC_SYSTEM_PARAMETERS.POINTS.POINT)Sys.GetNode(name, sydb.pointInfoList.Cast <Node>().ToList());
                        if (null != point)
                        {
                            string idName = point.ID + "-N";
                            if (!ptList.Contains(idName))
                            {
                                ptList.Add(idName);
                            }
                        }
                    }
                    else if (node.EndsWith("-R"))//道岔范围
                    {
                        string name = node.Substring(0, node.IndexOf("-R"));
                        GENERIC_SYSTEM_PARAMETERS.POINTS.POINT point = (GENERIC_SYSTEM_PARAMETERS.POINTS.POINT)Sys.GetNode(name, sydb.pointInfoList.Cast <Node>().ToList());
                        if (null != point)
                        {
                            string idName = point.ID + "-R";
                            if (!ptList.Contains(idName))
                            {
                                ptList.Add(idName);
                            }
                        }
                    }
                    else
                    {
                        GENERIC_SYSTEM_PARAMETERS.SIGNALS.SIGNAL signal = sydb.signalInfoList.Find(x => x.Name == node);
                        if (null != signal)
                        {
                            if (!sigList.Contains(signal.ID.ToString()))
                            {
                                sigList.Add(signal.ID.ToString());
                            }
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        private bool GenerateBeaconData()
        {
            bool rt = true;
            //BMGR-0022
            //read route info from sydb
            //split the routes into RouteSpacing and Spacing routes
            RouteSegConfig SyDBRouteCfg = new RouteSegConfig(sydb);

            SyDBRouteCfg.generateRouteSegments();

            for (int i = 0; i < beaconList.Count(); ++i)
            {
                #region [originsignal]

                foreach (GENERIC_SYSTEM_PARAMETERS.IMPLEMENTATION_BEACON_BLOCK_MODE.BM_BEACON.INPUT_SIGNAL inSig in beaconList[i].m_ibbmInfo.Input_Signal)
                {
                    GENERIC_SYSTEM_PARAMETERS.SIGNALS.SIGNAL OrgSig = sydb.signalInfoList.Find(x => x.Name == inSig.Name.ToString());

                    if (null == OrgSig)
                    {
                        TraceMethod.RecordInfo($"Warning:{inSig.Info} can't find in sydb.signals, no data will generate for it!");
                        continue;
                    }

                    //create an OriginSignal by IBBM input and the real signal
                    OriginSignal newOrgSig = new OriginSignal(OrgSig, inSig);

                    if (false == newOrgSig.GetRouteSegments(SyDBRouteCfg, beaconList[i].m_ibbmInfo))
                    {
                        TraceMethod.RecordInfo($"Warning:IBBM {inSig.Info} to {beaconList[i].Info} Generate RouteSegments fail!");
                    }

                    if (Sys.Reopening == inSig.Type)
                    {
                        beaconList[i].m_ReopenOrgSig = newOrgSig;
                    }
                    else if (Sys.Approach == inSig.Type)
                    {
                        beaconList[i].m_AppOrgSigLst.Add(newOrgSig);
                    }
                    else
                    {
                        TraceMethod.RecordInfo($"IBBM {inSig.Info} to {beaconList[i].Info} error, unknown type");
                    }
                }
                #endregion

                GenerateVariantList(beaconList[i]);
            }

            return(rt);
        }