管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-01-03 315766f6501751233fddda8a0e876efc74cdcebe
TEWin/FrmWin.cs
@@ -21,15 +21,9 @@
        FrmTool tool;
        public SGWorld74 SG = null;
        string mainUrl;
        public static string StartupPath
        {
            get
            {
                return System.Windows.Forms.Application.StartupPath;
            }
        }
        public SGWorld74 SG = null;
        public FrmWin()
        {
@@ -43,8 +37,9 @@
            try
            {
                LogOut.Info("开始运行..");
                mainUrl = Application.StartupPath.Replace("\\", "/");
                string fly = Path.Combine(StartupPath, "Resources\\sample.fly");
                string fly = Path.Combine(Application.StartupPath, "Resources\\sample.fly");
                if (!File.Exists(fly))
                {
                    LogOut.Error("Fly文件不存在:" + fly);
@@ -61,6 +56,8 @@
                string isTest = ConfigurationManager.AppSettings["isTest"];
                if ("1".Equals(isTest))
                {
                    this.FormBorderStyle = FormBorderStyle.FixedSingle;
                    tree.FormBorderStyle = FormBorderStyle.FixedSingle;
                    tool = new FrmTool(this);
                    tool.Show();
                }
@@ -90,6 +87,19 @@
        protected override void DefWndProc(ref Message m)
        {
            switch (m.Msg)
            {
                case 0x64:
                    InvokeByCode(m.WParam.ToInt32()); break;
                case 0x4A:
                    MessageBox.Show("Test."); break;
                default:
                    base.DefWndProc(ref m); break;
            }
        }
        public void InvokeByCode(int code)
        {
            switch (code)
            {
                case 0xc0: // 重置鼠标模式
                    SG.Window.SetInputMode(0); break;
@@ -152,15 +162,14 @@
                    SG.Command.Execute(1028, null); break;
                case 0xd6: // 传统4D产品派生(集成osgblab)
                    InvokeOsgbLab(); break;
                default:
                    base.DefWndProc(ref m); break;
            }
        }
        public void InvokeProc(int code)
        {
            Message m = new Message();
            m.Msg = code;
            m.Msg = 0x4A;
            m.WParam = new IntPtr(code);
            this.DefWndProc(ref m);
        }
@@ -225,5 +234,47 @@
        {
        }
        public void ShowHtmlByid(int id, int arg)
        {
            switch (id)
            {
                case 1034:
                    this.ShowHtml("距离测量", mainUrl + "/Resources/DistanceMeasurement/distanceMeasurement.html", 20, 20, 400, 245);
                    break;
                case 1037:
                    this.ShowHtml("面积测量", mainUrl + "/Resources/AreaMeasurement/AreaMeasurement.html", 20, 20, 400, 245);
                    break;
                case 1149:
                    if (28 == arg)
                        this.ShowHtml("剖面分析", mainUrl + "/Resources/TerrainProfile/TerrainProfile.html", 20, 20, 400, 290);
                    else
                        this.ShowHtml("剖切分析", mainUrl + "/Resources/CrossSection/CrossSection.html", 20, 20, 400, 225);
                    break;
                case 1093:
                    this.ShowHtml("坡度分析", mainUrl + "/Resources/SlopeMapQuery/SlopeMapQuery.html", 20, 20, 350, 365);
                    break;
                case 1045:
                    this.ShowHtml("体积分析", mainUrl + "/Resources/Volume/Volume.html", 20, 20, 350, 225);
                    break;
            }
        }
        public void ShowHtml(string tile, string url, int left, int top, int width, int height)
        {
            if (SG.Window.GetPopupByCaption(tile) != null)
            {
                SG.Window.RemovePopupByCaption(tile);
            }
            var popup = SG.Creator.CreatePopupMessage(tile, url, left, top, width, height);
            popup.AllowResize = true;
            popup.ShowCaption = true;
            popup.AllowDrag = true;
            popup.Width = width;
            popup.Height = height;
            SG.Window.ShowPopup(popup);
        }
    }
}