Exemple #1
0
        private void AddSelectedStations()
        {
            this.MapGis.ClearAllStation();
            DataTable stationinfodt = new Graphics_StationInfoBLL().GetStationInfo();

            if (stationinfodt != null && stationinfodt.Rows.Count > 0)
            {
                for (int i = 0; i < stationinfodt.Rows.Count; i++)
                {
                    if (((DataGridViewCheckBoxCell)dgvStations.Rows[i].Cells[0]).Value == ((DataGridViewCheckBoxCell)dgvStations.Rows[i].Cells[0]).TrueValue)
                    {
                        string stationID    = stationinfodt.Rows[i][0].ToString() + "." + stationinfodt.Rows[i][1].ToString();
                        string stationName  = stationinfodt.Rows[i][2].ToString();
                        float  stationheadx = float.Parse(stationinfodt.Rows[i][3].ToString());
                        float  stationheady = float.Parse(stationinfodt.Rows[i][4].ToString());
                        if (System.IO.File.Exists(Application.StartupPath + "\\MapGis\\ShineImage\\Signal.gif"))
                        {
                            this.MapGis.AddStation(stationheadx, stationheady, stationName, stationID, "正常", new Bitmap(Application.StartupPath + "\\MapGis\\ShineImage\\Signal.gif"));
                        }
                        else
                        {
                            MessageBox.Show("系统提供的图形文件已不存在!", "提示", MessageBoxButtons.OK);
                            return;
                        }
                    }
                }
            }
            MapGis.FalshStations();
            MapGis.FalshStatics();
            MapGis.FlashMap();
        }
 private void AddSelectedStations()
 {
     this.MapGis.ClearAllStation();
     DataTable stationinfodt = dpicbll.GetStationHeadByFileID(FileID);
     if (stationinfodt != null && stationinfodt.Rows.Count > 0)
     {
         for (int i = 0; i < stationinfodt.Rows.Count; i++)
         {
             //if (dgvStations.Rows[i].Cells[0].Value != null && dgvStations.Rows[i].Cells[0].Value.ToString() == "1")
             //{
                 string stationID = stationinfodt.Rows[i][0].ToString() + "." + stationinfodt.Rows[i][1].ToString();
                 string stationName = stationinfodt.Rows[i][2].ToString();
                 float stationheadx = float.Parse(stationinfodt.Rows[i][3].ToString());
                 float stationheady = float.Parse(stationinfodt.Rows[i][4].ToString());
                 if (System.IO.File.Exists(Application.StartupPath + "\\MapGis\\ShineImage\\Signal.gif"))
                 {
                     this.MapGis.AddStation(stationheadx, stationheady, stationName, stationID, "正常", new Bitmap(Application.StartupPath + "\\MapGis\\ShineImage\\Signal.gif"));
                 }
                 else
                 {
                     MessageBox.Show("系统提供的图形文件已不存在!", "提示", MessageBoxButtons.OK);
                     return;
                 }
             //}
         }
     }
     MapGis.FalshStations();
     MapGis.FalshStatics();
     MapGis.FlashMap();
 }
 /// <summary>
 /// 窗体载入
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void FrmRealTime_Load(object sender, EventArgs e)
 {
     try
     {
         trvRealTime.Nodes.Add("qy", "按区域划分");
         trvRealTime.Nodes.Add("gz", "按工种划分");
         trvRealTime.Nodes.Add("bm", "按部门划分");
         pnlRealTime.Visible = false;
         LoadGisMapInfo();
         if (System.IO.File.Exists(MapFilePath))
         {
             this.MapGis.MapFilePath     = MapFilePath;
             this.MapGis.StationFilePath = StationFilePath;
         }
         else
         {
             MessageBox.Show("您所配置的图形已经失效,请重新配置后使用..", "提示", MessageBoxButtons.OK);
             return;
         }
         if (isConfiged)
         {
             DataTable stationinfodt = new Graphics_StationInfoBLL().GetStationInfo();
             if (stationinfodt != null && stationinfodt.Rows.Count > 0)
             {
                 try
                 {
                     for (int i = 0; i < stationinfodt.Rows.Count; i++)
                     {
                         string stationID    = stationinfodt.Rows[i][0].ToString() + "." + stationinfodt.Rows[i][1].ToString();
                         string stationName  = stationinfodt.Rows[i][2].ToString();
                         float  stationheadx = float.Parse(stationinfodt.Rows[i][3].ToString());
                         float  stationheady = float.Parse(stationinfodt.Rows[i][4].ToString());
                         string stationstate = stationinfodt.Rows[i][5].ToString();
                         if (this.StationFilePath != null && this.StationFilePath != "")
                         {
                             if (stationstate == "正常")
                             {
                                 this.MapGis.AddStation(stationheadx, stationheady, stationName, stationID, "正常", new Bitmap(StationFilePath));
                             }
                             if (stationstate == "故障")
                             {
                                 this.MapGis.AddStation(stationheadx, stationheady, stationName, stationID, stationstate, new Bitmap(Application.StartupPath + "\\MapGis\\ShineImage\\No-Signal.gif"));
                             }
                             if (stationstate == "休眠")
                             {
                                 this.MapGis.AddStation(stationheadx, stationheady, stationName, stationID, stationstate, new Bitmap(Application.StartupPath + "\\MapGis\\ShineImage\\Station.GIF"));
                             }
                         }
                     }
                     MapGis.FalshStations();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show("图形系统中部分图片已经不存在", "提示", MessageBoxButtons.OK);
                 }
             }
             IsOut = true;
             LoadRealTimeInfo();
             IsOut               = false;
             FlashTimer          = new Timer();
             FlashTimer.Interval = 5000;
             FlashTimer.Tick    += new EventHandler(t_Tick);
             FlashTimer.Start();
         }
     }
     catch (ArgumentException ex)
     {
         MessageBox.Show("您所配置的图形已经失效,请重新配置后使用..", "提示", MessageBoxButtons.OK);
     }
 }
