管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-07-18 0747d6d46796671408d6325f664be3404f57aaa6
添加工具类
已添加11个文件
已修改6个文件
315 ■■■■ 文件已修改
SimuTools/App.config 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/FrmMain.Designer.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/FrmMain.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/Log.config 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/Properties/Resources.Designer.cs 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/Properties/Settings.Designer.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/SimuTools.csproj 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/Tools/LogOut.cs 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/dlls/gdal_csharp.dll 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/dlls/gdal_wrap.dll 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/dlls/gdalconst_csharp.dll 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/dlls/gdalconst_wrap.dll 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/dlls/log4net4.dll 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/dlls/ogr_csharp.dll 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/dlls/ogr_wrap.dll 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/dlls/osr_csharp.dll 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/dlls/osr_wrap.dll 补丁 | 查看 | 原始文档 | blame | 历史
SimuTools/App.config
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0"?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
    </startup>
</configuration>
  <appSettings>
    <add key="sizes" value="64,128,256,512,1024,2048"/>
  </appSettings>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
  </startup>
</configuration>
SimuTools/FrmMain.Designer.cs
@@ -37,7 +37,6 @@
            this.txtFlowPath = new System.Windows.Forms.TextBox();
            this.lblFlow = new System.Windows.Forms.Label();
            this.btnFlowPath = new System.Windows.Forms.Button();
            this.tabLogs = new System.Windows.Forms.ListBox();
            this.btnRun = new System.Windows.Forms.Button();
            this.SuspendLayout();
            // 
@@ -134,22 +133,11 @@
            this.btnFlowPath.UseVisualStyleBackColor = true;
            this.btnFlowPath.Click += new System.EventHandler(this.btnFlowPath_Click);
            // 
            // tabLogs
            //
            this.tabLogs.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.tabLogs.FormattingEnabled = true;
            this.tabLogs.ItemHeight = 16;
            this.tabLogs.Location = new System.Drawing.Point(27, 176);
            this.tabLogs.Name = "tabLogs";
            this.tabLogs.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;
            this.tabLogs.Size = new System.Drawing.Size(670, 340);
            this.tabLogs.TabIndex = 56;
            //
            // btnRun
            // 
            this.btnRun.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.btnRun.ForeColor = System.Drawing.SystemColors.Highlight;
            this.btnRun.Location = new System.Drawing.Point(27, 540);
            this.btnRun.Location = new System.Drawing.Point(27, 172);
            this.btnRun.Name = "btnRun";
            this.btnRun.Size = new System.Drawing.Size(670, 26);
            this.btnRun.TabIndex = 57;
@@ -161,9 +149,8 @@
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(735, 594);
            this.ClientSize = new System.Drawing.Size(735, 222);
            this.Controls.Add(this.btnRun);
            this.Controls.Add(this.tabLogs);
            this.Controls.Add(this.txtFlowPath);
            this.Controls.Add(this.lblFlow);
            this.Controls.Add(this.btnFlowPath);
@@ -176,6 +163,7 @@
            this.Name = "FrmMain";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "内涝仿真工具";
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
            this.Load += new System.EventHandler(this.FrmMain_Load);
            this.ResumeLayout(false);
            this.PerformLayout();
@@ -193,7 +181,6 @@
        private System.Windows.Forms.TextBox txtFlowPath;
        private System.Windows.Forms.Label lblFlow;
        private System.Windows.Forms.Button btnFlowPath;
        private System.Windows.Forms.ListBox tabLogs;
        private System.Windows.Forms.Button btnRun;
    }
}
SimuTools/FrmMain.cs
@@ -1,4 +1,5 @@
using System;
using SimuTools.Tools;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -19,7 +20,12 @@
        private void FrmMain_Load(object sender, EventArgs e)
        {
            LogOut.Info("启动程序...");
        }
        private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            LogOut.Info("关闭程序...");
        }
        private void btnTerrainPath_Click(object sender, EventArgs e)
