2026年6月22日 :大量更新

This commit is contained in:
2026-06-22 08:51:10 +08:00
parent be39714c5e
commit 0fb69c2897
75 changed files with 1518 additions and 528 deletions
+16 -25
View File
@@ -78,15 +78,6 @@ SysPara::SysPara(void):
#endif
}
SysPara *SysPara::ins()
{
static SysPara* ins = nullptr;
if (ins == nullptr) {
ins = new SysPara();
}
return ins;
}
void SysPara::loadParaFromFile(){
QFile file(PARA_FILE_PATH);
QFile DeviceCodefile(DeviceCode_FILE_PATH);
@@ -168,7 +159,7 @@ void SysPara::loadDefaultPara(){
para.synPulseNumPerMm = 8;// 同步器参数 脉冲/毫米
para.OuputPulseCol = 0;//桂林客户,精准控制输出脉冲的位置,精确到打印的列数
para.gearPumpEnable = 1;
para.flagOfReclaimPumEnable = false;
para.flagOfReclaimPumEnable = true;
para.oscillatorVoltage = 30;//晶振电压
para.highVoltageLevel = 100;//高压包容差
@@ -202,27 +193,27 @@ void SysPara::saveParaToFile(){
// qDebug()<<"saveParaToFile:"<<sysFile<<"LO:"<<para.lastOpenedFileName;
if(!file.open(QIODevice::ReadWrite)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看
// QMessageBox::warning(0,QString("警告"),QString("无法打开配置文件 ") + PARA_FILE_PATH,
// QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok );
QMessageBox::warning(0,QString("警告"),QString("无法打开配置文件 ") + PARA_FILE_PATH,
QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok );
}
else {
if(file.isOpen()){
file.seek(0);
file.write((char *)&para,(long long int)sizeof(para));
fsync(file.handle());
file.close();
if(!DeviceCodefile.open(QIODevice::WriteOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看
//QMessageBox::warning(0,"警告",QString("无法打开文件:mac.bin") );
}
else {
DeviceCodefile.seek(0);
//file.write((char *)&jd.addr,(long long int)sizeof(jd));
DeviceCodefile.write((char *)&para.Json_device_code,(qint64)sizeof(para.Json_device_code));
fsync(file.handle());
file.close();
if(!DeviceCodefile.open(QIODevice::WriteOnly)){//怀疑是QIODevice::Truncate 引起参数错误,去掉试试看
//QMessageBox::warning(0,"警告",QString("无法打开文件:mac.bin") );
}
else {
DeviceCodefile.seek(0);
//file.write((char *)&jd.addr,(long long int)sizeof(jd));
DeviceCodefile.write((char *)&para.Json_device_code,(qint64)sizeof(para.Json_device_code));
fsync(DeviceCodefile.handle());
fsync(DeviceCodefile.handle());
DeviceCodefile.close();
}
DeviceCodefile.close();
}
}
if(sysFile!="")
{
@@ -498,7 +489,7 @@ void SysPara::loadPrintParaFromFile(QString fileName){
para.timeTriggerPrintDelayMs = print.timeTriggerPrintDelayMs ;
para.timeTriggerPrintMode = print.timeTriggerPrintMode ;
para.upDownInverse = print.upDownInverse ;
z
para.varLen = print.varLen;
print.varLen1 = para.varLen1;
para.varLenEn = print.varLenEn?1:0;