修复因场景模式修改为绝对坐标引起的打印补全、蜂鸣器报警改为常响、添加相位故障关闭回收槽功能、取消翻转上下颠倒,与莱宾格行为同步、修改场景模式默认字体为7点、取消变量占位图设计
This commit is contained in:
@@ -2650,12 +2650,8 @@ int DevOp::writeFpgaPrintPara(bool ignoreWarn){
|
|||||||
sysPara->para.maxHighVoltageDAC = expected_voltage_DAC + sysPara->para.highVoltageLevel;
|
sysPara->para.maxHighVoltageDAC = expected_voltage_DAC + sysPara->para.highVoltageLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sysPara->status.isPrinting==false){
|
|
||||||
sysPara->para.printTotalColNum = currPrintCol;
|
sysPara->para.printTotalColNum = currPrintCol;
|
||||||
sysPara->status.printTotalColNum = currPrintCol;
|
sysPara->status.printTotalColNum = currPrintCol;
|
||||||
}
|
|
||||||
else
|
|
||||||
sysPara->para.printTotalColNum = sysPara->status.printTotalColNum;
|
|
||||||
|
|
||||||
set_totalSynPulseNum(0);
|
set_totalSynPulseNum(0);
|
||||||
|
|
||||||
@@ -3308,18 +3304,18 @@ void DevOp::writeFpgaVariCtrlv2()
|
|||||||
}
|
}
|
||||||
|
|
||||||
memset((char *)®_var_print_ctrl,0,sizeof(reg_var_print_ctrl));
|
memset((char *)®_var_print_ctrl,0,sizeof(reg_var_print_ctrl));
|
||||||
reg_var_print_ctrl.charColNum = std::max_element(std::begin(p_var->widthTable), std::end(p_var->widthTable));
|
reg_var_print_ctrl.charColNum = *std::max_element(std::begin(p_var->widthTable), std::end(p_var->widthTable)); // 5
|
||||||
reg_var_print_ctrl.charRamBaseAddr = p_var->bassAddr;
|
reg_var_print_ctrl.charRamBaseAddr = p_var->bassAddr; // 0 Examples
|
||||||
reg_var_print_ctrl.charRowNum = p_var->height;
|
reg_var_print_ctrl.charRowNum = p_var->height; // 7
|
||||||
reg_var_print_ctrl.horizonWidth = p_var->width; //字模的宽度
|
reg_var_print_ctrl.horizonWidth = p_var->width; //字模的宽度 // 68
|
||||||
reg_var_print_ctrl.colOffset = p_var->startColPos+BLANK_COL_NUM;
|
reg_var_print_ctrl.colOffset = p_var->startColPos+BLANK_COL_NUM; // 3
|
||||||
reg_var_print_ctrl.verticalOffset = p_var->startRowPos;
|
reg_var_print_ctrl.verticalOffset = p_var->startRowPos; // 0
|
||||||
reg_var_print_ctrl.varDigitalNum = p_var->digitalNum;
|
reg_var_print_ctrl.varDigitalNum = p_var->digitalNum; // 8
|
||||||
reg_var_print_ctrl.varTypeSel = Public::getType(p_var->type) %20;
|
reg_var_print_ctrl.varTypeSel = Public::getType(p_var->type) %20; // 7
|
||||||
reg_var_print_ctrl.enbVarWidthFont = 1;
|
reg_var_print_ctrl.enbVarWidthFont = 1;
|
||||||
reg_var_print_ctrl.alignLeft = 0;
|
reg_var_print_ctrl.alignLeft = 1;
|
||||||
reg_var_print_ctrl.charSpacing = p_var->letterSpace;
|
reg_var_print_ctrl.charSpacing = p_var->letterSpace; // 4
|
||||||
memcpy(dataOfreg_var_print_ctrl[i],(unsigned char *)®_var_print_ctrl,8);
|
memcpy(dataOfreg_var_print_ctrl[i],(unsigned char *)®_var_print_ctrl,9);
|
||||||
|
|
||||||
fpgaWr(VAR_CTRL_REG_ADDR,dataOfreg_var_print_ctrl[i], 9);
|
fpgaWr(VAR_CTRL_REG_ADDR,dataOfreg_var_print_ctrl[i], 9);
|
||||||
}
|
}
|
||||||
@@ -3449,7 +3445,7 @@ unsigned char dataOfmainInkCtrl[1];
|
|||||||
void DevOp::mainInkCtrl()
|
void DevOp::mainInkCtrl()
|
||||||
{
|
{
|
||||||
dataOfmainInkCtrl[0]=(isReleaseValveOpen()?(1<<3):0)+(isMainInkPumpOpen()?(1<<2):0) + (sysPara->status.selfCheckDone?(1<<1):0) + (sysPara->status.isPumpValveControledByHand?1:0);
|
dataOfmainInkCtrl[0]=(isReleaseValveOpen()?(1<<3):0)+(isMainInkPumpOpen()?(1<<2):0) + (sysPara->status.selfCheckDone?(1<<1):0) + (sysPara->status.isPumpValveControledByHand?1:0);
|
||||||
fpgaWr(MAININKCTRL_ADDR,dataOfmainInkCtrl,1);
|
// fpgaWr(MAININKCTRL_ADDR,dataOfmainInkCtrl,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DevOp::pumpValveCtrl(int viscosityAdjustByTemp)//20140423 OK
|
void DevOp::pumpValveCtrl(int viscosityAdjustByTemp)//20140423 OK
|
||||||
@@ -3529,7 +3525,7 @@ void DevOp::pumpValveCtrl(int viscosityAdjustByTemp)//20140423 OK
|
|||||||
| (sysPara->devOp->isInkValveOpen()?(1<<4):0)
|
| (sysPara->devOp->isInkValveOpen()?(1<<4):0)
|
||||||
| (sysPara->devOp->isMixValveOpen()?(1<<5):0);
|
| (sysPara->devOp->isMixValveOpen()?(1<<5):0);
|
||||||
|
|
||||||
fpgaWr(MAININKCTRL_ADDR,(unsigned char *)buf,i);// //20140423 5A,5B
|
// fpgaWr(MAININKCTRL_ADDR,(unsigned char *)buf,i);// //20140423 5A,5B
|
||||||
}
|
}
|
||||||
|
|
||||||
void DevOp::showData( QByteArray dat)
|
void DevOp::showData( QByteArray dat)
|
||||||
|
|||||||
@@ -424,12 +424,10 @@ int pwm_ink;
|
|||||||
unsigned int enbVarWidthFont:1; // 启用非等宽字体
|
unsigned int enbVarWidthFont:1; // 启用非等宽字体
|
||||||
|
|
||||||
// 0x59
|
// 0x59
|
||||||
unsigned int reserved: 3;
|
|
||||||
unsigned int charSpacing: 4;
|
unsigned int charSpacing: 4;
|
||||||
unsigned int alignLeft:1; // 使用非等宽字体时,计数器的对齐方向。 0左 1右
|
unsigned int alignLeft:1; // 使用非等宽字体时,计数器的对齐方向。 0左 1右
|
||||||
|
unsigned int reserved: 3;
|
||||||
}reg_var_print_ctrl_t_v2;
|
}reg_var_print_ctrl_t_v2;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* DEVOP_H_ */
|
#endif /* DEVOP_H_ */
|
||||||
|
|||||||
+2
-8
@@ -1055,12 +1055,6 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
sysPara->devOp->mainInkCtrl();
|
sysPara->devOp->mainInkCtrl();
|
||||||
sysPara->status.canRunAirPushing = true;
|
sysPara->status.canRunAirPushing = true;
|
||||||
|
|
||||||
// 自检结束发送打印设置
|
|
||||||
qInfo() << "Self check done and send print para to FPGA";
|
|
||||||
// sysPara->devOp->setHighVoltageAmplitudetoSTM32();
|
|
||||||
// sysPara->devOp->writeFpgaCalandar(0);
|
|
||||||
// sysPara->devOp->writeFpgaPrintPara(true);
|
|
||||||
|
|
||||||
// 自检完成后,关闭高电压,不知道为什么,有时候开机自检都有高压
|
// 自检完成后,关闭高电压,不知道为什么,有时候开机自检都有高压
|
||||||
sysPara->devOp->highVoltageCtrl(0);
|
sysPara->devOp->highVoltageCtrl(0);
|
||||||
|
|
||||||
@@ -1317,8 +1311,8 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sysPara->status.beeperOnFlag){ //报警会时有时无
|
if(sysPara->status.beeperOnFlag && !sysPara->devOp->isBeeperEnable()){ //报警会时有时无
|
||||||
sysPara->devOp->controlBeeper(!sysPara->devOp->isBeeperEnable());
|
sysPara->devOp->controlBeeper(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((sysPara->status.statWarn & (WARN_STATUS_POWER_MON))
|
if((sysPara->status.statWarn & (WARN_STATUS_POWER_MON))
|
||||||
|
|||||||
+2
-4
@@ -814,8 +814,7 @@ void PrintSettingModel::applyToSysPara(const PrintSettingModel &model, SysPara *
|
|||||||
{
|
{
|
||||||
// 喷印风格相关
|
// 喷印风格相关
|
||||||
sysPara->para.leftRightInverse = model.leftRightInverse;
|
sysPara->para.leftRightInverse = model.leftRightInverse;
|
||||||
//韩国反馈以左下方第一个点阵位置为 Y:1 X:1 也是离回收管最近的墨点位置
|
sysPara->para.upDownInverse = model.upDownInverse;
|
||||||
sysPara->para.upDownInverse = !model.upDownInverse;
|
|
||||||
sysPara->para.currSelectVolPara = model.volParaIndex;
|
sysPara->para.currSelectVolPara = model.volParaIndex;
|
||||||
sysPara->para.printColDelay = model.printColDelay;
|
sysPara->para.printColDelay = model.printColDelay;
|
||||||
sysPara->para.HighVoltageAmplitude = model.highVoltageAmplitude;
|
sysPara->para.HighVoltageAmplitude = model.highVoltageAmplitude;
|
||||||
@@ -901,8 +900,7 @@ PrintSettingModel PrintSettingModel::fromSysPara(SysPara *sysPara)
|
|||||||
return model;
|
return model;
|
||||||
|
|
||||||
model.leftRightInverse = sysPara->para.leftRightInverse;
|
model.leftRightInverse = sysPara->para.leftRightInverse;
|
||||||
//韩国反馈以左下方第一个点阵位置为 Y:1 X:1 也是离回收管最近的墨点位置
|
model.upDownInverse = sysPara->para.upDownInverse;
|
||||||
model.upDownInverse = !sysPara->para.upDownInverse;
|
|
||||||
model.mode0211 = sysPara->para.mode0211;
|
model.mode0211 = sysPara->para.mode0211;
|
||||||
model.printColDelay = sysPara->para.printColDelay;
|
model.printColDelay = sysPara->para.printColDelay;
|
||||||
model.highVoltageAmplitude = sysPara->para.HighVoltageAmplitude;
|
model.highVoltageAmplitude = sysPara->para.HighVoltageAmplitude;
|
||||||
|
|||||||
+2
-2
@@ -51,7 +51,7 @@ SysPara::SysPara(void):
|
|||||||
para.ReadFileErrorCnt=0;
|
para.ReadFileErrorCnt=0;
|
||||||
if(para.PowerOnErrorCnt>=4)
|
if(para.PowerOnErrorCnt>=4)
|
||||||
para.PowerOnErrorCnt=0;
|
para.PowerOnErrorCnt=0;
|
||||||
//qDebug()<<"sys Star Error, cnt :"<<para.ReadFileErrorCnt;
|
qDebug()<<"sys Star Error, cnt :"<<para.ReadFileErrorCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
//saveParaToFile();//下面devOp->writeFpgaPrintPara(true)会调用这个,所以忽略
|
//saveParaToFile();//下面devOp->writeFpgaPrintPara(true)会调用这个,所以忽略
|
||||||
@@ -189,6 +189,7 @@ void SysPara::loadDefaultPara(){
|
|||||||
|
|
||||||
para.canvasHeight = 32;
|
para.canvasHeight = 32;
|
||||||
para.airPushDurationSec = 4;
|
para.airPushDurationSec = 4;
|
||||||
|
para.closeReclaimTankWhenPhaseFault = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SysPara::saveParaToFile(){
|
void SysPara::saveParaToFile(){
|
||||||
@@ -399,7 +400,6 @@ void SysPara::loadPrintParaFromFile(QString fileName){
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
void SysPara::loadPrintParaFromFile(QString fileName){
|
void SysPara::loadPrintParaFromFile(QString fileName){
|
||||||
if(fileName=="") return;
|
if(fileName=="") return;
|
||||||
fileName = QString( PARA_ROOT_DIR+QFileInfo( fileName).baseName()+".dpn");
|
fileName = QString( PARA_ROOT_DIR+QFileInfo( fileName).baseName()+".dpn");
|
||||||
|
|||||||
@@ -807,14 +807,16 @@ typedef struct {
|
|||||||
bool flagOfInkWarning __attribute_deprecated_msg__("已经由 RFIDPara_t::inInkAndRFIDProgress 替代, 现在已经不使用"); //报错累计次数达标,报警标志设为true
|
bool flagOfInkWarning __attribute_deprecated_msg__("已经由 RFIDPara_t::inInkAndRFIDProgress 替代, 现在已经不使用"); //报错累计次数达标,报警标志设为true
|
||||||
bool flagOfSolventWarning __attribute_deprecated_msg__("已经由 RFIDPara_t::inSolventAndRFIDProgress 替代, 现在已经不使用"); //报错累计次数达标,报警标志设为true
|
bool flagOfSolventWarning __attribute_deprecated_msg__("已经由 RFIDPara_t::inSolventAndRFIDProgress 替代, 现在已经不使用"); //报错累计次数达标,报警标志设为true
|
||||||
unsigned short rfidCountDown;
|
unsigned short rfidCountDown;
|
||||||
unsigned int canvasHeight; // 韩国需求中,要求可以设定打印区域的高度,默认为32。
|
unsigned int canvasHeight; // 韩国需求中,要求可以设定打印区域的高度,默认为25。
|
||||||
|
|
||||||
bool enbSyncAndTimeTriggerLimit; // 同步和时喷打印次数限制功能使能
|
bool enbSyncAndTimeTriggerLimit; // 同步和时喷打印次数限制功能使能
|
||||||
unsigned int syncAndTimeTriggerLimit; // 同步和时喷打印次数限制值
|
unsigned int syncAndTimeTriggerLimit; // 同步和时喷打印次数限制值
|
||||||
|
|
||||||
int airPushDurationSec; // 排气时间,单位 秒
|
int airPushDurationSec; // 排气时间,单位 秒
|
||||||
|
|
||||||
|
bool closeReclaimTankWhenPhaseFault; // 相位故障时关闭回收槽。true 则关闭, false 不关闭
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
// 1108Bytes
|
|
||||||
}sysPara_t;
|
}sysPara_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|||||||
+6
-2
@@ -180,10 +180,13 @@ void SystemSetting::updateSysParaToUI(){
|
|||||||
ui->enableReclaimAlgorithm->setChecked(sysPara->para.flagOfReclaimPumEnable);
|
ui->enableReclaimAlgorithm->setChecked(sysPara->para.flagOfReclaimPumEnable);
|
||||||
ui->checkBoxReciclar->setChecked(sysPara->para.Reciclar);
|
ui->checkBoxReciclar->setChecked(sysPara->para.Reciclar);
|
||||||
ui->checkBoxMagnet->setChecked(sysPara->para.isCheckMagnet);
|
ui->checkBoxMagnet->setChecked(sysPara->para.isCheckMagnet);
|
||||||
ui->checkBoxSuspendAfterPhaseFault->setChecked(sysPara->para.suspendAfterPhaseFault);
|
|
||||||
ui->checkHVFaultCloseEn->setChecked(sysPara->para.HVFaultCloseEn);
|
ui->checkHVFaultCloseEn->setChecked(sysPara->para.HVFaultCloseEn);
|
||||||
|
|
||||||
ui->spinBoxAirPushDuration->setValue(sysPara->para.airPushDurationSec);
|
ui->spinBoxAirPushDuration->setValue(sysPara->para.airPushDurationSec);
|
||||||
|
ui->checkBoxCloseReclaimTankWhenPhaseFault->setChecked(sysPara->para.closeReclaimTankWhenPhaseFault);
|
||||||
|
sysPara->para.suspendAfterPhaseFault = sysPara->para.closeReclaimTankWhenPhaseFault ? true : sysPara->para.suspendAfterPhaseFault;
|
||||||
|
ui->checkBoxSuspendAfterPhaseFault->setChecked(sysPara->para.suspendAfterPhaseFault);
|
||||||
|
|
||||||
if(sysPara->para.EditMode>SCENE)
|
if(sysPara->para.EditMode>SCENE)
|
||||||
sysPara->para.EditMode=TXTFILE;
|
sysPara->para.EditMode=TXTFILE;
|
||||||
@@ -219,7 +222,6 @@ void SystemSetting::applyUIPara(){
|
|||||||
sysPara->para.flagOfReclaimPumEnable = ui->enableReclaimAlgorithm->isChecked();
|
sysPara->para.flagOfReclaimPumEnable = ui->enableReclaimAlgorithm->isChecked();
|
||||||
sysPara->para.Reciclar = ui->checkBoxReciclar->isChecked();
|
sysPara->para.Reciclar = ui->checkBoxReciclar->isChecked();
|
||||||
sysPara->para.isCheckMagnet = ui->checkBoxMagnet->isChecked();
|
sysPara->para.isCheckMagnet = ui->checkBoxMagnet->isChecked();
|
||||||
sysPara->para.suspendAfterPhaseFault = ui->checkBoxSuspendAfterPhaseFault->isChecked();
|
|
||||||
sysPara->para.HVFaultCloseEn = ui->checkHVFaultCloseEn->isChecked();
|
sysPara->para.HVFaultCloseEn = ui->checkHVFaultCloseEn->isChecked();
|
||||||
|
|
||||||
sysPara->para.FanTemperature = ui->spinBoxFanTemperature->value();
|
sysPara->para.FanTemperature = ui->spinBoxFanTemperature->value();
|
||||||
@@ -228,6 +230,8 @@ void SystemSetting::applyUIPara(){
|
|||||||
sysPara->para.diaphramOffset = diaphramOffset;
|
sysPara->para.diaphramOffset = diaphramOffset;
|
||||||
|
|
||||||
sysPara->para.airPushDurationSec = ui->spinBoxAirPushDuration->value();
|
sysPara->para.airPushDurationSec = ui->spinBoxAirPushDuration->value();
|
||||||
|
sysPara->para.closeReclaimTankWhenPhaseFault = ui->checkBoxCloseReclaimTankWhenPhaseFault->isChecked();
|
||||||
|
sysPara->para.suspendAfterPhaseFault = sysPara->para.closeReclaimTankWhenPhaseFault ? true : ui->checkBoxSuspendAfterPhaseFault->isChecked();
|
||||||
|
|
||||||
//sysPara->para.mixValveisNewVersion = ui->radioButtonMixValveNewVersion->isChecked();
|
//sysPara->para.mixValveisNewVersion = ui->radioButtonMixValveNewVersion->isChecked();
|
||||||
if(sysPara->devOp->writeFpgaPrintPara(true) != -1){
|
if(sysPara->devOp->writeFpgaPrintPara(true) != -1){
|
||||||
|
|||||||
+2
-2
@@ -728,7 +728,7 @@
|
|||||||
QComboBox::drop-down { width: 30px; }</string>
|
QComboBox::drop-down { width: 30px; }</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="fixedHeight" stdset="0">
|
<property name="fixedHeight" stdset="0">
|
||||||
<number>60</number>
|
<number>60</number>
|
||||||
@@ -1171,7 +1171,7 @@ QGraphicsView QScrollBar::handle:horizontal {
|
|||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
<height>35</height>
|
<height>40</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
Major.Minor.Rivison.yyyy-MM-DD_Beta
|
Major.Minor.Rivison.yyyy-MM-DD_Beta
|
||||||
*/
|
*/
|
||||||
#define UP_PRINTER_MAJOR_VER 6
|
#define UP_PRINTER_MAJOR_VER 6
|
||||||
#define UP_PRINTER_MINOR_VER 7
|
#define UP_PRINTER_MINOR_VER 8
|
||||||
#define UP_PRINTER_RIVISION_VER 6
|
#define UP_PRINTER_RIVISION_VER 6
|
||||||
#define SUB_VERSION "_KOR"
|
#define SUB_VERSION "_KOR"
|
||||||
#ifdef __RFID_OLD
|
#ifdef __RFID_OLD
|
||||||
|
|||||||
+217
-230
File diff suppressed because it is too large
Load Diff
+217
-230
File diff suppressed because it is too large
Load Diff
+14
-78
@@ -993,25 +993,6 @@ void MainWidget::on_m_StartBtn_clicked()
|
|||||||
sysPara->devOp->highVoltageCtrl(1);
|
sysPara->devOp->highVoltageCtrl(1);
|
||||||
sysPara->devOp->setHighVoltageAmplitudetoSTM32();
|
sysPara->devOp->setHighVoltageAmplitudetoSTM32();
|
||||||
sysPara->status.waitHightVolOff = 0;
|
sysPara->status.waitHightVolOff = 0;
|
||||||
// if(!printintFlag)setRunStatus(tr("正在加高压..."));
|
|
||||||
// 复位计数器
|
|
||||||
if(sysPara->status.FileChangeRestCntFlag){
|
|
||||||
if(sysPara->para.ResetAllProductCntEn)
|
|
||||||
{
|
|
||||||
sysPara->devOp->clearProductCnt(3 | 0x10); // [3]总产品计数器清零FPGA
|
|
||||||
sysPara->para.totalProductCnt=0;
|
|
||||||
}
|
|
||||||
else if(sysPara->para.ResetProductCntEn)
|
|
||||||
{
|
|
||||||
sysPara->devOp->clearProductCnt(3);
|
|
||||||
}
|
|
||||||
sysPara->status.FileChangeRestCntFlag=0;
|
|
||||||
sysPara->saveParaToFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
// onPreviewScene 没有必要再次调用,评估后删除 byons@2026年7月28日
|
|
||||||
if(sysPara->para.EditMode == SCENE)
|
|
||||||
onPreviewScene();
|
|
||||||
|
|
||||||
if(sysPara->status.currPrintCol > (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)){
|
if(sysPara->status.currPrintCol > (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)){
|
||||||
QMessageBox::critical(0,tr("错误"),tr("当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度").arg(sysPara->status.currPrintCol).arg((MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)));
|
QMessageBox::critical(0,tr("错误"),tr("当前总列数 %1 ,支持的总列数为 %2,请减少打印串的长度").arg(sysPara->status.currPrintCol).arg((MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide)));
|
||||||
@@ -1025,7 +1006,7 @@ void MainWidget::on_m_StartBtn_clicked()
|
|||||||
{
|
{
|
||||||
int dotNumPerCol = sysPara->status.currPrintRow*(1 + sysPara->para.printRowDelay) + sysPara->para.printColDelay;
|
int dotNumPerCol = sysPara->status.currPrintRow*(1 + sysPara->para.printRowDelay) + sysPara->para.printColDelay;
|
||||||
long printTmUs = 1.0f*dotNumPerCol*(1 + sysPara->para.charBold)*sysPara->status.currPrintCol*(2*sysPara->para.divideRatio)/(FPGA_SYS_HZ/1000000);
|
long printTmUs = 1.0f*dotNumPerCol*(1 + sysPara->para.charBold)*sysPara->status.currPrintCol*(2*sysPara->para.divideRatio)/(FPGA_SYS_HZ/1000000);
|
||||||
if((printTmUs/1000 + 3) > (sysPara->para.printDelayMs)
|
if((printTmUs/1000 + 3) > (sysPara->para.printDelayMs)\
|
||||||
&& (sysPara->para.timeTriggerPrintMode == TIME_TRIGGER_PRINT_MODE_HEAD_TO_HEAD)
|
&& (sysPara->para.timeTriggerPrintMode == TIME_TRIGGER_PRINT_MODE_HEAD_TO_HEAD)
|
||||||
&& (sysPara->para.printTriggerMode == PRINT_TRIGGER_TIME )
|
&& (sysPara->para.printTriggerMode == PRINT_TRIGGER_TIME )
|
||||||
) // 在电眼方式下,是否需要判呢?
|
) // 在电眼方式下,是否需要判呢?
|
||||||
@@ -1127,7 +1108,7 @@ void MainWidget::SendPrintDataToFpga(unsigned char alterEnable, bool isUpdate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sysPara->devOp->fpgaWr(0,blankDat1,sizeof(blankDat1));//...所加的空白偏移地址
|
sysPara->devOp->fpgaWr(0,blankDat1,sizeof(blankDat1));//...所加的空白偏移地址
|
||||||
// 交替打印处理
|
|
||||||
unsigned char *dat;
|
unsigned char *dat;
|
||||||
size_t sizeofdat;
|
size_t sizeofdat;
|
||||||
bool MaxCol4000;
|
bool MaxCol4000;
|
||||||
@@ -1142,6 +1123,7 @@ void MainWidget::SendPrintDataToFpga(unsigned char alterEnable, bool isUpdate)
|
|||||||
dat =sysPara->status.printDat;
|
dat =sysPara->status.printDat;
|
||||||
sizeofdat = sizeof(sysPara->status.printDat);
|
sizeofdat = sizeof(sysPara->status.printDat);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sysPara->status.currPrintCol* MAX_PRINT_ROW_BYTE_NUM <= 20000)
|
if(sysPara->status.currPrintCol* MAX_PRINT_ROW_BYTE_NUM <= 20000)
|
||||||
sysPara->devOp->fpgaWr(sizeof(blankDat1),dat, sysPara->status.currPrintCol* MAX_PRINT_ROW_BYTE_NUM);
|
sysPara->devOp->fpgaWr(sizeof(blankDat1),dat, sysPara->status.currPrintCol* MAX_PRINT_ROW_BYTE_NUM);
|
||||||
else
|
else
|
||||||
@@ -2047,7 +2029,7 @@ void MainWidget::onPreviewScene()
|
|||||||
// int maxPicHeight = qMin(sceneRect.height(), int(sysPara->para.canvasHeight));
|
// int maxPicHeight = qMin(sceneRect.height(), int(sysPara->para.canvasHeight));
|
||||||
// QSize size(coldot,maxPicHeight);
|
// QSize size(coldot,maxPicHeight);
|
||||||
int coldot = qMin(int(contentRect.right()), MaxCol4000 ? MAX_PRINT_COL_NUM_Normal : MAX_PRINT_COL_NUM_Wide);
|
int coldot = qMin(int(contentRect.right()), MaxCol4000 ? MAX_PRINT_COL_NUM_Normal : MAX_PRINT_COL_NUM_Wide);
|
||||||
QSize size(MAX_PRINT_COL_NUM_Normal,sysPara->para.canvasHeight);
|
QSize size(coldot, sysPara->para.canvasHeight);
|
||||||
|
|
||||||
|
|
||||||
if(size.isEmpty()) {
|
if(size.isEmpty()) {
|
||||||
@@ -2131,67 +2113,26 @@ void MainWidget::onPreviewScene()
|
|||||||
varPara.letterSpace = counterItem->letterSpace();
|
varPara.letterSpace = counterItem->letterSpace();
|
||||||
|
|
||||||
++sysPara->status.variNum;
|
++sysPara->status.variNum;
|
||||||
|
|
||||||
// // 将变量序号、类型、数字个数、大小位置打印到日志
|
|
||||||
// LogInfo::setRunStatusText("Variable " + QString::number(varI) + ": type=" + QString::number(varPara.type) +
|
|
||||||
// "\n digitalNum=" + QString::number(varPara.digitalNum) +
|
|
||||||
// "\n width=" + QString::number(varPara.width) +
|
|
||||||
// "\n height=" + QString::number(varPara.height) +
|
|
||||||
// "\n startColPos=" + QString::number(varPara.startColPos) +
|
|
||||||
// "\n endRowPos=" + QString::number(varPara.endRowPos) +
|
|
||||||
// "\n startRowPos=" + QString::number(varPara.startRowPos) +
|
|
||||||
// "\n letterSpace=" + QString::number(varPara.letterSpace));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pPicScene->render(&painter, itemRect, sourceRect);
|
pPicScene->render(&painter, itemRect, sourceRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
sysPara->status.currPrintRow = contentRect.bottom();
|
sysPara->status.currPrintRow = size.height();
|
||||||
sysPara->status.currPrintCol = contentRect.right();
|
sysPara->status.currPrintCol = size.width();
|
||||||
|
|
||||||
imageToPrintData(image, 0, 0);
|
imageToPrintData(image, 0, 0);
|
||||||
|
|
||||||
// /*--------------------------------------------------------------------------*/
|
|
||||||
// generateCharRamData();
|
|
||||||
|
|
||||||
generateCharRamDataV2();
|
generateCharRamDataV2();
|
||||||
|
|
||||||
if(sysPara->status.currPrintRow>MAX_PRINT_ROW_NUM-1)sysPara->status.currPrintRow=MAX_PRINT_ROW_NUM-1;
|
|
||||||
sysPara->status.currPrintRow = qMin(sysPara->status.currPrintRow, MAX_PRINT_ROW_NUM-1);
|
|
||||||
|
|
||||||
// 计算末行位置
|
|
||||||
bool found = false;
|
|
||||||
int lastRow = sysPara->status.currPrintRow;
|
|
||||||
for(int j = sysPara->status.currPrintRow; j > 2 ; j--){
|
|
||||||
for(int i = 0; i < coldot; i++){
|
|
||||||
if(dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8] & (1 << (j%8))){
|
|
||||||
lastRow = j+1;
|
|
||||||
found = true;//qDebug()<<"fOUND:"<<i<<j<<dat[MAX_PRINT_ROW_BYTE_NUM*i + j/8]<<sysPara->status.currPrintRow;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(found)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
sysPara->status.currPrintRow = qBound(1, lastRow, MAX_PRINT_ROW_NUM - 1);
|
|
||||||
|
|
||||||
int wmax = sysPara->status.currPrintRow;
|
|
||||||
sysPara->status.currAlterPrintRow = sysPara->status.currPrintRow/2;
|
|
||||||
if(sysPara->para.alterPrint.enable<1) sysPara->para.AlterMode=0;
|
|
||||||
else {
|
|
||||||
if(sysPara->para.AlterMode==0)sysPara->para.AlterMode=1;
|
|
||||||
wmax = sysPara->status.currAlterPrintRow;
|
|
||||||
}
|
|
||||||
/*-------------------------------切换到显示窗口-----------------------------------*/
|
/*-------------------------------切换到显示窗口-----------------------------------*/
|
||||||
|
|
||||||
qDebug() << "currPrintCol: " << sysPara->status.currPrintCol;
|
qDebug() << "currPrintCol: " << sysPara->status.currPrintCol;
|
||||||
LogInfo::setRunStatusText("currPrintCol: " + QString::number(sysPara->status.currPrintCol));
|
LogInfo::setRunStatusText("currPrintCol: " + QString::number(sysPara->status.currPrintCol));
|
||||||
LogInfo::setRunStatusText("currPrintRow: " + QString::number(sysPara->status.currPrintRow));
|
LogInfo::setRunStatusText("currPrintRow: " + QString::number(sysPara->status.currPrintRow));
|
||||||
LogInfo::setRunStatusText(QString("Items bounding rect: {%1, %2}").arg(sceneRect.width()).arg(sceneRect.height()));
|
|
||||||
|
|
||||||
// sysPara->status.currPrintRow = sceneRect.height();
|
// sysPara->status.currPrintRow = sceneRect.height();
|
||||||
sysPara->status.currPrintCol = sceneRect.width();
|
// sysPara->status.currPrintCol = sceneRect.width();
|
||||||
|
|
||||||
auto rows = sysPara->para.AlterMode?sysPara->status.currAlterPrintRow : sysPara->status.currPrintRow;
|
auto rows = sysPara->para.AlterMode?sysPara->status.currAlterPrintRow : sysPara->status.currPrintRow;
|
||||||
rows = std::max(rows, (m_PrintDisplay->parentWidget()->height() / m_PrintDisplay->currScaleRatio()));
|
rows = std::max(rows, (m_PrintDisplay->parentWidget()->height() / m_PrintDisplay->currScaleRatio()));
|
||||||
@@ -2207,12 +2148,6 @@ void MainWidget::handleEmptySize()
|
|||||||
bool MaxCol4000 = sysPara->status.flagOfNo67FPGA ? true : false;
|
bool MaxCol4000 = sysPara->status.flagOfNo67FPGA ? true : false;
|
||||||
QSize emptySize(MaxCol4000 ? MAX_PRINT_COL_NUM_Normal : MAX_PRINT_COL_NUM_Wide, MAX_PRINT_ROW_NUM);
|
QSize emptySize(MaxCol4000 ? MAX_PRINT_COL_NUM_Normal : MAX_PRINT_COL_NUM_Wide, MAX_PRINT_ROW_NUM);
|
||||||
|
|
||||||
// 不是,渲染这个有什么用处吗?byons@2026年7月21日
|
|
||||||
// QImage emptyImage(emptySize, QImage::Format_ARGB32);
|
|
||||||
// emptyImage.fill(0x00ffffff); // 填充白色背景,与正常场景渲染一致
|
|
||||||
// QPainter emptyPainter(&emptyImage);
|
|
||||||
// pPicScene->render(&emptyPainter, QRectF(), QRectF(0, 0, emptySize.width(), emptySize.height()));
|
|
||||||
|
|
||||||
// 初始化打印参数,避免空场景导致的参数异常
|
// 初始化打印参数,避免空场景导致的参数异常
|
||||||
sysPara->status.currPrintRow = 0;
|
sysPara->status.currPrintRow = 0;
|
||||||
sysPara->status.currPrintCol = 0; // emptySize.width();
|
sysPara->status.currPrintCol = 0; // emptySize.width();
|
||||||
@@ -2496,15 +2431,11 @@ bool MainWidget::updatePhaseIndicatorLight(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(sysPara->para.suspendAfterPhaseFault){
|
else if(sysPara->para.suspendAfterPhaseFault){
|
||||||
if(sysPara->para.stopCounterMeterAfterFault){
|
if(sysPara->status.isPrinting){ //已经在打印,则暂停打印
|
||||||
if(startPrintingFlag && printintFlag){ //已经在打印,则暂停打印
|
|
||||||
// on_pushButtonPausePrint_pressed();
|
|
||||||
on_m_StopBtn_clicked();
|
on_m_StopBtn_clicked();
|
||||||
LogInfo::setRunStatusText(tr("相位故障,暂停打印"));
|
LogInfo::setRunStatusText(tr("相位故障,暂停打印"));
|
||||||
setRunStatus(tr("相位故障,暂停打印"));
|
setRunStatus(tr("相位故障,暂停打印"));
|
||||||
strTitle = tr("相位故障,暂停打印");
|
strTitle = tr("相位故障,暂停打印");
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(!sysPara->status.DACDisable){
|
else if(!sysPara->status.DACDisable){
|
||||||
sysPara->devOp->printCtrl(PRINT_CTRL_DAC_DISABLE);
|
sysPara->devOp->printCtrl(PRINT_CTRL_DAC_DISABLE);
|
||||||
@@ -2512,9 +2443,14 @@ bool MainWidget::updatePhaseIndicatorLight(){
|
|||||||
LogInfo::setRunStatusText(tr("相位故障,屏蔽DAC输出"));
|
LogInfo::setRunStatusText(tr("相位故障,屏蔽DAC输出"));
|
||||||
setRunStatus(tr("相位故障,屏蔽充电"));
|
setRunStatus(tr("相位故障,屏蔽充电"));
|
||||||
strTitle = tr("相位故障,屏蔽充电");
|
strTitle = tr("相位故障,屏蔽充电");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sysPara->para.closeReclaimTankWhenPhaseFault) {
|
||||||
|
on_m_LeftBtn_clicked();
|
||||||
|
LogInfo::setRunStatusText(tr("相位故障, 关闭回收槽"));
|
||||||
|
setRunStatus(tr("相位故障,关闭回收槽"));
|
||||||
|
strTitle = tr("相位故障,关闭回收槽");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-9
@@ -552,10 +552,12 @@ QImage ItemUtils::txtToImage(const QString &txt, const QFont &font, const QColor
|
|||||||
return QImage();
|
return QImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString targetTxt = txt.left(400);
|
||||||
|
|
||||||
// 用 QFontMetrics 计算给定字体下文本的水平推进宽度和单行高度,
|
// 用 QFontMetrics 计算给定字体下文本的水平推进宽度和单行高度,
|
||||||
// 这样初始画布刚好能容纳整段文本,避免后续裁剪时出现截断
|
// 这样初始画布刚好能容纳整段文本,避免后续裁剪时出现截断
|
||||||
QFontMetrics fm(font);
|
QFontMetrics fm(font);
|
||||||
int width = fm.horizontalAdvance(txt);
|
int width = fm.horizontalAdvance(targetTxt);
|
||||||
int height = fm.height();
|
int height = fm.height();
|
||||||
|
|
||||||
// 优先使用字体名中后缀标识的字体高度
|
// 优先使用字体名中后缀标识的字体高度
|
||||||
@@ -569,16 +571,20 @@ QImage ItemUtils::txtToImage(const QString &txt, const QFont &font, const QColor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!numStr.isEmpty()) {
|
if (!numStr.isEmpty()) {
|
||||||
height = numStr.toInt();
|
int h = numStr.toInt();
|
||||||
if(height < 5 || height > 32)
|
if (h >= 5 && h <= 32) {
|
||||||
|
height = h;
|
||||||
|
} else {
|
||||||
height = fm.height();
|
height = fm.height();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (width <= 0 || height <= 0) {
|
if (width <= 0 || height <= 0) {
|
||||||
return QImage();
|
return QImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage img(width, height, QImage::Format_ARGB32);
|
int letterSpace = (int)(font.letterSpacing());
|
||||||
|
QImage img(width - letterSpace, height, QImage::Format_ARGB32);
|
||||||
|
|
||||||
QRgb bgRgb = bgColor.rgba();
|
QRgb bgRgb = bgColor.rgba();
|
||||||
img.fill(bgRgb);
|
img.fill(bgRgb);
|
||||||
@@ -587,11 +593,10 @@ QImage ItemUtils::txtToImage(const QString &txt, const QFont &font, const QColor
|
|||||||
painter.begin(&img);
|
painter.begin(&img);
|
||||||
painter.setFont(font);
|
painter.setFont(font);
|
||||||
painter.setPen(fgColor);
|
painter.setPen(fgColor);
|
||||||
painter.drawText(img.rect(), txt);
|
|
||||||
|
// 使用基线坐标绘制单行文本,确保 glyph 间距按字体度量精确排列
|
||||||
|
int baselineY = fm.ascent();
|
||||||
|
painter.drawText(QPoint(0, baselineY), targetTxt);
|
||||||
painter.end();
|
painter.end();
|
||||||
|
|
||||||
return img;
|
return img;
|
||||||
|
|
||||||
// 按背景色裁剪,使输出图像紧贴文字像素的最小包围盒(详见函数注释)
|
|
||||||
return clipTxtImage(img, bgRgb);
|
|
||||||
}
|
}
|
||||||
@@ -32,6 +32,11 @@ void PicCounterItem::setSource(QVariant var)
|
|||||||
|
|
||||||
void PicCounterItem::setCounter(COUNTER_TYPE type, int digitalNum)
|
void PicCounterItem::setCounter(COUNTER_TYPE type, int digitalNum)
|
||||||
{
|
{
|
||||||
|
if(type != COUNTER_TYPE_1 && type != COUNTER_TYPE_2) {
|
||||||
|
qWarning() << "Missing counter type: " << type;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 直接修改字体,生成新的HTML占位图
|
// 直接修改字体,生成新的HTML占位图
|
||||||
auto font = this->font();
|
auto font = this->font();
|
||||||
QString fontname = font.family();
|
QString fontname = font.family();
|
||||||
@@ -59,13 +64,13 @@ void PicCounterItem::setCounter(COUNTER_TYPE type, int digitalNum)
|
|||||||
width += letterSpace();
|
width += letterSpace();
|
||||||
|
|
||||||
m_counterType = type;
|
m_counterType = type;
|
||||||
m_digitalNum = digitalNum;
|
m_digitalNum = qBound(1, digitalNum, 8);
|
||||||
m_digitalImg = strToImage(QString("8").repeated(digitalNum));
|
m_digitalImg = strToImage(QString("8").repeated(m_digitalNum));
|
||||||
applyModify();
|
applyModify();
|
||||||
|
|
||||||
qInfo() << "Counter item set to " << type ;
|
qInfo() << "Counter item set to " << type ;
|
||||||
qInfo() << ">\tdigitalNum: " << digitalNum << ", font name: " << fontname << ", pixel size: " << pixelSize;
|
qInfo() << ">\tdigitalNum: " << m_digitalNum << ", font name: " << fontname << ", pixel size: " << pixelSize;
|
||||||
qInfo() << ">\tletterSpace: " << letterSpace() << "charRom width: " << digitalNum * width << " width: " << width;
|
qInfo() << ">\tletterSpace: " << letterSpace() << "charRom width: " << m_digitalNum * width << " width: " << width;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PicCounterItem::charWidth()
|
int PicCounterItem::charWidth()
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ PicTextItem::PicTextItem(QGraphicsItem *parent, QGraphicsScene *scene, const Sou
|
|||||||
setFlag(QGraphicsItem::ItemIsSelectable);
|
setFlag(QGraphicsItem::ItemIsSelectable);
|
||||||
setFlag(QGraphicsItem::ItemIsFocusable);
|
setFlag(QGraphicsItem::ItemIsFocusable);
|
||||||
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||||
QFont f("Dinkie9");
|
QFont f("WenQuanYi7");
|
||||||
// font.setFamily("wenquanyi");
|
// font.setFamily("wenquanyi");
|
||||||
// font.setPixelSize(5);
|
// font.setPixelSize(5);
|
||||||
f.setLetterSpacing(QFont::AbsoluteSpacing, 1);
|
f.setLetterSpacing(QFont::AbsoluteSpacing, 1);
|
||||||
|
|||||||
+1
-1
@@ -58,7 +58,7 @@ struct TextItemModel {
|
|||||||
int boldMultiple = 1;
|
int boldMultiple = 1;
|
||||||
int letterSpace = 0;
|
int letterSpace = 0;
|
||||||
bool colorReversal = false;
|
bool colorReversal = false;
|
||||||
QString fontFamily = "Dinkie9";
|
QString fontFamily = "WenQuanYi7";
|
||||||
int fontSize = 9;
|
int fontSize = 9;
|
||||||
|
|
||||||
std::function<QImage()> imageGenerator; // 图片生成函数
|
std::function<QImage()> imageGenerator; // 图片生成函数
|
||||||
|
|||||||
+217
-230
File diff suppressed because it is too large
Load Diff
+578
-548
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -55,7 +55,7 @@ TestPrintWidget::TestPrintWidget(QWidget* parent)
|
|||||||
// 获取文档并设置边距为0
|
// 获取文档并设置边距为0
|
||||||
m_TextEdit->document()->setDocumentMargin(0);
|
m_TextEdit->document()->setDocumentMargin(0);
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setFamily("Dinkie9");
|
font.setFamily("WenQuanYi7");
|
||||||
font.setPointSizeF(6.75);
|
font.setPointSizeF(6.75);
|
||||||
m_TextEdit->setFont(font);
|
m_TextEdit->setFont(font);
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ TestPrintWidget::TestPrintWidget(QWidget* parent)
|
|||||||
|
|
||||||
pPicScene->clearSelection();
|
pPicScene->clearSelection();
|
||||||
|
|
||||||
QFont font("Dinkie9");
|
QFont font("WenQuanYi7");
|
||||||
int ls = (int)(font.letterSpacing());
|
int ls = (int)(font.letterSpacing());
|
||||||
|
|
||||||
CounterViewModel vm;
|
CounterViewModel vm;
|
||||||
|
|||||||
+1
-1
@@ -154,7 +154,7 @@ private:
|
|||||||
int m_copiedCounterType = COUNTER_TYPE_1;
|
int m_copiedCounterType = COUNTER_TYPE_1;
|
||||||
int m_copiedCounterDigitalNum = 1;
|
int m_copiedCounterDigitalNum = 1;
|
||||||
int m_copiedCounterLetterSpace = 1;
|
int m_copiedCounterLetterSpace = 1;
|
||||||
QString m_copiedCounterFontFamily = "Dinkie9";
|
QString m_copiedCounterFontFamily = "WenQuanYi7";
|
||||||
QPointF m_copiedPos;
|
QPointF m_copiedPos;
|
||||||
//判断要复制什么图层,添加该图层
|
//判断要复制什么图层,添加该图层
|
||||||
PicTextItem* checkSelectItem(PicTextItem* srcItem);
|
PicTextItem* checkSelectItem(PicTextItem* srcItem);
|
||||||
|
|||||||
Reference in New Issue
Block a user