示例#1
0
        private void RefreshMonitor()
        {
            foreach (UserControl ctl in asrsMonitors)
            {
                AsrsStatUserCtl asrsUserCtl = ctl as AsrsStatUserCtl;
                string          houseName   = asrsUserCtl.ID;
                int             errCode     = 0;
                string[]        status      = null;
                if (!AsrsMonitor.GetAsrsStat(houseName, ref errCode, ref status))
                {
                    Console.WriteLine("获取{0}状态失败", houseName);
                    continue;
                }
                List <StatItem> asrsStatItems = new List <StatItem>();
                if (status.Count() < 3)
                {
                    continue;
                }
                StatItem stat = new StatItem();
                stat.statDesc = status[0];
                if (errCode > 0)
                {
                    stat.bkgColor = Color.Red;
                }
                asrsStatItems.Add(stat);
                stat          = new StatItem();
                stat.statDesc = status[1];

                asrsStatItems.Add(stat);
                stat          = new StatItem();
                stat.statDesc = status[2];
                asrsStatItems.Add(stat);
                asrsUserCtl.UpdateAsrsStat(asrsStatItems.ToArray());
            }
        }
示例#2
0
        public void Init()
        {
            if (AsrsMonitor != null)
            {
                string[] houseNames = AsrsMonitor.GetAllAsrsHousNames();
                foreach (string houseName in houseNames)
                {
                    AsrsStatUserCtl statUserCtl = new AsrsStatUserCtl();
                    statUserCtl.ID = houseName;
                    asrsMonitors.Add(statUserCtl);
                }
            }

            //
            // this.portBufView.AsrsPorts = presenter.AsrsPorts;
        }