Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ec427097e | ||
|
|
a18665b5f9 |
+41
-3
@@ -91,7 +91,7 @@ void CounterVarSet::onDigitsChanged(int digits)
|
|||||||
endValueBox->setValue(maxValue);
|
endValueBox->setValue(maxValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CounterVarSet::setCounterConfig(CounterViewModel viewModel)
|
void CounterVarSet::setCounterConfig(CounterViewModel viewModel, bool isChange)
|
||||||
{
|
{
|
||||||
m_vm = viewModel;
|
m_vm = viewModel;
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ void CounterVarSet::setCounterConfig(CounterViewModel viewModel)
|
|||||||
ui->tabWidget->setCurrentIndex(viewModel.counterType == COUNTER_TYPE_1 ? 1 : 2);
|
ui->tabWidget->setCurrentIndex(viewModel.counterType == COUNTER_TYPE_1 ? 1 : 2);
|
||||||
ui->letterSpaceSpinBox->setValue(viewModel.letterSpace);
|
ui->letterSpaceSpinBox->setValue(viewModel.letterSpace);
|
||||||
|
|
||||||
updateSysParaToUI();
|
updateSysParaToUI(isChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CounterVarSet::getValue(int *varType,int *digitalWidth,unsigned char *splitMode){
|
void CounterVarSet::getValue(int *varType,int *digitalWidth,unsigned char *splitMode){
|
||||||
@@ -139,8 +139,10 @@ void CounterVarSet::applyUIPara()
|
|||||||
m_vm.cnt2Settings.currValue = ui->spinBoxCnt2CurrValue->value();
|
m_vm.cnt2Settings.currValue = ui->spinBoxCnt2CurrValue->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CounterVarSet::updateSysParaToUI()
|
void CounterVarSet::updateSysParaToUI(bool isChange)
|
||||||
{
|
{
|
||||||
|
handleChange(isChange);
|
||||||
|
|
||||||
ui->spinBoxCnt1EndValue->setValue(m_vm.cnt1Settings.endValue);
|
ui->spinBoxCnt1EndValue->setValue(m_vm.cnt1Settings.endValue);
|
||||||
ui->spinBoxCnt1RepeateCnt->setValue(m_vm.cnt1Settings.repeatValue);
|
ui->spinBoxCnt1RepeateCnt->setValue(m_vm.cnt1Settings.repeatValue);
|
||||||
ui->spinBoxCnt1StartValue->setValue(m_vm.cnt1Settings.startValue);
|
ui->spinBoxCnt1StartValue->setValue(m_vm.cnt1Settings.startValue);
|
||||||
@@ -154,6 +156,42 @@ void CounterVarSet::updateSysParaToUI()
|
|||||||
ui->spinBoxCnt2CurrValue->setValue(m_vm.cnt2Settings.currValue);
|
ui->spinBoxCnt2CurrValue->setValue(m_vm.cnt2Settings.currValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CounterVarSet::handleChange(bool isChange)
|
||||||
|
{
|
||||||
|
if (isChange) {
|
||||||
|
const bool useCnt1 = ui->radioButtonVar1->isChecked();
|
||||||
|
if (useCnt1) {
|
||||||
|
// 只显示 cnt1Tab
|
||||||
|
if (ui->tabWidget->indexOf(ui->cnt2Tab) >= 0)
|
||||||
|
ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->cnt2Tab));
|
||||||
|
if (ui->tabWidget->indexOf(ui->cnt1Tab) < 0)
|
||||||
|
ui->tabWidget->insertTab(1, ui->cnt1Tab, tr("计数器1"));
|
||||||
|
|
||||||
|
ui->tabWidget->setCurrentWidget(ui->cnt1Tab);
|
||||||
|
ui->radioButtonVar1->setEnabled(true);
|
||||||
|
ui->radioButtonVar2->setEnabled(false);
|
||||||
|
} else {
|
||||||
|
// 只显示 cnt2Tab
|
||||||
|
if (ui->tabWidget->indexOf(ui->cnt1Tab) >= 0)
|
||||||
|
ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->cnt1Tab));
|
||||||
|
if (ui->tabWidget->indexOf(ui->cnt2Tab) < 0)
|
||||||
|
ui->tabWidget->insertTab(1, ui->cnt2Tab, tr("计数器2"));
|
||||||
|
|
||||||
|
ui->tabWidget->setCurrentWidget(ui->cnt2Tab);
|
||||||
|
ui->radioButtonVar1->setEnabled(false);
|
||||||
|
ui->radioButtonVar2->setEnabled(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 两个都显示
|
||||||
|
if (ui->tabWidget->indexOf(ui->cnt1Tab) < 0)
|
||||||
|
ui->tabWidget->insertTab(1, ui->cnt1Tab, tr("计数器1"));
|
||||||
|
if (ui->tabWidget->indexOf(ui->cnt2Tab) < 0)
|
||||||
|
ui->tabWidget->insertTab(2, ui->cnt2Tab, tr("计数器2"));
|
||||||
|
ui->radioButtonVar1->setEnabled(true);
|
||||||
|
ui->radioButtonVar2->setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CounterVarSet::applyStyleSheet()
|
void CounterVarSet::applyStyleSheet()
|
||||||
{
|
{
|
||||||
QString styleSheet =
|
QString styleSheet =
|
||||||
|
|||||||
+3
-2
@@ -25,14 +25,15 @@ public:
|
|||||||
void applyStyleSheet();
|
void applyStyleSheet();
|
||||||
void getValue(int *varType,int *digitalWidth,unsigned char *splitMode);
|
void getValue(int *varType,int *digitalWidth,unsigned char *splitMode);
|
||||||
|
|
||||||
void updateSysParaToUI(); //重载
|
void updateSysParaToUI(bool isChange); //重载
|
||||||
|
void handleChange(bool isChange);
|
||||||
void applyUIPara(); //重载
|
void applyUIPara(); //重载
|
||||||
|
|
||||||
// 获取当前计数器配置:varType(7或8) 和 digitalNum(位数)
|
// 获取当前计数器配置:varType(7或8) 和 digitalNum(位数)
|
||||||
CounterViewModel getCounterConfig();
|
CounterViewModel getCounterConfig();
|
||||||
|
|
||||||
// 设置ui,用户编辑计数器item时,会调用此函数显示计数器的配置
|
// 设置ui,用户编辑计数器item时,会调用此函数显示计数器的配置
|
||||||
void setCounterConfig(CounterViewModel viewModel);
|
void setCounterConfig(CounterViewModel viewModel, bool isChange);
|
||||||
signals:
|
signals:
|
||||||
void sendButtonClickedSignal(int);
|
void sendButtonClickedSignal(int);
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -187,7 +187,7 @@ void InkJetPrinter::init()
|
|||||||
m_PrintSetting->updateModelToUI();
|
m_PrintSetting->updateModelToUI();
|
||||||
m_SystemSetting->updateSysParaToUI();
|
m_SystemSetting->updateSysParaToUI();
|
||||||
m_OtherInfo->updateSysParaToUI();
|
m_OtherInfo->updateSysParaToUI();
|
||||||
m_CounterVarSet->updateSysParaToUI();
|
m_CounterVarSet->updateSysParaToUI(false);
|
||||||
|
|
||||||
m_SystemManage->loadKeyBoardType();
|
m_SystemManage->loadKeyBoardType();
|
||||||
|
|
||||||
@@ -256,11 +256,11 @@ void InkJetPrinter::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// type 1,2: 分别显示计数器1或2的界面
|
// type 1,2: 分别显示计数器1或2的界面
|
||||||
void InkJetPrinter::slt_editCounter(CounterViewModel vm)
|
void InkJetPrinter::slt_editCounter(CounterViewModel vm, bool isChange)
|
||||||
{
|
{
|
||||||
if (m_CounterVarSet) {
|
if (m_CounterVarSet) {
|
||||||
m_CounterVarSet->updateSysParaToUI();
|
// m_CounterVarSet->updateSysParaToUI(isChange);
|
||||||
m_CounterVarSet->setCounterConfig(vm);
|
m_CounterVarSet->setCounterConfig(vm,isChange);
|
||||||
m_StackedWidget->setCurrentWidget(m_CounterVarSet);
|
m_StackedWidget->setCurrentWidget(m_CounterVarSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -234,7 +234,7 @@ private slots:
|
|||||||
|
|
||||||
void OnFinished(int event);
|
void OnFinished(int event);
|
||||||
|
|
||||||
void slt_editCounter(CounterViewModel vm);
|
void slt_editCounter(CounterViewModel vm, bool isChange);
|
||||||
|
|
||||||
// 保养警告
|
// 保养警告
|
||||||
void slt_warningMaintenance();
|
void slt_warningMaintenance();
|
||||||
|
|||||||
@@ -425,3 +425,11 @@ void MainInstruction::applyStyleSheet()
|
|||||||
|
|
||||||
this->setStyleSheet(styleSheet);
|
this->setStyleSheet(styleSheet);
|
||||||
}
|
}
|
||||||
|
void MainInstruction::on_visSetBtn_clicked()
|
||||||
|
{
|
||||||
|
if (dlgVisSetting == nullptr) {
|
||||||
|
dlgVisSetting = new DlgViscositySetting(this);
|
||||||
|
}
|
||||||
|
if (dlgVisSetting)
|
||||||
|
dlgVisSetting->show();
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "dialogmaintenancetimesetting.h"
|
#include "dialogmaintenancetimesetting.h"
|
||||||
#include "LogInfo.h"
|
#include "LogInfo.h"
|
||||||
#include "TimeSettingDialog.h"
|
#include "TimeSettingDialog.h"
|
||||||
|
#include "dlgviscositysetting.h"
|
||||||
|
|
||||||
class DlgRFIDConfig;
|
class DlgRFIDConfig;
|
||||||
class DlgCanvasHeightEditor;
|
class DlgCanvasHeightEditor;
|
||||||
@@ -60,6 +61,8 @@ private slots:
|
|||||||
|
|
||||||
void onCanvasCfgBtnClicked();
|
void onCanvasCfgBtnClicked();
|
||||||
|
|
||||||
|
void on_visSetBtn_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainInstruction *ui;
|
Ui::MainInstruction *ui;
|
||||||
SysPara* sysPara = nullptr;
|
SysPara* sysPara = nullptr;
|
||||||
@@ -75,6 +78,9 @@ private:
|
|||||||
// 时间设置
|
// 时间设置
|
||||||
TimeSettingDialog timeDia;
|
TimeSettingDialog timeDia;
|
||||||
|
|
||||||
|
//
|
||||||
|
DlgViscositySetting* dlgVisSetting = nullptr;
|
||||||
|
|
||||||
void applyStyleSheet(); // 应用样式表
|
void applyStyleSheet(); // 应用样式表
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+14
-1
@@ -98,7 +98,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tabBasic">
|
<widget class="QWidget" name="tabBasic">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -304,6 +304,19 @@
|
|||||||
<string>窗口点阵设置</string>
|
<string>窗口点阵设置</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="visSetBtn">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>310</x>
|
||||||
|
<y>230</y>
|
||||||
|
<width>254</width>
|
||||||
|
<height>92</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>粘度设置</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="closeBtn">
|
<widget class="QPushButton" name="closeBtn">
|
||||||
|
|||||||
@@ -296,7 +296,8 @@ void PrintTextDisplay::paintEvent(QPaintEvent *event){
|
|||||||
if(val>base-1)jmin=Num-j-1;
|
if(val>base-1)jmin=Num-j-1;
|
||||||
base *= 10;
|
base *= 10;
|
||||||
}
|
}
|
||||||
str= QString("%1").arg(val%base,Num,10,QLatin1Char('0'))+str;
|
int r = (base != 0) ? (val % base) : 0;
|
||||||
|
str= QString("%1").arg(r,Num,10,QLatin1Char('0'))+str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -186,7 +186,8 @@ HEADERS += Public.h \
|
|||||||
dump.h \
|
dump.h \
|
||||||
DlgCanvasHeightEditor.h \
|
DlgCanvasHeightEditor.h \
|
||||||
StateMachine/PrinterStateManager.h \
|
StateMachine/PrinterStateManager.h \
|
||||||
CustomDoubleSpinBox.h
|
CustomDoubleSpinBox.h \
|
||||||
|
dlgviscositysetting.h
|
||||||
|
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
@@ -236,7 +237,8 @@ FORMS += \
|
|||||||
scene/DlgBarcodeFormat.ui \
|
scene/DlgBarcodeFormat.ui \
|
||||||
scene/DlgQrcodeFormat.ui \
|
scene/DlgQrcodeFormat.ui \
|
||||||
dlgQrCode.ui \
|
dlgQrCode.ui \
|
||||||
DlgCanvasHeightEditor.ui
|
DlgCanvasHeightEditor.ui \
|
||||||
|
dlgviscositysetting.ui
|
||||||
|
|
||||||
SOURCES +=\
|
SOURCES +=\
|
||||||
mainwidget.cpp \
|
mainwidget.cpp \
|
||||||
@@ -350,7 +352,8 @@ SOURCES +=\
|
|||||||
loginfoctrl.cpp \
|
loginfoctrl.cpp \
|
||||||
runtimectrl.cpp \
|
runtimectrl.cpp \
|
||||||
DlgCanvasHeightEditor.cpp \
|
DlgCanvasHeightEditor.cpp \
|
||||||
StateMachine/PrinterStateManager.cpp
|
StateMachine/PrinterStateManager.cpp \
|
||||||
|
dlgviscositysetting.cpp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+14
@@ -193,12 +193,16 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="84"/>
|
<location filename="countervarset.ui" line="84"/>
|
||||||
<location filename="countervarset.ui" line="273"/>
|
<location filename="countervarset.ui" line="273"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="168"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="183"/>
|
||||||
<source>计数器1</source>
|
<source>计数器1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="112"/>
|
<location filename="countervarset.ui" line="112"/>
|
||||||
<location filename="countervarset.ui" line="655"/>
|
<location filename="countervarset.ui" line="655"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="176"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="185"/>
|
||||||
<source>计数器2</source>
|
<source>计数器2</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -5958,6 +5962,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>是否保存文件?</source>
|
<source>是否保存文件?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>警告</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>无法创建更多计数器</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TimeSettingDialog</name>
|
<name>TimeSettingDialog</name>
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include "dlgviscositysetting.h"
|
||||||
|
#include "ui_dlgviscositysetting.h"
|
||||||
|
|
||||||
|
DlgViscositySetting::DlgViscositySetting(QWidget *parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
ui(new Ui::DlgViscositySetting)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
DlgViscositySetting::~DlgViscositySetting()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef DLGVISCOSITYSETTING_H
|
||||||
|
#define DLGVISCOSITYSETTING_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class DlgViscositySetting;
|
||||||
|
}
|
||||||
|
|
||||||
|
class DlgViscositySetting : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit DlgViscositySetting(QWidget *parent = 0);
|
||||||
|
~DlgViscositySetting();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::DlgViscositySetting *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGVISCOSITYSETTING_H
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>DlgViscositySetting</class>
|
||||||
|
<widget class="QDialog" name="DlgViscositySetting">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>421</width>
|
||||||
|
<height>266</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Dialog</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
+14
@@ -193,12 +193,16 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="84"/>
|
<location filename="countervarset.ui" line="84"/>
|
||||||
<location filename="countervarset.ui" line="273"/>
|
<location filename="countervarset.ui" line="273"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="168"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="183"/>
|
||||||
<source>计数器1</source>
|
<source>计数器1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="112"/>
|
<location filename="countervarset.ui" line="112"/>
|
||||||
<location filename="countervarset.ui" line="655"/>
|
<location filename="countervarset.ui" line="655"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="176"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="185"/>
|
||||||
<source>计数器2</source>
|
<source>计数器2</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -5958,6 +5962,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>是否保存文件?</source>
|
<source>是否保存文件?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>警告</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>无法创建更多计数器</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TimeSettingDialog</name>
|
<name>TimeSettingDialog</name>
|
||||||
|
|||||||
@@ -193,12 +193,16 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="84"/>
|
<location filename="countervarset.ui" line="84"/>
|
||||||
<location filename="countervarset.ui" line="273"/>
|
<location filename="countervarset.ui" line="273"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="168"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="183"/>
|
||||||
<source>计数器1</source>
|
<source>计数器1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="112"/>
|
<location filename="countervarset.ui" line="112"/>
|
||||||
<location filename="countervarset.ui" line="655"/>
|
<location filename="countervarset.ui" line="655"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="176"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="185"/>
|
||||||
<source>计数器2</source>
|
<source>计数器2</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -5958,6 +5962,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>是否保存文件?</source>
|
<source>是否保存文件?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>警告</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>无法创建更多计数器</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TimeSettingDialog</name>
|
<name>TimeSettingDialog</name>
|
||||||
|
|||||||
@@ -201,12 +201,16 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="84"/>
|
<location filename="countervarset.ui" line="84"/>
|
||||||
<location filename="countervarset.ui" line="273"/>
|
<location filename="countervarset.ui" line="273"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="168"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="183"/>
|
||||||
<source>计数器1</source>
|
<source>计数器1</source>
|
||||||
<translation>카운터1</translation>
|
<translation>카운터1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="112"/>
|
<location filename="countervarset.ui" line="112"/>
|
||||||
<location filename="countervarset.ui" line="655"/>
|
<location filename="countervarset.ui" line="655"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="176"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="185"/>
|
||||||
<source>计数器2</source>
|
<source>计数器2</source>
|
||||||
<translation>카운터2</translation>
|
<translation>카운터2</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -11351,6 +11355,16 @@ configuration.</source>
|
|||||||
<source>是否保存文件?</source>
|
<source>是否保存文件?</source>
|
||||||
<translation>파일을 저장하시겠습니까?</translation>
|
<translation>파일을 저장하시겠습니까?</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>警告</source>
|
||||||
|
<translation>경고</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>无法创建更多计数器</source>
|
||||||
|
<translation>더 이상 카운터를 생성할 수 없습니다</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TextEditOption</name>
|
<name>TextEditOption</name>
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ void PicCounterItem::setCustomAttrs(const QXmlStreamAttributes &attrs)
|
|||||||
|
|
||||||
ok = false;
|
ok = false;
|
||||||
int displayNum = displayNumRef.toInt(&ok);
|
int displayNum = displayNumRef.toInt(&ok);
|
||||||
if(!ok || displayNum <= 0) {
|
if(!ok /*|| displayNum <= 0*/) {
|
||||||
qWarning() << "Invalied counter display number: " << displayNum;
|
qWarning() << "Invalied counter display number: " << displayNum;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+14
@@ -193,12 +193,16 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="84"/>
|
<location filename="countervarset.ui" line="84"/>
|
||||||
<location filename="countervarset.ui" line="273"/>
|
<location filename="countervarset.ui" line="273"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="168"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="183"/>
|
||||||
<source>计数器1</source>
|
<source>计数器1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="112"/>
|
<location filename="countervarset.ui" line="112"/>
|
||||||
<location filename="countervarset.ui" line="655"/>
|
<location filename="countervarset.ui" line="655"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="176"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="185"/>
|
||||||
<source>计数器2</source>
|
<source>计数器2</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -5958,6 +5962,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>是否保存文件?</source>
|
<source>是否保存文件?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>警告</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>无法创建更多计数器</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TimeSettingDialog</name>
|
<name>TimeSettingDialog</name>
|
||||||
|
|||||||
+21
-2
@@ -146,7 +146,7 @@ TestPrintWidget::TestPrintWidget(QWidget* parent)
|
|||||||
vm.letterSpace = 1;
|
vm.letterSpace = 1;
|
||||||
vm.cnt1Settings = m_printSettingModel.cnt1Settings;
|
vm.cnt1Settings = m_printSettingModel.cnt1Settings;
|
||||||
vm.cnt2Settings = m_printSettingModel.cnt2Settings;
|
vm.cnt2Settings = m_printSettingModel.cnt2Settings;
|
||||||
emit sig_showEditCounter(vm);
|
emit sig_showEditCounter(vm, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(ui.btnBarcode, &QPushButton::clicked, [this](){
|
connect(ui.btnBarcode, &QPushButton::clicked, [this](){
|
||||||
@@ -715,7 +715,7 @@ void TestPrintWidget::onBtnItemConfigClicked()
|
|||||||
vm.charWidth = counterItem->charWidth();
|
vm.charWidth = counterItem->charWidth();
|
||||||
vm.cnt1Settings = m_printSettingModel.cnt1Settings;
|
vm.cnt1Settings = m_printSettingModel.cnt1Settings;
|
||||||
vm.cnt2Settings = m_printSettingModel.cnt2Settings;
|
vm.cnt2Settings = m_printSettingModel.cnt2Settings;
|
||||||
emit sig_showEditCounter(vm);
|
emit sig_showEditCounter(vm, true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1050,6 +1050,12 @@ void TestPrintWidget::addCounterItem(CounterViewModel vm, QSharedPointer<QFont>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 最多两个计数器
|
||||||
|
if (getCounterNum() >= 2 && !flag) {
|
||||||
|
QMessageBox::warning(this, tr("警告"),tr("无法创建更多计数器"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QVector<int> currVals{vm.cnt1Settings.currValue, vm.cnt2Settings.currValue};
|
QVector<int> currVals{vm.cnt1Settings.currValue, vm.cnt2Settings.currValue};
|
||||||
|
|
||||||
QFont font;
|
QFont font;
|
||||||
@@ -1100,6 +1106,19 @@ void TestPrintWidget::addCounterItem(CounterViewModel vm, QSharedPointer<QFont>
|
|||||||
updateCountersCurrVal(currVals);
|
updateCountersCurrVal(currVals);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int TestPrintWidget::getCounterNum()
|
||||||
|
{
|
||||||
|
int count = 0;
|
||||||
|
const QList<QGraphicsItem *> items = pPicScene->items();
|
||||||
|
for (QGraphicsItem *it : items) {
|
||||||
|
if (auto *counter = dynamic_cast<PicCounterItem *>(it)) {
|
||||||
|
Q_UNUSED(counter);
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
QString TestPrintWidget::currentFile()
|
QString TestPrintWidget::currentFile()
|
||||||
{
|
{
|
||||||
return xmlfileName;
|
return xmlfileName;
|
||||||
|
|||||||
+3
-1
@@ -58,6 +58,8 @@ public:
|
|||||||
|
|
||||||
void addCounterItem(CounterViewModel vm, QSharedPointer<QFont> font = nullptr);
|
void addCounterItem(CounterViewModel vm, QSharedPointer<QFont> font = nullptr);
|
||||||
|
|
||||||
|
int getCounterNum();
|
||||||
|
|
||||||
QString currentFile();
|
QString currentFile();
|
||||||
|
|
||||||
// 更新编辑界面内所有计数器的当前值
|
// 更新编辑界面内所有计数器的当前值
|
||||||
@@ -176,7 +178,7 @@ signals:
|
|||||||
|
|
||||||
void sendButtonClickedSignal(int index);
|
void sendButtonClickedSignal(int index);
|
||||||
|
|
||||||
void sig_showEditCounter(CounterViewModel viewModel);
|
void sig_showEditCounter(CounterViewModel viewModel, bool isChange);
|
||||||
|
|
||||||
// 用户请求打开日期类型图元编辑窗口时发送此信号
|
// 用户请求打开日期类型图元编辑窗口时发送此信号
|
||||||
void sig_showEditDateTime(DateItemModel dateModel, TextItemModel textModel);
|
void sig_showEditDateTime(DateItemModel dateModel, TextItemModel textModel);
|
||||||
|
|||||||
@@ -193,12 +193,16 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="84"/>
|
<location filename="countervarset.ui" line="84"/>
|
||||||
<location filename="countervarset.ui" line="273"/>
|
<location filename="countervarset.ui" line="273"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="168"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="183"/>
|
||||||
<source>计数器1</source>
|
<source>计数器1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="112"/>
|
<location filename="countervarset.ui" line="112"/>
|
||||||
<location filename="countervarset.ui" line="655"/>
|
<location filename="countervarset.ui" line="655"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="176"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="185"/>
|
||||||
<source>计数器2</source>
|
<source>计数器2</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -5958,6 +5962,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>是否保存文件?</source>
|
<source>是否保存文件?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>警告</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>无法创建更多计数器</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TimeSettingDialog</name>
|
<name>TimeSettingDialog</name>
|
||||||
|
|||||||
@@ -193,12 +193,16 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="84"/>
|
<location filename="countervarset.ui" line="84"/>
|
||||||
<location filename="countervarset.ui" line="273"/>
|
<location filename="countervarset.ui" line="273"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="168"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="183"/>
|
||||||
<source>计数器1</source>
|
<source>计数器1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="112"/>
|
<location filename="countervarset.ui" line="112"/>
|
||||||
<location filename="countervarset.ui" line="655"/>
|
<location filename="countervarset.ui" line="655"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="176"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="185"/>
|
||||||
<source>计数器2</source>
|
<source>计数器2</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -5958,6 +5962,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>是否保存文件?</source>
|
<source>是否保存文件?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>警告</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>无法创建更多计数器</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TimeSettingDialog</name>
|
<name>TimeSettingDialog</name>
|
||||||
|
|||||||
@@ -193,12 +193,16 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="84"/>
|
<location filename="countervarset.ui" line="84"/>
|
||||||
<location filename="countervarset.ui" line="273"/>
|
<location filename="countervarset.ui" line="273"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="168"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="183"/>
|
||||||
<source>计数器1</source>
|
<source>计数器1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="countervarset.ui" line="112"/>
|
<location filename="countervarset.ui" line="112"/>
|
||||||
<location filename="countervarset.ui" line="655"/>
|
<location filename="countervarset.ui" line="655"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="176"/>
|
||||||
|
<location filename="CounterVarSet.cpp" line="185"/>
|
||||||
<source>计数器2</source>
|
<source>计数器2</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -5958,6 +5962,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>是否保存文件?</source>
|
<source>是否保存文件?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>警告</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="testprintwidget.cpp" line="1055"/>
|
||||||
|
<source>无法创建更多计数器</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>TimeSettingDialog</name>
|
<name>TimeSettingDialog</name>
|
||||||
|
|||||||
Reference in New Issue
Block a user