2026年5月23日暂存
This commit is contained in:
+25
-18
@@ -106,23 +106,25 @@ void SysPara::loadParaFromFile(){
|
||||
file.seek(0);
|
||||
file.read((char *)¶,(long long int)sizeof(para));
|
||||
file.close();
|
||||
if(para.gearPumpSpeedAlarm < 1000 || para.gearPumpSpeedAlarm > 2000)
|
||||
para.gearPumpSpeedAlarm = 1500;
|
||||
if(para.gearPumpEnable && !para.flagOfReclaimPumEnable)
|
||||
para.flagOfReclaimPumEnable = 1;
|
||||
if (DeviceCodefile.isOpen()) {
|
||||
DeviceCodefile.close();
|
||||
}
|
||||
//jdDataRwLock.lockForRead();
|
||||
if(!DeviceCodefile.open(QIODevice::ReadOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看
|
||||
//QMessageBox::warning(0,"警告",QString("无法打开文件") );
|
||||
}
|
||||
else {
|
||||
DeviceCodefile.seek(0);
|
||||
//file.read((char *)&jd.addr,(long long int)sizeof(jd));
|
||||
DeviceCodefile.read((char *)¶.Json_device_code,(qint64)sizeof(para.Json_device_code));
|
||||
DeviceCodefile.close();
|
||||
}
|
||||
if(para.gearPumpSpeedAlarm < 1000 || para.gearPumpSpeedAlarm > 2000)
|
||||
para.gearPumpSpeedAlarm = 1500;
|
||||
|
||||
// 将flagOfReclaimPumEnable强制设置为0。该参数影响的是压力控制算法,但现在已经不使用 byons@2026年5月12日
|
||||
if(para.gearPumpEnable && para.flagOfReclaimPumEnable)
|
||||
para.flagOfReclaimPumEnable = false;
|
||||
if (DeviceCodefile.isOpen()) {
|
||||
DeviceCodefile.close();
|
||||
}
|
||||
//jdDataRwLock.lockForRead();
|
||||
if(!DeviceCodefile.open(QIODevice::ReadOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看
|
||||
//QMessageBox::warning(0,"警告",QString("无法打开文件") );
|
||||
}
|
||||
else {
|
||||
DeviceCodefile.seek(0);
|
||||
//file.read((char *)&jd.addr,(long long int)sizeof(jd));
|
||||
DeviceCodefile.read((char *)¶.Json_device_code,(qint64)sizeof(para.Json_device_code));
|
||||
DeviceCodefile.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -156,7 +158,7 @@ void SysPara::loadDefaultPara(){
|
||||
para.synPulseNumPerMm = 8;// 同步器参数 脉冲/毫米
|
||||
para.OuputPulseCol = 0;//桂林客户,精准控制输出脉冲的位置,精确到打印的列数
|
||||
para.gearPumpEnable = 1;
|
||||
para.flagOfReclaimPumEnable = 1;
|
||||
para.flagOfReclaimPumEnable = 0;
|
||||
|
||||
para.oscillatorVoltage = 30;//晶振电压
|
||||
para.highVoltageLevel = 100;//高压包容差
|
||||
@@ -1015,6 +1017,8 @@ void SysPara::saveRFIDPara()
|
||||
out << RFIDPara.maintenanceInterval;
|
||||
out << RFIDPara.maintenanceEndDate;
|
||||
out << RFIDPara.needMaintenance;
|
||||
out << RFIDPara.runTime;
|
||||
out << RFIDPara.maintenanceHours;
|
||||
out << para.rfidCountDown;
|
||||
|
||||
if(!file.flush()){
|
||||
@@ -1030,6 +1034,7 @@ void SysPara::saveRFIDPara()
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
|
||||
bool SysPara::loadRFIDPara()
|
||||
{
|
||||
QFile file(RFID_FILE_PATH);
|
||||
@@ -1055,6 +1060,8 @@ bool SysPara::loadRFIDPara()
|
||||
in >> RFIDPara.maintenanceInterval;
|
||||
in >> RFIDPara.maintenanceEndDate;
|
||||
in >> RFIDPara.needMaintenance;
|
||||
in >> RFIDPara.runTime;
|
||||
in >> RFIDPara.maintenanceHours;
|
||||
in >> para.rfidCountDown;
|
||||
|
||||
file.close();
|
||||
|
||||
Reference in New Issue
Block a user