Exemple #4
0
 private void frmRealTimeRoute_Load(object sender, EventArgs e)
 {
     try
     {
         LoadGisMapInfo();
         LoadRTempInfo();
         this.pnlRTRoute.Left = 0 - picRTRouteInOut.Left;
         if (System.IO.File.Exists(MapFilePath))
         {
             this.MapGis.MapFilePath     = MapFilePath;
             this.MapGis.StationFilePath = StationFilePath;
             this.MapGis.MinWidth        = 500;
             this.MapGis.MaxWidth        = 20000;
         }
         else
         {
             MessageBox.Show("您所配置的图形已经失效,请重新配置后使用..", "提示", MessageBoxButtons.OK);
             return;
         }
         if (isConfiged)
         {
             DataTable stationinfodt = new Graphics_StationInfoBLL().GetStationInfo();
             if (stationinfodt != null && stationinfodt.Rows.Count > 0)
             {
                 try
                 {
                     for (int i = 0; i < stationinfodt.Rows.Count; i++)
                     {
                         string stationID    = stationinfodt.Rows[i][0].ToString() + "." + stationinfodt.Rows[i][1].ToString();
                         string stationName  = stationinfodt.Rows[i][2].ToString();
                         float  stationheadx = float.Parse(stationinfodt.Rows[i][3].ToString());
                         float  stationheady = float.Parse(stationinfodt.Rows[i][4].ToString());
                         string stationstate = stationinfodt.Rows[i][5].ToString();
                         if (this.StationFilePath != null && this.StationFilePath != "")
                         {
                             if (stationstate == "正常")
                             {
                                 this.MapGis.AddStation(stationheadx, stationheady, stationName, stationID, "正常", new Bitmap(StationFilePath));
                             }
                             if (stationstate == "故障")
                             {
                                 this.MapGis.AddStation(stationheadx, stationheady, stationName, stationID, stationstate, new Bitmap(Application.StartupPath + "\\MapGis\\ShineImage\\No-Signal.gif"));
                             }
                             if (stationstate == "休眠")
                             {
                                 this.MapGis.AddStation(stationheadx, stationheady, stationName, stationID, stationstate, new Bitmap(Application.StartupPath + "\\MapGis\\ShineImage\\Station.GIF"));
                             }
                         }
                     }
                     MapGis.FalshStations();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show("图形系统中部分图片已经不存在", "提示", MessageBoxButtons.OK);
                 }
             }
         }
         this.cmbRTRouteSpeed.SelectedIndex = 0;
         pnlRTRoute.Visible     = true;
         this.MapGis.MoveEnded += new ZzhaControlLibrary.ZzhaMapGis.MoveingEnd(MapGis_MoveEnded);
         Timer t = new Timer();
         t.Interval = 10000;
         t.Tick    += new EventHandler(t_Tick);
         t.Start();
     }
     catch (Exception ex)
     {
         MessageBox.Show("图形及轨迹尚未配置完成,请配置后再使用!", "提示", MessageBoxButtons.OK);
         return;
     }
 }