SimuTools/Log.config
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <!--日志配置部分-->
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
  </configSections>
  <!--站点日志配置部分-->
  <log4net>
    <root>
      <!-- æ—¥å¿—等级:ALL|DEBUG|INFO|WARN|ERROR|FATAL|OFF -->
      <priority value="INFO"/>
      <appender-ref ref="RollingFileAppender"/>
    </root>
    <appender name="TraceAppender" type="log4net.Appender.TraceAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date%newline%message"/>
      </layout>
    </appender>
    <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date%newline%message"/>
      </layout>
    </appender>
    <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
      <file value="log.txt"/>
      <appendToFile value="true"/>
      <maxSizeRollBackups value="5"/>
      <maximumFileSize value="10MB"/>
      <rollingStyle value="Size"/>
      <staticLogFileName value="true"/>
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date%newline%message"/>
      </layout>
    </appender>
  </log4net>
</configuration>
SimuTools/Properties/Resources.Designer.cs
@@ -1,17 +1,17 @@
//------------------------------------------------------------------------------
// <auto-generated>
//     æ­¤ä»£ç ç”±å·¥å…·ç”Ÿæˆã€‚
//     è¿è¡Œæ—¶ç‰ˆæœ¬: 4.0.30319.42000
//     è¿è¡Œæ—¶ç‰ˆæœ¬:4.0.30319.42000
//
//     å¯¹æ­¤æ–‡ä»¶çš„æ›´æ”¹å¯èƒ½ä¼šå¯¼è‡´ä¸æ­£ç¡®çš„行为,并且如果
//     é‡æ–°ç”Ÿæˆä»£ç ï¼Œè¿™äº›æ›´æ”¹å°†ä¸¢å¤±ã€‚
//     é‡æ–°ç”Ÿæˆä»£ç ï¼Œè¿™äº›æ›´æ”¹å°†ä¼šä¸¢å¤±ã€‚
// </auto-generated>
//------------------------------------------------------------------------------
namespace SimuTools.Properties
{
namespace SimuTools.Properties {
    using System;
    /// <summary>
    ///   ä¸€ä¸ªå¼ºç±»åž‹çš„资源类,用于查找本地化的字符串等。
    /// </summary>
@@ -22,48 +22,40 @@
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources
    {
    internal class Resources {
        private static global::System.Resources.ResourceManager resourceMan;
        private static global::System.Globalization.CultureInfo resourceCulture;
        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources()
        {
        internal Resources() {
        }
        /// <summary>
        ///   è¿”回此类使用的、缓存的 ResourceManager å®žä¾‹ã€‚
        ///   è¿”回此类使用的缓存的 ResourceManager å®žä¾‹ã€‚
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager
        {
            get
            {
                if ((resourceMan == null))
                {
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SimuTools.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }
        /// <summary>
        ///   ä¸ºæ‰€æœ‰èµ„源查找重写当前线程的 CurrentUICulture å±žæ€§ï¼Œ
        ///   æ–¹æ³•是使用此强类型资源类。
        ///   ä½¿ç”¨æ­¤å¼ºç±»åž‹èµ„源类,为所有资源查找
        ///   é‡å†™å½“前线程的 CurrentUICulture å±žæ€§ã€‚
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture
        {
            get
            {
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set
            {
            set {
                resourceCulture = value;
            }
        }
SimuTools/Properties/Settings.Designer.cs
@@ -1,28 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//     æ­¤ä»£ç ç”±å·¥å…·ç”Ÿæˆã€‚
//     è¿è¡Œæ—¶ç‰ˆæœ¬:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
//     å¯¹æ­¤æ–‡ä»¶çš„æ›´æ”¹å¯èƒ½ä¼šå¯¼è‡´ä¸æ­£ç¡®çš„行为,并且如果
//     é‡æ–°ç”Ÿæˆä»£ç ï¼Œè¿™äº›æ›´æ”¹å°†ä¼šä¸¢å¤±ã€‚
// </auto-generated>
//------------------------------------------------------------------------------
namespace SimuTools.Properties
{
namespace SimuTools.Properties {
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
    {
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
        public static Settings Default
        {
            get
            {
        public static Settings Default {
            get {
                return defaultInstance;
            }
        }
SimuTools/SimuTools.csproj
@@ -9,8 +9,9 @@
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>SimuTools</RootNamespace>
    <AssemblyName>SimuTools</AssemblyName>
    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <TargetFrameworkProfile />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
@@ -32,6 +33,10 @@
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="log4net4, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>dlls\log4net4.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
@@ -52,6 +57,7 @@
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Tools\LogOut.cs" />
    <EmbeddedResource Include="FrmMain.resx">
      <DependentUpon>FrmMain.cs</DependentUpon>
    </EmbeddedResource>
@@ -63,7 +69,11 @@
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
      <DesignTime>True</DesignTime>
    </Compile>
    <EmbeddedResource Include="Log.config">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -77,6 +87,20 @@
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="dlls\gdalconst_csharp.dll" />
    <Content Include="dlls\gdalconst_wrap.dll" />
    <Content Include="dlls\gdal_csharp.dll" />
    <Content Include="dlls\gdal_wrap.dll" />
    <Content Include="dlls\log4net4.dll" />
    <Content Include="dlls\ogr_csharp.dll" />
    <Content Include="dlls\ogr_wrap.dll" />
    <Content Include="dlls\osr_csharp.dll" />
    <Content Include="dlls\osr_wrap.dll" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Domain\" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
SimuTools/Tools/LogOut.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,132 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace SimuTools.Tools
{
    /// <summary>
    /// æ—¥å¿—输出类
    /// </summary>
    public class LogOut
    {
        /// <summary>
        /// æ—¥å¿—
        /// </summary>
        protected static readonly log4net.ILog _log;
        /// <summary>
        /// é™æ€æž„造函数
        /// </summary>
        static LogOut()
        {
            try
            {
                _log = log4net.LogManager.GetLogger("log4net");
                //HttpContext.Current.Request.PhysicalApplicationPath
                //string fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources\\Log.config");
                //string fileName = Path.Combine(Application.StartupPath, "Log.config");
                string fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Log.config");
                log4net.Config.XmlConfigurator.Configure(new FileInfo(fileName));
            }
            catch
            {
            }
        }
        /// <summary>
        /// è°ƒè¯•
        /// </summary>
        /// <param name="message">日志</param>
        public static void Debug(string message)
        {
            try
            {
                if (_log.IsDebugEnabled)
                {
                    _log.Debug("调试:" + message + "\r\n\r\n");
                }
            }
            catch
            {
            }
        }
        /// <summary>
        /// ä¿¡æ¯
        /// </summary>
        /// <param name="message">日志</param>
        public static void Info(string message)
        {
            try
            {
                if (_log.IsInfoEnabled)
                {
                    _log.Info("信息:" + message + "\r\n\r\n");
                }
            }
            catch
            {
            }
        }
        /// <summary>
        /// è­¦å‘Š
        /// </summary>
        /// <param name="message">日志</param>
        public static void Warn(string message)
        {
            try
            {
                if (_log.IsWarnEnabled)
                {
                    _log.Warn("警告:" + message + "\r\n\r\n");
                }
            }
            catch
            {
            }
        }
        /// <summary>
        /// é”™è¯¯
        /// </summary>
        /// <param name="message">日志</param>
        public static void Error(string message)
        {
            try
            {
                if (_log.IsErrorEnabled)
                {
                    _log.Error("错误:" + message + "\r\n\r\n");
                }
            }
            catch
            {
            }
        }
        /// <summary>
        /// è‡´å‘½
        /// </summary>
        /// <param name="message">日志</param>
        public static void Fatal(string message)
        {
            try
            {
                if (_log.IsFatalEnabled)
                {
                    _log.Fatal("致命:" + message + "\r\n\r\n");
                }
            }
            catch
            {
            }
        }
    }
}
SimuTools/dlls/gdal_csharp.dll
Binary files differ
SimuTools/dlls/gdal_wrap.dll
Binary files differ
SimuTools/dlls/gdalconst_csharp.dll
Binary files differ
SimuTools/dlls/gdalconst_wrap.dll
Binary files differ
SimuTools/dlls/log4net4.dll
Binary files differ
SimuTools/dlls/ogr_csharp.dll
Binary files differ
SimuTools/dlls/ogr_wrap.dll
Binary files differ
SimuTools/dlls/osr_csharp.dll
Binary files differ
SimuTools/dlls/osr_wrap.dll
Binary files differ