Browse Source

优化粒级表选中编辑

cxs 1 month ago
parent
commit
b81f8a1662

+ 1 - 1
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -933,7 +933,7 @@
 	  <Control name="ChineseStandard2" text="GB30834方法二" />
 	  <Control name="AmericanStandard" text="美标" />
 	  <Control name="GermanStandard" text="德标" />
-	  <Control name="yb6156" text="YB/T 6156-2023" />
+	  <Control name="yb6156" text="德标 K法(YB/T 6156-2023" />
 	  <Control name="CommonClassification" text="颗粒成分分类" />
 	  <Control name="ParticlesAnalyzed" text="已分析颗粒" />
 	  <Control name="SelectParticles" text="选择颗粒" />

+ 2 - 3
OTSIncAReportApp/1-UI/GBCalculate/YB6156ABCD.Designer.cs

@@ -661,9 +661,9 @@
             this.label1.AutoSize = true;
             this.label1.Location = new System.Drawing.Point(3, 7);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(329, 12);
+            this.label1.Size = new System.Drawing.Size(491, 12);
             this.label1.TabIndex = 5;
-            this.label1.Text = "备注:YB/T6156-2023 规定总检测面积应不小于1000平方毫米";
+            this.label1.Text = "备注:YB/T6156-2023 规定总检测面积应不小于1000平方毫米,推荐一组试样数量不少于6个";
             // 
             // label2
             // 
@@ -682,7 +682,6 @@
             this.comboBox_InitialRatingLevel.Name = "comboBox_InitialRatingLevel";
             this.comboBox_InitialRatingLevel.Size = new System.Drawing.Size(83, 20);
             this.comboBox_InitialRatingLevel.TabIndex = 7;
-            //this.comboBox_InitialRatingLevel.SelectedIndexChanged += new System.EventHandler(this.comboBox_InitialRatingLevel_SelectedIndexChanged);
             // 
             // YB6156ABCD
             // 

+ 15 - 19
OTSIncAReportApp/1-UI/OTSMgrInfo/frmPartSizeEditorNew.cs

@@ -27,7 +27,7 @@ namespace OTSIncAReportApp
         string mPartSizeFilePath = "";
 
         string str_selectID = "-1";
-
+        string selPartiSizeN = "";
         /// <summary>
         /// 选择使用的粒级名
         /// </summary>
@@ -40,14 +40,14 @@ namespace OTSIncAReportApp
 
         #region 窗体加载及构造函数
 
-        public frmPartSizeEditorNew(frmReportApp infrmReportApp, string in_partsizefilepath)
+        public frmPartSizeEditorNew(frmReportApp infrmReportApp, string in_partsizefilepath,string PartiSizeN)
         {
             InitializeComponent();
 
             m_ReportApp = infrmReportApp;
             m_DataMgrFun = infrmReportApp.m_rstDataMgr;
             mPartSizeFilePath = in_partsizefilepath;
-
+            selPartiSizeN = PartiSizeN;
             m_dt_partsize.Columns.Add("ID");
             m_dt_partsize.Columns.Add("FilePath");
             m_dt_partsize.Columns.Add("FileName");
@@ -59,7 +59,6 @@ namespace OTSIncAReportApp
             table = lan.GetNameTable(this.Name);
             #endregion
         }
-
         private void frmPartSizeEditorNew_Load(object sender, EventArgs e)
         {
             //设置GridView样式
@@ -67,23 +66,8 @@ namespace OTSIncAReportApp
 
             //绑定GridView
             BindGridView();
-
-            Init();
-        }
-
-        void Init()
-        {
-            if (Gview_LJ.RowCount >= 0)
-            {
-                str_selectID = Gview_LJ.Rows[0].Cells[0].Value.ToString();
-                tb_lj.Text = Gview_LJ.Rows[0].Cells[1].Value.ToString();//路径
-                tb_ljm.Text = Gview_LJ.Rows[0].Cells[3].Value.ToString();//粒级名
-                tb_ljz.Text = Gview_LJ.Rows[0].Cells[4].Value.ToString();//粒级值
-
-            }
         }
             #endregion
-
             #region 自定义方法
             /// <summary>
             /// 提供编号列名,获取DataTable中,编号列自增长后的ID标识
@@ -226,6 +210,18 @@ namespace OTSIncAReportApp
                 Gview_LJ.Rows[index].Cells["ParticleSizeValue"].Value = m_dt_partsize.Rows[i]["Value"].ToString();
             }
 
