若升级过程中失败,则下次升级重置提示语

This commit is contained in:
chenjiangqun
2026-05-13 14:47:25 +08:00
parent 2ae1a69422
commit 39fbf5570c

View File

@@ -77,6 +77,7 @@ namespace WinISP
private const byte MS_GET_BOARD_NAME = 0x45; private const byte MS_GET_BOARD_NAME = 0x45;
private const byte MS_GET_FW_VERSION = 0x47; private const byte MS_GET_FW_VERSION = 0x47;
private string _fwVersionFromDDC = String.Empty; private string _fwVersionFromDDC = String.Empty;
private bool _suppressSendFileFailMessage = false;
object _lockObj = new object(); object _lockObj = new object();
int _numberOfMonitors; int _numberOfMonitors;
int _lastNumOfMonitors = 0; int _lastNumOfMonitors = 0;
@@ -1656,6 +1657,10 @@ namespace WinISP
frmISP.WriteLog("binFilePath is NULL", "debug"); frmISP.WriteLog("binFilePath is NULL", "debug");
return; return;
} }
bool suppressSendFileFail = _suppressSendFileFailMessage;
_suppressSendFileFailMessage = false;
if (suppressSendFileFail)
SetStatusMsg("Ready");
frmISP.WriteLog("Start ISP", "debug"); frmISP.WriteLog("Start ISP", "debug");
//int totalFailCnt1 = 0; //int totalFailCnt1 = 0;
int failCnt = 0; int failCnt = 0;
@@ -1894,8 +1899,16 @@ namespace WinISP
//bypass empty sector //bypass empty sector
if (SetSentInfo(sentLen + _flashSectorSize) == false) if (SetSentInfo(sentLen + _flashSectorSize) == false)
{ {
SetStatusMsg("Send file fail."); if (!suppressSendFileFail)
SetISPStatus(false, "Send file fail."); {
SetStatusMsg("Send file fail.");
SetISPStatus(false, "Send file fail.");
}
else
{
SetISPStatus(false);
}
_suppressSendFileFailMessage = true;
return; return;
} }
checkSum = 0; checkSum = 0;
@@ -1909,8 +1922,16 @@ namespace WinISP
//bypass empty sector //bypass empty sector
if (SetSentInfo(sentLen + _flashSectorSize) == false) if (SetSentInfo(sentLen + _flashSectorSize) == false)
{ {
SetStatusMsg("Send file fail."); if (!suppressSendFileFail)
SetISPStatus(false, "Send file fail."); {
SetStatusMsg("Send file fail.");
SetISPStatus(false, "Send file fail.");
}
else
{
SetISPStatus(false);
}
_suppressSendFileFailMessage = true;
return; return;
} }
checkSum = 0; checkSum = 0;
@@ -1961,15 +1982,31 @@ namespace WinISP
//reset sent info //reset sent info
if (SetSentInfo(sentLen) == false) if (SetSentInfo(sentLen) == false)
{ {
SetStatusMsg("Send file fail."); if (!suppressSendFileFail)
SetISPStatus(false, "Send file fail."); {
SetStatusMsg("Send file fail.");
SetISPStatus(false, "Send file fail.");
}
else
{
SetISPStatus(false);
}
_suppressSendFileFailMessage = true;
return; return;
} }
if (retryCnt > MaxRetryCnt) if (retryCnt > MaxRetryCnt)
{ {
SetStatusMsg("Send file fail."); if (!suppressSendFileFail)
SetISPStatus(false, "Send file fail."); {
SetStatusMsg("Send file fail.");
SetISPStatus(false, "Send file fail.");
}
else
{
SetISPStatus(false);
}
_suppressSendFileFailMessage = true;
return; return;
} }
} }