//private void InitPicListPanel()
        //{
        //    this.labGifTitle = new Label();
        //    labGifTitle.Left = 0;
        //    labGifTitle.Top = cpStationHead.Bottom;
        //}

        

        private void MapGis_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (isPic)
                {
                    if (lsvImg.SelectedItems.Count > 0)
                    {
                        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);
                        MapGis.AddStaticObj(p.X, p.Y, new Bitmap(Application.StartupPath + imgFileht[lsvImg.SelectedItems[0].Text].ToString()), imgFileht[lsvImg.SelectedItems[0].Text].ToString(), LastSelectNode.Text, ZzhaControlLibrary.StaticType.Image, Label.DefaultFont, Color.Red);
                    }
                }
                else
                {
                    if (trvRealTime.SelectedNode != null)
                    {
                        if (this.trvRealTime.SelectedNode.Name != "bm" && this.trvRealTime.SelectedNode.Name != "gz" && this.trvRealTime.SelectedNode.Name != "qy" && this.trvRealTime.SelectedNode.Name != "cf")
                        {
                            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);
                            MapGis.AddStaticObj(p.X, p.Y, trvRealTime.SelectedNode.Text, trvRealTime.SelectedNode.Name, LastSelectNode.Text, Label.DefaultFont, Color.Red);
                        }
                    }
                }
                MapGis.FlashAll();
            }
        }
 private void tsmiWordConfig_Click(object sender, EventArgs e)
 {
     if (EventStaticObject != null)
     {
         frmWordConfig f;
         if (EventStaticObject.StaticName == "")
             f = new frmWordConfig();
         else
             f = new frmWordConfig(EventStaticObject.StaticName, EventStaticObject.NameKey);
         if (f.ShowDialog() == DialogResult.OK)
         {
             if (f.ConfigLab.Text != "")
             {
                 if (EventStaticObject.StaticImage != null)
                 {
                     EventStaticObject.Type = ZzhaControlLibrary.StaticType.ImageAndWord;
                 }
                 EventStaticObject.StaticName = f.ConfigLab.Text;
                 EventStaticObject.StaticFont = f.ConfigLab.Font;
                 EventStaticObject.StaticColor = f.ConfigLab.ForeColor;
                 EventStaticObject.NameKey = f.Key;
             }
             MapGis.FlashAll();
         }
     }
 }
 private void tsmiDel_Click(object sender, EventArgs e)
 {
     if (this.EventStaticObject != null)
     {
         MapGis.DelStaticObj(this.EventStaticObject);
         MapGis.FlashAll();
     }
 }
 private void tsmiConfig_Click(object sender, EventArgs e)
 {
     if (this.EventStaticObject != null)
     {
         frmStaticConfig f = new frmStaticConfig(EventStaticObject, MapGis);
         f.ShowDialog();
         MapGis.FlashAll();
     }
 }
