ZKShow.cs
上传用户:chizxy
上传日期:2014-11-29
资源大小:407k
文件大小:47k
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using System.Data;
- using System.Data.SqlClient;
- namespace MKIms3
- {
- /// <summary>
- /// ZKShow 的摘要说明。
- /// </summary>
- public class ZKShow : System.Windows.Forms.Form
- {
- private double k_x;
- private double k_y;
- private double k_z;
- private double k_h;
- private string k_com;
- private DateTime k_date;
- private string k_other;
- private string k_lay;
- private int kong_id; //钻孔在数据库中的编号,用来更新用。
- private string k_id; //钻孔的文字编号 *-*;
- private DataSet Ceng_DataSet;
- private DataGridTableStyle GridTableStyle;
- private SuperMapLib.soRecordset myRecordset; //剖面示意图的纪录集
- /// <summary>
- /// 煤层的上下两层填充物
- /// </summary>
- public struct lay_Region
- {
- public int ding; //顶板填充代码
- public int di; //底板填充代码
- public SuperMapLib.soGeoRegion lay_up_Region; //上下两层填充物
- public SuperMapLib.soGeoRegion lay_down_Region; //上下两层填充物
- public lay_Region(int ding,int di)
- {
- this.ding = ding ;
- this.di = di;
- this.lay_down_Region = new SuperMapLib.soGeoRegionClass();
- this.lay_up_Region = new SuperMapLib.soGeoRegionClass();
- }
- }
- #region 系统自己定义的字段
- private System.Windows.Forms.GroupBox groupBox_kong;
- private System.Windows.Forms.TextBox txt_other;
- private System.Windows.Forms.TextBox txt_com;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label label8;
- private System.Windows.Forms.Label label9;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.TextBox txt_No;
- private System.Windows.Forms.TextBox txt_lay;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.ToolBarButton toolBarButton_xiao;
- private System.Windows.Forms.ToolBarButton toolBarButton_da;
- private System.Windows.Forms.ToolBarButton toolBarButton_pan;
- private System.Windows.Forms.ImageList imageList_tool;
- private System.Windows.Forms.GroupBox groupBox_ceng;
- private System.Windows.Forms.ToolBarButton toolBarButton_full;
- private System.Windows.Forms.GroupBox groupBox_pou;
- private AxSuperMapLib.AxSuperMap axSuperMap1;
- private System.Windows.Forms.Button btn_ok;
- private System.Windows.Forms.Label label10;
- private System.Windows.Forms.DataGrid dataGrid_lay;
- private System.Windows.Forms.ToolBar toolBar_tool;
- private System.Windows.Forms.Panel panel1;
- private System.Windows.Forms.NumericUpDown numericUpDown_x;
- private System.Windows.Forms.NumericUpDown numericUpDown_y;
- private System.Windows.Forms.NumericUpDown numericUpDown_z;
- private System.Windows.Forms.NumericUpDown numericUpDown_h;
- private System.Windows.Forms.DateTimePicker dateTimePicker_data;
- private AxSuperMapLib.AxSuperWorkspace axSuperWorkspace1;
- private System.ComponentModel.IContainer components;
- #endregion
- public ZKShow(string k_id)
- {
- //
- // Windows 窗体设计器支持所必需的
- //
- InitializeComponent();
- //
- // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
- //
- this.k_id = k_id;
- }
- /// <summary>
- /// 清理所有正在使用的资源。
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
- #region Windows 窗体设计器生成的代码
- /// <summary>
- /// 设计器支持所需的方法 - 不要使用代码编辑器修改
- /// 此方法的内容。
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ZKShow));
- this.groupBox_kong = new System.Windows.Forms.GroupBox();
- this.dateTimePicker_data = new System.Windows.Forms.DateTimePicker();
- this.numericUpDown_h = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown_z = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown_y = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown_x = new System.Windows.Forms.NumericUpDown();
- this.txt_other = new System.Windows.Forms.TextBox();
- this.txt_com = new System.Windows.Forms.TextBox();
- this.label6 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.label8 = new System.Windows.Forms.Label();
- this.label9 = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.txt_No = new System.Windows.Forms.TextBox();
- this.txt_lay = new System.Windows.Forms.TextBox();
- this.label5 = new System.Windows.Forms.Label();
- this.label7 = new System.Windows.Forms.Label();
- this.toolBarButton_xiao = new System.Windows.Forms.ToolBarButton();
- this.toolBarButton_da = new System.Windows.Forms.ToolBarButton();
- this.toolBarButton_pan = new System.Windows.Forms.ToolBarButton();
- this.imageList_tool = new System.Windows.Forms.ImageList(this.components);
- this.groupBox_ceng = new System.Windows.Forms.GroupBox();
- this.dataGrid_lay = new System.Windows.Forms.DataGrid();
- this.toolBarButton_full = new System.Windows.Forms.ToolBarButton();
- this.groupBox_pou = new System.Windows.Forms.GroupBox();
- this.axSuperMap1 = new AxSuperMapLib.AxSuperMap();
- this.panel1 = new System.Windows.Forms.Panel();
- this.toolBar_tool = new System.Windows.Forms.ToolBar();
- this.axSuperWorkspace1 = new AxSuperMapLib.AxSuperWorkspace();
- this.btn_ok = new System.Windows.Forms.Button();
- this.label10 = new System.Windows.Forms.Label();
- this.groupBox_kong.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_h)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_z)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_y)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_x)).BeginInit();
- this.groupBox_ceng.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGrid_lay)).BeginInit();
- this.groupBox_pou.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.axSuperMap1)).BeginInit();
- this.panel1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.axSuperWorkspace1)).BeginInit();
- this.SuspendLayout();
- //
- // groupBox_kong
- //
- this.groupBox_kong.Controls.Add(this.dateTimePicker_data);
- this.groupBox_kong.Controls.Add(this.numericUpDown_h);
- this.groupBox_kong.Controls.Add(this.numericUpDown_z);
- this.groupBox_kong.Controls.Add(this.numericUpDown_y);
- this.groupBox_kong.Controls.Add(this.numericUpDown_x);
- this.groupBox_kong.Controls.Add(this.txt_other);
- this.groupBox_kong.Controls.Add(this.txt_com);
- this.groupBox_kong.Controls.Add(this.label6);
- this.groupBox_kong.Controls.Add(this.label3);
- this.groupBox_kong.Controls.Add(this.label2);
- this.groupBox_kong.Controls.Add(this.label8);
- this.groupBox_kong.Controls.Add(this.label9);
- this.groupBox_kong.Controls.Add(this.label4);
- this.groupBox_kong.Controls.Add(this.label1);
- this.groupBox_kong.Controls.Add(this.txt_No);
- this.groupBox_kong.Controls.Add(this.txt_lay);
- this.groupBox_kong.Controls.Add(this.label5);
- this.groupBox_kong.Controls.Add(this.label7);
- this.groupBox_kong.Location = new System.Drawing.Point(8, 8);
- this.groupBox_kong.Name = "groupBox_kong";
- this.groupBox_kong.Size = new System.Drawing.Size(408, 184);
- this.groupBox_kong.TabIndex = 3;
- this.groupBox_kong.TabStop = false;
- this.groupBox_kong.Text = "钻孔基本信息";
- //
- // dateTimePicker_data
- //
- this.dateTimePicker_data.Location = new System.Drawing.Point(264, 99);
- this.dateTimePicker_data.Name = "dateTimePicker_data";
- this.dateTimePicker_data.Size = new System.Drawing.Size(112, 21);
- this.dateTimePicker_data.TabIndex = 40;
- //
- // numericUpDown_h
- //
- this.numericUpDown_h.DecimalPlaces = 2;
- this.numericUpDown_h.Location = new System.Drawing.Point(264, 24);
- this.numericUpDown_h.Maximum = new System.Decimal(new int[] {
- 1410065407,
- 2,
- 0,
- 0});
- this.numericUpDown_h.Name = "numericUpDown_h";
- this.numericUpDown_h.Size = new System.Drawing.Size(128, 21);
- this.numericUpDown_h.TabIndex = 39;
- this.numericUpDown_h.ThousandsSeparator = true;
- //
- // numericUpDown_z
- //
- this.numericUpDown_z.DecimalPlaces = 2;
- this.numericUpDown_z.Location = new System.Drawing.Point(80, 96);
- this.numericUpDown_z.Maximum = new System.Decimal(new int[] {
- 1410065407,
- 2,
- 0,
- 0});
- this.numericUpDown_z.Name = "numericUpDown_z";
- this.numericUpDown_z.Size = new System.Drawing.Size(114, 21);
- this.numericUpDown_z.TabIndex = 38;
- this.numericUpDown_z.ThousandsSeparator = true;
- //
- // numericUpDown_y
- //
- this.numericUpDown_y.DecimalPlaces = 2;
- this.numericUpDown_y.Location = new System.Drawing.Point(80, 72);
- this.numericUpDown_y.Maximum = new System.Decimal(new int[] {
- 1410065407,
- 2,
- 0,
- 0});
- this.numericUpDown_y.Name = "numericUpDown_y";
- this.numericUpDown_y.Size = new System.Drawing.Size(114, 21);
- this.numericUpDown_y.TabIndex = 37;
- this.numericUpDown_y.ThousandsSeparator = true;
- //
- // numericUpDown_x
- //
- this.numericUpDown_x.DecimalPlaces = 2;
- this.numericUpDown_x.Location = new System.Drawing.Point(80, 48);
- this.numericUpDown_x.Maximum = new System.Decimal(new int[] {
- 1410065407,
- 2,
- 0,
- 0});
- this.numericUpDown_x.Name = "numericUpDown_x";
- this.numericUpDown_x.Size = new System.Drawing.Size(114, 21);
- this.numericUpDown_x.TabIndex = 36;
- this.numericUpDown_x.ThousandsSeparator = true;
- //
- // txt_other
- //
- this.txt_other.Location = new System.Drawing.Point(80, 128);
- this.txt_other.Multiline = true;
- this.txt_other.Name = "txt_other";
- this.txt_other.Size = new System.Drawing.Size(312, 48);
- this.txt_other.TabIndex = 35;
- this.txt_other.Text = "";
- //
- // txt_com
- //
- this.txt_com.Location = new System.Drawing.Point(264, 73);
- this.txt_com.Name = "txt_com";
- this.txt_com.Size = new System.Drawing.Size(128, 21);
- this.txt_com.TabIndex = 28;
- this.txt_com.Text = "";
- //
- // label6
- //
- this.label6.Location = new System.Drawing.Point(32, 144);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(32, 16);
- this.label6.TabIndex = 23;
- this.label6.Text = "备注";
- //
- // label3
- //
- this.label3.Location = new System.Drawing.Point(208, 81);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(56, 16);
- this.label3.TabIndex = 20;
- this.label3.Text = "施工单位";
- //
- // label2
- //
- this.label2.Location = new System.Drawing.Point(208, 104);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(56, 16);
- this.label2.TabIndex = 19;
- this.label2.Text = "施工时间";
- //
- // label8
- //
- this.label8.Location = new System.Drawing.Point(13, 77);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(64, 16);
- this.label8.TabIndex = 25;
- this.label8.Text = "孔口坐标Y";
- //
- // label9
- //
- this.label9.Location = new System.Drawing.Point(12, 102);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(62, 16);
- this.label9.TabIndex = 26;
- this.label9.Text = "孔口坐标Z";
- //
- // label4
- //
- this.label4.Location = new System.Drawing.Point(208, 30);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(56, 16);
- this.label4.TabIndex = 21;
- this.label4.Text = "终孔深度";
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(22, 29);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(56, 17);
- this.label1.TabIndex = 18;
- this.label1.Text = "钻孔编号";
- //
- // txt_No
- //
- this.txt_No.Location = new System.Drawing.Point(80, 23);
- this.txt_No.Name = "txt_No";
- this.txt_No.ReadOnly = true;
- this.txt_No.Size = new System.Drawing.Size(114, 21);
- this.txt_No.TabIndex = 27;
- this.txt_No.Text = "";
- //
- // txt_lay
- //
- this.txt_lay.Location = new System.Drawing.Point(264, 48);
- this.txt_lay.Name = "txt_lay";
- this.txt_lay.Size = new System.Drawing.Size(128, 21);
- this.txt_lay.TabIndex = 30;
- this.txt_lay.Text = "";
- //
- // label5
- //
- this.label5.Location = new System.Drawing.Point(208, 54);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(56, 16);
- this.label5.TabIndex = 22;
- this.label5.Text = "终孔层位";
- //
- // label7
- //
- this.label7.Location = new System.Drawing.Point(14, 53);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(66, 17);
- this.label7.TabIndex = 24;
- this.label7.Text = "孔口坐标X";
- //
- // toolBarButton_xiao
- //
- this.toolBarButton_xiao.ImageIndex = 1;
- this.toolBarButton_xiao.ToolTipText = "缩小";
- //
- // toolBarButton_da
- //
- this.toolBarButton_da.ImageIndex = 0;
- this.toolBarButton_da.ToolTipText = "放大";
- //
- // toolBarButton_pan
- //
- this.toolBarButton_pan.ImageIndex = 2;
- this.toolBarButton_pan.ToolTipText = "平移";
- //
- // imageList_tool
- //
- this.imageList_tool.ImageSize = new System.Drawing.Size(16, 16);
- this.imageList_tool.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList_tool.ImageStream")));
- this.imageList_tool.TransparentColor = System.Drawing.Color.Transparent;
- //
- // groupBox_ceng
- //
- this.groupBox_ceng.Controls.Add(this.dataGrid_lay);
- this.groupBox_ceng.Location = new System.Drawing.Point(8, 200);
- this.groupBox_ceng.Name = "groupBox_ceng";
- this.groupBox_ceng.Size = new System.Drawing.Size(408, 192);
- this.groupBox_ceng.TabIndex = 5;
- this.groupBox_ceng.TabStop = false;
- this.groupBox_ceng.Text = "钻孔煤层信息";
- //
- // dataGrid_lay
- //
- this.dataGrid_lay.AlternatingBackColor = System.Drawing.SystemColors.Info;
- this.dataGrid_lay.CaptionText = "F ";
- this.dataGrid_lay.CaptionVisible = false;
- this.dataGrid_lay.DataMember = "";
- this.dataGrid_lay.Dock = System.Windows.Forms.DockStyle.Fill;
- this.dataGrid_lay.FlatMode = true;
- this.dataGrid_lay.GridLineStyle = System.Windows.Forms.DataGridLineStyle.None;
- this.dataGrid_lay.HeaderForeColor = System.Drawing.SystemColors.ControlText;
- this.dataGrid_lay.Location = new System.Drawing.Point(3, 17);
- this.dataGrid_lay.Name = "dataGrid_lay";
- this.dataGrid_lay.Size = new System.Drawing.Size(402, 172);
- this.dataGrid_lay.TabIndex = 0;
- //
- // toolBarButton_full
- //
- this.toolBarButton_full.ImageIndex = 3;
- this.toolBarButton_full.ToolTipText = "全屏";
- //
- // groupBox_pou
- //
- this.groupBox_pou.Controls.Add(this.axSuperMap1);
- this.groupBox_pou.Controls.Add(this.panel1);
- this.groupBox_pou.Controls.Add(this.axSuperWorkspace1);
- this.groupBox_pou.Location = new System.Drawing.Point(420, 8);
- this.groupBox_pou.Name = "groupBox_pou";
- this.groupBox_pou.Size = new System.Drawing.Size(320, 409);
- this.groupBox_pou.TabIndex = 6;
- this.groupBox_pou.TabStop = false;
- this.groupBox_pou.Text = "钻孔剖面示意图";
- //
- // axSuperMap1
- //
- this.axSuperMap1.ContainingControl = this;
- this.axSuperMap1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.axSuperMap1.Enabled = true;
- this.axSuperMap1.Location = new System.Drawing.Point(3, 48);
- this.axSuperMap1.Name = "axSuperMap1";
- this.axSuperMap1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axSuperMap1.OcxState")));
- this.axSuperMap1.Size = new System.Drawing.Size(314, 358);
- this.axSuperMap1.TabIndex = 1;
- this.axSuperMap1.MouseWheelEvent += new AxSuperMapLib._DSuperMapEvents_MouseWheelEventHandler(this.axSuperMap1_MouseWheelEvent);
- //
- // panel1
- //
- this.panel1.Controls.Add(this.toolBar_tool);
- this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
- this.panel1.Location = new System.Drawing.Point(3, 17);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(314, 31);
- this.panel1.TabIndex = 3;
- //
- // toolBar_tool
- //
- this.toolBar_tool.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
- this.toolBar_tool.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.toolBar_tool.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
- this.toolBarButton_da,
- this.toolBarButton_xiao,
- this.toolBarButton_pan,
- this.toolBarButton_full});
- this.toolBar_tool.ButtonSize = new System.Drawing.Size(16, 16);
- this.toolBar_tool.DropDownArrows = true;
- this.toolBar_tool.ImageList = this.imageList_tool;
- this.toolBar_tool.Location = new System.Drawing.Point(0, 0);
- this.toolBar_tool.Name = "toolBar_tool";
- this.toolBar_tool.ShowToolTips = true;
- this.toolBar_tool.Size = new System.Drawing.Size(314, 29);
- this.toolBar_tool.TabIndex = 2;
- this.toolBar_tool.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_tool_ButtonClick);
- //
- // axSuperWorkspace1
- //
- this.axSuperWorkspace1.ContainingControl = this;
- this.axSuperWorkspace1.Enabled = true;
- this.axSuperWorkspace1.Location = new System.Drawing.Point(64, 128);
- this.axSuperWorkspace1.Name = "axSuperWorkspace1";
- this.axSuperWorkspace1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axSuperWorkspace1.OcxState")));
- this.axSuperWorkspace1.Size = new System.Drawing.Size(32, 32);
- this.axSuperWorkspace1.TabIndex = 4;
- //
- // btn_ok
- //
- this.btn_ok.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btn_ok.Location = new System.Drawing.Point(337, 396);
- this.btn_ok.Name = "btn_ok";
- this.btn_ok.Size = new System.Drawing.Size(71, 25);
- this.btn_ok.TabIndex = 7;
- this.btn_ok.Text = "提交修改";
- this.btn_ok.Click += new System.EventHandler(this.btn_ok_Click);
- //
- // label10
- //
- this.label10.Location = new System.Drawing.Point(8, 403);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(328, 23);
- this.label10.TabIndex = 8;
- this.label10.Text = "系统提示:如果您修改了有关数据,请单击右边的按钮提交";
- //
- // ZKShow
- //
- this.AcceptButton = this.btn_ok;
- this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
- this.ClientSize = new System.Drawing.Size(746, 421);
- this.Controls.Add(this.label10);
- this.Controls.Add(this.btn_ok);
- this.Controls.Add(this.groupBox_kong);
- this.Controls.Add(this.groupBox_ceng);
- this.Controls.Add(this.groupBox_pou);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "ZKShow";
- this.ShowInTaskbar = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "钻孔详细信息";
- this.Closing += new System.ComponentModel.CancelEventHandler(this.ZKShow_Closing);
- this.Load += new System.EventHandler(this.ZKShow_Load);
- this.groupBox_kong.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_h)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_z)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_y)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_x)).EndInit();
- this.groupBox_ceng.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.dataGrid_lay)).EndInit();
- this.groupBox_pou.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.axSuperMap1)).EndInit();
- this.panel1.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.axSuperWorkspace1)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- private void ZKShow_Load(object sender, System.EventArgs e)
- {
- if(App.u_flag!=(int)flag.admin)
- {
- user_admin();
- }
- get_fill_file();
- get_kong_info(k_id);
- get_ceng_info(k_id);
- Draw_lay(Ceng_DataSet);
- theme();
- this.axSuperMap1.ViewEntire();
- this.axSuperMap1.CtlRefresh();
- }
- private void toolBar_tool_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
- {
- switch(this.toolBar_tool.Buttons.IndexOf(e.Button))
- {
- case 0:
- this.axSuperMap1.Action = SuperMapLib.seAction.scaZoomIn;
- break;
- case 1:
- this.axSuperMap1.Action = SuperMapLib.seAction.scaZoomOut;
- break;
- case 2:
- this.axSuperMap1.Action = SuperMapLib.seAction.scaPan;
- break;
- case 3:
- this.axSuperMap1.ViewEntire();;
- break;
- }
- }
- private void axSuperMap1_MouseWheelEvent(object sender, AxSuperMapLib._DSuperMapEvents_MouseWheelEvent e)
- {
- if((int)e.zDelta > 0 )
- {
- this.axSuperMap1.Zoom(1.2);
- this.axSuperMap1.CtlRefresh();
- }
- else
- {
- this.axSuperMap1.Zoom(0.8);
- this.axSuperMap1.CtlRefresh();
- }
- }
- private void ZKShow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
- {
- this.axSuperMap1.Disconnect();
- this.axSuperWorkspace1.Close();
- }
- private void btn_ok_Click(object sender, System.EventArgs e)
- {
- get_value();//先得到需要的信息
- if(kong_change() && lay_change())
- {
- MessageBox.Show("钻孔信息修改成功!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
- }
- }
- #region 根据传递过来的钻孔编号得到钻孔的基本信息
- /// <summary>
- /// 得到钻孔的基本信息
- /// </summary>
- /// <param name="k_id">钻孔的文字标号</param>
- private void get_kong_info(string k_id)
- {
- DataBase myDB = new DataBase();
- SqlDataReader myReader;
- SqlParameter[] myParamers={new SqlParameter("@k_id",SqlDbType.Char,10)} ;
- myParamers[0].Value = k_id;
- myReader = myDB.RunProcedure("up_get_kong_info",myParamers);
- if(myReader!=null)
- {
- //开始填充相关地图
- if(myReader.HasRows == true)
- {
- myReader.Read();
- this.kong_id = Convert.ToInt32(myReader["序号"]);
- this.txt_other.Text = myReader["备注"].ToString().Trim();
- this.txt_No.Text = myReader["钻孔编号"].ToString().Trim();
- this.txt_lay.Text = myReader["终孔层位"].ToString().Trim();
- this.txt_com.Text = myReader["施工单位"].ToString().Trim();
- this.numericUpDown_x.Value = Convert.ToDecimal(myReader["孔口X坐标"]);
- this.numericUpDown_y.Value = Convert.ToDecimal(myReader["孔口Y坐标"]);
- this.numericUpDown_z.Value = Convert.ToDecimal(myReader["孔口Z坐标"]);
- this.numericUpDown_h.Value = Convert.ToDecimal(myReader["终孔深度"]);
- this.dateTimePicker_data.Value = (DateTime)myReader["施工时间"];
- myReader.Close();
- }
- else
- {
- MessageBox.Show("没有该钻孔的相关信息","错误信息",MessageBoxButtons.OK,MessageBoxIcon.Warning);
- }
- }
- }
- /// <summary>
- /// 显示相关钻孔的煤层信息,填充datagrid
- /// </summary>
- /// <param name="k_id"></param>
- private void get_ceng_info(string k_id)
- {
- DataBase myDB = new DataBase();
- Ceng_DataSet = new DataSet();
- SqlParameter[] myParamers={new SqlParameter("@k_id",SqlDbType.Char,10)} ;
- myParamers[0].Value = k_id;
- Ceng_DataSet = myDB.RunProcedure("up_get_ceng_info",myParamers,"cenginfo");
- if(Ceng_DataSet!=null)
- {
- this.Ceng_DataSet.Tables[0].Columns["钻孔序号"].DefaultValue = this.kong_id;
- addstyle(Ceng_DataSet);
- this.dataGrid_lay.SetDataBinding(Ceng_DataSet,"cenginfo");
- }
- else
- {
- MessageBox.Show("没有该钻孔的相关信息");
- }
- }
- /// <summary>
- /// 添加datagrid的列标题
- /// </summary>
- /// <param name="myset">层信息的dataset</param>
- private void addstyle(DataSet Ceng_DataSet)
- {
- DataSet yanset = new DataSet();
- DataBase myDB = new DataBase();
- yanset = myDB.RunProcedure("get_yanxin","yan");
- CurrencyManager objcengCM;
- GridTableStyle = new DataGridTableStyle();
- GridTableStyle.MappingName = "cenginfo";
- objcengCM = (System.Windows.Forms.CurrencyManager)this.BindingContext[Ceng_DataSet.Tables[0]];
- GridTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(objcengCM .GetItemProperties()["煤层名称"]));
- GridTableStyle.GridColumnStyles[0].MappingName = "煤层名称";
- GridTableStyle.GridColumnStyles[0].HeaderText = "煤层名称";
- GridTableStyle.GridColumnStyles[0].Alignment = HorizontalAlignment.Left;
- GridTableStyle.GridColumnStyles[0].NullText = string.Empty;
- GridTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(objcengCM .GetItemProperties()["止煤深度"]));
- GridTableStyle.GridColumnStyles[1].MappingName = "止煤深度";
- GridTableStyle.GridColumnStyles[1].HeaderText = "止煤深度";
- GridTableStyle.GridColumnStyles[1].Alignment = HorizontalAlignment.Left;
- GridTableStyle.GridColumnStyles[1].NullText = string.Empty;
- GridTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(objcengCM .GetItemProperties()["底板坐标x"]));
- GridTableStyle.GridColumnStyles[2].MappingName = "底板坐标x";
- GridTableStyle.GridColumnStyles[2].HeaderText = "底板坐标x";
- GridTableStyle.GridColumnStyles[2].Alignment = HorizontalAlignment.Left;
- GridTableStyle.GridColumnStyles[2].NullText = string.Empty;
- GridTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(objcengCM .GetItemProperties()["底板坐标y"]));
- GridTableStyle.GridColumnStyles[3].MappingName = "底板坐标y";
- GridTableStyle.GridColumnStyles[3].HeaderText = "底板坐标y";
- GridTableStyle.GridColumnStyles[3].Alignment = HorizontalAlignment.Left;
- GridTableStyle.GridColumnStyles[3].NullText = string.Empty;
-
- GridTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(objcengCM .GetItemProperties()["底板坐标z"]));
- GridTableStyle.GridColumnStyles[4].MappingName = "底板坐标z";
- GridTableStyle.GridColumnStyles[4].HeaderText = "底板坐标z";
- GridTableStyle.GridColumnStyles[4].Alignment = HorizontalAlignment.Left;
- GridTableStyle.GridColumnStyles[4].NullText = string.Empty;
- GridTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(objcengCM .GetItemProperties()["煤层伪厚"]));
- GridTableStyle.GridColumnStyles[5].MappingName = "煤层伪厚";
- GridTableStyle.GridColumnStyles[5].HeaderText = "煤层伪厚";
- GridTableStyle.GridColumnStyles[5].Alignment = HorizontalAlignment.Left;
- GridTableStyle.GridColumnStyles[5].NullText = string.Empty;
- GridTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(objcengCM .GetItemProperties()["利用厚度"]));
- GridTableStyle.GridColumnStyles[6].MappingName = "利用厚度";
- GridTableStyle.GridColumnStyles[6].HeaderText = "利用厚度";
- GridTableStyle.GridColumnStyles[6].Alignment = HorizontalAlignment.Left;
- GridTableStyle.GridColumnStyles[6].NullText = string.Empty;
- GridTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(objcengCM .GetItemProperties()["煤层倾角"]));
- GridTableStyle.GridColumnStyles[7].MappingName = "煤层倾角";
- GridTableStyle.GridColumnStyles[7].HeaderText = "煤层倾角";
- GridTableStyle.GridColumnStyles[7].Alignment = HorizontalAlignment.Left;
- GridTableStyle.GridColumnStyles[7].NullText = string.Empty;
- GridTableStyle.GridColumnStyles.Add(new DataGridComboBoxColumn(yanset.Tables["yan"],0,0));
- GridTableStyle.GridColumnStyles[8].MappingName = "顶板岩性";
- GridTableStyle.GridColumnStyles[8].HeaderText = "顶板岩性";
- GridTableStyle.GridColumnStyles[8].Alignment = HorizontalAlignment.Left;
- GridTableStyle.GridColumnStyles[8].NullText = string.Empty;
- GridTableStyle.GridColumnStyles.Add(new DataGridComboBoxColumn(yanset.Tables["yan"],0,0));
- GridTableStyle.GridColumnStyles[9].MappingName = "底板岩性";
- GridTableStyle.GridColumnStyles[9].HeaderText = "底板岩性";
- GridTableStyle.GridColumnStyles[9].Alignment = HorizontalAlignment.Left;
- GridTableStyle.GridColumnStyles[9].NullText = string.Empty;
- GridTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(objcengCM .GetItemProperties()["等级"]));
- GridTableStyle.GridColumnStyles[10].MappingName = "等级";
- GridTableStyle.GridColumnStyles[10].HeaderText = "等级";
- GridTableStyle.GridColumnStyles[10].Alignment = HorizontalAlignment.Left;
- GridTableStyle.GridColumnStyles[10].NullText = string.Empty;
- this.dataGrid_lay.TableStyles.Add(this.GridTableStyle);
- //这个可以不加的!!
- GridTableStyle.GridColumnStyles.Add(new DataGridTextBoxColumn(objcengCM .GetItemProperties()["钻孔序号"]));
- GridTableStyle.GridColumnStyles[11].MappingName = "钻孔序号";
- GridTableStyle.GridColumnStyles[11].HeaderText = "钻孔序号";
- GridTableStyle.GridColumnStyles[11].Alignment = HorizontalAlignment.Left;
- GridTableStyle.GridColumnStyles[11].Width =0; //隐藏起来不让用户输入
- GridTableStyle.GridColumnStyles[11].NullText = this.kong_id.ToString();
- GridTableStyle.GridColumnStyles[11].ReadOnly = true;
- }
- #endregion
- #region 根据钻孔的煤层信息画出简单的剖面示意图
- /// <summary>
- /// 打开空白的文件
- /// </summary>
- /// <returns>返回打开的纪录集,失败返回空</returns>
- private SuperMapLib.soRecordset get_Recordset()
- {
- SuperMapLib.soRecordset temp_Recordset;
- SuperMapLib.soDatasetVector myV;
- SuperMapLib.soStrings myString;
- SuperMapLib.soDataSource myDatasource;
- myString=new SuperMapLib.soStringsClass();
-
- this.axSuperMap1.Connect(this.axSuperWorkspace1.CtlHandle);
- myDatasource=this.axSuperWorkspace1.OpenDataSource(Application.StartupPath+"\temp.sdb","temp",SuperMapLib.seEngineType.sceSDBPlus,false);
- if(myDatasource!=null)
- {
- SuperMapLib.soDatasets myDatasets= myDatasource.Datasets;
- for(int i=1;i<=myDatasets.Count;i++)
- {
- this.axSuperMap1.Layers.AddDataset(myDatasets[i],true);
- }
- myString.Add("*");
- myV = (SuperMapLib.soDatasetVector)myDatasource.Datasets["Region"];
- temp_Recordset = myV.Query("",true,myString,"");
- if(temp_Recordset.RecordCount>0)
- {
- temp_Recordset.DeleteAll(); //先清除所有的纪录
- temp_Recordset.Update();
- }
- return temp_Recordset;
- }
- else
- {
- return null;
- }
- }
- /// <summary>
- /// 得到钻孔边框的几何对象
- /// </summary>
- /// <param name="j_high">孔的高度</param>
- /// <param name="j_z">孔口Z坐标</param>
- /// <returns>SuperMapLib.soGeoRegion</returns>
- private SuperMapLib.soGeoRegion get_kong_Region(double j_high,double j_z)
- {
- SuperMapLib.soGeoRegion myRegion;
- SuperMapLib.soPoints myPoints;
- myPoints = new SuperMapLib.soPointsClass();
- myRegion = new SuperMapLib.soGeoRegionClass();
- //1.1 生成井边框多边形。
- myPoints.Add2(10,j_z+10);
- myPoints.Add2(20,j_z);
- myPoints.Add2(20,j_z-j_high);
- myPoints.Add2(0,j_z-j_high);
- myPoints.Add2(0,j_z);
- myPoints.Add2(10,j_z+10);
- myRegion.AddPart(myPoints);
- return myRegion;
- }
- /// <summary>
- /// 得到煤层的几何对象
- /// </summary>
- /// <param name="ceng_h">煤层的厚度</param>
- /// <param name="ceng_z">煤层的Z坐标</param>
- /// <returns>几何对象 SuperMapLib.soGeoRegion</returns>
- private SuperMapLib.soGeoRegion get_ceng_Region(double ceng_h,double ceng_z)
- {
- SuperMapLib.soGeoRegion ceng_Region = new SuperMapLib.soGeoRegionClass();
- SuperMapLib.soPoints myPoints = new SuperMapLib.soPointsClass();
- myPoints.Add2(0,ceng_z);
- myPoints.Add2(20,ceng_z);
- myPoints.Add2(20,ceng_z-ceng_h);
- myPoints.Add2(0,ceng_z-ceng_h);
- myPoints.Add2(0,ceng_z);
- ceng_Region.AddPart(myPoints);
- return ceng_Region;
- }
- /// <summary>
- /// 返回煤层的顶板和底板填充信息的结构体。
- /// </summary>
- /// <param name="up_t">顶板岩性</param>
- /// <param name="down_t">底板岩性</param>
- /// <param name="up_h">上高</param>
- /// <param name="down_h">下高</param>
- /// <param name="ceng">层标示 1.只有一层 2.多层的最上部分 3.多层的最下部分 4.其他的</param>
- /// <param name="j_h">井的高度</param>
- /// <param name="j_z">井的Z坐标</param>
- /// <param name="ceng_h">煤层的厚度</param>
- /// <param name="ceng_z">煤层的Z坐标</param>
- /// <returns></returns>
- private lay_Region get_ceng_fill(int up_t,int down_t,double up_h,double down_h,int ceng,double j_z,double j_h,double ceng_z,double ceng_h)
- {
- lay_Region mylay_fill = new lay_Region(up_t,down_t);
- switch(ceng)
- {
- case 1: //只有一层
- {
- //先画上部
- if(up_h>=8)
- { //画出折线
- mylay_fill.lay_up_Region.AddPart(draw_pline(ceng_z,0));
- //draw_pline(ceng_z,0);
- }
- else
- { //直接画成矩形
- mylay_fill.lay_up_Region.AddPart(draw_line(ceng_z,up_h,0));
- //draw_line(ceng_z,up_h);
- }
- //再画下部分
- if(down_h>=8)
- { //画出折线
- mylay_fill.lay_down_Region.AddPart(draw_pline(ceng_z,ceng_h));
- }
- else
- { //直接画成矩形
- mylay_fill.lay_down_Region.AddPart(draw_line(ceng_z,-down_h,ceng_h));
- }
- }
- break;
- case 2: //多层的最上层
- {
- //画上部
- if(up_h>=8)
- { //画出折线
- mylay_fill.lay_up_Region.AddPart(draw_pline(ceng_z,0));
- }
- else
- { //直接画成矩形
- mylay_fill.lay_up_Region.AddPart(draw_line(ceng_z,up_h,0));
- }
- //再画下部
- if(down_h>=14)
- { //画出折线
- mylay_fill.lay_down_Region.AddPart(draw_pline(ceng_z,ceng_h));
- }
- else
- { //分成平均的两半
- mylay_fill.lay_down_Region.AddPart(draw_line(ceng_z,-down_h/2,ceng_h));
- }
- }
- break;
- case 3: //多层的最下层
- {
- //先画上部
- if(up_h>=14)
- { //画出折线
- mylay_fill.lay_up_Region.AddPart(draw_pline(ceng_z,0));
- }
- else
- { //分成平均的两半
- mylay_fill.lay_up_Region.AddPart(draw_line(ceng_z,up_h/2,0));
- }
- // 再画下部分
- if(down_h>=8)
- { //画出折线
- mylay_fill.lay_down_Region.AddPart(draw_pline(ceng_z,ceng_h));
- }
- else
- { //直接画成矩形
- mylay_fill.lay_down_Region.AddPart(draw_line(ceng_z,-down_h,ceng_h));
- }
- }
- break;
-
- case 4: //多层的中间层
- {
- if(up_h>=14)
- { //画出折线
- mylay_fill.lay_up_Region.AddPart(draw_pline(ceng_z,0));
- }
- else
- { //分成平均的两半
- mylay_fill.lay_up_Region.AddPart(draw_line(ceng_z,up_h/2,0));
- }
-
- if(down_h>=14)
- { //画出折线
- mylay_fill.lay_down_Region.AddPart(draw_pline(ceng_z,ceng_h));
- }
- else
- { //分成平均的两半
- mylay_fill.lay_down_Region.AddPart(draw_line(ceng_z,-down_h/2,ceng_h));
- }
- }
- break;
- }
- return mylay_fill;
- }
- /// <summary>
- /// 处理直接画成矩形的情况 /如果是底板把lin_h取反
- /// </summary>
- /// <param name="ceng_z">起点坐标</param>
- /// <param name="lin_h">高度 如果是底板把lin_h取反</param>
- /// <param name="ceng_h">该层煤的厚度。 在顶板时取0</param>
- /// <returns></returns>
- private SuperMapLib.soPoints draw_line(double ceng_z,double lin_h,double ceng_h)
- {
- SuperMapLib.soPoints myPoints= new SuperMapLib.soPointsClass();
- myPoints.Add2(0,ceng_z-ceng_h);
- myPoints.Add2(0,ceng_z+lin_h-ceng_h);
- myPoints.Add2(20,ceng_z+lin_h-ceng_h);
- myPoints.Add2(20,ceng_z-ceng_h);
- myPoints.Add2(0,ceng_z-ceng_h);
- return myPoints;
- }
- /// <summary>
- /// 处理画成折线的情况 如果为上部 lin_h取 0
- /// </summary>
- /// <param name="ceng_z">起点坐标</param>
- /// <param name="lin_h">煤层的厚度 顶板时为0 </param>
- /// <returns></returns>
- private SuperMapLib.soPoints draw_pline(double ceng_z,double lin_h)
- {
- SuperMapLib.soPoints myPoints= new SuperMapLib.soPointsClass();
- if(lin_h != 0)
- {
- myPoints.Add2(0,ceng_z-lin_h);
- myPoints.Add2(0,ceng_z-5-lin_h);
- myPoints.Add2(5,ceng_z-6-lin_h);
- myPoints.Add2(10,ceng_z-5-lin_h);
- myPoints.Add2(15,ceng_z-4-lin_h);
- myPoints.Add2(20,ceng_z-5-lin_h);
- myPoints.Add2(20,ceng_z-lin_h);
- myPoints.Add2(0,ceng_z-lin_h);
- }
- else
- {
- myPoints.Add2(0,ceng_z);
- myPoints.Add2(0,ceng_z+5);
- myPoints.Add2(5,ceng_z+4);
- myPoints.Add2(10,ceng_z+5);
- myPoints.Add2(15,ceng_z+6);
- myPoints.Add2(20,ceng_z+5);
- myPoints.Add2(20,ceng_z);
- myPoints.Add2(0,ceng_z);
- }
- return myPoints;
- }
- /// <summary>
- /// 跟新myrecordset
- /// </summary>
- /// <param name="pencolor">pencolor</param>
- /// <param name="bushstyle">bushstyle</param>
- /// <param name="brushcolor">brushcolor</param>
- /// <param name="penwidth">penwidth</param>
- private void updata_Recordset(SuperMapLib.soGeoRegion myRegin,int pencolor,int bushstyle,int brushcolor,int penwidth,string txt)
- {
- myRecordset.AddNew((SuperMapLib.soGeometry)myRegin,true);
- myRecordset.SetFieldValue("PenColor",pencolor); //这里加入属性数据
- myRecordset.SetFieldValue("BrushStyle",bushstyle);
- myRecordset.SetFieldValue("BrushColor",brushcolor);
- myRecordset.SetFieldValue("PenWidth",penwidth);
- myRecordset.SetFieldValue("txt",txt);
- myRecordset.Update();
- }
-
- /// <summary>
- /// 把填充层的信息更新到 recordset中去。
- /// </summary>
- /// <param name="up_t"></param>
- /// <param name="down_t"></param>
- /// <param name="up_h"></param>
- /// <param name="down_h"></param>
- /// <param name="ceng"></param>
- /// <param name="j_z"></param>
- /// <param name="j_h"></param>
- /// <param name="ceng_z"></param>
- /// <param name="ceng_h"></param>
- /// <param name="pencolor"></param>
- private void updata_fill(int up_t,int down_t,double up_h,double down_h,int ceng,double j_z,double j_h,double ceng_z,double ceng_h,int pencolor,string txt_di,string txt_ding)
- {
- lay_Region mylay_fill = new lay_Region(0,0);
- SuperMapLib.soGeoRegion myRegin = new SuperMapLib.soGeoRegionClass();
- mylay_fill= get_ceng_fill(up_t,down_t,up_h,down_h,ceng,j_z,j_h,ceng_z,ceng_h);
- myRegin =mylay_fill.lay_down_Region;
- updata_Recordset(myRegin,pencolor,mylay_fill.di,pencolor,1,txt_di);
- myRegin = mylay_fill.lay_up_Region;
- updata_Recordset(myRegin,pencolor,mylay_fill.ding,pencolor,1,txt_ding);
- }
-
- /// <summary>
- /// 根据查询出来的相关煤层信息把钻孔的示意图画出来。
- /// </summary>
- /// <param name="Ceng_DataSet">包含钻孔信息的dataset</param>
- private void Draw_lay(DataSet Ceng_DataSet)
- {
- SuperMapLib.soGeoRegion myRegin = new SuperMapLib.soGeoRegionClass();
-
- this.myRecordset = get_Recordset();
- if(this.myRecordset!=null)
- {
- double j_high =Convert.ToDouble(this.numericUpDown_h.Value); //井的深度
- double j_z = Convert.ToDouble(this.numericUpDown_z.Value); //井口Y坐标
- myRegin = get_kong_Region(j_high,j_z);
-
- //1.1 设置字段的值
- int brushcolor = (int)ColorTranslator.ToOle(Color.SkyBlue);
- int pencolor = (int)ColorTranslator.ToOle(Color.Black);
- updata_Recordset(myRegin,pencolor,1,brushcolor,1,""); //钻孔的填充风格
- //2.0开始加入煤层信息
- double ceng_h; //煤的厚度
- double ceng_z; //煤的Z轴坐标
- int m = Ceng_DataSet.Tables[0].Rows.Count; //总共有多少层煤
- for(int n=0;n<m;n++)
- {
- if(Ceng_DataSet.Tables[0].Rows[n]["煤层名称"].ToString()!="未见煤"&&Ceng_DataSet.Tables[0].Rows[n]["煤层名称"].ToString()!="煤层露头外")
- {
-
- ceng_h = Convert.ToDouble(Ceng_DataSet.Tables[0].Rows[n]["煤层伪厚"]);
- ceng_z = Convert.ToDouble(Ceng_DataSet.Tables[0].Rows[n]["底板坐标z"]);
- myRegin = get_ceng_Region(ceng_h,ceng_z);
- string meiName = Ceng_DataSet.Tables[0].Rows[n]["煤层名称"].ToString()+" z:"+ceng_z.ToString();
- pencolor = (int)ColorTranslator.ToOle(Color.Black);
- updata_Recordset(myRegin,pencolor,131,pencolor,1,meiName); //煤层的填充风格
- //到此为止 煤层信息和钻孔边框加入完毕。
- //3.0加入填充物多变形
- //在这里计算出每层煤上下的间隔距离
- //3.1
- double up_h; // 与上一层的高度差
- double down_h; //与下一层的高度差
- double font_h; //上一层的煤厚
- double font_z;//上一层的Z坐标
- double next_z ; //下一层的Z坐标
- int up_t;//顶板的填充物
- int down_t;//底板的填充物
- //只有一层煤的情况,
- //###################################################find_fill_id
- up_t =Convert.ToInt32(Ceng_DataSet.Tables[0].Rows[n]["ding"]);
- down_t =Convert.ToInt32(Ceng_DataSet.Tables[0].Rows[n]["di"]);
- pencolor = (int)ColorTranslator.ToOle(Color.Black);
- string txt_di = Ceng_DataSet.Tables[0].Rows[n]["底板岩性"].ToString();
- string txt_ding = Ceng_DataSet.Tables[0].Rows[n]["顶板岩性"].ToString();
- if(m==1)
- { //跟钻孔的最高点和最低点比较
- up_h = j_z-ceng_z;
- down_h = ceng_z-ceng_h - (j_z-j_high);
- updata_fill(up_t,down_t,up_h,down_h,1,j_z,j_high,ceng_z,ceng_h,pencolor,txt_di,txt_ding);
- }
- else //有两层及其以上的情况
- {
- //1.处理最上面那层煤
- if(n==0)
- {
- next_z = Convert.ToDouble(Ceng_DataSet.Tables[0].Rows[n+1]["底板坐标z"]);
- up_h = j_z-ceng_z;
- down_h = ceng_z-ceng_h - next_z;
- updata_fill(up_t,down_t,up_h,down_h,2,j_z,j_high,ceng_z,ceng_h,pencolor,txt_di,txt_ding);
- }
- else if(n==m-1) //最下面那层
- {
- font_z = Convert.ToDouble(Ceng_DataSet.Tables[0].Rows[n-1]["底板坐标z"]);
- font_h = Convert.ToDouble(Ceng_DataSet.Tables[0].Rows[n-1]["煤层伪厚"]);
- up_h = font_z - font_h-ceng_z;
- down_h = ceng_z-ceng_h - (j_z-j_high);
- updata_fill(up_t,down_t,up_h,down_h,3,j_z,j_high,ceng_z,ceng_h,pencolor,txt_di,txt_ding);
- }
- else
- {
- font_z = Convert.ToDouble(Ceng_DataSet.Tables[0].Rows[n-1]["底板坐标z"]);
- font_h = Convert.ToDouble(Ceng_DataSet.Tables[0].Rows[n-1]["煤层伪厚"]);
- next_z = Convert.ToDouble(Ceng_DataSet.Tables[0].Rows[n+1]["底板坐标z"]);
- up_h = font_z - font_h-ceng_z;
- down_h = ceng_z-ceng_h - next_z;
- updata_fill(up_t,down_t,up_h,down_h,4,j_z,j_high,ceng_z,ceng_h,pencolor,txt_di,txt_ding);
- }
- }
- }
- else
- {
- MessageBox.Show("临时文件打开失败,或者当前钻孔无煤层信息!不能绘制剖面图","错误信息",MessageBoxButtons.OK,MessageBoxIcon.Error);
- }
- }
- }
- }
- /// <summary>
- /// 生成专题图
- /// </summary>
- private void theme()
- {
- SuperMapLib.soThemeCustom myTheme;
- myTheme = this.axSuperMap1.Layers[1].ThemeCustom;
- myTheme.BrushStyleField = "BrushStyle";
- myTheme.BrushColorField = "BrushColor";
- myTheme.PenWidthField = "PenWidth";
- myTheme.PenColorField = "PenColor";
- myTheme.Enable = true;
- SuperMapLib.soThemeLabel myThemelabel;
- SuperMapLib.soTextStyle myText = new SuperMapLib.soTextStyleClass();
- myText.FontHeight =1.3;
- myText.FontWidth =1.1;
- myText.BgColor = 50;
- myText.Color = 180;
- myThemelabel = this.axSuperMap1.Layers[1].ThemeLabel;
- myThemelabel.Field = "txt";
- myThemelabel.TextStyle = myText;
- myThemelabel.OffsetX = -8;
- myThemelabel.Enable = true;
- myTheme = null;
- myThemelabel = null;
- myText = null;
- }
- /// <summary>
- /// 返回查找指定 ID 的填充模式实体的顺序号
- /// </summary>
- /// <param name="id">指定 ID </param>
- /// <returns></returns>
- private int find_fill_id(int id)
- {
- int f_id = 0;
- SuperMapLib.soFillStyleLib myFill;
- SuperMapLib.soResources myResourse;
- myResourse = this.axSuperWorkspace1.Resources;
- myFill = myResourse.FillStyleLib;
- f_id = myFill.FindID(id);
- myFill =null;
- myResourse = null;
- return f_id;
- }
- #endregion
- #region 修改钻孔信息
- /// <summary>
- /// 根据datagrid的变化更新数据库
- /// </summary>
- /// <returns>成功为true</returns>
- private bool lay_change()
- {
- string select = "select ceng.煤层名称,ceng.止煤深度,ceng.底板坐标x,ceng.底板坐标y,ceng.底板坐标z,ceng.煤层伪厚,ceng.煤层倾角,ceng.利用厚度,ceng.顶板岩性,ceng.底板岩性,ceng.钻孔序号,ceng.等级,ceng.编号 from 煤层关联钻孔 as ceng where 1>2";
- DataBase myDB = new DataBase();
- if(myDB.Run_change(select,this.Ceng_DataSet,"cenginfo"))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- /// <summary>
- /// 得到有钻孔关的基本信息
- /// </summary>
- private void get_value()
- {
- this.k_id = this.txt_No.Text.Trim();
- this.k_x = Convert.ToDouble(this.numericUpDown_x.Value);
- this.k_y = Convert.ToDouble(this.numericUpDown_y.Value);
- this.k_z = Convert.ToDouble(this.numericUpDown_z.Value);
- this.k_h = Convert.ToDouble(this.numericUpDown_h.Value);
- this.k_other = this.txt_other.Text.Trim();
- this.k_com = this.txt_com.Text.Trim();
- this.k_date = (DateTime)this.dateTimePicker_data.Value;
- this.k_lay = this.txt_lay.Text.Trim();
- }
- /// <summary>
- /// 修改孔的基本信息
- /// </summary>
- /// <returns></returns>
- private bool kong_change()
- {
- SqlParameter[] myParamers={
- new SqlParameter("@id",SqlDbType.Int,4),
- new SqlParameter("@x",SqlDbType.Float),
- new SqlParameter("@y",SqlDbType.Float),
- new SqlParameter("@z",SqlDbType.Float),
- new SqlParameter("@shigong_time",SqlDbType.DateTime),
- new SqlParameter("@shigong_danwei",SqlDbType.Char,30),
- new SqlParameter("@beizhu",SqlDbType.VarChar,500),
- new SqlParameter("@kong_shendu",SqlDbType.Float),
- new SqlParameter("@kong_cengwei",SqlDbType.Char,5),
- } ;
- myParamers[0].Value = this.kong_id;
- myParamers[1].Value = this.k_x;
- myParamers[2].Value = this.k_y;
- myParamers[3].Value = this.k_z;
- myParamers[4].Value = this.k_date;
- myParamers[5].Value = this.k_com;
- myParamers[6].Value = this.k_other;
- myParamers[7].Value = this.k_h;
- myParamers[8].Value = this.k_lay;
- DataBase myDB = new DataBase();
- if(myDB.RunProcedure_Nr("up_change_kong",myParamers))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- #endregion
- #region 加载自己定义的填充库
- /// <summary>
- /// 获取系统填充库文件
- /// </summary>
- private void get_fill_file()
- {
- SuperMapLib.soFillStyleLib myFill;
- SuperMapLib.soResources myResourse;
- myResourse = this.axSuperWorkspace1.Resources;
- myFill = myResourse.FillStyleLib;
- string url = Application.StartupPath+"\fill.dll";
- try
- {
- myFill.Import(url,true);
- }
- catch(Exception e)
- {
- MessageBox.Show("岩性填充库加载失败,您可能无法看到正确的钻孔剖面示意图nn错误信息:"+e.Message,"系统错误",MessageBoxButtons.OK,MessageBoxIcon.Error);
- }
- finally
- {
- myFill =null;
- myResourse = null;
- }
- }
- #endregion
- private void user_admin()
- {
- this.btn_ok.Enabled = false;
- this.label10.Text = "您的身份为普通用户,不能修改数据";
- }
- }
- }