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();
 }
Exemple #3
0
 void MapGis_MouseMove(object sender, MouseEventArgs e)
 {
     if (EventStaticObject != null)
     {
         if (StaticCanMove)
         {
             PointF p = ZzhaControlLibrary.PositionChanger.PositionChange(new PointF(MapGis.MapX, MapGis.MapY), new PointF(0, 0), e.Location);
             p = ZzhaControlLibrary.PositionChanger.ZoomPositionChange(Convert.ToDouble(MapGis.OldMapWidth) / Convert.ToDouble(MapGis._MapWidth), p);
             this.EventStaticObject.StaticPoint = p;
             MapGis.FalshStatics();
             MapGis.FlashMap();
         }
     }
 }