管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-01-03 b138834384e977cfc93cff1c66f70676cd4e7e18
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();
                }
@@ -92,58 +89,68 @@
            switch (m.Msg)
            {
                case 0xc0: // 重置鼠标模式
                    SG.Window.SetInputMode(0);
                    break;
                    SG.Window.SetInputMode(0); break;
                case 0xc1: // 打开数据方案/打开显示场景
                    SG.Command.Execute(1001, null);
                    break;
                    SG.Command.Execute(1001, null); break;
                case 0xc2: // 保存数据方案/保存显示场景
                    SG.Command.Execute(1003, null);
                    break;
                case 0xc3: // 矢量数据(默认为*.shp)
                    SG.Command.Execute(1013, 5);
                    break;
                    SG.Command.Execute(1003, null); break;
                case 0xc3: // 矢量数据(默认为*.shp,支持Excel)
                    SG.Command.Execute(1013, 5); break;
                case 0xc4: // 影像数据(默认为*.tif)
                    SG.Command.Execute(1014, 9);
                    break;
                    SG.Command.Execute(1014, 9); break;
                case 0xc5: // 地形数据(默认为*.tif)
                    SG.Command.Execute(1014, 26);
                    break;
                    SG.Command.Execute(1014, 26); break;
                case 0xc6: // 模型数据(*.osgb)
                    //SG.Command.Execute(2342, null);
                    string path = Path.Combine(ConfigurationManager.AppSettings["tePath"], "MeshLayerTool.exe");
                    string args = " -RunApp TerraExplorer -RunConvertor -Mode ImportMeshLayer -Type osgb";
                    ExecCmd(new List<string> { "taskkill /f /t /im MeshLayerTool.exe" });
                    RunExe(path, args, false);
                    ExecCmd(new List<string> { "taskkill /f /t /im MeshLayerTool.exe" }); // SG.Command.Execute(2342, null);
                    RunExe(Path.Combine(ConfigurationManager.AppSettings["tePath"], "MeshLayerTool.exe"), " -RunApp TerraExplorer -RunConvertor -Mode ImportMeshLayer -Type osgb", false);
                    break;
                case 0xc7: // 模型数据(*.obj)
                    SG.Command.Execute(1012, 13);
                    SG.Command.Execute(1012, 13); break;
                case 0xc8: // 基础编辑(选择对象,开启编辑)
                    SG.Command.Execute(1021, null); break;
                case 0xc9: // 点量算(坐标+高程)
                    SG.Command.Execute(1023, null); break;
                case 0xca: // 点量算(坡度+坡向)
                    //
                    break;
                case 0xd1: // 点量算
                    SG.Command.Execute(1023, null);
                    break;
                case 0xd2: // 距离量算
                    SG.Command.Execute(2356, null);
                    break;
                case 0xd3: // 面积量算
                case 0xcb: // 线量算
                    SG.Command.Execute(2356, null); break;
                case 0xcc: // 面量算
                    if (SG.Command.IsChecked(2359, null))
                        SG.Window.SetInputMode(0);
                    else
                        SG.Command.Execute(2359, null);
                    break;
                case 0xcd: // 体量算(挖填方)
                /*
*/
                default:
                    base.DefWndProc(ref m);
                    break;
                case 0xce: // 角量算
                    break;
                case 0xcf: // 空间统计
                    break;
                case 0xd0: // 空间分析
                    break;
                case 0xd1: // DEM分析(剖面分析)
                    break;
                case 0xd2: // DEM分析(坡度分析)
                    break;
                case 0xd3: // DEM分析(等值线)
                    break;
                case 0xd4: // 三维模型分析(剖面分析+剖切分析)
                    break;
                case 0xd5: // 地理场景产品组装(抽取指定区域并发布离线数据包)
                    SG.Command.Execute(1028, null); break;
                case 0xd6: // 传统4D产品派生(集成osgblab)
                    InvokeOsgbLab(); break;
                default:
                    base.DefWndProc(ref m); break;
            }
        }
@@ -210,5 +217,52 @@
            return str;
        }
        public void InvokeOsgbLab()
        {
        }
        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);
        }
    }
}