فهرست منبع

Deal with the issue of repeatedly copying user-defined libraries when only system libraries are selected

cxs 1 هفته پیش
والد
کامیت
a83d80b3cf

+ 32 - 14
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.cs

@@ -329,6 +329,24 @@ namespace OTSMeasureApp
 
         private void comboEngineType_SelectedIndexChanged(object sender, EventArgs e)
         {
+            ComboBox cbEngineTyp = (ComboBox)sender;
+            int selectValue = Convert.ToInt32(((OTSMeasureApp.ComboBoxItem)comboEngineType.Items[comboEngineType.SelectedIndex]).Value);
+            if (selectValue == (int)otsdataconst.OTS_CLASSIFY_ENGINE_TYPE.InclustionEngine)
+            {
+                IDC_COMBO_STDSelect.Enabled = false;
+                foreach(ComboBoxItem cbi in IDC_COMBO_STDSelect.Items)
+                {
+                    if(cbi.Text== "NoSTDDB")
+                    {
+                        IDC_COMBO_STDSelect.SelectedItem = cbi;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                IDC_COMBO_STDSelect.Enabled = true;
+            }
             ThisSetIsModify();
         }
 
@@ -495,21 +513,19 @@ namespace OTSMeasureApp
                         IDC_COMBO_IMGSIZE.SelectedItem = cbi;
                     }
             }
-           
-
         }
 
+
+
         /// <summary>
         /// 加载一般常规参数
         /// </summary>
         public void LoadCGenParam()
         {
-
             //样品名
             IDC_EDIT_SAMPLENAME.Text = m_cgenparam.GetSampleName().ToString();
             //执行开关
             IDC_MEAS_SWITCH.Checked = m_cgenparam.GetMeasurementSwitch();
-            //是否使用系统库开关
             OTS_CLASSIFY_ENGINE_TYPE EngineType = m_cgenparam.GetEngineType();
             int sel = 0;
             if (m_cotsprogmgrparamfile.GetSysTypeName() == "SteelMineral")
@@ -532,7 +548,6 @@ namespace OTSMeasureApp
                 sel = 0;
             }
             comboEngineType.SelectedIndex = sel;
-           
             //精炼工艺选项
             foreach (ComboBoxItem cbi in IDC_COMBO_TECHNOLOGY.Items)
             {
@@ -542,7 +557,6 @@ namespace OTSMeasureApp
                         IDC_COMBO_TECHNOLOGY.SelectedItem = cbi;
                     }
             }
-
             //测量区域形状
             foreach (ComboBoxItem cbi in cBMeasShape.Items)
             {
@@ -554,19 +568,23 @@ namespace OTSMeasureApp
             }
             //测量区域面积
             tBMeasArea.Text = m_cgenparam.GetArea().ToString();
-
-            //标准库选择
             foreach (ComboBoxItem cbi in IDC_COMBO_STDSelect.Items)
             {
-                if (cbi.Text.ToString() != "")
+                if (comboEngineType.SelectedIndex == (int)OTS_CLASSIFY_ENGINE_TYPE.InclustionEngine)
+                {
+                    if (cbi.Text.ToString() == "NoSTDDB")
+                        IDC_COMBO_STDSelect.SelectedItem = cbi; break;
+                }
+                else
+                {
                     if (cbi.Text.ToString() == m_cgenparam.GetSTDSelect())
-                    {
-                        IDC_COMBO_STDSelect.SelectedItem = cbi;
-                    }
+                        IDC_COMBO_STDSelect.SelectedItem = cbi; break;
+                }
             }
+         }
+
+
 
-            
-        }
         /// <summary>
         /// 加载默认参数
         /// </summary>

+ 13 - 12
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.designer.cs

@@ -64,6 +64,7 @@
             this.label11 = new System.Windows.Forms.Label();
             this.label7 = new System.Windows.Forms.Label();
             this.groupBox4 = new System.Windows.Forms.GroupBox();
+            this.comboEngineType = new System.Windows.Forms.ComboBox();
             this.IDC_COMBO_STDSelect = new System.Windows.Forms.ComboBox();
             this.label17 = new System.Windows.Forms.Label();
             this.tBMeasArea = new System.Windows.Forms.TextBox();
@@ -134,7 +135,6 @@
             this.IDC_COMBO_Model = new System.Windows.Forms.ComboBox();
             this.groupBox7 = new System.Windows.Forms.GroupBox();
             this.btncancel = new System.Windows.Forms.Button();
-            this.comboEngineType = new System.Windows.Forms.ComboBox();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
@@ -151,7 +151,7 @@
             this.groupBox1.Controls.Add(this.IDC_COMBO_STAGE);
             this.groupBox1.Controls.Add(this.label41);
             this.groupBox1.Controls.Add(this.label1);
-            this.groupBox1.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.groupBox1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.groupBox1.Location = new System.Drawing.Point(6, 69);
             this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox1.Name = "groupBox1";
@@ -571,6 +571,17 @@
             this.groupBox4.TabStop = false;
             this.groupBox4.Text = "常规测量参数";
             // 
+            // comboEngineType
+            // 
+            this.comboEngineType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboEngineType.FormattingEnabled = true;
+            this.comboEngineType.Location = new System.Drawing.Point(117, 74);
+            this.comboEngineType.Margin = new System.Windows.Forms.Padding(2);
+            this.comboEngineType.Name = "comboEngineType";
+            this.comboEngineType.Size = new System.Drawing.Size(137, 20);
+            this.comboEngineType.TabIndex = 822;
+            this.comboEngineType.SelectedIndexChanged += new System.EventHandler(this.comboEngineType_SelectedIndexChanged);
+            // 
             // IDC_COMBO_STDSelect
             // 
             this.IDC_COMBO_STDSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -1326,16 +1337,6 @@
             this.btncancel.UseVisualStyleBackColor = true;
             this.btncancel.Click += new System.EventHandler(this.btncancel_Click);
             // 
-            // comboEngineType
-            // 
-            this.comboEngineType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.comboEngineType.FormattingEnabled = true;
-            this.comboEngineType.Location = new System.Drawing.Point(117, 74);
-            this.comboEngineType.Margin = new System.Windows.Forms.Padding(2);
-            this.comboEngineType.Name = "comboEngineType";
-            this.comboEngineType.Size = new System.Drawing.Size(137, 20);
-            this.comboEngineType.TabIndex = 822;
-            // 
             // ProgMgrInfoForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);