Exemple #5
0
        private void labColor_Click(object sender, EventArgs e)
        {
            ColorDialog Cdlg = new ColorDialog();

            if (Cdlg.ShowDialog() == DialogResult.OK)
            {
                labColor.BackColor   = Cdlg.Color;
                MapGis.MoverStrColor = Cdlg.Color;
                MapGis.FlashAll();
            }
        }
 private bool CanShowMap()
 {
     try
     {
         //this.MapGis.MapFilePath = Application.StartupPath + MapFilePath;
         try
         {
             DataTable dt     = dpicbll.GetBackPicByFileID(FileID);
             byte[]    buffer = (byte[])dt.Rows[0][0];
             Graphics.Config.FileChanger fc = new KJ128NMainRun.Graphics.Config.FileChanger();
             if (!System.IO.Directory.Exists(Application.StartupPath + "\\MapGis\\DMap"))
             {
                 System.IO.Directory.CreateDirectory(Application.StartupPath + "\\MapGis\\DMap");
             }
             fc.CreateFile(Application.StartupPath + "\\MapGis\\DMap\\" + dt.Rows[0][1].ToString(), buffer);
             this.MapGis.MapFilePath = Application.StartupPath + "\\MapGis\\DMap\\" + dt.Rows[0][1].ToString();
             System.IO.File.Delete(Application.StartupPath + "\\MapGis\\DMap\\" + dt.Rows[0][1].ToString());
         }
         catch (Exception ex)
         {
             MessageBox.Show("无法识别的图片!", "提示", MessageBoxButtons.OK);
             return(false);
         }
         try
         {
             if (Convert.ToInt32(ntbMin.Text) > Convert.ToInt32(ntbMax.Text))
             {
                 throw new Exception();
             }
             this.MapGis.MinWidth = Convert.ToInt32(ntbMin.Text);
             this.MapGis.MaxWidth = Convert.ToInt32(ntbMax.Text);
         }
         catch (Exception ex)
         {
             MessageBox.Show("图层显示范围没有配置或配置不正确,请检查!", "提示", MessageBoxButtons.OK);
             return(false);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("存取文件异常!", "提示", MessageBoxButtons.OK);
         return(false);
     }
     AddSelectedStations();
     //LoadStatic();
     HasMonied = true;
     MapGis.FlashAll();
     pnl2.Visible = true;
     pnl3.Visible = true;
     return(true);
 }
 private void btnLoadRoute_Click(object sender, EventArgs e)
 {
     if (MapGis.RouteList.Count == 0)
     {
         DataTable stationposition = dpicbll.GetStationPositionByFileID(this.FileID);
         DataTable routedt         = dpicbll.GetRouteInfoPositionByFileID(this.FileID);
         if (routedt.Rows.Count > 0)
         {
             this.MapGis.ClareRouteModelList();
             this.MapGis.ClearAllStation();
             for (int i = 0; i < stationposition.Rows.Count; i++)
             {
                 string stationname = stationposition.Rows[i][0].ToString();
                 PointF p           = new PointF(float.Parse(stationposition.Rows[i][1].ToString()), float.Parse(stationposition.Rows[i][2].ToString()));
                 MapGis.AddConfigStation(stationname, p);
             }
             for (int i = 0; i < routedt.Rows.Count; i++)
             {
                 if (i % 2 != 0)
                 {
                     ZzhaControlLibrary.RouteModel rm = new RouteModel();
                     string   from   = routedt.Rows[i][0].ToString();
                     string[] fromxy = from.Split(',');
                     rm.From = new PointF(float.Parse(fromxy[0]), float.Parse(fromxy[1]));
                     string   to   = routedt.Rows[i][1].ToString();
                     string[] toxy = to.Split(',');
                     rm.To          = new PointF(float.Parse(toxy[0]), float.Parse(toxy[1]));
                     rm.RouteLength = int.Parse(routedt.Rows[i][2].ToString());
                     MapGis.AddConfigRouteModel(rm);
                 }
             }
             MapGis.FlashAll();
             this.btnCreate.Enabled    = true;
             this.btnLoadRoute.Enabled = false;
         }
         else
         {
             MessageBox.Show("您尚未配置过路径,无法载入上次路径配置信息...", "提示", MessageBoxButtons.OK);
         }
     }
 }
Exemple #8
0
 private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     try
     {
         if (Convert.ToInt32(ntbMin.Text) > Convert.ToInt32(ntbMax.Text))
         {
             throw new Exception();
         }
         this.MapGis.MinWidth    = Convert.ToInt32(ntbMin.Text);
         this.MapGis.MaxWidth    = Convert.ToInt32(ntbMax.Text);
         this.MapGis.MapFilePath = Application.StartupPath + MapFilePath;
     }
     catch (Exception ex)
     {
         MessageBox.Show("图层显示范围没有配置或配置不正确,请检查!", "提示", MessageBoxButtons.OK);
         return;
     }
     AddSelectedStations();
     LoadStatic();
     HasMonied = true;
     MapGis.FlashAll();
 }
 private void 载入路径LToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (MapGis.RouteList.Count == 0)
     {
         DataTable stationposition = new Graphics_RouteBLL().GetStationHeadPosition();
         DataTable routedt         = new Graphics_RouteBLL().GetAllRoute();
         if (routedt.Rows.Count > 0)
         {
             this.MapGis.ClareRouteModelList();
             this.MapGis.ClearAllStation();
             for (int i = 0; i < stationposition.Rows.Count; i++)
             {
                 string stationname = stationposition.Rows[i][0].ToString();
                 PointF p           = new PointF(float.Parse(stationposition.Rows[i][1].ToString()), float.Parse(stationposition.Rows[i][2].ToString()));
                 MapGis.AddConfigStation(stationname, p);
             }
             for (int i = 0; i < routedt.Rows.Count; i++)
             {
                 ZzhaControlLibrary.RouteModel rm = new RouteModel();
                 string   from   = routedt.Rows[i][0].ToString();
                 string[] fromxy = from.Split(',');
                 rm.From = new PointF(float.Parse(fromxy[0]), float.Parse(fromxy[1]));
                 string   to   = routedt.Rows[i][1].ToString();
                 string[] toxy = to.Split(',');
                 rm.To          = new PointF(float.Parse(toxy[0]), float.Parse(toxy[1]));
                 rm.RouteLength = int.Parse(routedt.Rows[i][2].ToString());
                 MapGis.AddConfigRouteModel(rm);
             }
             MapGis.FlashAll();
         }
         else
         {
             MessageBox.Show("您尚未配置过路径,无法载入上次路径配置信息...", "提示", MessageBoxButtons.OK);
         }
     }
 }