示例#1
0
        public void InitTscData(TscInfo ti)
        {
            TscData td   = new TscData();
            Node    node = new Node(ti.Ip, ti.Name, ti.Version, ti.Port);

            td.Node = node;
            Application.Current.Properties[Define.TSC_DATA] = td;
            try
            {
                td.ListSchedule = TscDataUtils.GetSchedule();
                td.ListPlan     = TscDataUtils.GetPlan();
                td.ListModule   = TscDataUtils.GetModule();
                td.ListPhase    = TscDataUtils.GetPhase();
                try
                {
                    td.ListCollision  = TscDataUtils.GetCollision();
                    td.Node.sProtocol = "GBT_V32";
                }
                catch (Exception ex)
                {
                    td.ListCollision  = TscDataUtils.GetCollision16();
                    td.Node.sProtocol = "GBT_V16";
                }

                td.ListDetector = TscDataUtils.GetDetector();
                td.ListChannel  = TscDataUtils.GetChannel();
                td.ListEventLog = TscDataUtils.GetEventLog();
                td.ListPattern  = TscDataUtils.GetPattern();
                try
                {
                    td.ListStagePattern = TscDataUtils.GetStagePattern();
                }
                catch (Exception ex)
                {
                    td.ListStagePattern = TscDataUtils.GetStagePattern16();
                }

                td.ListOverlapPhase = TscDataUtils.GetOverlapPhase();

                td.ListPhaseToDirec = TscDataUtils.GetPhaseToDirec();
                td.ListLampCheck    = TscDataUtils.GetLampCheck();
                currentTI           = null;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                MessageBox.Show("信号机为16相位,协议无法匹配!");
            }
        }