增加提示

This commit is contained in:
chenjiangqun
2026-04-13 15:14:01 +08:00
parent dd9db12c9d
commit 7114b7704a
3 changed files with 27 additions and 17 deletions

View File

@@ -111,11 +111,20 @@
<EmbeddedResource Include="frmISP.resx"> <EmbeddedResource Include="frmISP.resx">
<DependentUpon>frmISP.cs</DependentUpon> <DependentUpon>frmISP.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Properties\Resource-CN.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource-CN.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<Compile Include="Properties\Resource-CN.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resource-CN.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>

View File

@@ -343,7 +343,6 @@
this.progressBar1.Name = "progressBar1"; this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(621, 34); this.progressBar1.Size = new System.Drawing.Size(621, 34);
this.progressBar1.TabIndex = 115; this.progressBar1.TabIndex = 115;
this.progressBar1.Visible = false;
// //
// lblPgsPercentage // lblPgsPercentage
// //

View File

@@ -226,10 +226,12 @@ namespace WinISP
cboConnectedMonitor.Enabled = !isRunning; cboConnectedMonitor.Enabled = !isRunning;
} }
private void SetStatusMsg(String msg) private void SetStatusMsg(String msg,bool display = false)
{ {
toolStripStatusLabel1.Text = msg; toolStripStatusLabel1.Text = msg;
Application.DoEvents(); Application.DoEvents();
if(display) MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
private void frmISP_FormClosing(object sender, FormClosingEventArgs e) private void frmISP_FormClosing(object sender, FormClosingEventArgs e)
@@ -301,7 +303,7 @@ namespace WinISP
} }
catch (Exception ex) catch (Exception ex)
{ {
SetStatusMsg("Could not read file from disk."); SetStatusMsg("Could not read file from disk.",true);
} }
if (_binFilePath == String.Empty) if (_binFilePath == String.Empty)
@@ -405,7 +407,7 @@ namespace WinISP
cboConnectedMonitor.Enabled = false; cboConnectedMonitor.Enabled = false;
btnRunDPISP.Enabled = false; btnRunDPISP.Enabled = false;
pnlConnState.BackColor = Color.Red; pnlConnState.BackColor = Color.Red;
SetStatusMsg("Current F/W version is not compatible with this tool."); SetStatusMsg("Current F/W version is not compatible with this tool.", true);
} }
_chipType = chipType; _chipType = chipType;
switch (chipType) switch (chipType)
@@ -893,7 +895,7 @@ namespace WinISP
if (SetSentInfo(0) == false) if (SetSentInfo(0) == false)
{ {
SetStatusMsg("Adaptive PktLen fail."); SetStatusMsg("Adaptive PktLen fail.");
SetISPStatus(false); SetISPStatus(false, "Adaptive PktLen fail.");
return; return;
} }
@@ -964,7 +966,7 @@ namespace WinISP
if (SetSentInfo(0) == false) if (SetSentInfo(0) == false)
{ {
SetStatusMsg("Adaptive pktDelayTime fail."); SetStatusMsg("Adaptive pktDelayTime fail.");
SetISPStatus(false); SetISPStatus(false, "Adaptive pktDelayTime fail.");
return; return;
} }
WriteLog("Adaptive pktDelayTime: " + pktDelayTime.ToString() + "us.", "debug"); WriteLog("Adaptive pktDelayTime: " + pktDelayTime.ToString() + "us.", "debug");
@@ -1200,7 +1202,7 @@ namespace WinISP
if (IsConnect == false) if (IsConnect == false)
{ {
SetStatusMsg("Initialize ISP connection fail."); SetStatusMsg("Initialize ISP connection fail.");
SetISPStatus(false); SetISPStatus(false, "Initialize ISP connection fail.");
return; return;
} }
@@ -1217,25 +1219,25 @@ namespace WinISP
if (!IsModelNameMatch(_u8ModelName)) if (!IsModelNameMatch(_u8ModelName))
{ {
SetStatusMsg(Properties.Resources.ModelNameErr); SetStatusMsg(Properties.Resources.ModelNameErr);
SetISPStatus(false); SetISPStatus(false, Properties.Resources.ModelNameErr);
return; return;
} }
if (!IsChipNameMatch(_u8ChipName)) if (!IsChipNameMatch(_u8ChipName))
{ {
SetStatusMsg(Properties.Resources.ChipNameErr); SetStatusMsg(Properties.Resources.ChipNameErr);
SetISPStatus(false); SetISPStatus(false, Properties.Resources.ChipNameErr);
return; return;
} }
if (!IsPanelNameMatch(_u8PanelName)) if (!IsPanelNameMatch(_u8PanelName))
{ {
SetStatusMsg(Properties.Resources.PanelNameErr); SetStatusMsg(Properties.Resources.PanelNameErr);
SetISPStatus(false); SetISPStatus(false, Properties.Resources.PanelNameErr);
return; return;
} }
if (!IsBoardNameMatch(_u8BoardName)) if (!IsBoardNameMatch(_u8BoardName))
{ {
SetStatusMsg(Properties.Resources.BoardNameErr); SetStatusMsg(Properties.Resources.BoardNameErr);
SetISPStatus(false); SetISPStatus(false, Properties.Resources.BoardNameErr);
return; return;
} }
@@ -1255,7 +1257,7 @@ namespace WinISP
if (rdSize != bin.Length) if (rdSize != bin.Length)
{ {
SetStatusMsg("Initialize file Information fail."); SetStatusMsg("Initialize file Information fail.");
SetISPStatus(false); SetISPStatus(false, "Initialize file Information fail.");
return; return;
} }
@@ -1379,7 +1381,7 @@ namespace WinISP
if (SetSentInfo(sentLen + _flashSectorSize) == false) if (SetSentInfo(sentLen + _flashSectorSize) == false)
{ {
SetStatusMsg("Send file fail."); SetStatusMsg("Send file fail.");
SetISPStatus(false); SetISPStatus(false, "Send file fail.");
return; return;
} }
checkSum = 0; checkSum = 0;
@@ -1394,7 +1396,7 @@ namespace WinISP
if (SetSentInfo(sentLen + _flashSectorSize) == false) if (SetSentInfo(sentLen + _flashSectorSize) == false)
{ {
SetStatusMsg("Send file fail."); SetStatusMsg("Send file fail.");
SetISPStatus(false); SetISPStatus(false, "Send file fail.");
return; return;
} }
checkSum = 0; checkSum = 0;
@@ -1446,14 +1448,14 @@ namespace WinISP
if (SetSentInfo(sentLen) == false) if (SetSentInfo(sentLen) == false)
{ {
SetStatusMsg("Send file fail."); SetStatusMsg("Send file fail.");
SetISPStatus(false); SetISPStatus(false, "Send file fail.");
return; return;
} }
if (retryCnt > MaxRetryCnt) if (retryCnt > MaxRetryCnt)
{ {
SetStatusMsg("Send file fail."); SetStatusMsg("Send file fail.");
SetISPStatus(false); SetISPStatus(false, "Send file fail.");
return; return;
} }
} }
@@ -1559,7 +1561,7 @@ namespace WinISP
} }
else else
{ {
SetStatusMsg("Update firmware fail, " + "Elapsed Time : " + end.ToString() + " ms"); SetStatusMsg("Update firmware fail, " + "Elapsed Time : " + end.ToString() + " ms",true);
} }
SetISPStatus(false); SetISPStatus(false);