From 718cec11a55dcd696dc4e3c0cade56c7f2ae81b1 Mon Sep 17 00:00:00 2001 From: chenjiangqun Date: Thu, 2 Jul 2026 15:17:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=A2=9E=E5=8A=A0=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WinISP/FormISP_MSI.cs | 90 +++++++++++++------ 1 file changed, 64 insertions(+), 26 deletions(-) diff --git a/WIN10_WinISP_SrcCode_For_MOKA_20250416_1/WinISP/FormISP_MSI.cs b/WIN10_WinISP_SrcCode_For_MOKA_20250416_1/WinISP/FormISP_MSI.cs index 0ae7ca8..1d27f54 100644 --- a/WIN10_WinISP_SrcCode_For_MOKA_20250416_1/WinISP/FormISP_MSI.cs +++ b/WIN10_WinISP_SrcCode_For_MOKA_20250416_1/WinISP/FormISP_MSI.cs @@ -142,38 +142,59 @@ namespace WinISP #else string debugversion = ""; #endif + private bool _isStartupInitializing = false; private void FormISP_MSI_Load(object sender, EventArgs e) { - UpdateNumofConnectedMonitor(); - // lblDisplayNumber.Text = _numberOfMonitors.ToString(); + BeginStartupLoadingAnimation(); + BeginInvoke(new Action(InitializeAfterFormLoaded)); + } - CenterToScreen(); - if (_simI2cCtrl == null) - _simI2cCtrl = new GraphicCardI2CCtrl(); - MTKDebugCmd.InitI2CCtrl(_simI2cCtrl); - - CheckSingleInstance(); - - SetStatusMsg("Ready"); - - string betaString = ""; - System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location); - this.Text += " [Program Version] : " + fvi.ProductVersion + " " + betaString /*+ " (FW ver : " + ver + ") "*/ + debugversion; - frmISP.WriteLog("Program version: " + fvi.ProductVersion, "debug"); -#if DEBUG + private void InitializeAfterFormLoaded() + { + if (_isStartupInitializing) { - // this.label21.Visible = true; - // this.lblPktDelayTime.Visible = true; - // this.txtPktDelayTime.Visible = true; - // this.label20.Visible = true; - // this.lblMTKChipType.Visible = true; + return; } + + _isStartupInitializing = true; + try + { + UpdateNumofConnectedMonitor(); + // lblDisplayNumber.Text = _numberOfMonitors.ToString(); + + CenterToScreen(); + if (_simI2cCtrl == null) + _simI2cCtrl = new GraphicCardI2CCtrl(); + MTKDebugCmd.InitI2CCtrl(_simI2cCtrl); + + CheckSingleInstance(); + + SetStatusMsg("Ready"); + + string betaString = ""; + System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location); + this.Text += " [Program Version] : " + fvi.ProductVersion + " " + betaString /*+ " (FW ver : " + ver + ") "*/ + debugversion; + frmISP.WriteLog("Program version: " + fvi.ProductVersion, "debug"); +#if DEBUG + { + // this.label21.Visible = true; + // this.lblPktDelayTime.Visible = true; + // this.txtPktDelayTime.Visible = true; + // this.label20.Visible = true; + // this.lblMTKChipType.Visible = true; + } #endif - TopMost = true; - btnAuto.Enabled = false; - Connect(); - _lastNumOfMonitors = _numberOfMonitors; - Application.Idle += Application_Idle; + TopMost = true; + btnAuto.Enabled = false; + Connect(); + _lastNumOfMonitors = _numberOfMonitors; + Application.Idle += Application_Idle; + } + finally + { + EndStartupLoadingAnimation(); + _isStartupInitializing = false; + } } private void FormISP_MSI_Shown(object sender, EventArgs e) @@ -238,6 +259,23 @@ namespace WinISP return Environment.TickCount & Int32.MaxValue; } + private void BeginStartupLoadingAnimation() + { + prbProgress.Style = ProgressBarStyle.Marquee; + prbProgress.MarqueeAnimationSpeed = 30; + SetStatusMsg("程序加载中,请稍候..."); + btnAuto.Enabled = false; + btnLoadFile.Enabled = false; + } + + private void EndStartupLoadingAnimation() + { + prbProgress.MarqueeAnimationSpeed = 0; + prbProgress.Style = ProgressBarStyle.Blocks; + prbProgress.Value = 0; + btnLoadFile.Enabled = true; + } + private void OnUpdateProgress(int total, int done, String msg) { if (msg != String.Empty)