+            foreach(DataGridViewRow row in Gview_LJ.Rows)//(int i=0;i<Gview_LJ.Rows.Count;i++)
+            {
+                if(row.Cells["FileName"].Value.ToString() == selPartiSizeN)        //(Gview_LJ.Rows[i].Cells["FileName"].Value.ToString()== selPartiSizeN)
+                {
+                    row.Selected = true;                                            //Gview_LJ.Rows[i].Selected=true;
+                    str_selectID = row.Cells[0].Value.ToString();
+                    tb_lj.Text = row.Cells[1].Value.ToString();//路径
+                    tb_ljm.Text = row.Cells[3].Value.ToString();//粒级名
+                    tb_ljz.Text = row.Cells[4].Value.ToString();//粒级值
+                    this.Refresh();
+                }
+            }
         }
 
         /// <summary>

+ 19 - 69
OTSIncAReportApp/1-UI/OTSMgrInfo/frmReportSysConfig.Designer.cs

@@ -45,24 +45,20 @@ namespace OTSIncAReprotCharts
             this.button16 = new System.Windows.Forms.Button();
             this.button15 = new System.Windows.Forms.Button();
             this.groupBox3 = new System.Windows.Forms.GroupBox();
+            this.comboBox_PartiSizeFileFolder = new System.Windows.Forms.ComboBox();
             this.btn_PartSize = new System.Windows.Forms.Button();
-            this.tb_PartiSizeFileFolder = new System.Windows.Forms.TextBox();
             this.label4 = new System.Windows.Forms.Label();
-            this.tb_sjtmbwj = new System.Windows.Forms.TextBox();
-            this.tb_sjtmb = new System.Windows.Forms.TextBox();
             this.btn_ybcsqx = new System.Windows.Forms.Button();
             this.btn_ybcsbc = new System.Windows.Forms.Button();
             this.btn_sjtmbwj = new System.Windows.Forms.Button();
             this.label17 = new System.Windows.Forms.Label();
-            this.label5 = new System.Windows.Forms.Label();
             this.groupBox6 = new System.Windows.Forms.GroupBox();
+            this.cB_sjtmbwj = new System.Windows.Forms.ComboBox();
             this.tb_blyz = new System.Windows.Forms.TextBox();
             this.label22 = new System.Windows.Forms.Label();
             this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
             this.groupBox2 = new System.Windows.Forms.GroupBox();
             this.label1 = new System.Windows.Forms.Label();
-            this.comboBox_PartiSizeFileFolder = new System.Windows.Forms.ComboBox();
-            this.cB_sjtmbwj = new System.Windows.Forms.ComboBox();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.cB_SIZE_CAL_METHOD_TYPE = new System.Windows.Forms.ComboBox();
             this.label2 = new System.Windows.Forms.Label();
@@ -198,6 +194,15 @@ namespace OTSIncAReprotCharts
             this.groupBox3.TabStop = false;
             this.groupBox3.Text = "粒级设置";
             // 
+            // comboBox_PartiSizeFileFolder
+            // 
+            this.comboBox_PartiSizeFileFolder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_PartiSizeFileFolder.FormattingEnabled = true;
+            this.comboBox_PartiSizeFileFolder.Location = new System.Drawing.Point(125, 15);
+            this.comboBox_PartiSizeFileFolder.Name = "comboBox_PartiSizeFileFolder";
+            this.comboBox_PartiSizeFileFolder.Size = new System.Drawing.Size(333, 20);
+            this.comboBox_PartiSizeFileFolder.TabIndex = 5;
+            // 
             // btn_PartSize
             // 
             this.btn_PartSize.Location = new System.Drawing.Point(463, 17);
@@ -209,15 +214,6 @@ namespace OTSIncAReprotCharts
             this.btn_PartSize.UseVisualStyleBackColor = true;
             this.btn_PartSize.Click += new System.EventHandler(this.btn_PartSize_Click);
             // 
-            // tb_PartiSizeFileFolder
-            // 
-            this.tb_PartiSizeFileFolder.Enabled = false;
-            this.tb_PartiSizeFileFolder.Location = new System.Drawing.Point(545, 23);
-            this.tb_PartiSizeFileFolder.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.tb_PartiSizeFileFolder.Name = "tb_PartiSizeFileFolder";
-            this.tb_PartiSizeFileFolder.Size = new System.Drawing.Size(336, 21);
-            this.tb_PartiSizeFileFolder.TabIndex = 3;
-            // 
             // label4
             // 
             this.label4.AutoSize = true;
@@ -228,24 +224,6 @@ namespace OTSIncAReprotCharts
             this.label4.TabIndex = 2;
             this.label4.Text = "粒级表";
             // 
