优化RFID流程逻辑、修改自检流程,关闭循环阀
This commit is contained in:
+16
-3
@@ -70,7 +70,7 @@ SysPara::SysPara(void):
|
||||
status.flagOfNo67FPGA=false;
|
||||
#ifdef __RFID_CARD
|
||||
if(!loadRFIDPara()){
|
||||
memset(&RFIDPara,0,sizeof(RFIDPara));
|
||||
RFIDPara = RFIDPara_t{};
|
||||
saveRFIDPara();
|
||||
}
|
||||
#endif
|
||||
@@ -1024,7 +1024,7 @@ void SysPara::saveRFIDPara()
|
||||
out << RFIDPara.maintenanceInterval;
|
||||
out << RFIDPara.maintenanceEndDate;
|
||||
out << RFIDPara.needMaintenance;
|
||||
out << RFIDPara.runTime;
|
||||
out << (unsigned int)(RFIDPara.runtimeMs / 1000);
|
||||
out << RFIDPara.maintenanceHours;
|
||||
out << RFIDPara.addedInk;
|
||||
out << RFIDPara.addedSolvent;
|
||||
@@ -1032,6 +1032,7 @@ void SysPara::saveRFIDPara()
|
||||
out << RFIDPara.cardSolvent;
|
||||
out << para.rfidCountDown;
|
||||
out << status.showInkWarningNumber << status.showSolventWarningNumber;
|
||||
out << RFIDPara.inInkAndRFIDProgress << RFIDPara.inSolventAndRFIDProgress << RFIDPara.runtimeMs;
|
||||
|
||||
if(!file.flush()){
|
||||
LogInfo::setRunStatusText("RFID Para save Failed 1");
|
||||
@@ -1057,6 +1058,11 @@ bool SysPara::loadRFIDPara()
|
||||
|
||||
QDataStream in(&file);
|
||||
in.setVersion(QDataStream::Qt_4_6); // Set the version compatible with Qt 4.8.5
|
||||
uint oldRuntimeSec = 0;
|
||||
|
||||
RFIDPara.inInkAndRFIDProgress = 0;
|
||||
RFIDPara.inSolventAndRFIDProgress = 0;
|
||||
RFIDPara.runtimeMs = 0;
|
||||
|
||||
in >> RFIDPara.PrintInkDots;
|
||||
in >> RFIDPara.InkEmptyCnt;
|
||||
@@ -1072,7 +1078,7 @@ bool SysPara::loadRFIDPara()
|
||||
in >> RFIDPara.maintenanceInterval;
|
||||
in >> RFIDPara.maintenanceEndDate;
|
||||
in >> RFIDPara.needMaintenance;
|
||||
in >> RFIDPara.runTime;
|
||||
in >> oldRuntimeSec;
|
||||
in >> RFIDPara.maintenanceHours;
|
||||
in >> RFIDPara.addedInk;
|
||||
in >> RFIDPara.addedSolvent;
|
||||
@@ -1080,6 +1086,13 @@ bool SysPara::loadRFIDPara()
|
||||
in >> RFIDPara.cardSolvent;
|
||||
in >> para.rfidCountDown;
|
||||
in >> status.showInkWarningNumber >> status.showSolventWarningNumber;
|
||||
in >> RFIDPara.inInkAndRFIDProgress >> RFIDPara.inSolventAndRFIDProgress >> RFIDPara.runtimeMs;
|
||||
|
||||
// 兼容获取旧的运行时间,如果新的运行时间为0且旧的运行时间大于0,则使用旧的运行时间
|
||||
// 新时间所占用的8字节空间,在旧实现上也是没有用的,它们总是被写入为0,因此RFIDPara.runtimeMs为 0 ,表示软件刚刚升级,第一次运行,应该使用旧的运行时间
|
||||
if(RFIDPara.runtimeMs == 0){
|
||||
RFIDPara.runtimeMs = oldRuntimeSec * 1000;
|
||||
}
|
||||
|
||||
file.close();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user