改进计数器编辑、预览状态和行为;修复移除source属性的影响、修改自检期间粘度计每次工作时间、更新翻译
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
#include "scene/PicCounterItem.h"
|
||||
#include <qmath.h>
|
||||
|
||||
CounterVarSet::CounterVarSet(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
@@ -25,6 +26,30 @@ void CounterVarSet::init()
|
||||
// 连接信号槽
|
||||
connect(ui->checkBtn, &QPushButton::clicked, this, &CounterVarSet::buttonClickedSlot);
|
||||
connect(ui->closeBtn, &QPushButton::clicked, this, &CounterVarSet::buttonClickedSlot);
|
||||
|
||||
connect(ui->tabWidget, &QTabWidget::currentChanged, this, [this](int i){
|
||||
|
||||
if(ui->cb_digits->currentIndex() == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSpinBox *endValueBox = nullptr;
|
||||
if(ui->tabWidget->widget(i) == ui->cnt1Tab && ui->radioButtonVar1->isChecked()) {
|
||||
endValueBox = ui->spinBoxCnt1EndValue;
|
||||
}
|
||||
else if(ui->tabWidget->widget(i) == ui->cnt2Tab && ui->radioButtonVar2->isChecked()) {
|
||||
endValueBox = ui->spinBoxCnt2EndValue;
|
||||
}
|
||||
|
||||
if(!endValueBox) {
|
||||
return;
|
||||
}
|
||||
|
||||
int digits = ui->cb_digits->itemText(ui->cb_digits->currentIndex()).toInt();
|
||||
int maxValue = qPow(10, digits) - 1;
|
||||
endValueBox->setMaximum(maxValue);
|
||||
endValueBox->setValue(maxValue);
|
||||
});
|
||||
}
|
||||
|
||||
void CounterVarSet::buttonClickedSlot()
|
||||
@@ -52,6 +77,20 @@ CounterViewModel CounterVarSet::getCounterConfig()
|
||||
return viewModel;
|
||||
}
|
||||
|
||||
void CounterVarSet::onDigitsChanged(int digits)
|
||||
{
|
||||
int maxValue = qPow(10, digits) - 1;
|
||||
|
||||
QSpinBox* endValueBox = nullptr;
|
||||
if(ui->radioButtonVar1->isChecked())
|
||||
endValueBox = ui->spinBoxCnt1EndValue;
|
||||
else
|
||||
endValueBox = ui->spinBoxCnt2EndValue;
|
||||
|
||||
endValueBox->setMaximum(maxValue);
|
||||
endValueBox->setValue(maxValue);
|
||||
}
|
||||
|
||||
void CounterVarSet::setCounterConfig(CounterViewModel viewModel)
|
||||
{
|
||||
m_vm = viewModel;
|
||||
|
||||
@@ -41,6 +41,7 @@ signals:
|
||||
|
||||
private slots:
|
||||
void buttonClickedSlot();
|
||||
void onDigitsChanged(int digits);
|
||||
|
||||
private:
|
||||
Ui::CounterVarSet *ui;
|
||||
|
||||
@@ -25,6 +25,7 @@ DigitalInput::DigitalInput(MyInputMethod *myInputMethod,QWidget *parent) :
|
||||
connect(ui->Key_8,SIGNAL(pressed()),this,SLOT(onCharPressed()));
|
||||
connect(ui->Key_9,SIGNAL(pressed()),this,SLOT(onCharPressed()));
|
||||
connect(ui->Key_pluse,SIGNAL(pressed()),this,SLOT(onCharPressed()));
|
||||
connect(ui->Key_dot, SIGNAL(pressed()),this,SLOT(onCharPressed()));
|
||||
connect(ui->Key_backspace,SIGNAL(pressed()),this,SLOT(onKeyBackspacePressed()));
|
||||
// connect(ui->Key_selectAll,SIGNAL(pressed()),this,SLOT(onKeySelectAllPressed()));
|
||||
// connect(ui->Key_up,SIGNAL(pressed()),this,SLOT(onKeyUpPressed()));
|
||||
|
||||
+10
-3
@@ -1027,7 +1027,7 @@ void InkJetPrinter::timerHandler(void){
|
||||
arg((MAX_SELF_CHECK_CNT - sysPara->status.selfCheckCnt)/100));
|
||||
}
|
||||
#ifdef BNS_DEBUG
|
||||
if(sysPara->status.selfCheckCnt >= MAX_SELF_CHECK_CNT) // 测试自检改为15s
|
||||
if(sysPara->status.selfCheckCnt >= 500) // 测试自检改为5s
|
||||
#else
|
||||
if(sysPara->status.selfCheckCnt >= MAX_SELF_CHECK_CNT)
|
||||
#endif
|
||||
@@ -1558,6 +1558,11 @@ void InkJetPrinter::getMainWidgetButtonClickedSlot(int index)
|
||||
m_TestPrintWidget->openWorkFile(currWorkFile);
|
||||
ui.label_currEditFile->setText(QString("E: %1").arg(fileInfo.baseName()));
|
||||
m_StackedWidget->setCurrentWidget(m_TestPrintWidget);
|
||||
|
||||
QVector<int> counterValues{QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt(),
|
||||
QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue,16).toInt()};
|
||||
m_TestPrintWidget->updateCountersCurrVal(counterValues);
|
||||
|
||||
break;
|
||||
}
|
||||
case 2: // 调入文件喷印
|
||||
@@ -2628,17 +2633,19 @@ void InkJetPrinter::autoControlViscosityPumpForSelfCheck(int selfCheckCnt)
|
||||
|
||||
int stageCnt = selfCheckCnt % 1000;
|
||||
|
||||
if(stageCnt >= 0 && stageCnt < 150) {
|
||||
if(stageCnt >= 0 && stageCnt < 300) {
|
||||
if(!sysPara->devOp->isViscosityPumpOpen()) {
|
||||
sysPara->devOp->controlViscosityPump(true);
|
||||
qDebug() << "Start test viscosity pump.";
|
||||
LogInfo::setRunStatusText("Start test viscosity pump.");
|
||||
}
|
||||
}
|
||||
|
||||
if(stageCnt >= 150) {
|
||||
if(stageCnt >= 300) {
|
||||
if(sysPara->devOp->isViscosityPumpOpen()) {
|
||||
sysPara->devOp->controlViscosityPump(false);
|
||||
qDebug() << "Stop test viscosity pump.";
|
||||
LogInfo::setRunStatusText("Stop test viscosity pump.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ void MyInputMethod::updateHandler ( int type ){
|
||||
switch(type){
|
||||
case 0:break;
|
||||
case 1:
|
||||
if(widget && dynamic_cast<QSpinBox *>(widget)){
|
||||
if(widget && (dynamic_cast<QSpinBox *>(widget))){
|
||||
if(digitalInput->isHidden()){
|
||||
QWidget *hostWindow = widget->window();
|
||||
QRect rec = QApplication::desktop()->screenGeometry();
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@
|
||||
Major.Minor.Rivison.yyyy-MM-DD_Beta
|
||||
*/
|
||||
#define UP_PRINTER_MAJOR_VER 6
|
||||
#define UP_PRINTER_MINOR_VER 8
|
||||
#define UP_PRINTER_RIVISION_VER 7
|
||||
#define UP_PRINTER_MINOR_VER 9
|
||||
#define UP_PRINTER_RIVISION_VER 1
|
||||
#define SUB_VERSION "_KOR"
|
||||
#ifdef __RFID_OLD
|
||||
#define SUB_RFID "_RO"
|
||||
|
||||
+225
-246
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -35,7 +35,7 @@
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
@@ -265,7 +265,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<widget class="QWidget" name="cnt1Tab">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
@@ -647,7 +647,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<widget class="QWidget" name="cnt2Tab">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
|
||||
+188
-173
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>231</width>
|
||||
<height>260</height>
|
||||
<height>270</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
@@ -89,6 +89,9 @@
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-size: 16px;</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
@@ -105,60 +108,8 @@
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="traceEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Key_backspace">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>DEL</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="image.qrc">
|
||||
<normaloff>:/icon/keybackspace.png</normaloff>:/icon/keybackspace.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
@@ -191,6 +142,63 @@
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="Key_7">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>7</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="Key_5">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>5</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="Key_6">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>6</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="Key_1">
|
||||
<property name="minimumSize">
|
||||
@@ -229,82 +237,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="Key_5">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>5</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="Key_9">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>9</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="Key_6">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>6</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="Key_7">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>7</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="Key_2">
|
||||
<property name="minimumSize">
|
||||
@@ -324,25 +256,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="Key_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>4</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="Key_8">
|
||||
<property name="minimumSize">
|
||||
@@ -362,8 +275,8 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="Key_pluse">
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="Key_9">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
@@ -377,7 +290,26 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
<string>9</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="Key_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>4</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -400,23 +332,40 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<item row="2" column="3" rowspan="2">
|
||||
<widget class="QPushButton" name="enterBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enter</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignBottom">
|
||||
<widget class="QWidget" name="rightPanel" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="topMargin">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="clrBtn">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>100</height>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
@@ -436,25 +385,93 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="enterBtn">
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="Key_pluse">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>100</height>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>100</height>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="Key_dot">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enter</string>
|
||||
<string>.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QWidget" name="topPanel" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="traceEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="Key_backspace">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>DEL</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="image.qrc">
|
||||
<normaloff>:/icon/keybackspace.png</normaloff>:/icon/keybackspace.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -462,8 +479,6 @@
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="image.qrc"/>
|
||||
|
||||
+225
-246
File diff suppressed because it is too large
Load Diff
+6
-5
@@ -33,6 +33,7 @@
|
||||
#include "scene/piccodeitem.h"
|
||||
#include "scene/PicCounterItem.h"
|
||||
#include <QElapsedTimer>
|
||||
#include <QStringList>
|
||||
#include <QScroller>
|
||||
#include <QFontMetrics>
|
||||
#include <QPainter>
|
||||
@@ -991,7 +992,7 @@ void MainWidget::on_m_StartBtn_clicked()
|
||||
|
||||
// 高亮切换
|
||||
changeHighLight(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWidget::on_m_StopBtn_clicked()
|
||||
@@ -2358,7 +2359,7 @@ bool MainWidget::updatePhaseIndicatorLight(){
|
||||
sysPara->status.phaseErrorCnt = 0;
|
||||
}
|
||||
else {
|
||||
if(sysPara->status.phaseErrorCnt < 10)
|
||||
if(sysPara->status.phaseErrorCnt < 200)
|
||||
sysPara->status.phaseErrorCnt ++ ;
|
||||
else {
|
||||
if(!sysPara->status.lastPhaseFault){
|
||||
@@ -2524,15 +2525,15 @@ bool MainWidget::checkTriggerMode()
|
||||
#ifndef QT_DEBUG
|
||||
if(!SIMULATE_PRINTING_MODE){
|
||||
if (!sysPara->status.reclainTankReachEnd) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if((sysPara->status.statWarn & WARN_STATUS_HDINT)){
|
||||
QMessageBox::information(this,tr("错误"),tr("喷头盖未关,请先关喷头盖!"));
|
||||
return ;
|
||||
return false;
|
||||
}
|
||||
if((sysPara->status.statWarn & WARN_STATUS_INK_SWINT)){
|
||||
QMessageBox::information(this,tr("错误"),tr("墨线未开,请先开墨线开关!"));
|
||||
return ;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <QToolButton>
|
||||
#include <QTextEdit>
|
||||
#include <QTime>
|
||||
#include <QElapsedTimer>
|
||||
#include <QMessageBox>
|
||||
#include "scene/picscene.h"
|
||||
#include "LogInfo.h"
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#define TEST_MODE 0 //测试模式
|
||||
#define SIMULATE_PRINTING_MODE 1 //模拟打印模式
|
||||
|
||||
#define DISABLE_PRINT_START_CHECK
|
||||
|
||||
#ifdef __CONVERTERWIFI__
|
||||
#define LANINTERFACE_NAME "eth0"
|
||||
#endif
|
||||
|
||||
@@ -181,6 +181,11 @@ QImage PicDateItem::itemImage()
|
||||
return img;
|
||||
}
|
||||
|
||||
void PicDateItem::letterSpaceChanged()
|
||||
{
|
||||
setModel(m_model);
|
||||
}
|
||||
|
||||
QRectF PicDateItem::boundingRect() const
|
||||
{
|
||||
return PicTextItem::boundingRect();
|
||||
|
||||
@@ -28,6 +28,8 @@ protected:
|
||||
|
||||
virtual QImage itemImage() override;
|
||||
|
||||
virtual void letterSpaceChanged() override;
|
||||
|
||||
private:
|
||||
|
||||
QTimer m_timer;
|
||||
|
||||
@@ -102,6 +102,11 @@ QImage PicScheduleShiftItem::itemImage()
|
||||
return backgroundImg;
|
||||
}
|
||||
|
||||
void PicScheduleShiftItem::letterSpaceChanged()
|
||||
{
|
||||
setSchedules(schedules());
|
||||
}
|
||||
|
||||
QSize PicScheduleShiftItem::calcMaxSize()
|
||||
{
|
||||
if (m_schedules.isEmpty())
|
||||
|
||||
@@ -39,6 +39,8 @@ protected:
|
||||
|
||||
virtual QImage itemImage();
|
||||
|
||||
virtual void letterSpaceChanged() override;
|
||||
|
||||
private:
|
||||
|
||||
QString findScheduleName(const QTime& time);
|
||||
|
||||
@@ -117,8 +117,7 @@ void PicTextItem::setCustomFont(QString name)
|
||||
newFont.setStyleStrategy(QFont::NoAntialias);
|
||||
setFont(newFont);
|
||||
|
||||
m_untransImage = strToImage(m_source.toString());
|
||||
applyModify();
|
||||
letterSpaceChanged();
|
||||
}
|
||||
|
||||
int PicTextItem::letterSpace()
|
||||
|
||||
+225
-246
File diff suppressed because it is too large
Load Diff
+41
-18
@@ -138,15 +138,12 @@ TestPrintWidget::TestPrintWidget(QWidget* parent)
|
||||
connect(ui.btnNum,&QPushButton::clicked,[this](){
|
||||
pPicScene->clearSelection();
|
||||
|
||||
QFont font("WenQuanYi7");
|
||||
int ls = (int)(font.letterSpacing());
|
||||
|
||||
CounterViewModel vm;
|
||||
vm.charWidth = 0;
|
||||
vm.enbCustomCharWidth = false;
|
||||
vm.counterType = COUNTER_TYPE_1;
|
||||
vm.digitalNum = 2;
|
||||
vm.letterSpace = ls;
|
||||
vm.letterSpace = 1;
|
||||
vm.cnt1Settings = m_printSettingModel.cnt1Settings;
|
||||
vm.cnt2Settings = m_printSettingModel.cnt2Settings;
|
||||
emit sig_showEditCounter(vm);
|
||||
@@ -689,10 +686,9 @@ void TestPrintWidget::onImageLoaderAccepted()
|
||||
item->setImagePath(imgPath);
|
||||
auto boundingRect = pPicScene->itemsBoundingRect();
|
||||
int y = sysPara->para.canvasHeight - item->boundingRect().height();
|
||||
item->setPos(x_item, y);
|
||||
x_item = x_item + boundingRect.right() + 5;
|
||||
item->setPos(boundingRect.right() + 1, y);
|
||||
x_item = x_item + boundingRect.right() + 1;
|
||||
item->setSelected(true);
|
||||
|
||||
}
|
||||
|
||||
void TestPrintWidget::onBtnItemConfigClicked()
|
||||
@@ -831,8 +827,8 @@ void TestPrintWidget::slt_BarCodeItemDone()
|
||||
auto boundingRect = pPicScene->itemsBoundingRect();
|
||||
pPicScene->addItem(codeItem);
|
||||
int y = sysPara->para.canvasHeight - codeItem->boundingRect().height();
|
||||
codeItem->setPos(x_item, y);
|
||||
x_item = x_item + boundingRect.right() + 5;
|
||||
codeItem->setPos(boundingRect.right() + 1, y);
|
||||
x_item = x_item + boundingRect.right() + 1;
|
||||
} else {
|
||||
codeItem->setBarcodeViewModel(vm);
|
||||
}
|
||||
@@ -993,16 +989,22 @@ void TestPrintWidget::addDateTimeItem(const DateItemModel &model, const TextItem
|
||||
PicDateItem* item = new PicDateItem();
|
||||
item->setHtml(htmlStr);
|
||||
pPicScene->addItem(item);
|
||||
item->setTextItemModel(textModel);
|
||||
item->setModel(model);
|
||||
auto boundingRect = pPicScene->itemsBoundingRect();
|
||||
int y = sysPara->para.canvasHeight - item->boundingRect().height();
|
||||
item->setPos(x_item, y);
|
||||
x_item = x_item + boundingRect.right() + 5;
|
||||
item->setPos(boundingRect.right() + 1, y);
|
||||
x_item = x_item + boundingRect.right() + 1;
|
||||
item->setSelected(true);
|
||||
item->setModel(model);
|
||||
}
|
||||
|
||||
void TestPrintWidget::addScheduleShiftsItem(QVector<ScheduleModel> schedules, TextItemModel txtModel)
|
||||
{
|
||||
if(schedules.size() == 0) {
|
||||
qWarning() << "The schedules is empty, will be nothing";
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果当前选中了一个日期时间item,则直接设置模型
|
||||
auto selectItems = pPicScene->selectedItems();
|
||||
if(selectItems.size() == 1) {
|
||||
@@ -1022,13 +1024,12 @@ void TestPrintWidget::addScheduleShiftsItem(QVector<ScheduleModel> schedules, Te
|
||||
item->setHtml(htmlStr);
|
||||
pPicScene->addItem(item);
|
||||
item->setTextItemModel(txtModel);
|
||||
item->setSchedules(std::move(schedules));
|
||||
auto boundingRect = pPicScene->itemsBoundingRect();
|
||||
int y = sysPara->para.canvasHeight - item->boundingRect().height();
|
||||
item->setPos(x_item, y+3);
|
||||
x_item = x_item + boundingRect.right() + 5;
|
||||
item->setPos(boundingRect.right() + 1, y+3);
|
||||
x_item = x_item + boundingRect.right() + 1;
|
||||
item->setSelected(true);
|
||||
item->setSchedules(std::move(schedules));
|
||||
|
||||
}
|
||||
|
||||
void TestPrintWidget::addCounterItem(CounterViewModel vm, QSharedPointer<QFont> f)
|
||||
@@ -1047,6 +1048,8 @@ void TestPrintWidget::addCounterItem(CounterViewModel vm, QSharedPointer<QFont>
|
||||
}
|
||||
}
|
||||
|
||||
QVector<int> currVals{vm.cnt1Settings.currValue, vm.cnt2Settings.currValue};
|
||||
|
||||
QFont font;
|
||||
|
||||
if(flag) {
|
||||
@@ -1066,6 +1069,7 @@ void TestPrintWidget::addCounterItem(CounterViewModel vm, QSharedPointer<QFont>
|
||||
|
||||
m_printSettingModel.cnt1Settings = vm.cnt1Settings;
|
||||
m_printSettingModel.cnt2Settings = vm.cnt2Settings;
|
||||
updateCountersCurrVal(currVals);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1085,12 +1089,13 @@ void TestPrintWidget::addCounterItem(CounterViewModel vm, QSharedPointer<QFont>
|
||||
|
||||
auto boundingRect = pPicScene->itemsBoundingRect();
|
||||
int y = sysPara->para.canvasHeight - item->boundingRect().height();
|
||||
item->setPos(x_item, y);
|
||||
x_item = x_item + boundingRect.right() + 5;
|
||||
item->setPos(boundingRect.right() + 1, y);
|
||||
x_item = x_item + boundingRect.right() + 1;
|
||||
item->setSelected(true);
|
||||
|
||||
m_printSettingModel.cnt1Settings = vm.cnt1Settings;
|
||||
m_printSettingModel.cnt2Settings = vm.cnt2Settings;
|
||||
updateCountersCurrVal(currVals);
|
||||
}
|
||||
|
||||
QString TestPrintWidget::currentFile()
|
||||
@@ -1098,6 +1103,24 @@ QString TestPrintWidget::currentFile()
|
||||
return xmlfileName;
|
||||
}
|
||||
|
||||
void TestPrintWidget::updateCountersCurrVal(const QVector<int> values)
|
||||
{
|
||||
if(values.size() < 2) {
|
||||
qDebug() << "Invalied values";
|
||||
return;
|
||||
}
|
||||
|
||||
auto items = pPicScene->items();
|
||||
for(auto item : items) {
|
||||
auto counterItem = dynamic_cast<PicCounterItem*>(item);
|
||||
if(!counterItem)
|
||||
continue;
|
||||
|
||||
int displayNum = counterItem->counterType() == COUNTER_TYPE_1 ? values[0] : values[1];
|
||||
counterItem->setCounter(counterItem->counterType(), counterItem->digitalNum(), displayNum);
|
||||
}
|
||||
}
|
||||
|
||||
void TestPrintWidget::showBarcodeEditor(const BarcodeViewModel& vm)
|
||||
{
|
||||
#if defined(ARCH_AARCH64)
|
||||
|
||||
@@ -60,6 +60,9 @@ public:
|
||||
|
||||
QString currentFile();
|
||||
|
||||
// 更新编辑界面内所有计数器的当前值
|
||||
void updateCountersCurrVal(const QVector<int> values);
|
||||
|
||||
public slots:
|
||||
void on_enlargeButton_pressed();
|
||||
void on_addButton_pressed(const SourceType type = SourceType::UNKNOWN);
|
||||
|
||||
Reference in New Issue
Block a user