-            // tb_sjtmbwj
-            // 
-            this.tb_sjtmbwj.Enabled = false;
-            this.tb_sjtmbwj.Location = new System.Drawing.Point(606, 94);
-            this.tb_sjtmbwj.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.tb_sjtmbwj.Name = "tb_sjtmbwj";
-            this.tb_sjtmbwj.Size = new System.Drawing.Size(335, 21);
-            this.tb_sjtmbwj.TabIndex = 3;
-            // 
-            // tb_sjtmb
-            // 
-            this.tb_sjtmb.Enabled = false;
-            this.tb_sjtmb.Location = new System.Drawing.Point(606, 69);
-            this.tb_sjtmb.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.tb_sjtmb.Name = "tb_sjtmb";
-            this.tb_sjtmb.Size = new System.Drawing.Size(373, 21);
-            this.tb_sjtmb.TabIndex = 3;
-            // 
             // btn_ybcsqx
             // 
             this.btn_ybcsqx.Location = new System.Drawing.Point(444, 253);
@@ -289,16 +267,6 @@ namespace OTSIncAReprotCharts
             this.label17.TabIndex = 2;
             this.label17.Text = "三元图";
             // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(550, 72);
-            this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(41, 12);
-            this.label5.TabIndex = 2;
-            this.label5.Text = "文件夹";
-            // 
             // groupBox6
             // 
             this.groupBox6.Controls.Add(this.cB_sjtmbwj);
@@ -313,6 +281,14 @@ namespace OTSIncAReprotCharts
             this.groupBox6.TabStop = false;
             this.groupBox6.Text = "三元相图模板设置";
             // 
+            // cB_sjtmbwj
+            // 
+            this.cB_sjtmbwj.FormattingEnabled = true;
+            this.cB_sjtmbwj.Location = new System.Drawing.Point(125, 24);
+            this.cB_sjtmbwj.Name = "cB_sjtmbwj";
+            this.cB_sjtmbwj.Size = new System.Drawing.Size(333, 20);
+            this.cB_sjtmbwj.TabIndex = 5;
+            // 
             // tb_blyz
             // 
             this.tb_blyz.Location = new System.Drawing.Point(125, 15);
@@ -361,23 +337,6 @@ namespace OTSIncAReprotCharts
             this.label1.TabIndex = 2;
             this.label1.Text = "特征/夹杂物指数=特征总面积/检测视场总面积*系数";
             // 
-            // comboBox_PartiSizeFileFolder
-            // 
-            this.comboBox_PartiSizeFileFolder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.comboBox_PartiSizeFileFolder.FormattingEnabled = true;
-            this.comboBox_PartiSizeFileFolder.Location = new System.Drawing.Point(125, 15);
-            this.comboBox_PartiSizeFileFolder.Name = "comboBox_PartiSizeFileFolder";
-            this.comboBox_PartiSizeFileFolder.Size = new System.Drawing.Size(333, 20);
-            this.comboBox_PartiSizeFileFolder.TabIndex = 5;
-            // 
-            // cB_sjtmbwj
-            // 
-            this.cB_sjtmbwj.FormattingEnabled = true;
-            this.cB_sjtmbwj.Location = new System.Drawing.Point(125, 24);
-            this.cB_sjtmbwj.Name = "cB_sjtmbwj";
-            this.cB_sjtmbwj.Size = new System.Drawing.Size(333, 20);
-            this.cB_sjtmbwj.TabIndex = 5;
-            // 
             // groupBox1
             // 
             this.groupBox1.Controls.Add(this.cB_SIZE_CAL_METHOD_TYPE);
@@ -415,11 +374,7 @@ namespace OTSIncAReprotCharts
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(520, 283);
             this.Controls.Add(this.groupBox1);
-            this.Controls.Add(this.tb_sjtmbwj);
-            this.Controls.Add(this.tb_sjtmb);
-            this.Controls.Add(this.label5);
             this.Controls.Add(this.groupBox2);
-            this.Controls.Add(this.tb_PartiSizeFileFolder);
             this.Controls.Add(this.groupBox6);
             this.Controls.Add(this.groupBox3);
             this.Controls.Add(this.btn_ybcsqx);
@@ -442,7 +397,6 @@ namespace OTSIncAReprotCharts
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
             this.ResumeLayout(false);
-            this.PerformLayout();
 
         }
 
@@ -465,15 +419,11 @@ namespace OTSIncAReprotCharts
         private System.Windows.Forms.Button btn_ybcsbc;
         private System.Windows.Forms.Button btn_sjtmbwj;
         private System.Windows.Forms.Label label17;
-        private System.Windows.Forms.Label label5;
         private System.Windows.Forms.Label label4;
         private System.Windows.Forms.GroupBox groupBox6;
         private System.Windows.Forms.Label label22;
         private System.Windows.Forms.TextBox tb_blyz;
-        public System.Windows.Forms.TextBox tb_sjtmbwj;
-        public System.Windows.Forms.TextBox tb_sjtmb;
         private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
-        public System.Windows.Forms.TextBox tb_PartiSizeFileFolder;
         private System.Windows.Forms.GroupBox groupBox2;
         private Button btn_PartSize;
         private Label label1;

