From e5a570db2036a6b155c2ddc289b42bd050b9ad3c Mon Sep 17 00:00:00 2001
From: lx <ex_lixiang17@cosl.com.cn>
Date: 星期一, 24 十一月 2025 13:49:16 +0800
Subject: [PATCH] update 1.4

---
 ErrorAnalysis.UI/FrmMain.cs |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/ErrorAnalysis.UI/FrmMain.cs b/ErrorAnalysis.UI/FrmMain.cs
index ce31e28..fd0bb63 100644
--- a/ErrorAnalysis.UI/FrmMain.cs
+++ b/ErrorAnalysis.UI/FrmMain.cs
@@ -9,6 +9,7 @@
 using OxyPlot.Series;
 using OxyPlot.WindowsForms;
 using System.ComponentModel.DataAnnotations;
+using System.Runtime.InteropServices;
 using System.Security.Cryptography;
 using System.Windows.Forms;
 using static System.Windows.Forms.VisualStyles.VisualStyleElement.Menu;
@@ -17,12 +18,14 @@
 {
     public partial class FrmMain : Form
     {
+        [DllImport("user32.dll")]
+        private static extern short GetAsyncKeyState(Keys vKey);
+
         private string? _connectionString;
         private List<COModelTable> _models;
         private Dictionary<string, string> _filters;
         private COModelTable _model;
         private ReportModel _reportModel;
-
         public FrmMain()
         {
             InitializeComponent();
@@ -30,6 +33,7 @@
         private void FrmMain_Load(object sender, EventArgs e)
         {
             cmbSpeedUnit.SelectedIndex = 0;
+            cmbToolType.SelectedIndex = 0;
             cmbTargetLoggingIntervalUnit.SelectedIndex = 0;
         }
         private void InitInputControl()
@@ -58,7 +62,7 @@
                 pbLoadDB.Show();
                 pbLoadDB.Value = 0;
                 txtDataPath.Text = fileDlg.FileName;
-                txtToolType.Text = fileDlg.SafeFileName.Substring(0, fileDlg.SafeFileName.IndexOf("Mcnp"));
+                //txtToolType.Text = fileDlg.SafeFileName.Substring(0, fileDlg.SafeFileName.IndexOf("Mcnp"));
                 _connectionString = $"Data Source={fileDlg.FileName};";
                 RepositoryInstance.Instance.ReLoad(_connectionString);
 
@@ -172,7 +176,7 @@
                 }
                 var calcSpeed = cmbSpeedUnit.Text == "ft/hr" ? UnitConvert.FtHr2MS(speed) : UnitConvert.MHR2MS(speed);
 
-                var result = ErrorRatioCalc.GetErrorRatioResult(_model.ModelID, porosity, sw, depth, true, calcSpeed, yieldCounting, targetErrorRatio / 100, out _, out processingData);
+                var result = ErrorRatioCalc.GetErrorRatioResult(_model.ModelID, porosity, sw, depth, true, calcSpeed, yieldCounting, targetErrorRatio / 100, cmbToolType.Text, out _, out processingData);
 
                 Plot(result);
 
@@ -184,7 +188,7 @@
                 AppendText(txtAnalysisResult, $"{errorRate}%", ColorTranslator.FromHtml("#8B0000"));
                 txtAnalysisResult.AppendText(" error rate. With the tool operating at ");
                 AppendText(txtAnalysisResult, $"{speed} {cmbSpeedUnit.Text}", ColorTranslator.FromHtml("#8B0000"));
-                txtAnalysisResult.AppendText(" the estimated total job duration is ");
+                txtAnalysisResult.AppendText(" the estimated one pass duration is ");
                 AppendText(txtAnalysisResult, $"{totalTime} hours.", ColorTranslator.FromHtml("#8B0000"));
 
                 _reportModel = CreateReportModel(totalTime.ToString(), result.ErrorRatios.Count.ToString(), Math.Round(UnitConvert.MS2FtHr(calcSpeed), 2).ToString(), errorRate.ToString());
@@ -197,7 +201,7 @@
                     return;
                 }
                 double speed;
-                var result = ErrorRatioCalc.GetErrorRatioResult(_model.ModelID, porosity, sw, depth, false, 0, yieldCounting, targetErrorRatio / 100, out speed, out processingData, pass);
+                var result = ErrorRatioCalc.GetErrorRatioResult(_model.ModelID, porosity, sw, depth, false, 0, yieldCounting, targetErrorRatio / 100,cmbToolType.Text, out speed, out processingData, pass);
                 Plot(result);
 
                 double totalTime = Math.Round((targetLoggingInterval / speed / 60 / 60), 2);
@@ -215,10 +219,8 @@
 
                 _reportModel = CreateReportModel(totalTime.ToString(), result.ErrorRatios.Count.ToString(), speedFr.ToString(), errorRate.ToString());
             }
-            if (chkProcessing.Checked)
+            if ((Control.ModifierKeys & Keys.Control) == Keys.Control && (GetAsyncKeyState(Keys.D) & 0x8000) != 0)
                 new ProcessingData(processingData).Show();
-
-
         }
         private void btnReport_Click(object sender, EventArgs e)
         {

--
Gitblit v1.9.3