新二维码/条形码编辑逻辑

This commit is contained in:
2026-05-06 10:34:48 +08:00
parent a06c926162
commit a9e99f4425
76 changed files with 12679 additions and 12744 deletions
+133 -578
View File
@@ -80,472 +80,46 @@ void PrintSetting::on_pushButtonApply_pressed(){
}
void PrintSetting::applyUIPara(){
if(sysPara){
/*
LogInfo::setRunStatusText(tr("addr: %1").arg(addr));
LogInfo::setRunStatusText(tr("data: %1").arg(data));
LogInfo::setRunStatusText(tr("len: %1").arg(len));
if(sysPara){
sysPara->para.printTriggerMode = PRINT_TRIGGER_TIME; //延时触发
sysPara->para.printDelayMs = 200; //重复间隔
sysPara->para.checkSpace = 0;//ui->checkSpace->isChecked();
ui->spinBoxColDelay->setEnabled(1);
sysPara->para.leftRightInverse = ui->checkBoxLeftRightInverse->isChecked();
sysPara->para.upDownInverse = ui->checkBoxUpDownInverse->isChecked();
sysPara->para.currSelectVolPara = ui->comboBox_selcetVolPara->currentIndex();
sysPara->para.printColDelay = ui->spinBoxColDelay->value();
sysPara->para.ExtScreenType = ui->comBoxExtSrceen->currentIndex();
sysPara->para.ExtMeterType = ui->comBoxExtMeterType->currentIndex();
sysPara->para.gearPumpSpeedAlarm = ui->spinBox_gearPumpSpeedAlarm->value();
if(sysPara->para.ExtScreenType==0)
{
sysPara->status.ExtScreenEn =0;
}
*/
sysPara->para.HighVoltageAmplitude = ui->spinBoxHighVoltageValue->value();
sysPara->para.printTriggerMode = PRINT_TRIGGER_TIME; //延时触发
sysPara->para.printDelayMs = 200; //重复间隔
sysPara->para.checkSpace = 0;//ui->checkSpace->isChecked();
ui->spinBoxColDelay->setEnabled(1);
sysPara->para.leftRightInverse = ui->checkBoxLeftRightInverse->isChecked();
sysPara->para.upDownInverse = ui->checkBoxUpDownInverse->isChecked();
sysPara->para.currSelectVolPara = ui->comboBox_selcetVolPara->currentIndex();
sysPara->para.printColDelay = ui->spinBoxColDelay->value();
/*
sysPara->para.scanInverse = ui->checkBoxScanInverse->isChecked();
sysPara->para.currPrintMode = ui->comboBoxPrintMode->currentIndex();
sysPara->para.varLenEn = ui->checkVARLEN->isChecked();
sysPara->para.suspendAfterPhaseFault = ui->checkBoxSuspendAfterPhaseFault->isChecked();
sysPara->para.powerOffAfterPhaseFault = ui->checkBoxPowerOffAfterPhaseFault->isChecked();
sysPara->para.RecycleWarnAction = ui->checkBoxRecycleWarnAction->isChecked();
sysPara->para.stopCounterMeterAfterFault = ui->checkBoxStopCounterMeterAfterFault->isChecked();
// 回收泵的控制转至系统设置界面 byons@2026年4月22日
// sysPara->para.gearPumpEnable = ui->checkBoxGearPumpEnable->isChecked();
// sysPara->para.flagOfReclaimPumEnable = ui->checkBox_ReclaimPumpEnable->isChecked();
sysPara->para.cnt1EndValue = ui->spinBoxCnt1EndValue->value();
sysPara->para.cnt1RepeateValue = ui->spinBoxCnt1RepeateCnt->value();
sysPara->para.cnt1StartValue = ui->spinBoxCnt1StartValue->value();
sysPara->para.cnt1StepValue = ui->spinBoxCnt1StepValue->value();
sysPara->para.cnt1CurrValue = ui->spinBoxCnt1CurrValue->value(); //这个值设置没关系,在关机前还会再此被设置
sysPara->para.cnt2EndValue = ui->spinBoxCnt2EndValue->value();
sysPara->para.cnt2RepeateValue = ui->spinBoxCnt2RepeateCnt->value();
sysPara->para.cnt2StartValue = ui->spinBoxCnt2StartValue->value();
sysPara->para.cnt2StepValue = ui->spinBoxCnt2StepValue->value();
sysPara->para.cnt2CurrValue = ui->spinBoxCnt2CurrValue->value();
sysPara->devOp->setHighVoltageAmplitudetoSTM32();
sysPara->para.newAmplifyPlate = ui->checkBoxNewAmplifyPlate->isChecked();
sysPara->para.cnt3EndValue = ui->spinBoxCnt3EndValue->value();
sysPara->para.cnt3RepeateValue = ui->spinBoxCnt3RepeateCnt->value();
sysPara->para.cnt3StartValue = ui->spinBoxCnt3StartValue->value();
sysPara->para.cnt3StepValue = ui->spinBoxCnt3StepValue->value();
sysPara->para.cnt3CurrValue = ui->spinBoxCnt3CurrValue->value();
sysPara->devOp->writeFpgaCalandar(0);
sysPara->para.startVoltage = ui->spinBoxStartVoltage->value();
sysPara->para.endVoltage = ui->spinBoxEndVoltage->value();
sysPara->para.charBold = ui->spinBoxColRepeatCnt->value();
*/
sysPara->para.HighVoltageAmplitude = ui->spinBoxHighVoltageValue->value();
// 回收泵的控制转至系统设置界面 byons@2026年4月22日
// sysPara->para.gearPumpEnable = ui->checkBoxGearPumpEnable->isChecked();
// sysPara->para.flagOfReclaimPumEnable = ui->checkBox_ReclaimPumpEnable->isChecked();
sysPara->devOp->setHighVoltageAmplitudetoSTM32();
/*
sysPara->status.cnt1CurrentValueInitDoneFlag = !ui->checkBoxResetCnt1CurrValue->isChecked();
sysPara->status.cnt2CurrentValueInitDoneFlag = !ui->checkBoxResetCnt2CurrValue->isChecked();
sysPara->status.cnt3CurrentValueInitDoneFlag = !ui->checkBoxResetCnt3CurrValue->isChecked();
if(sysPara->para.cnt1ByGroupEnalbe)
ApplyCnt1GroupSetting();
sysPara->para.flagOfFastMode = ui->checkBox_FastMode->isChecked();
if(sysPara->para.flagOfFastMode){
if(ui->comboBoxPrintMode->count()>=3){
ui->comboBoxPrintMode->setItemText(0,tr("超高速"));
ui->comboBoxPrintMode->setItemText(1,tr("高速"));
ui->comboBoxPrintMode->removeItem(2);
}
}else{
if(ui->comboBoxPrintMode->count()<3){
ui->comboBoxPrintMode->setItemText(0,tr("快速"));
ui->comboBoxPrintMode->setItemText(1,tr("标准"));
ui->comboBoxPrintMode->addItem(tr("慢速"));
}
}
if(sysPara->para.EditMode==TXTFILE)
{
sysPara->status.specialVarPrint.SpecialVarEnable = ui->radioButtonSpecialCondition->isChecked();
sysPara->status.cnt4CurrValue = ui->spinBoxHiddenValue->value();
sysPara->status.specialVarPrint.MeterEnable = ui ->spinBoxMeterEnable->value();
sysPara ->status.specialVarPrint.SpecialConditionValue = ui->spinBoxConditionValue->value();
if(sysPara->status.specialVarPrint.SpecialVarEnable)
sysPara->status.specialVarPrint.SpecialVarEnable = 0xFF;
if(sysPara->status.specialVarPrint.MeterEnable)
sysPara->status.specialVarPrint.MeterEnable = 0xFF;
sysPara->para.cnt4CurrValue = sysPara->status.cnt4CurrValue;
sysPara->para.HiddenConditionValue = sysPara->status.specialVarPrint.SpecialConditionValue;
sysPara->para.HiddenFuncEnable = sysPara->status.specialVarPrint.SpecialVarEnable;
sysPara->para.HiddenMeterEnable = sysPara->status.specialVarPrint.MeterEnable;
}
*/
sysPara->devOp->writeFpgaCalandar(0);
/*
sysPara->para.reducedPixelNumRatio = ui->spinBoxReducedPixelNum->value();
sysPara->para.reducedPixelMode = ui->comboBoxReducedPixMode->currentIndex();
sysPara->para.rowSequenceMode = ui->spinBoxRowSequenceMode->value();
sysPara->para.pointVoltageAdjustPos = ui->spinBoxPointVoltageAdjustPos->value();
sysPara->para.PointVoltageAdjustValue = ui->spinBoxVoltageAdjustValue->value();
sysPara->para.lineEndAdjustPointCnt = ui->spinBoxLineEndAdjustPointCnt->value();
sysPara->para.lineEndAdjustPointDelay = ui->comboBoxLineEndAdjustPointMode->currentIndex();
sysPara->para.lastLineEndPointFixedValue = ui->spinBoxLastLineEndPointFixedValue->value();
sysPara->para.FullColFixVal = ui->radioButtonFUllColFIxVal->isChecked();//2020/3/2
sysPara->para.dacScale = ui->dacScaledSpinBox->value();
sysPara->para.industryIndex = ui->comboBoxIndustry->currentIndex();
sysPara->para.recommendedPrintSpeed = ui->comboBoxRecommendedPrintSpeed->currentIndex();
if(ui->eleCNT1IncEn->isChecked())
sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode | 0x10); // CNT1 +1
else
sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode & 0xef); // CNT1 = current
if(ui->eleCNT2IncEn->isChecked())
sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode | 0x20); // CNT2 +1
else
sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode & 0xdf); // CNT2 = current
if(ui->eleCNT3IncEn->isChecked())
sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode | 0x40); // CNT3 +1
else
sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode & 0xbf); // CNT3 = current
sysPara->para.alterPrint.enable =ui->comboBoxAlterPrintEnable->currentIndex();// 修改后的
if(sysPara->para.alterPrint.enable)
sysPara->para.textEditLineSpace = 0;
sysPara->para.alterPrint.lineSpace = sysPara->para.textEditLineSpace;
sysPara->para.alterPrint.startValue = ui->spinBoxXStartValue->value ();
sysPara->para.alterPrint.repeatValue = ui->spinBoxXGapValue->value ();
sysPara->para.alterPrint.repeatPrintTimes =ui->spinBoxXRepeatTimeValue->value ();
sysPara->para.alterPrint.DistanceTail =ui->spinBoxDistanceTail->value ();
if( sysPara->para.alterPrint.startValue>= sysPara->para.alterPrint.repeatValue )
{
sysPara->para.alterPrint.startValue =sysPara->para.alterPrint.repeatValue -1;
ui->spinBoxXStartValue->setValue (sysPara->para.alterPrint.startValue);
QMessageBox::information(this,tr("提示:交替参数不正确"),tr("要求:起始位置<交替间隔"));
}
if( sysPara->para.alterPrint.repeatPrintTimes+sysPara->para.alterPrint.startValue
> sysPara->para.alterPrint.repeatValue )
{
sysPara->para.alterPrint.repeatPrintTimes =sysPara->para.alterPrint.repeatValue -sysPara->para.alterPrint.startValue-1;
ui->spinBoxXRepeatTimeValue->setValue (sysPara->para.alterPrint.repeatPrintTimes);
QMessageBox::information(this,tr("提示:交替参数不正确"),tr("要求:(重复次数+起始位置)<交替间隔"));
}
sysPara->para.Cnt1NatureValue = ui->checkBoxCnt1NatureValue->isChecked (); //
sysPara->para.speedoverPaushPrint = ui->checkBoxSpeedOver->isChecked();
sysPara->para.SynCntEn = ui->checkSynCntEn->isChecked();
sysPara->para.Vol1of8En = ui->checkVol1of8En->isChecked();//打印优化
sysPara->para.mode0211 = ui->checkmode0211->isChecked();//添加0211模式
sysPara->para.cnt1ResetToInitValue = ui->resetToCnt1InitValueCheckBox->isChecked();// 电眼复位时,复位起始值或当前值
//sysPara->para.printOnce = ui->checkBoxPrintOnce->isChecked();// 每条信息只喷一次
// sysPara->para.printOnce = 0;// 每条信息只喷一次
//sysPara->para.printNumPoint = ui->checkBoxNumPoint->isChecked();// 每条信息只喷一次
sysPara->para.Reciclar = ui->checkBoxReciclar->isChecked();//sysPara->para.Reciclar = 0; //
switch(ui->spinBoxdecimalpointnum->value())
//20240625修改小数点位数可选0-3位,FPGA原参数a44d 地址第6号位为 是否打印小数使能信号,1为打印小数,0为不打印小数。
//更改为:
// a44d 地址第6号位和第7号位为 打印显示小数位数;
// 第7,6变量为 11 打印3位小数,
// 第7,6变量为 10 打印2位小数,
// 第7,6变量为 01 打印1位小数,
// 第7,6变量为 00 打印0位小数,
{
case 0:
ui->radioButtonSpecialCondition->setEnabled(true);
sysPara->para.printNumPoint = 0;
sysPara->para.rrr_nc = 0;
break;
case 1:
ui->radioButtonSpecialCondition->setEnabled(false);
ui->spinBoxMeterEnable->setValue(0);
sysPara->para.printNumPoint = 1;
sysPara->para.rrr_nc = 0;
break;
case 2:
ui->radioButtonSpecialCondition->setEnabled(false);
ui->spinBoxMeterEnable->setValue(0);
sysPara->para.printNumPoint = 0;
sysPara->para.rrr_nc = 1;
break;
case 3:
ui->radioButtonSpecialCondition->setEnabled(false);
ui->spinBoxMeterEnable->setValue(0);
sysPara->para.printNumPoint = 1;
sysPara->para.rrr_nc = 1;
break;
default:
sysPara->para.printNumPoint = 0;
sysPara->para.rrr_nc = 0;
break;
}
sysPara->para.stepPrint.startValue = ui->spinBoxJumpStartValue->value();
sysPara->para.stepPrint.endValue = ui->spinBoxJumpEndValue->value();
sysPara->para.stepPrint.enbale = ui->checkBoxStepPrintEn->isChecked();
sysPara->para.stepPrint.StepValue = ui->spinBoxJumpStepValue->value();
sysPara->para.ResetSendData = ui->checkBoxResetSendData->isChecked();
sysPara->para.eleEyeReTrigDisable = ui->checkBoxEleEyeRetrigDis->isChecked();
sysPara->para.ResetAllProductCntEn = ui->checkAllProductResetEn->isChecked();
sysPara->para.ResetProductCntEn = ui->checkProductResetEn->isChecked();
sysPara->para.HVFaultCloseEn = ui->checkHVFaultCloseEn->isChecked();
sysPara->para.phaseHighCnt = ui->phaseHighCntSpinBox->value();
sysPara->para.charWidthSetEnable = ui->checkBoxCharWidthSet->isChecked();
sysPara->para.isCheckMagnet = ui->checkBoxMagnet->isChecked();
sysPara->para.isCheckPrintLight = ui->printfLightCheckBox->isChecked();
sysPara->para.bcOption.var1Num=ui->spinBoxCnt1EndValue->text().length();
sysPara->para.bcOption.var2Num=ui->spinBoxCnt2EndValue->text().length();
// sysPara->para.bcOption.var3Num=ui->spinBoxCnt2EndValue_2->text().length();
//qDebug()<<"sysPara->para.bcOption.varNum"<<sysPara->para.bcOption.var1Num<<sysPara->para.bcOption.var2Num;
sysPara->para.ExpiryDay = ui->spinBoxExpiryDate->value();
sysPara->para.ExpirySplitMode = ui->CBDateFormat1->currentIndex();
ui->resetToCnt1InitValueCheckBox->isChecked();
//qDebug()<<sysPara->print.ExpiryDay;
*/
// if(sysPara->devOp->writeFpgaPrintPara() != -1) // save para to disk file.
// QMessageBox::information(this,tr("提示"),tr("应用成功"));
/*
//ui->labelCnt1CurrValueTxt->setEnabled(false);
// ui->labelCnt2CurrValueTxt->setEnabled(false);
ui->spinBoxCnt1CurrValue->setEnabled(false);
ui->spinBoxCnt2CurrValue->setEnabled(false);
ui->spinBoxCnt3CurrValue->setEnabled(false);
ui->checkBoxResetCnt1CurrValue->setChecked(false);
ui->checkBoxResetCnt2CurrValue->setChecked(false);
ui->checkBoxResetCnt3CurrValue->setChecked(false);
*/
}
}
}
void PrintSetting::updateSysParaToUI(){
if(sysPara){
/*
ui->checkVARLEN->setChecked(sysPara->para.varLenEn?1:0);
ui->checkBoxNewAmplifyPlate->setChecked(sysPara->para.newAmplifyPlate);
ui->comBoxExtSrceen->setCurrentIndex(sysPara->para.ExtScreenType);
ui->comBoxExtMeterType->setCurrentIndex(sysPara->para.ExtMeterType);
*/
ui->checkBoxLeftRightInverse->setChecked(sysPara->para.leftRightInverse);
ui->checkBoxUpDownInverse->setChecked(sysPara->para.upDownInverse);
sysPara->para.mode0211 = 1;
/*
ui->checkBoxScanInverse->setChecked(sysPara->para.scanInverse);
ui->checkBoxRecycleWarnAction->setChecked(sysPara->para.RecycleWarnAction);
ui->checkBoxPowerOffAfterPhaseFault->setChecked(sysPara->para.powerOffAfterPhaseFault);
ui->checkBoxSuspendAfterPhaseFault->setChecked(!sysPara->para.powerOffAfterPhaseFault);
ui->checkBoxSuspendAfterPhaseFault->setChecked(sysPara->para.suspendAfterPhaseFault);
ui->checkBoxStopCounterMeterAfterFault->setEnabled(sysPara->para.suspendAfterPhaseFault);
ui->checkBoxStopCounterMeterAfterFault->setChecked(sysPara->para.stopCounterMeterAfterFault);
ui->comboBoxPrintMode->setCurrentIndex(sysPara->para.currPrintMode);
ui->spinBox_gearPumpSpeedAlarm->setValue(sysPara->para.gearPumpSpeedAlarm);
*/
/*----------------------------------------*/
if(sysPara){
ui->checkBoxLeftRightInverse->setChecked(sysPara->para.leftRightInverse);
ui->checkBoxUpDownInverse->setChecked(sysPara->para.upDownInverse);
sysPara->para.mode0211 = 1;
ui->spinBoxColDelay->setValue(sysPara->para.printColDelay);
ui->spinBoxColDelay->setValue(sysPara->para.printColDelay);
/*
ui->spinBoxColRepeatCnt->setValue(sysPara->para.charBold);
ui->spinBoxCnt1EndValue->setValue(sysPara->para.cnt1EndValue);
ui->spinBoxCnt1RepeateCnt->setValue(sysPara->para.cnt1RepeateValue);
ui->spinBoxCnt1StartValue->setValue(sysPara->para.cnt1StartValue);
ui->spinBoxCnt1StepValue->setValue(sysPara->para.cnt1StepValue);
ui->spinBoxCnt1CurrValue->setValue(sysPara->para.cnt1CurrValue);
ui->spinBoxCnt2EndValue->setValue(sysPara->para.cnt2EndValue);
ui->spinBoxCnt2RepeateCnt->setValue(sysPara->para.cnt2RepeateValue);
ui->spinBoxCnt2StartValue->setValue(sysPara->para.cnt2StartValue);
ui->spinBoxCnt2StepValue->setValue(sysPara->para.cnt2StepValue);
ui->spinBoxCnt2CurrValue->setValue(sysPara->para.cnt2CurrValue);
ui->spinBoxHighVoltageValue->setValue(sysPara->para.HighVoltageAmplitude);
ui->spinBoxCnt3EndValue->setValue(sysPara->para.cnt3EndValue);
ui->spinBoxCnt3RepeateCnt->setValue(sysPara->para.cnt3RepeateValue);
ui->spinBoxCnt3StartValue->setValue(sysPara->para.cnt3StartValue);
ui->spinBoxCnt3StepValue->setValue(sysPara->para.cnt3StepValue);
ui->spinBoxCnt3CurrValue->setValue(sysPara->para.cnt3CurrValue);
ui->comboBox_selcetVolPara->setCurrentIndex(sysPara->para.currSelectVolPara);
ui->spinBoxStartVoltage->setValue(sysPara->para.startVoltage);
// 齿轮泵和回收泵的控制转至系统设置 byons@2026年4月22日
// ui->checkBoxGearPumpEnable->setChecked(sysPara->para.gearPumpEnable);
// ui->checkBox_ReclaimPumpEnable->setChecked(sysPara->para.flagOfReclaimPumEnable);
ui->spinBoxEndVoltage->setValue(sysPara->para.endVoltage);
*/
ui->spinBoxHighVoltageValue->setValue(sysPara->para.HighVoltageAmplitude);
/*
ui->spinBoxReducedPixelNum->setValue(sysPara->para.reducedPixelNumRatio);
ui->comboBoxReducedPixMode->setCurrentIndex(sysPara->para.reducedPixelMode);
ui->spinBoxRowSequenceMode->setValue(sysPara->para.rowSequenceMode);
ui->spinBoxPointVoltageAdjustPos->setValue(sysPara->para.pointVoltageAdjustPos);
ui->spinBoxVoltageAdjustValue->setValue(sysPara->para.PointVoltageAdjustValue);
ui->spinBoxLineEndAdjustPointCnt->setValue(sysPara->para.lineEndAdjustPointCnt);
ui->comboBoxLineEndAdjustPointMode->setCurrentIndex(sysPara->para.lineEndAdjustPointDelay);
ui->spinBoxLastLineEndPointFixedValue->setValue(sysPara->para.lastLineEndPointFixedValue);
// ui->spinBoxFullColFixVal->setValue(sysPara->para.FullColFixVal);
ui->radioButtonFUllColFIxVal->setChecked(sysPara->para.FullColFixVal);
*/
ui->comboBox_selcetVolPara->setCurrentIndex(sysPara->para.currSelectVolPara);
// 齿轮泵和回收泵的控制转至系统设置 byons@2026年4月22日
// ui->checkBoxGearPumpEnable->setChecked(sysPara->para.gearPumpEnable);
// ui->checkBox_ReclaimPumpEnable->setChecked(sysPara->para.flagOfReclaimPumEnable);
//隐藏功能
/*
ui->radioButtonSpecialCondition->setChecked(sysPara->para.HiddenFuncEnable);
ui->spinBoxHiddenValue->setValue(sysPara->para.cnt4CurrValue);
ui->spinBoxConditionValue->setValue(sysPara->para.HiddenConditionValue);
ui->spinBoxMeterEnable->setValue(sysPara->para.HiddenMeterEnable);
// sysPara->status.cnt4CurrValue = sysPara->para.cnt4CurrValue;
sysPara->status.specialVarPrint.SpecialConditionValue = sysPara->para.HiddenConditionValue ;
sysPara->status.specialVarPrint.SpecialVarEnable =sysPara->para.HiddenFuncEnable ;
sysPara->status.specialVarPrint.MeterEnable = sysPara->para.HiddenMeterEnable;
if(sysPara->status.specialVarPrint.SpecialVarEnable)
sysPara->status.specialVarPrint.SpecialVarEnable = 0xFF;
if(sysPara->status.specialVarPrint.MeterEnable)
sysPara->status.specialVarPrint.MeterEnable = 0xFF;
emit HiddenFunction(ui->radioButtonSpecialCondition->isChecked());
if(sysPara->para.HiddenFuncEnable)
{
// emit HiddenFunction(ui->radioButtonSpecialCondition->isChecked());
ui->spinBoxdecimalpointnum->setValue(0);
ui->spinBoxdecimalpointnum->setEnabled(false);
ui->radioButtonSpecialCondition->setEnabled(true);
ui->spinBoxHiddenValue->setEnabled(true);
ui->spinBoxConditionValue->setEnabled(true);
ui->spinBoxMeterEnable->setEnabled(true);
}
if(!sysPara->para.rrr_nc)
{
if(!sysPara->para.printNumPoint)
ui->spinBoxdecimalpointnum->setValue(0);
else
ui->spinBoxdecimalpointnum->setValue(1);
}
else
{
if(!sysPara->para.printNumPoint)
ui->spinBoxdecimalpointnum->setValue(2);
else
ui->spinBoxdecimalpointnum->setValue(3);
}
ui->comboBoxIndustry->setCurrentIndex(sysPara->para.industryIndex);
ui->comboBoxRecommendedPrintSpeed->setCurrentIndex(sysPara->para.recommendedPrintSpeed);
ui->comboBoxAlterPrintEnable->setCurrentIndex (sysPara->para.alterPrint.enable );// 修改后的
if(sysPara->para.alterPrint.enable == 0)
{
ui->spinBoxXStartValue->setEnabled(false);
ui->spinBoxXRepeatTimeValue->setEnabled(false);
ui->spinBoxXGapValue->setEnabled(false);
}
ui->spinBoxXStartValue->setValue (sysPara->para.alterPrint.startValue );
ui->spinBoxXGapValue->setValue (sysPara->para.alterPrint.repeatValue);
ui->spinBoxXRepeatTimeValue->setValue (sysPara->para.alterPrint.repeatPrintTimes);
ui->spinBoxDistanceTail->setValue(sysPara->para.alterPrint.DistanceTail );
ui->checkBoxCnt1NatureValue->setChecked ( sysPara->para.Cnt1NatureValue); //
ui->checkBoxSpeedOver->setChecked(sysPara->para.speedoverPaushPrint);
ui->checkSynCntEn->setChecked(sysPara->para.SynCntEn);
ui->checkVol1of8En->setChecked(sysPara->para.Vol1of8En);
ui->checkBoxEleEyeRetrigDis->setChecked( sysPara->para.eleEyeReTrigDisable );
ui->checkmode0211->setChecked(sysPara->para.mode0211);
ui->resetToCnt1InitValueCheckBox->setChecked(sysPara->para.cnt1ResetToInitValue);
qDebug()<<"checkmode0211:"<<sysPara->para.mode0211;
qDebug()<<"checkVol1of8En:"<<sysPara->para.Vol1of8En;
qDebug()<<"radioButtonFUllColFIxVal:"<<sysPara->para.FullColFixVal;
qDebug()<<"checkBoxCharWidthSet:"<<sysPara->para.charWidthSetEnable;
//ui->checkBoxPrintOnce->setChecked(sysPara->para.printOnce);
//ui->checkBoxNumPoint->setChecked(sysPara->para.printNumPoint);
ui->checkBoxReciclar->setChecked(sysPara->para.Reciclar);
ui->dacScaledSpinBox->setValue(sysPara->para.dacScale);
ui->checkBoxResetSendData->setChecked(sysPara->para.ResetSendData);
ui->spinBoxJumpStartValue->setValue( sysPara->para.stepPrint.startValue );
ui->spinBoxJumpEndValue->setValue( sysPara->para.stepPrint.endValue );
//ui->checkBoxStepPrintEn->setEnabled( sysPara->para.stepPrint.enbale );
ui->checkBoxStepPrintEn->setChecked( sysPara->para.stepPrint.enbale );
ui->spinBoxJumpStepValue->setValue(sysPara->para.stepPrint.StepValue);
ui->checkProductResetEn->setChecked(sysPara->para.ResetProductCntEn);
ui->checkAllProductResetEn->setChecked(sysPara->para.ResetAllProductCntEn);
ui->checkHVFaultCloseEn->setChecked(sysPara->para.HVFaultCloseEn);
// 电眼触发计数器动作 选择
ui->eleCNT1IncEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x10)?1:0);
ui->radCNT1ResetEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x10)?0:1);
ui->eleCNT2IncEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x20)?1:0);
ui->radCNT2ResetEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x20)?0:1);
ui->eleCNT3IncEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x40)?1:0);
ui->radCNT3ResetEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x40)?0:1);
ui->checkBoxCharWidthSet->setChecked(sysPara->para.charWidthSetEnable);
ui->checkBoxMagnet->setChecked(sysPara->para.isCheckMagnet);
ui->printfLightCheckBox->setChecked(sysPara->para.isCheckPrintLight);
ui->phaseHighCntSpinBox->setValue( sysPara->para.phaseHighCnt);
sysPara->para.bcOption.var1Num=ui->spinBoxCnt1EndValue->text().length();
sysPara->para.bcOption.var2Num=ui->spinBoxCnt2EndValue->text().length();
ui->checkBox_FastMode->setChecked(sysPara->para.flagOfFastMode);
ui->labMac->setText(QString(" Mac:%1").arg(dlgInputAddr->jd.addr));
sysPara->status.machineMac = dlgInputAddr->jd.addr;
showMachInfo(QString::number(dlgInputAddr->jd.addr));
ui->CBDateFormat1->setCurrentIndex(sysPara->para.ExpirySplitMode);//p_var->splitMode
ui->spinBoxExpiryDate->setValue(sysPara->para.ExpiryDay);
//on_spinBoxExpiryDate_valueChanged(sysPara->print.ExpiryVar.);
ui->checkBoxSaveCNTStateValue->setCheckState(sysPara->para.isCntSaveStateValue ? Qt::Checked : Qt::Unchecked);
flagOfModuleDecimal = sysPara->para.flagOfModuleDecimal;
ModuleDecimalDisplay();
flagOfModuleHide = sysPara->para.flagOfModuleHide;
ModuleHideDisplay();
displayForAdjustVoltage(sysPara->para.flagOfAdjustVoltage);
LoadCnt1GroupSettingsToUI();
if(sysPara->para.mode0211 || sysPara->para.FullColFixVal)
{
ui->spinBoxStartVoltage->setEnabled(false);
ui->spinBoxEndVoltage->setEnabled(false);
}
if(sysPara->para.flagOfCnt1GroupDisp)
{
//edit@12-03
const int indexTab=ui->tabWidget_2->indexOf(ui->tab_9);
if(-1==indexTab)
ui->tabWidget_2->addTab(ui->tab_9,tr("其他设置"));
}
if(sysPara->para.flagOfstepPrint)
{
//edit@12-03
const int indexTab=ui->tabWidget->indexOf(ui->tab_6);
if(-1==indexTab)
ui->tabWidget->addTab(ui->tab_6,tr("跳米设置"));
}
*/
TriggerupdateSysParaToUI();
TriggerupdateSysParaToUI();
}
}
@@ -595,7 +169,7 @@ void PrintSetting::TriggerupdateSysParaToUI(){
//ui->spinBoxOutputPulseDelayMs->setEnabled(sysPara->para.pulseOutputEnable);
ui->spinBoxOutputPulseDelayMs->setEnabled(true /*sysPara->para.outputPulseDelayMs*/);
ui->spinBoxOutputPulseDelayMs->setEnabled(isPulseEenable);
ui->spinBoxOuputPulseCol->setValue(sysPara->para.OuputPulseCol);
ui->checkEyeTriggerSynPrintEn->setChecked (sysPara->para.eleEyeTriggerSynPrintEn);
ui->comboBoxSyncActType->setCurrentIndex (sysPara->para.synchronizorActType);
@@ -627,7 +201,7 @@ void PrintSetting::on_pushButtonApplyPulseFix_clicked()
pulseNumFix->hide();
pulseNumFix->show();
// qDebug()<<"pushButtonApplyPulseFix";
// qDebug()<<"pushButtonApplyPulseFix";
}
void PrintSetting::onPulseNumFixDone(float value){
@@ -658,17 +232,23 @@ void PrintSetting::applyUITriggerPara(){
sysPara->para.pulseOutputEnable = ui->checkBoxPulseOutputEnable->isChecked();
sysPara->para.productCntPerOutputPulse = ui->spinBoxProductCntPerOutputPulse->value();
sysPara->para.outputPulseDelayMs = ui->spinBoxOutputPulseDelayMs->value();
// 有脉冲延时使能的时候才可以设置延时
if (isEnabled()) {
sysPara->para.outputPulseDelayMs = ui->spinBoxOutputPulseDelayMs->value();
} else {
sysPara->para.outputPulseDelayMs = 0;
}
sysPara->para.OuputPulseCol = ui->spinBoxOuputPulseCol->value();
if(((ui->checkEyeTriggerSynPrintEn->checkState()==1 )
&&(sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE))
&&(sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE))
|| sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER )
{
ui->labelOutputPulseDelayMs->setText(tr("延时(毫米):"));
}
else ui->labelOutputPulseDelayMs->setText(tr("延时(毫秒):"));
// if(sysPara->devOp->writeFpgaPrintPara() != -1)
// QMessageBox::information(this,tr("提示"),tr("应用成功"));
// if(sysPara->devOp->writeFpgaPrintPara() != -1)
// QMessageBox::information(this,tr("提示"),tr("应用成功"));
}
}
@@ -700,7 +280,7 @@ void PrintSetting::GetTriggerUIPara(){
//qDebug()<< (sysPara->para.AltMirrorGap & 0x0fff) << (sysPara->para.AltMirrorGap & 0xf000);
// if(ui->radioButtonDelayTrigger->isChecked())
// if(ui->radioButtonDelayTrigger->isChecked())
if(ui->eleEyeEdgetTriggerInner->isChecked() && ui->radioButtonSynTriggerInner->isChecked()){ //都选外部--延时触发
sysPara->para.printTriggerMode = PRINT_TRIGGER_TIME;
sysPara->para.printDelayMs = ui->spinBoxEleEyeTriggerIntervalMs->value(); //延时触发的重复间隔
@@ -736,7 +316,7 @@ void PrintSetting::GetTriggerUIPara(){
void PrintSetting::on_radioButtonDelayTrigger_pressed()
{
setTriggerUI(PRINT_TRIGGER_TIME);
// emit synDisableFontWidth(false);
// emit synDisableFontWidth(false);
}
void PrintSetting::on_radioButtonEleEyeEdgetTrigger_pressed()
@@ -747,7 +327,7 @@ void PrintSetting::on_radioButtonEleEyeEdgetTrigger_pressed()
setEnableSynTriggerSetting(true);
else
setEnableSynTriggerSetting(false);
// emit synDisableFontWidth(false);
// emit synDisableFontWidth(false);
}
void PrintSetting::on_radioButtonEleEyeLevelTrigger_pressed()
@@ -758,22 +338,22 @@ void PrintSetting::on_radioButtonEleEyeLevelTrigger_pressed()
setEnableSynTriggerSetting(true);
else
setEnableSynTriggerSetting(false);
// emit synDisableFontWidth(false);
// emit synDisableFontWidth(false);
}
void PrintSetting::on_radioButtonSynTrigger_pressed()
{
//edit@11-19
sysPara->para.printTriggerMode = PRINT_TRIGGER_SYNCHRONIZER;
// setTriggerUI(PRINT_TRIGGER_SYNCHRONIZER);
// const unsigned short &FpgaVer=sysPara->status.build_dat.builTime;
// //72版本禁用字符宽度
// if(72 == FpgaVer){
// ui->spinBoxSynTriggerPrintLenRatio->setValue(0);
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(0);
// }else if (67 == FpgaVer)
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(1);
// emit synDisableFontWidth(true);
// setTriggerUI(PRINT_TRIGGER_SYNCHRONIZER);
// const unsigned short &FpgaVer=sysPara->status.build_dat.builTime;
// //72版本禁用字符宽度
// if(72 == FpgaVer){
// ui->spinBoxSynTriggerPrintLenRatio->setValue(0);
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(0);
// }else if (67 == FpgaVer)
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(1);
// emit synDisableFontWidth(true);
}
@@ -803,7 +383,7 @@ void PrintSetting::on_checkEyeTriggerSynPrintEn_clicked(bool checked)
ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(0);
ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫米)"));
ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫米)"));
ui->labelEleMaskTime->setText(tr("封锁间隔(毫米)"));
ui->labelEleMaskTime->setText(tr("抑止距离(毫米)"));
ui->labelOutputPulseDelayMs->setText(tr("延时(毫米):"));
if(ui->comboBoxSyncActType->currentIndex() || 0b11) //如果不是在正反转打印的模式下,就切换到正反转模式
{
@@ -812,7 +392,7 @@ void PrintSetting::on_checkEyeTriggerSynPrintEn_clicked(bool checked)
}
else
{
// ui->radioButtonSynTrigger->setChecked(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
// ui->radioButtonSynTrigger->setChecked(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
#ifndef NON_CABLE
ui->spinBoxSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
#endif
@@ -825,12 +405,12 @@ void PrintSetting::on_checkEyeTriggerSynPrintEn_clicked(bool checked)
ui->pushButtonApplyPulseFix->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->comboBoxSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->labelSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
// ui->checkBoxAutoSpeedEN->setEnabled (triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
// ui->checkBoxAutoSpeedEN->setEnabled (triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
//ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(1);
ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫秒)"));
ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫秒)"));
ui->labelEleMaskTime->setText(tr("封锁间隔(毫秒)"));
ui->labelEleMaskTime->setText(tr("抑止距离(毫秒)"));
ui->labelOutputPulseDelayMs->setText( ui->radioButtonSynTrigger->isChecked()?tr("延时(毫米):"):tr("延时(毫秒):"));
}
@@ -842,8 +422,8 @@ void PrintSetting::setTriggerUI(int triggerMode){
ui->radioButtonDelayTrigger->setChecked(triggerMode == PRINT_TRIGGER_TIME);
ui->spinBoxDelayTriggerValue->setEnabled(triggerMode == PRINT_TRIGGER_TIME);
ui->labelDelayTriggerValue->setEnabled(triggerMode == PRINT_TRIGGER_TIME);
// ui->comboBoxTimeTriggerMode->setEnabled(triggerMode == PRINT_TRIGGER_TIME);
// ui->labelTimeTriggerMode->setEnabled(triggerMode == PRINT_TRIGGER_TIME);
// ui->comboBoxTimeTriggerMode->setEnabled(triggerMode == PRINT_TRIGGER_TIME);
// ui->labelTimeTriggerMode->setEnabled(triggerMode == PRINT_TRIGGER_TIME);
ui->radioButtonEleEyeEdgetTrigger->setChecked( triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE);
ui->radioButtonEleEyeLevelTrigger->setChecked(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL);
@@ -863,7 +443,7 @@ void PrintSetting::setTriggerUI(int triggerMode){
)
{
//ui->radioButtonSynTrigger->setChecked(1);
// ui->spinBoxSynTriggerPrintLen->setEnabled(0);
// ui->spinBoxSynTriggerPrintLen->setEnabled(0);
ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(0);
ui->labelSynTriggerPrintLen->setEnabled(1);
ui->lineEditTriggerPulsePerMm->setEnabled(1);
@@ -882,7 +462,7 @@ void PrintSetting::setTriggerUI(int triggerMode){
ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫米)"));
ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫米)"));
ui->labelEleMaskTime->setText(tr("封锁间隔(毫米)"));
ui->labelEleMaskTime->setText(tr("抑止距离(毫米)"));
}
else
{
@@ -899,9 +479,7 @@ void PrintSetting::setTriggerUI(int triggerMode){
ui->pushButtonApplyPulseFix->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->comboBoxSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->labelSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
//ui->checkBoxAutoSpeedEN->setEnabled (triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
//ui->labelEleMaskTime->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
//ui->spinBoxEleMaskTime->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
if(triggerMode == PRINT_TRIGGER_SYNCHRONIZER)
{
ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫米)"));
@@ -927,20 +505,20 @@ void PrintSetting::setTriggerUI(int triggerMode){
//72版本禁用该输入框
//67打开
// if(triggerMode== PRINT_TRIGGER_SYNCHRONIZER){
// const unsigned short &FpgaVer=sysPara->status.build_dat.builTime;
// if(72==FpgaVer)
// {
// ui->spinBoxSynTriggerPrintLenRatio->setValue(0);
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(false);
// }
// else if(67==FpgaVer)
// {
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(true);
// }
// const unsigned short &FpgaVer=sysPara->status.build_dat.builTime;
// if(72==FpgaVer)
// {
// ui->spinBoxSynTriggerPrintLenRatio->setValue(0);
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(false);
// }
// else if(67==FpgaVer)
// {
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(true);
// }
// }
// else{
// ui->spinBoxSynTriggerPrintLenRatio->setValue(0);
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(false);
// ui->spinBoxSynTriggerPrintLenRatio->setValue(0);
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(false);
// }
}
@@ -963,139 +541,110 @@ void PrintSetting::setSynPrintMode(int mode){
void PrintSetting::applyStyleSheet()
{
QString styleSheet = R"(
QTabWidget {
QString styleSheet =
R"(
QTabWidget {
border: none;
background-color: #7B838E;
}
}
QTabWidget::tab-bar {
background-color: #7B838E;
alignment: left;
height: 80px;
margin: 0;
}
QTabBar::tab:focus {
outline: none;
}
QTabBar {
background-color: #7B838E;
border: none;
width: 100%;
min-width: 100%;
height: 80px;
padding: 0;
}
QTabBar::tab {
width: 140px;
height: 80px;
font-size: 16px;
font-weight: bold;
color: #000000;
border: none;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
alignment: center bottom;
padding-top: 0;
}
QTabBar::tab {
margin-left: 10px;
margin-top: 10px;
}
QTabBar::tab:!selected {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #6E757F, stop:1 #96A0A9);
border: 2px solid #63535D;
QTabBar::tab {
min-width: 90px;
min-height: 45px;
padding: 4px 10px;
margin-right: 4px;
border: 1px solid #dddddd;
border-bottom: none;
position: relative;
bottom: 0px;
}
border-top-left-radius: 4px;
border-top-right-radius: 4px;
background-color: #5396C1;
color: #ffffff;
}
QTabBar::tab:selected {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #95B2D4, stop:1 #F0F0F0);
border: none;
position: relative;
bottom: 0px;
}
QTabBar::tab:selected {
background-color: #6bb1e0;
color: #ffffff;
box-shadow: 0 -3px 8px rgba(44, 125, 232, 0.25);
}
QTabWidget::pane {
border: none;
background-color: #f0f0f0;
top: -12px;
}
QTabWidget::tab-bar {
top: -3px;
left: 10px;
}
QWidget#buttonWidget {
QWidget#buttonWidget {
background-color: #95989D;
}
}
QPushButton#closeBtn {
QPushButton#closeBtn {
background-color: #E6F7FF;
border: 1px solid #87CEEB;
border-radius: 4px;
font-size: 24px;
color: #228B22;
}
}
QPushButton#closeBtn:hover {
QPushButton#closeBtn:hover {
background-color: #D1E9FF;
}
}
QPushButton#closeBtn:pressed {
QPushButton#closeBtn:pressed {
background-color: #BAE7FF;
}
}
QLabel {
QLabel {
font-size: 18px;
color: #000000;
font-weight: 500;
}
}
QCheckBox {
QCheckBox {
font-size: 18px;
color: #000000;
font-weight:500;
}
}
QCheckBox::indicator {
QCheckBox::indicator {
width: 18px;
height: 18px;
border: 1px solid #96A0A9;
border-radius: 10px;
background-color: #ffffff;
}
}
QCheckBox::indicator:checked {
QCheckBox::indicator:checked {
background-color: #95B2D4;
border-color: #95B2D4;
image: url(:/Demo/image/select.png);
}
}
QPushButton {
QPushButton {
background-color: #5396C1;
color: #ffffff;
border: 1px solid #000000;
border-radius: 3px;
font-size: 18px;
font-weight:500;
}
}
QPushButton:hover {
QPushButton:hover {
background-color: #5396C1;
}
}
QPushButton:disabled {
QPushButton:disabled {
background-color: #7C828E;
color: #606060;
border-color: #808080;
}
}
QWidget#fileTab, QWidget#extraTab, QWidget#settingsTab, QWidget#serviceTab {
QWidget#fileTab, QWidget#extraTab, QWidget#settingsTab, QWidget#serviceTab {
background-color: #E3E7EC;
}
)";
// closeBtn->setObjectName("closeBtn");
// buttonWidget->setObjectName("buttonWidget");
}
)";
this->setStyleSheet(styleSheet);
}
@@ -1178,11 +727,17 @@ void PrintSetting::on_radioButtonSynTriggerExternal_clicked()
void PrintSetting::on_radioButtonEleEyeEdgetTrigger_clicked()
{
sysPara->para.printTriggerMode = PRINT_TRIGGER_ELEC_EYE_EDGE;
sysPara->para.printTriggerMode = PRINT_TRIGGER_ELEC_EYE_EDGE;
}
void PrintSetting::on_radioButtonEleEyeLevelTrigger_clicked()
{
sysPara->para.printTriggerMode = PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL;
sysPara->para.printTriggerMode = PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL;
}
void PrintSetting::on_checkBoxPulseOutputEnable_clicked(bool checked)
{
isPulseEenable = checked;
ui->spinBoxOutputPulseDelayMs->setEnabled(checked);
}