+ 13 - 53
OTSIncAReportApp/1-UI/OTSMgrInfo/frmReportSysConfig.cs

@@ -18,11 +18,9 @@ namespace OTSIncAReprotCharts
 
         #region 变量
         public ResultDataMgr m_DataMgrFun = null;
-
         //粒级文件夹路径
         public static string m_PathName = "";
 
-
         //粒级文件夹获取
         public static string m_strPath = "";
 
@@ -30,22 +28,16 @@ namespace OTSIncAReprotCharts
         /// 保存的全局主窗体对象
         /// </summary>
         frmReportApp m_ReportApp;
-
-
+        string strbpath = ".\\Config\\ProData\\";
         #endregion
-
         #region 构造函数及窗体加载
         public frmReportSysConfig(frmReportApp ReportApp)
         {
             InitializeComponent();
-
             //粒级部分
             this.m_DataMgrFun = ReportApp.m_rstDataMgr;
-
             m_ReportApp = ReportApp;
 
-            //参数设置
-            tb_sjtmbwj.Text = "";
             #region 国际化语言
             Language lan = new Language(this);
             #endregion
@@ -64,7 +56,7 @@ namespace OTSIncAReprotCharts
 
         public void InitData()
         {
-            DirectoryInfo theFolder = new DirectoryInfo(tb_PartiSizeFileFolder.Text);
+            DirectoryInfo theFolder = new DirectoryInfo(strbpath);
             if (!theFolder.Exists)
                 return;
 
@@ -120,21 +112,8 @@ namespace OTSIncAReprotCharts
         public void InitMyComponent()
         {
             string imagepath;
-
             //显示程序管理对话框参数设置
-            string strbpath = ".\\Config\\ProData\\";
-            tb_PartiSizeFileFolder.Text = strbpath;
-
             imagepath = strbpath;
-
-            tb_sjtmb.Text = strbpath;
-            tb_sjtmbwj.Text = "DefaultTriTemplateFile.tpf";
-
-            //一般参数内的所有textbox不可修改
-            tb_sjtmb.ReadOnly = true;
-            tb_sjtmbwj.ReadOnly = true;
-            tb_PartiSizeFileFolder.ReadOnly = true;
-
             DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXmlData(Application.StartupPath + RptConfigFile.m_ReportMgrParamFile, "XMLData");
             DataTable dt = ds.Tables["Member"];
             string str_scale="";
@@ -185,26 +164,9 @@ namespace OTSIncAReprotCharts
         //三元相图模板文件夹
         private void btn_klljwjj_Click(object sender, EventArgs e)
         {
-            if (tb_PartiSizeFileFolder.Text == ".\\Config\\ProData\\")
-            {
+            
                 string strb = ".\\Config\\ProData\\";
                 folderBrowserDialog1.SelectedPath = strb;
-                if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
-                {
-                    tb_PartiSizeFileFolder.Text = folderBrowserDialog1.SelectedPath;
-                }
-            }
-            else
-            {
-                if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
-                {
-                    tb_PartiSizeFileFolder.Text = folderBrowserDialog1.SelectedPath;
-                }
-                else
-                {
-                    tb_PartiSizeFileFolder.Text = folderBrowserDialog1.SelectedPath;
-                }
-            }
         }
 
         private void btn_sjtwj_Click(object sender, EventArgs e)
@@ -216,17 +178,16 @@ namespace OTSIncAReprotCharts
         #endregion
 
         #region 粒级相关
-        //颗粒粒级文件夹
-        private void btn_sjtmbwjj_Click(object sender, EventArgs e)
-        {
-            //点击颗粒粒级文件夹按钮
-            folderBrowserDialog1.ShowDialog();
-            tb_sjtmb.Text = folderBrowserDialog1.SelectedPath;
-        }
+
+
+
+
+
+
 
         private void btn_PartSize_Click(object sender, EventArgs e)
         {
-            frmPartSizeEditorNew fPSEN = new frmPartSizeEditorNew(m_ReportApp, tb_PartiSizeFileFolder.Text);
+            frmPartSizeEditorNew fPSEN = new frmPartSizeEditorNew(m_ReportApp, strbpath, comboBox_PartiSizeFileFolder.Text);
             if (fPSEN.ShowDialog() == DialogResult.OK)
             {
 
@@ -280,11 +241,10 @@ namespace OTSIncAReprotCharts
             {
                 MessageBox.Show("please check params!");
             }
-            //参数设置保存功能粒级文件
-            strParSizeFile = tb_PartiSizeFileFolder.Text;
 
-            String strTritempFile = tb_sjtmb.Text;
-            string strTritemp = tb_sjtmbwj.Text;
+
+
+
 
 
             //根据xml读取内容