2026年7月16日 缓存
This commit is contained in:
@@ -204,6 +204,14 @@ void CounterVarSet::applyUIPara(){
|
|||||||
|
|
||||||
sysPara->devOp->writeFpgaCalandar(0);
|
sysPara->devOp->writeFpgaCalandar(0);
|
||||||
|
|
||||||
|
// unsigned int flags = 0;
|
||||||
|
// if(sysPara->status.cnt1CurrentValueInitDoneFlag)
|
||||||
|
// flags = 1 << 2;
|
||||||
|
|
||||||
|
// if(sysPara->status.cnt2CurrentValueInitDoneFlag)
|
||||||
|
// flags |= 1 << 3;
|
||||||
|
|
||||||
|
// sysPara->devOp->clearProductCnt(flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,6 +236,9 @@ void CounterVarSet::updateSysParaToUI(){
|
|||||||
|
|
||||||
ui->eleCNT2IncEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x20)?1:0);
|
ui->eleCNT2IncEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x20)?1:0);
|
||||||
// ui->radCNT2ResetEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x20)?0:1);
|
// ui->radCNT2ResetEn->setChecked( (sysPara->para.eleEyeClearCntInSynMode & 0x20)?0:1);
|
||||||
|
|
||||||
|
ui->checkBoxResetCnt1CurrValue->setChecked(false);
|
||||||
|
ui->checkBoxResetCnt2CurrValue->setChecked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2562,8 +2562,8 @@ int DevOp::writeFpgaPrintPara(bool ignoreWarn){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(sysPara->status.build_dat.builTime == 73){
|
else if(sysPara->status.build_dat.builTime == 73){
|
||||||
writeDacValue2Fpga_No73();
|
|
||||||
if(sysPara->status.currVoltageVersion != sysPara->status.lastVoltageVersion){
|
if(sysPara->status.currVoltageVersion != sysPara->status.lastVoltageVersion){
|
||||||
|
writeDacValue2Fpga_No73();
|
||||||
sysPara->status.lastVoltageVersion = sysPara->status.currVoltageVersion;
|
sysPara->status.lastVoltageVersion = sysPara->status.currVoltageVersion;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3226,11 +3226,11 @@ void DevOp::writeFpgaCalandar(bool Enable){
|
|||||||
step = 1;
|
step = 1;
|
||||||
step = step < 0?(100000000 + step):step;
|
step = step < 0?(100000000 + step):step;
|
||||||
sysPara->para.calandar_and_dat.cnt2Step = QString::number(step).toUInt(0,16);
|
sysPara->para.calandar_and_dat.cnt2Step = QString::number(step).toUInt(0,16);
|
||||||
|
// 与vx5相反,调换过值位置,比如0:4改为4:0
|
||||||
sysPara->para.calandar_and_dat.cntCurrValueInitEnable =
|
sysPara->para.calandar_and_dat.cntCurrValueInitEnable =
|
||||||
(sysPara->status.cnt3CurrentValueInitDoneFlag?0:4)+
|
(sysPara->status.cnt3CurrentValueInitDoneFlag?4:0)+
|
||||||
(sysPara->status.cnt2CurrentValueInitDoneFlag?0:2)
|
(sysPara->status.cnt2CurrentValueInitDoneFlag?2:0)
|
||||||
+ (sysPara->status.cnt1CurrentValueInitDoneFlag?0:1);
|
+ (sysPara->status.cnt1CurrentValueInitDoneFlag?1:0);
|
||||||
|
|
||||||
fpgaWr(WRITE_CALENDAR_DAT_ADDR,(unsigned char *)&sysPara->para.calandar_and_dat,sizeof(sysPara->para.calandar_and_dat));
|
fpgaWr(WRITE_CALENDAR_DAT_ADDR,(unsigned char *)&sysPara->para.calandar_and_dat,sizeof(sysPara->para.calandar_and_dat));
|
||||||
|
|
||||||
@@ -3248,9 +3248,9 @@ void DevOp::writeFpgaCalandar(bool Enable){
|
|||||||
sysPara->para.Counter4.cnt4CurrValue= QString::number(sysPara->para.cnt4CurrValue).toUInt(0,16); //计数器4当前值用于隐藏功能
|
sysPara->para.Counter4.cnt4CurrValue= QString::number(sysPara->para.cnt4CurrValue).toUInt(0,16); //计数器4当前值用于隐藏功能
|
||||||
fpgaWr(WRITE_COUNTER4_ADDR,(unsigned char *)&sysPara->para.Counter4,sizeof(sysPara->para.Counter4));
|
fpgaWr(WRITE_COUNTER4_ADDR,(unsigned char *)&sysPara->para.Counter4,sizeof(sysPara->para.Counter4));
|
||||||
|
|
||||||
sysPara->status.cnt3CurrentValueInitDoneFlag = true;
|
sysPara->status.cnt3CurrentValueInitDoneFlag = false;
|
||||||
sysPara->status.cnt2CurrentValueInitDoneFlag = true;
|
sysPara->status.cnt2CurrentValueInitDoneFlag = false;
|
||||||
sysPara->status.cnt1CurrentValueInitDoneFlag = true;
|
sysPara->status.cnt1CurrentValueInitDoneFlag = false;
|
||||||
}
|
}
|
||||||
unsigned char dataOfvariNum[1];
|
unsigned char dataOfvariNum[1];
|
||||||
unsigned char dataOfreg_var_print_ctrl[8][8];
|
unsigned char dataOfreg_var_print_ctrl[8][8];
|
||||||
@@ -3644,7 +3644,7 @@ void DevOp::writeSyncAndDelayPrintCount(bool enb, uint32_t maxCount)
|
|||||||
buffer[3] = (maxCount >> 16) & 0xFF;
|
buffer[3] = (maxCount >> 16) & 0xFF;
|
||||||
buffer[4] = (maxCount >> 24) & 0xFF;
|
buffer[4] = (maxCount >> 24) & 0xFF;
|
||||||
|
|
||||||
fpgaWr(MAX_REPEAT_COUNT_DELAY_SYNC, &buffer, sizeof(buffer));
|
fpgaWr(MAX_REPEAT_COUNT_DELAY_SYNC, buffer, sizeof(buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DevOp::resendSTM32Date(int cmd, int addr, unsigned char *dat, int len, int type)
|
void DevOp::resendSTM32Date(int cmd, int addr, unsigned char *dat, int len, int type)
|
||||||
|
|||||||
+2
-1
@@ -32,7 +32,8 @@ DialogSaveFile::DialogSaveFile(QWidget *parent) :
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogSaveFile::refreshListView(int mode){
|
void DialogSaveFile::refreshListView(int mode)
|
||||||
|
{
|
||||||
|
|
||||||
QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_DOC_ROOT_DIR;
|
QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_DOC_ROOT_DIR;
|
||||||
QDir dir(dirPath);
|
QDir dir(dirPath);
|
||||||
|
|||||||
+79
-22
@@ -5,9 +5,10 @@
|
|||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
|
||||||
DigitalInput::DigitalInput(MyInputMethod *myInputMethod,QWidget *parent) :
|
DigitalInput::DigitalInput(MyInputMethod *myInputMethod,QWidget *parent) :
|
||||||
QWidget(parent,(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool|Qt::WindowDoesNotAcceptFocus|Qt::BypassWindowManagerHint)),
|
QWidget(parent,(Qt::FramelessWindowHint )),
|
||||||
ui(new Ui::DigitalInput)
|
ui(new Ui::DigitalInput)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@@ -31,6 +32,14 @@ DigitalInput::DigitalInput(MyInputMethod *myInputMethod,QWidget *parent) :
|
|||||||
|
|
||||||
connect(ui->enterBtn, &QPushButton::clicked, this, &DigitalInput::onEnterPressed);
|
connect(ui->enterBtn, &QPushButton::clicked, this, &DigitalInput::onEnterPressed);
|
||||||
connect(ui->clrBtn, &QPushButton::clicked, this, &DigitalInput::onClrPressed);
|
connect(ui->clrBtn, &QPushButton::clicked, this, &DigitalInput::onClrPressed);
|
||||||
|
|
||||||
|
// 所有键盘按钮不接收焦点,避免点击按钮时 traceEdit 丢失焦点
|
||||||
|
QList<QPushButton*> btns = findChildren<QPushButton*>();
|
||||||
|
for (QPushButton* btn : btns) {
|
||||||
|
btn->setFocusPolicy(Qt::NoFocus);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->traceEdit->setFocusPolicy(Qt::StrongFocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
DigitalInput::~DigitalInput()
|
DigitalInput::~DigitalInput()
|
||||||
@@ -41,21 +50,52 @@ DigitalInput::~DigitalInput()
|
|||||||
|
|
||||||
void DigitalInput::onCharPressed(){
|
void DigitalInput::onCharPressed(){
|
||||||
QPushButton * button = qobject_cast<QPushButton *>(sender());
|
QPushButton * button = qobject_cast<QPushButton *>(sender());
|
||||||
QString text = button->text();
|
QString ch = button->text();
|
||||||
myInputMethod->sendString (text);
|
|
||||||
|
if (!m_currSpinBox) {
|
||||||
|
ui->traceEdit->insert(ch);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cursorPos = ui->traceEdit->cursorPosition();
|
||||||
|
QString currentText = ui->traceEdit->text();
|
||||||
|
QString newText = currentText.left(cursorPos) + ch + currentText.mid(cursorPos);
|
||||||
|
|
||||||
|
if (newText.isEmpty()) {
|
||||||
|
ui->traceEdit->insert(ch);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ok = false;
|
||||||
|
int value = newText.toInt(&ok);
|
||||||
|
if (!ok) {
|
||||||
|
ui->traceEdit->insert(ch);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int max = m_currSpinBox->maximum();
|
||||||
|
if (value <= max) {
|
||||||
|
ui->traceEdit->insert(ch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DigitalInput::onKeyBackspacePressed(){
|
void DigitalInput::onKeyBackspacePressed(){
|
||||||
|
|
||||||
if(m_currSpinBox && QString::number(m_currSpinBox->value()).size() == 1) {
|
// if(m_currSpinBox && QString::number(m_currSpinBox->value()).size() == 1) {
|
||||||
ui->traceEdit->clear();
|
// ui->traceEdit->clear();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #ifndef Q_OS_WIN32
|
||||||
|
// //QWSServer::sendKeyEvent(0,Qt::Key_Backspace,Qt::NoModifier,true,false); //锟斤拷系统锟斤拷锟酵硷拷锟斤拷锟铰硷拷
|
||||||
|
// MyInputMethod::sendEvent(Qt::Key_Backspace,Qt::NoModifier);
|
||||||
|
// #endif
|
||||||
|
int cursorPos = ui->traceEdit->cursorPosition();
|
||||||
|
if (cursorPos > 0) {
|
||||||
|
QString text = ui->traceEdit->text();
|
||||||
|
text.remove(cursorPos - 1, 1);
|
||||||
|
ui->traceEdit->setText(text);
|
||||||
|
ui->traceEdit->setCursorPosition(cursorPos - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef Q_OS_WIN32
|
|
||||||
//QWSServer::sendKeyEvent(0,Qt::Key_Backspace,Qt::NoModifier,true,false); //锟斤拷系统锟斤拷锟酵硷拷锟斤拷锟铰硷拷
|
|
||||||
MyInputMethod::sendEvent(Qt::Key_Backspace,Qt::NoModifier);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DigitalInput::onKeySelectAllPressed(){
|
void DigitalInput::onKeySelectAllPressed(){
|
||||||
@@ -85,16 +125,19 @@ void DigitalInput::onKeyDownPressed(){
|
|||||||
|
|
||||||
void DigitalInput::onEnterPressed()
|
void DigitalInput::onEnterPressed()
|
||||||
{
|
{
|
||||||
if(m_currSpinBox) {
|
hide();
|
||||||
m_currSpinBox->clearFocus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DigitalInput::onClrPressed()
|
void DigitalInput::onClrPressed()
|
||||||
{
|
{
|
||||||
if(m_currSpinBox) {
|
// if(m_currSpinBox) {
|
||||||
m_currSpinBox->setValue(std::min(m_currSpinBox->maximum(), std::max(m_currSpinBox->minimum(), 0)));
|
// m_currSpinBox->setValue(std::min(m_currSpinBox->maximum(), std::max(m_currSpinBox->minimum(), 0)));
|
||||||
}
|
// ui->traceEdit->setText(m_currSpinBox->value());
|
||||||
|
// // ui->traceEdit->setFocus();
|
||||||
|
// }
|
||||||
|
|
||||||
|
ui->traceEdit->clear();
|
||||||
|
ui->traceEdit->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DigitalInput::showEvent(QShowEvent *event)
|
void DigitalInput::showEvent(QShowEvent *event)
|
||||||
@@ -104,15 +147,29 @@ void DigitalInput::showEvent(QShowEvent *event)
|
|||||||
QSpinBox* box = dynamic_cast<QSpinBox*>(focusWidget);
|
QSpinBox* box = dynamic_cast<QSpinBox*>(focusWidget);
|
||||||
if(!box) {
|
if(!box) {
|
||||||
qWarning() << "focusWidget is not QSpinBox";
|
qWarning() << "focusWidget is not QSpinBox";
|
||||||
|
m_currSpinBox = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_currSpinBox) {
|
|
||||||
disconnect(m_currSpinBox, QOverload<const QString&>::of(&QSpinBox::valueChanged), ui->traceEdit, &QLineEdit::setText);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_currSpinBox = box;
|
m_currSpinBox = box;
|
||||||
ui->traceEdit->setText(box->text());
|
ui->traceEdit->setText(box->text());
|
||||||
connect(box, QOverload<const QString&>::of(&QSpinBox::valueChanged), ui->traceEdit, &QLineEdit::setText);
|
// focusWidget->clearFocus();
|
||||||
|
ui->traceEdit->setFocus();
|
||||||
|
|
||||||
|
// connect(box, QOverload<const QString&>::of(&QSpinBox::valueChanged), ui->traceEdit, &QLineEdit::setText);
|
||||||
qDebug() << "The traceEdit has connected to the QSpinBox: " << box->objectName();
|
qDebug() << "The traceEdit has connected to the QSpinBox: " << box->objectName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DigitalInput::hideEvent(QHideEvent * event)
|
||||||
|
{
|
||||||
|
QWidget::hideEvent(event);
|
||||||
|
|
||||||
|
if(m_currSpinBox) {
|
||||||
|
int value = ui->traceEdit->text().toInt();
|
||||||
|
int min = m_currSpinBox->minimum();
|
||||||
|
int max = m_currSpinBox->maximum();
|
||||||
|
value = qBound(min, value, max);
|
||||||
|
m_currSpinBox->setValue(value);
|
||||||
|
m_currSpinBox->clearFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,6 +29,7 @@ private slots:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void showEvent(QShowEvent* event) override;
|
virtual void showEvent(QShowEvent* event) override;
|
||||||
|
void hideEvent(QHideEvent* event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::DigitalInput *ui;
|
Ui::DigitalInput *ui;
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#include "DlgCanvasHeightEditor.h"
|
||||||
|
#include "ui_DlgCanvasHeightEditor.h"
|
||||||
|
|
||||||
|
DlgCanvasHeightEditor::DlgCanvasHeightEditor(QWidget *parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
ui(new Ui::DlgCanvasHeightEditor)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
DlgCanvasHeightEditor::~DlgCanvasHeightEditor()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlgCanvasHeightEditor::setCanvsHeight(unsigned h)
|
||||||
|
{
|
||||||
|
ui->sbCanvasHeight->setValue(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned DlgCanvasHeightEditor::canvasHeight() const
|
||||||
|
{
|
||||||
|
return ui->sbCanvasHeight->value();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#ifndef DLGCANVASHEIGHTEDITOR_H
|
||||||
|
#define DLGCANVASHEIGHTEDITOR_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class DlgCanvasHeightEditor;
|
||||||
|
}
|
||||||
|
|
||||||
|
class DlgCanvasHeightEditor : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit DlgCanvasHeightEditor(QWidget *parent = nullptr);
|
||||||
|
~DlgCanvasHeightEditor();
|
||||||
|
|
||||||
|
void setCanvsHeight(unsigned h);
|
||||||
|
|
||||||
|
unsigned canvasHeight() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::DlgCanvasHeightEditor *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGCANVASHEIGHTEDITOR_H
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>DlgCanvasHeightEditor</class>
|
||||||
|
<widget class="QDialog" name="DlgCanvasHeightEditor">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>340</width>
|
||||||
|
<height>226</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>窗口点阵设置</string>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QPushButton#closeBtn, QPushButton#checkBtn{
|
||||||
|
background-color: #E6F7FF;
|
||||||
|
border: 1px solid #87CEEB;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: #228B22;
|
||||||
|
}
|
||||||
|
QPushButton#closeBtn:hover,QPushButton#checkBtn:hover{
|
||||||
|
background-color: #D1E9FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#closeBtn:pressed,QPushButton#checkBtn:pressed{
|
||||||
|
background-color: #BAE7FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton {
|
||||||
|
background-color: #5396C1;
|
||||||
|
color: #ffffff;
|
||||||
|
border: 1px solid #000000;
|
||||||
|
border-radius: 3px;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight:500;
|
||||||
|
width: 180px;
|
||||||
|
height: 90px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:hover {
|
||||||
|
background-color: #5396C1;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:disabled {
|
||||||
|
background-color: #7C828E;
|
||||||
|
color: #606060;
|
||||||
|
border-color: #808080;
|
||||||
|
}
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QPushButton" name="closeBtn">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>220</x>
|
||||||
|
<y>170</y>
|
||||||
|
<width>100</width>
|
||||||
|
<height>40</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>✕</string>
|
||||||
|
</property>
|
||||||
|
<property name="fixedSize" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>80</width>
|
||||||
|
<height>80</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="checkBtn">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>100</x>
|
||||||
|
<y>170</y>
|
||||||
|
<width>101</width>
|
||||||
|
<height>40</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>✓</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QSpinBox" name="sbCanvasHeight">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>70</y>
|
||||||
|
<width>221</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="buttonSymbols">
|
||||||
|
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>24</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>32</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>32</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>30</y>
|
||||||
|
<width>211</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>点阵高度</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>checkBtn</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>DlgCanvasHeightEditor</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>141</x>
|
||||||
|
<y>196</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>141</x>
|
||||||
|
<y>281</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>closeBtn</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>DlgCanvasHeightEditor</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>275</x>
|
||||||
|
<y>189</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>297</x>
|
||||||
|
<y>304</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
||||||
+106
-32
@@ -113,6 +113,29 @@ void InkJetPrinter::init()
|
|||||||
// TestPrintWidget::sendButtonClickedSignal(16) 转由 openDatetimeEditor 处理
|
// TestPrintWidget::sendButtonClickedSignal(16) 转由 openDatetimeEditor 处理
|
||||||
connect(m_TestPrintWidget, &TestPrintWidget::sig_showEditDateTime, this, &InkJetPrinter::openDatetimeEditor);
|
connect(m_TestPrintWidget, &TestPrintWidget::sig_showEditDateTime, this, &InkJetPrinter::openDatetimeEditor);
|
||||||
connect(m_TestPrintWidget, &TestPrintWidget::sig_updatePrintContent, this, &InkJetPrinter::slt_updatePrintContent);
|
connect(m_TestPrintWidget, &TestPrintWidget::sig_updatePrintContent, this, &InkJetPrinter::slt_updatePrintContent);
|
||||||
|
|
||||||
|
#ifndef FPGA_TEST
|
||||||
|
// 调入文件喷印时,主动重启打印
|
||||||
|
connect(m_TestPrintWidget, &TestPrintWidget::sig_stopPrint, m_MainWidget, [this](){
|
||||||
|
auto isPrinting = sysPara->status.isPrinting;
|
||||||
|
if(isPrinting) {
|
||||||
|
m_MainWidget->on_m_StopBtn_clicked();
|
||||||
|
|
||||||
|
QTimer::singleShot(500, [this](){
|
||||||
|
|
||||||
|
m_PrintSetting->applyPrintSettingsToSysPara(false);
|
||||||
|
|
||||||
|
m_MainWidget->on_m_StartBtn_clicked();
|
||||||
|
LogInfo::setRunStatusText("Restarting the print because the work file was switched.");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
QTimer::singleShot(300, [this](){
|
||||||
|
m_PrintSetting->applyPrintSettingsToSysPara(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
#endif
|
||||||
|
|
||||||
// 班时元素与编辑 连接
|
// 班时元素与编辑 连接
|
||||||
connect(m_TestPrintWidget, &TestPrintWidget::sig_showScheduleShiftsEditor, this, &InkJetPrinter::showScheduleShiftsEditor);
|
connect(m_TestPrintWidget, &TestPrintWidget::sig_showScheduleShiftsEditor, this, &InkJetPrinter::showScheduleShiftsEditor);
|
||||||
@@ -985,7 +1008,8 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// byons: 时间类型图元更新 @2026年4月11日
|
// byons: 时间类型图元更新 @2026年4月11日
|
||||||
if (m_MainWidget->dateTimeItemsDotUpdate()) {
|
auto updateArea = m_MainWidget->variableItemsUpdate();
|
||||||
|
if (!updateArea.isNull()) {
|
||||||
// // 统计追踪更新频率
|
// // 统计追踪更新频率
|
||||||
// static QElapsedTimer bnsTimer;
|
// static QElapsedTimer bnsTimer;
|
||||||
// static int toogleCount = 0;
|
// static int toogleCount = 0;
|
||||||
@@ -997,7 +1021,7 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
if(sysPara->status.isPrinting) {
|
if(sysPara->status.isPrinting) {
|
||||||
m_MainWidget->SendPrintDataToFpga(0, true);
|
m_MainWidget->SendPrintDataToFpga(0, updateArea.left(), updateArea.width());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_StackedWidget->currentWidget() == m_MainWidget) {
|
if(m_StackedWidget->currentWidget() == m_MainWidget) {
|
||||||
@@ -1013,11 +1037,14 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
if(gearPumpRunFlag || sysPara->para.gearPumpEnable == 0)
|
if(gearPumpRunFlag || sysPara->para.gearPumpEnable == 0)
|
||||||
{
|
{
|
||||||
if(!sysPara->status.selfCheckDone && sysPara->status.isPrinting){
|
if(!sysPara->status.selfCheckDone && sysPara->status.isPrinting){
|
||||||
sysPara->status.selfCheckDone = true;
|
// sysPara->status.selfCheckDone = true;
|
||||||
m_MainWidget->updatePrintDisplayLabel();
|
m_MainWidget->updatePrintDisplayLabel();
|
||||||
// sysPara->status.flagOfAbnormalStatus = true;
|
// sysPara->status.flagOfAbnormalStatus = true;
|
||||||
qDebug()<<"打印过程中死机了!!!";
|
qDebug()<<"打印过程中死机了!!!";
|
||||||
|
|
||||||
|
m_MainWidget->on_m_StopBtn_clicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!sysPara->status.selfCheckDone)
|
if(!sysPara->status.selfCheckDone)
|
||||||
{
|
{
|
||||||
/*开机自检*/
|
/*开机自检*/
|
||||||
@@ -1075,19 +1102,20 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
|
|
||||||
// 自检结束发送打印设置
|
// 自检结束发送打印设置
|
||||||
qInfo() << "Self check done and send print para to FPGA";
|
qInfo() << "Self check done and send print para to FPGA";
|
||||||
sysPara->devOp->setHighVoltageAmplitudetoSTM32();
|
// sysPara->devOp->setHighVoltageAmplitudetoSTM32();
|
||||||
sysPara->devOp->writeFpgaCalandar(0);
|
// sysPara->devOp->writeFpgaCalandar(0);
|
||||||
sysPara->devOp->writeFpgaPrintPara(true);
|
// sysPara->devOp->writeFpgaPrintPara(true);
|
||||||
|
|
||||||
#ifdef __RFID_CARD
|
// 自检完成后,关闭高电压,不知道为什么,有时候开机自检都有高压
|
||||||
// 刷卡判定
|
sysPara->devOp->highVoltageCtrl(0);
|
||||||
if(sysPara->RFIDPara.inkCardTimeOut
|
|
||||||
|| sysPara->RFIDPara.solventCardTimeOut
|
// 自检完成后,写入一遍打印设置和内容,不然好像直接开始打印不行
|
||||||
|| sysPara->RFIDPara.needMaintenance) {
|
if(m_PrintSetting)
|
||||||
m_MainWidget->setReclaimOpenBtnStatus(false);
|
m_PrintSetting->applyPrintSettingsToSysPara(false);
|
||||||
LogInfo::setRunStatusText(tr("Need maintenance."));
|
|
||||||
}
|
m_MainWidget->SendPrintDataToFpga(0);
|
||||||
#endif
|
|
||||||
|
m_MainWidget->on_m_StopBtn_clicked();
|
||||||
|
|
||||||
if(sysPara->para.Reciclar)
|
if(sysPara->para.Reciclar)
|
||||||
test_flag = 1;
|
test_flag = 1;
|
||||||
@@ -1172,7 +1200,8 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
if(pulse_300ms){
|
if(pulse_300ms){
|
||||||
sysPara->devOp->readCalandarDat(); //务必读一下此数据
|
sysPara->devOp->readCalandarDat(); //务必读一下此数据
|
||||||
|
|
||||||
if(sysPara->status.RandomNum>0)
|
if(sysPara->status.RandomNum>0)
|
||||||
sysPara->devOp->Read_RanddomFromFpga();
|
sysPara->devOp->Read_RanddomFromFpga();
|
||||||
#ifdef COUNTER1_BY_GROUP /* 分段计米 */
|
#ifdef COUNTER1_BY_GROUP /* 分段计米 */
|
||||||
@@ -1291,6 +1320,7 @@ void InkJetPrinter::timerHandler(void){
|
|||||||
// warningHandler(3);
|
// warningHandler(3);
|
||||||
// }
|
// }
|
||||||
// LogInfo::setRunStatusText(tr("处理警告:%1").arg(QDateTime::currentDateTime()));
|
// LogInfo::setRunStatusText(tr("处理警告:%1").arg(QDateTime::currentDateTime()));
|
||||||
|
|
||||||
handleWarnInk(); // 处理墨水警告
|
handleWarnInk(); // 处理墨水警告
|
||||||
handleWarnSolvent(); // 处理溶剂警告
|
handleWarnSolvent(); // 处理溶剂警告
|
||||||
#endif
|
#endif
|
||||||
@@ -1495,6 +1525,7 @@ void InkJetPrinter::getTestPrintWidgetButtonClickedSlot(int index)
|
|||||||
m_StackedWidget->setCurrentWidget(m_MainWidget);
|
m_StackedWidget->setCurrentWidget(m_MainWidget);
|
||||||
MySleep(200);
|
MySleep(200);
|
||||||
m_MainWidget->onPreviewScene();
|
m_MainWidget->onPreviewScene();
|
||||||
|
m_MainWidget->SendPrintDataToFpga(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1852,6 +1883,13 @@ void InkJetPrinter::saveFPGACalandarAndDat(unsigned char *data){
|
|||||||
for(int i=0;i<len;i++){
|
for(int i=0;i<len;i++){
|
||||||
target[i]=data[7+i];
|
target[i]=data[7+i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString hexStr = QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue, 16);
|
||||||
|
bool ok;
|
||||||
|
sysPara->para.cnt1CurrValue = hexStr.toUInt(&ok, 10);
|
||||||
|
|
||||||
|
hexStr = QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue, 16);
|
||||||
|
sysPara->para.cnt2CurrValue = hexStr.toUInt(&ok, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InkJetPrinter::saveFPGACnt3CurrValue(unsigned char *data){
|
void InkJetPrinter::saveFPGACnt3CurrValue(unsigned char *data){
|
||||||
@@ -2454,7 +2492,6 @@ void InkJetPrinter::autoControlHeater(){
|
|||||||
* 控制回收槽
|
* 控制回收槽
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
|
|
||||||
void InkJetPrinter::detectAndcontrolReclaimTank(){
|
void InkJetPrinter::detectAndcontrolReclaimTank(){
|
||||||
sysPara->status.currReclaimTankPos =10*sysPara->status.curr_reclaimTankTime;
|
sysPara->status.currReclaimTankPos =10*sysPara->status.curr_reclaimTankTime;
|
||||||
sysPara->status.reclaimTankBlockedAppending =0;
|
sysPara->status.reclaimTankBlockedAppending =0;
|
||||||
@@ -2471,6 +2508,7 @@ void InkJetPrinter::detectAndcontrolReclaimTank(){
|
|||||||
sysPara->devOp->controlReclaimTankOpen(false);
|
sysPara->devOp->controlReclaimTankOpen(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_MainWidget->stopFlashReclaimOpenBtn();
|
||||||
}
|
}
|
||||||
else if(sysPara->status.reclaimTankstatus == 5 )//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作
|
else if(sysPara->status.reclaimTankstatus == 5 )//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作
|
||||||
{
|
{
|
||||||
@@ -2480,7 +2518,10 @@ void InkJetPrinter::detectAndcontrolReclaimTank(){
|
|||||||
m_MainWidget->setRunStatus(tr("回收槽到头"));
|
m_MainWidget->setRunStatus(tr("回收槽到头"));
|
||||||
m_MainWidget->setReclaimStatus(true, 100);
|
m_MainWidget->setReclaimStatus(true, 100);
|
||||||
m_MainWidget->enablePrintButton(true); //仅仅在此时能使能打印按钮
|
m_MainWidget->enablePrintButton(true); //仅仅在此时能使能打印按钮
|
||||||
sysPara->devOp->highVoltageCtrl(1);
|
// sysPara->devOp->highVoltageCtrl(1);
|
||||||
|
|
||||||
|
m_MainWidget->stopFlashReclaimOpenBtn();
|
||||||
|
|
||||||
// emit reclaimTankOpenDone();
|
// emit reclaimTankOpenDone();
|
||||||
/*回收槽开关时间校正*/
|
/*回收槽开关时间校正*/
|
||||||
sysPara->para.reclaimTankTime =( sysPara->status.currReclaimTankPos>120 )? sysPara->status.currReclaimTankPos/10-1:12;
|
sysPara->para.reclaimTankTime =( sysPara->status.currReclaimTankPos>120 )? sysPara->status.currReclaimTankPos/10-1:12;
|
||||||
@@ -2494,13 +2535,21 @@ void InkJetPrinter::detectAndcontrolReclaimTank(){
|
|||||||
else if(sysPara->status.reclaimTankstatus == 0x11 )//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作
|
else if(sysPara->status.reclaimTankstatus == 0x11 )//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作
|
||||||
{
|
{
|
||||||
sysPara->devOp->controlReclaimTankOpen(false); //卡住,关闭
|
sysPara->devOp->controlReclaimTankOpen(false); //卡住,关闭
|
||||||
|
m_MainWidget->stopFlashReclaimOpenBtn();
|
||||||
// ui->tabMainWindow->setRunStatus(tr("回收槽卡住或者回收槽开关时间设置错误"));
|
// ui->tabMainWindow->setRunStatus(tr("回收槽卡住或者回收槽开关时间设置错误"));
|
||||||
}
|
}
|
||||||
else if(sysPara->status.reclaimTankstatus == 1 || sysPara->status.reclaimTankstatus == 2)//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作
|
else if(sysPara->status.reclaimTankstatus == 1 || sysPara->status.reclaimTankstatus == 2)//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作
|
||||||
{
|
{
|
||||||
auto recliamTime = (sysPara->para.reclaimTankTime != 0 ? sysPara->para.reclaimTankTime : 15.0f) * 10.0f;
|
auto recliamTime = (sysPara->para.reclaimTankTime != 0 ? sysPara->para.reclaimTankTime : 15.0f) * 10.0f;
|
||||||
int rate = qBound(0, 100, int((sysPara->status.currReclaimTankPos / recliamTime) * 100));
|
int rate = qBound(0, 100, int((sysPara->status.currReclaimTankPos / recliamTime) * 100));
|
||||||
m_MainWidget->setReclaimStatus(sysPara->status.reclaimTankstatus == 1, rate);
|
|
||||||
|
// 不知道为什么会有rate为0,且 sysPara->status.reclaimTankstatus == 2 ,也就是 关的状态。 回收槽位置在0处,而状态却是 关 ,很奇怪
|
||||||
|
if(sysPara->status.reclaimTankstatus != 2 && rate != 0) {
|
||||||
|
m_MainWidget->setReclaimStatus(sysPara->status.reclaimTankstatus == 1, rate);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_MainWidget->setReclaimOpenBtnStatus(sysPara->status.reclaimTankstatus == 2);
|
||||||
|
m_MainWidget->setReclaimCloseBtnStatus(sysPara->status.reclaimTankstatus == 1);
|
||||||
|
|
||||||
sysPara->status.reclaimBlockedCnt = 0;
|
sysPara->status.reclaimBlockedCnt = 0;
|
||||||
}
|
}
|
||||||
@@ -2509,14 +2558,13 @@ void InkJetPrinter::detectAndcontrolReclaimTank(){
|
|||||||
if(sysPara->devOp->isReclaimTankCloseEnable())
|
if(sysPara->devOp->isReclaimTankCloseEnable())
|
||||||
sysPara->devOp->controlReclaimTankClose(false); //到头,关闭
|
sysPara->devOp->controlReclaimTankClose(false); //到头,关闭
|
||||||
m_MainWidget->setReclaimStatus(false, 0);
|
m_MainWidget->setReclaimStatus(false, 0);
|
||||||
|
m_MainWidget->stopFlashReclaimOpenBtn();
|
||||||
//sysPara->status.currReclaimTankPos = 0; //将回收槽的时间置为零
|
//sysPara->status.currReclaimTankPos = 0; //将回收槽的时间置为零
|
||||||
// emit reclaimTankCloseDone();
|
// emit reclaimTankCloseDone();
|
||||||
sysPara->status.lastRecycleWarn = 0;
|
sysPara->status.lastRecycleWarn = 0;
|
||||||
sysPara->status.HVFaultCloseEn=0;
|
sysPara->status.HVFaultCloseEn=0;
|
||||||
sysPara->status.reclainCloseAppending=false;
|
sysPara->status.reclainCloseAppending=false;
|
||||||
sysPara->status.canRunAirPushing = true; //下次开回收槽就执行排气程序
|
sysPara->status.canRunAirPushing = true; //下次开回收槽就执行排气程序
|
||||||
|
|
||||||
LogInfo::setRunStatusText("reclaimTankCloseDone currReclaimTankPos:"+QString::number(sysPara->status.currReclaimTankPos));
|
|
||||||
}
|
}
|
||||||
else if(sysPara->status.reclaimTankstatus == 0x12 )//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作
|
else if(sysPara->status.reclaimTankstatus == 0x12 )//7 故障,6 关完成,5开完成,4 保持, 3 停止, 2 关, 1 开,0-无操作
|
||||||
{
|
{
|
||||||
@@ -2524,6 +2572,12 @@ void InkJetPrinter::detectAndcontrolReclaimTank(){
|
|||||||
LogInfo::setRunStatusText(tr("回收槽卡住或者回收槽开关时间设置错误"));
|
LogInfo::setRunStatusText(tr("回收槽卡住或者回收槽开关时间设置错误"));
|
||||||
m_MainWidget->setRunStatus(tr("回收槽卡住或者回收槽开关时间设置错误"));
|
m_MainWidget->setRunStatus(tr("回收槽卡住或者回收槽开关时间设置错误"));
|
||||||
}
|
}
|
||||||
|
else if(sysPara->status.reclaimTankstatus == 4 )
|
||||||
|
{
|
||||||
|
m_MainWidget->setReclaimOpenBtnStatus(true);
|
||||||
|
m_MainWidget->setReclaimCloseBtnStatus(true);
|
||||||
|
LogInfo::setRunStatusText("Reclaim tank hold on "+QString::number(sysPara->status.currReclaimTankPos));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InkJetPrinter::viscosity_timerHandler()
|
void InkJetPrinter::viscosity_timerHandler()
|
||||||
@@ -2562,7 +2616,7 @@ void InkJetPrinter::rebootApp()
|
|||||||
sysPara->devOp->controlInkValve(false);
|
sysPara->devOp->controlInkValve(false);
|
||||||
sysPara->devOp->controlInkValvePWM(false);
|
sysPara->devOp->controlInkValvePWM(false);
|
||||||
}
|
}
|
||||||
m_MainWidget->setRunStatus(tr("正在准备重启,请等待%1秒...............").arg(i));
|
m_MainWidget->setRunStatus(tr("正在准备重启,请等待%1秒......").arg(i));
|
||||||
MySleep(1000);
|
MySleep(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2595,7 +2649,7 @@ void InkJetPrinter::rebootApp()
|
|||||||
{
|
{
|
||||||
if(i==9)
|
if(i==9)
|
||||||
sysPara->devOp->controlReclaimTankOpen(false);
|
sysPara->devOp->controlReclaimTankOpen(false);
|
||||||
m_MainWidget->setRunStatus(tr("正在准备重启,请等待%1秒...............").arg(i));
|
m_MainWidget->setRunStatus(tr("正在准备重启,请等待%1秒......").arg(i));
|
||||||
MySleep(1000);
|
MySleep(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2621,7 +2675,7 @@ void InkJetPrinter::rebootApp()
|
|||||||
sysPara->para.gearPumpValue = 0;
|
sysPara->para.gearPumpValue = 0;
|
||||||
sysPara->devOp->WriteMoterPump();
|
sysPara->devOp->WriteMoterPump();
|
||||||
}
|
}
|
||||||
m_MainWidget->setRunStatus(tr("正在准备重启,请等待%1秒...............").arg(i));
|
m_MainWidget->setRunStatus(tr("正在准备重启,请等待%1秒......").arg(i));
|
||||||
MySleep(1000);
|
MySleep(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2719,11 +2773,12 @@ void InkJetPrinter::warningHandler(int type){
|
|||||||
if (!sysPara->RFIDPara.inkCardTimeOut)
|
if (!sysPara->RFIDPara.inkCardTimeOut)
|
||||||
inkTime = 48- dateTimeDiff/60/60;
|
inkTime = 48- dateTimeDiff/60/60;
|
||||||
}
|
}
|
||||||
if(sysPara->RFIDPara.inkCardTimeOut){
|
if(sysPara->RFIDPara.inkCardTimeOut && flagOfWarning){
|
||||||
if(++sysPara->status.showInkWarningNumber >= INTERVAL_AFTER48H){
|
if(++sysPara->status.showInkWarningNumber >= INTERVAL_AFTER48H){
|
||||||
warningShow(CARD_TYPE::INK,49);
|
warningShow(CARD_TYPE::INK,49);
|
||||||
sysPara->status.showInkWarningNumber = 0;//是否有必要保存?
|
sysPara->status.showInkWarningNumber = 0;//是否有必要保存?
|
||||||
sysPara->saveRFIDPara();
|
sysPara->saveRFIDPara();
|
||||||
|
flagOfWarning = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2736,18 +2791,21 @@ void InkJetPrinter::warningHandler(int type){
|
|||||||
if (dateTimeDiff > 60*60*24*2) {
|
if (dateTimeDiff > 60*60*24*2) {
|
||||||
sysPara->RFIDPara.solventCardTimeOut = true;
|
sysPara->RFIDPara.solventCardTimeOut = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sysPara->RFIDPara.solventCardTimeOut)
|
if (!sysPara->RFIDPara.solventCardTimeOut)
|
||||||
solventTime = 48- dateTimeDiff/60/60;
|
solventTime = 48- dateTimeDiff / 60 / 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sysPara->RFIDPara.solventCardTimeOut){
|
if(sysPara->RFIDPara.solventCardTimeOut && flagOfWarning){
|
||||||
if(++sysPara->status.showSolventWarningNumber >= INTERVAL_AFTER48H){
|
if(++sysPara->status.showSolventWarningNumber >= INTERVAL_AFTER48H){
|
||||||
warningShow(CARD_TYPE::SOLVENT,49);
|
warningShow(CARD_TYPE::SOLVENT,49);
|
||||||
sysPara->status.showSolventWarningNumber = 0;
|
sysPara->status.showSolventWarningNumber = 0;
|
||||||
sysPara->saveRFIDPara();
|
sysPara->saveRFIDPara();
|
||||||
|
flagOfWarning = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sysPara->saveRFIDPara();
|
sysPara->saveRFIDPara();
|
||||||
}
|
}
|
||||||
/***********处理保养到期提示start******************/
|
/***********处理保养到期提示start******************/
|
||||||
@@ -2856,6 +2914,7 @@ int InkJetPrinter::updateWarningTime(int type){
|
|||||||
// 读取文件内容
|
// 读取文件内容
|
||||||
QTextStream in(&file);
|
QTextStream in(&file);
|
||||||
QString starTime = in.readAll(); // 第一次提示的时间
|
QString starTime = in.readAll(); // 第一次提示的时间
|
||||||
|
starTime = starTime.trimmed();
|
||||||
// 关闭文件
|
// 关闭文件
|
||||||
file.close();
|
file.close();
|
||||||
inkWarnTime = QDateTime::fromString(starTime,"yyyy-MM-dd HH::mm::ss");
|
inkWarnTime = QDateTime::fromString(starTime,"yyyy-MM-dd HH::mm::ss");
|
||||||
@@ -2873,6 +2932,7 @@ int InkJetPrinter::updateWarningTime(int type){
|
|||||||
// 读取文件内容
|
// 读取文件内容
|
||||||
QTextStream in(&file);
|
QTextStream in(&file);
|
||||||
QString starTime = in.readAll(); // 第一次提示的时间
|
QString starTime = in.readAll(); // 第一次提示的时间
|
||||||
|
starTime = starTime.trimmed();
|
||||||
// 关闭文件
|
// 关闭文件
|
||||||
file.close();
|
file.close();
|
||||||
solventWarnTime = QDateTime::fromString(starTime,"yyyy-MM-dd HH::mm::ss");
|
solventWarnTime = QDateTime::fromString(starTime,"yyyy-MM-dd HH::mm::ss");
|
||||||
@@ -2968,7 +3028,6 @@ void InkJetPrinter::handleWarnInk()
|
|||||||
|
|
||||||
if(sysPara->status.inkWarningCnt >= DETECT_WARNING_TIME){
|
if(sysPara->status.inkWarningCnt >= DETECT_WARNING_TIME){
|
||||||
sysPara->para.flagOfInkWarning = true;
|
sysPara->para.flagOfInkWarning = true;
|
||||||
sysPara->RFIDPara.needInkCard = true;
|
|
||||||
manager_rfid->setInkCardFirstPrompt(true);
|
manager_rfid->setInkCardFirstPrompt(true);
|
||||||
QString strCurDateTime = QDateTime::currentDateTime().toString("yyMMddhhmmss");
|
QString strCurDateTime = QDateTime::currentDateTime().toString("yyMMddhhmmss");
|
||||||
LogInfo::setRunStatusText("Ink warning.");
|
LogInfo::setRunStatusText("Ink warning.");
|
||||||
@@ -3007,7 +3066,7 @@ void InkJetPrinter::handleWarnInk()
|
|||||||
QDateTime curDateTime = QDateTime::currentDateTime();
|
QDateTime curDateTime = QDateTime::currentDateTime();
|
||||||
QByteArray curDateTimestr = curDateTime.toString("yyyy-MM-dd HH::mm::ss").toUtf8();
|
QByteArray curDateTimestr = curDateTime.toString("yyyy-MM-dd HH::mm::ss").toUtf8();
|
||||||
QFile file("/home/plg/inkRFIDTime.txt");
|
QFile file("/home/plg/inkRFIDTime.txt");
|
||||||
if(!file.open(QIODevice::WriteOnly)){
|
if(!file.open(QIODevice::WriteOnly | QIODevice::Truncate)){
|
||||||
qDebug()<<"Open inkRFIDTime Failure.";
|
qDebug()<<"Open inkRFIDTime Failure.";
|
||||||
LogInfo::setRunStatusText("Open inkRFIDTime Failure.");
|
LogInfo::setRunStatusText("Open inkRFIDTime Failure.");
|
||||||
}
|
}
|
||||||
@@ -3046,7 +3105,6 @@ void InkJetPrinter::handleWarnSolvent()
|
|||||||
|
|
||||||
if(sysPara->status.solventWarningCnt >= DETECT_WARNING_TIME){
|
if(sysPara->status.solventWarningCnt >= DETECT_WARNING_TIME){
|
||||||
sysPara->para.flagOfSolventWarning = true;
|
sysPara->para.flagOfSolventWarning = true;
|
||||||
sysPara->RFIDPara.needSolventCard = true;
|
|
||||||
manager_rfid->setSolventCardFirstPrompt(true);
|
manager_rfid->setSolventCardFirstPrompt(true);
|
||||||
QDateTime curDateTime = QDateTime::currentDateTime();
|
QDateTime curDateTime = QDateTime::currentDateTime();
|
||||||
QString strCurDateTime = curDateTime.toString("yyMMddhhmmss");
|
QString strCurDateTime = curDateTime.toString("yyMMddhhmmss");
|
||||||
@@ -3084,7 +3142,7 @@ void InkJetPrinter::handleWarnSolvent()
|
|||||||
QDateTime curDateTime = QDateTime::currentDateTime();
|
QDateTime curDateTime = QDateTime::currentDateTime();
|
||||||
QByteArray curDateTimestr = curDateTime.toString("yyyy-MM-dd HH::mm::ss").toUtf8();
|
QByteArray curDateTimestr = curDateTime.toString("yyyy-MM-dd HH::mm::ss").toUtf8();
|
||||||
QFile file("/home/plg/solventRFIDTime.txt");
|
QFile file("/home/plg/solventRFIDTime.txt");
|
||||||
if(!file.open(QIODevice::WriteOnly)){
|
if(!file.open(QIODevice::WriteOnly | QIODevice::Truncate)){
|
||||||
qDebug()<<"Open solventRFIDTime Failure.";
|
qDebug()<<"Open solventRFIDTime Failure.";
|
||||||
LogInfo::setRunStatusText("Open solventRFIDTime Failure.");
|
LogInfo::setRunStatusText("Open solventRFIDTime Failure.");
|
||||||
}
|
}
|
||||||
@@ -3113,8 +3171,24 @@ void InkJetPrinter::handleWarnSolvent()
|
|||||||
|
|
||||||
void InkJetPrinter::slt_showMsg(QString msg)
|
void InkJetPrinter::slt_showMsg(QString msg)
|
||||||
{
|
{
|
||||||
|
static QList<QMessageBox*> msgPool;
|
||||||
|
|
||||||
QMessageBox * msgBox = new QMessageBox(QMessageBox::NoIcon, tr("提示"), msg, QMessageBox::StandardButton::Ok);
|
QMessageBox * msgBox = new QMessageBox(QMessageBox::NoIcon, tr("提示"), msg, QMessageBox::StandardButton::Ok);
|
||||||
connect(msgBox, &QMessageBox::finished, msgBox, &QMessageBox::deleteLater);
|
msgPool.push_back(msgBox);
|
||||||
|
connect(msgBox, &QMessageBox::finished, [this, msgBox, &msgPool](){
|
||||||
|
auto idx = msgPool.lastIndexOf(msgBox);
|
||||||
|
if(idx != -1) {
|
||||||
|
msgPool.removeAt(idx);
|
||||||
|
}
|
||||||
|
|
||||||
|
msgBox->deleteLater();
|
||||||
|
});
|
||||||
|
|
||||||
msgBox->show();
|
msgBox->show();
|
||||||
|
|
||||||
|
if(msgPool.size() > 3) {
|
||||||
|
msgPool.takeFirst()->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
LogInfo::setRunStatusText(msg);
|
LogInfo::setRunStatusText(msg);
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-1
@@ -4,6 +4,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "DlgRFIDConfig.h"
|
#include "DlgRFIDConfig.h"
|
||||||
#include "runtimectrl.h"
|
#include "runtimectrl.h"
|
||||||
|
#include "DlgCanvasHeightEditor.h"
|
||||||
|
|
||||||
MainInstruction::MainInstruction(QWidget *parent) :
|
MainInstruction::MainInstruction(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
@@ -26,6 +27,7 @@ MainInstruction::MainInstruction(QWidget *parent) :
|
|||||||
dlgInputAddr = new DlgInputAddr(parent);
|
dlgInputAddr = new DlgInputAddr(parent);
|
||||||
dialogAuthorization = new DialogAuthorization(parent);
|
dialogAuthorization = new DialogAuthorization(parent);
|
||||||
dlgRfidConfig = new DlgRFIDConfig(this);
|
dlgRfidConfig = new DlgRFIDConfig(this);
|
||||||
|
dlgRfidConfig->setWindowTitle(tr("RFID Settings"));
|
||||||
|
|
||||||
connect(dlgRfidConfig, &DlgRFIDConfig::accepted, this, &MainInstruction::onRFIDAutoConfirmTimeoutChanged);
|
connect(dlgRfidConfig, &DlgRFIDConfig::accepted, this, &MainInstruction::onRFIDAutoConfirmTimeoutChanged);
|
||||||
|
|
||||||
@@ -57,6 +59,17 @@ MainInstruction::MainInstruction(QWidget *parent) :
|
|||||||
connect(&timeDia,SIGNAL(accepted()),this,SLOT(slt_timeSetting()));
|
connect(&timeDia,SIGNAL(accepted()),this,SLOT(slt_timeSetting()));
|
||||||
|
|
||||||
ui->btn_network->hide();
|
ui->btn_network->hide();
|
||||||
|
|
||||||
|
dlgCanvasHeightEditor = new DlgCanvasHeightEditor(this);
|
||||||
|
dlgCanvasHeightEditor->setWindowModality(Qt::WindowModality::WindowModal);
|
||||||
|
connect(dlgCanvasHeightEditor, &QDialog::accepted, this, [this](){
|
||||||
|
if(!sysPara)
|
||||||
|
return;
|
||||||
|
|
||||||
|
sysPara->para.canvasHeight = dlgCanvasHeightEditor->canvasHeight();
|
||||||
|
LogInfo::setRunStatusText(QString("Canvas Height: %1").arg(sysPara->para.canvasHeight));
|
||||||
|
sysPara->saveParaToFile();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
MainInstruction::~MainInstruction()
|
MainInstruction::~MainInstruction()
|
||||||
@@ -251,7 +264,7 @@ void MainInstruction::slt_timeSetting()
|
|||||||
void MainInstruction::onRfidCfgBtnClicked()
|
void MainInstruction::onRfidCfgBtnClicked()
|
||||||
{
|
{
|
||||||
dlgRfidConfig->setAutoConfirmTimeout(sysPara->para.rfidCountDown);
|
dlgRfidConfig->setAutoConfirmTimeout(sysPara->para.rfidCountDown);
|
||||||
dlgRfidConfig->setWindowModality(Qt::WindowModal);
|
dlgRfidConfig->setWindowModality(Qt::WindowModality::WindowModal);
|
||||||
dlgRfidConfig->show();
|
dlgRfidConfig->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,6 +275,14 @@ void MainInstruction::onRFIDAutoConfirmTimeoutChanged()
|
|||||||
sysPara->saveRFIDPara();
|
sysPara->saveRFIDPara();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainInstruction::onCanvasCfgBtnClicked()
|
||||||
|
{
|
||||||
|
if(sysPara)
|
||||||
|
dlgCanvasHeightEditor->setCanvsHeight(sysPara->para.canvasHeight);
|
||||||
|
|
||||||
|
dlgCanvasHeightEditor->show();
|
||||||
|
}
|
||||||
|
|
||||||
void MainInstruction::applyStyleSheet()
|
void MainInstruction::applyStyleSheet()
|
||||||
{
|
{
|
||||||
QString styleSheet =
|
QString styleSheet =
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "TimeSettingDialog.h"
|
#include "TimeSettingDialog.h"
|
||||||
|
|
||||||
class DlgRFIDConfig;
|
class DlgRFIDConfig;
|
||||||
|
class DlgCanvasHeightEditor;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class MainInstruction;
|
class MainInstruction;
|
||||||
@@ -55,6 +56,8 @@ private slots:
|
|||||||
|
|
||||||
void onRFIDAutoConfirmTimeoutChanged();
|
void onRFIDAutoConfirmTimeoutChanged();
|
||||||
|
|
||||||
|
void onCanvasCfgBtnClicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainInstruction *ui;
|
Ui::MainInstruction *ui;
|
||||||
SysPara* sysPara = nullptr;
|
SysPara* sysPara = nullptr;
|
||||||
@@ -65,6 +68,7 @@ private:
|
|||||||
DialogMaintenanceTimeSetting *MTimeSetting;
|
DialogMaintenanceTimeSetting *MTimeSetting;
|
||||||
DialogAuthorization *dialogAuthorization;
|
DialogAuthorization *dialogAuthorization;
|
||||||
DlgRFIDConfig *dlgRfidConfig = nullptr;
|
DlgRFIDConfig *dlgRfidConfig = nullptr;
|
||||||
|
DlgCanvasHeightEditor* dlgCanvasHeightEditor = nullptr;
|
||||||
|
|
||||||
// 时间设置
|
// 时间设置
|
||||||
TimeSettingDialog timeDia;
|
TimeSettingDialog timeDia;
|
||||||
|
|||||||
+37
-7
@@ -98,7 +98,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tabBasic">
|
<widget class="QWidget" name="tabBasic">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -291,13 +291,26 @@
|
|||||||
<string>其他设置</string>
|
<string>其他设置</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="canvaSizeCfgBtn">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>310</x>
|
||||||
|
<y>70</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">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>660</x>
|
<x>670</x>
|
||||||
<y>470</y>
|
<y>500</y>
|
||||||
<width>100</width>
|
<width>100</width>
|
||||||
<height>40</height>
|
<height>40</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -328,8 +341,8 @@
|
|||||||
<slot>onGraphicsEditBtnClicked()</slot>
|
<slot>onGraphicsEditBtnClicked()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
<x>230</x>
|
<x>232</x>
|
||||||
<y>196</y>
|
<y>195</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel">
|
<hint type="destinationlabel">
|
||||||
<x>-154</x>
|
<x>-154</x>
|
||||||
@@ -344,8 +357,8 @@
|
|||||||
<slot>onRfidCfgBtnClicked()</slot>
|
<slot>onRfidCfgBtnClicked()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
<x>137</x>
|
<x>139</x>
|
||||||
<y>94</y>
|
<y>115</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel">
|
<hint type="destinationlabel">
|
||||||
<x>-182</x>
|
<x>-182</x>
|
||||||
@@ -353,9 +366,26 @@
|
|||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>canvaSizeCfgBtn</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>MainInstruction</receiver>
|
||||||
|
<slot>onCanvasCfgBtnClicked()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>491</x>
|
||||||
|
<y>139</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>956</x>
|
||||||
|
<y>250</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
<slots>
|
<slots>
|
||||||
<slot>onGraphicsEditBtnClicked()</slot>
|
<slot>onGraphicsEditBtnClicked()</slot>
|
||||||
<slot>onRfidCfgBtnClicked()</slot>
|
<slot>onRfidCfgBtnClicked()</slot>
|
||||||
|
<slot>onCanvasCfgBtnClicked()</slot>
|
||||||
</slots>
|
</slots>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
+115
-28
@@ -217,7 +217,7 @@ QScrollBar::add-line:horizontal { bottom: 0px; }</string>
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>780</width>
|
<width>780</width>
|
||||||
<height>169</height>
|
<height>177</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -289,7 +289,7 @@ QScrollBar::add-line:horizontal { bottom: 0px; }</string>
|
|||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>200</width>
|
<width>200</width>
|
||||||
<height>0</height>
|
<height>130</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
@@ -473,7 +473,7 @@ QScrollBar::add-line:horizontal { bottom: 0px; }</string>
|
|||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>200</width>
|
<width>200</width>
|
||||||
<height>150</height>
|
<height>140</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
@@ -591,13 +591,13 @@ QScrollBar::add-line:horizontal { bottom: 0px; }</string>
|
|||||||
<widget class="QFrame" name="fra_state">
|
<widget class="QFrame" name="fra_state">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>200</width>
|
<width>214</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>200</width>
|
<width>214</width>
|
||||||
<height>140</height>
|
<height>140</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@@ -629,6 +629,18 @@ QScrollBar::add-line:horizontal { bottom: 0px; }</string>
|
|||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="lb_nozzleState">
|
<widget class="QLabel" name="lb_nozzleState">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>214</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>214</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -642,6 +654,12 @@ QScrollBar::add-line:horizontal { bottom: 0px; }</string>
|
|||||||
</item>
|
</item>
|
||||||
<item alignment="Qt::AlignRight">
|
<item alignment="Qt::AlignRight">
|
||||||
<widget class="QWidget" name="rightPanel" native="true">
|
<widget class="QWidget" name="rightPanel" native="true">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>156</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0">
|
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
@@ -649,6 +667,9 @@ QScrollBar::add-line:horizontal { bottom: 0px; }</string>
|
|||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
<item>
|
<item>
|
||||||
@@ -657,11 +678,14 @@ QScrollBar::add-line:horizontal { bottom: 0px; }</string>
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="m_RightBtn">
|
<widget class="QToolButton" name="m_RightBtn">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>150</width>
|
<width>0</width>
|
||||||
<height>95</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
@@ -671,10 +695,40 @@ QScrollBar::add-line:horizontal { bottom: 0px; }</string>
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true">QToolButton {
|
||||||
|
padding: 4px 16px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333333; /* 深灰文字,与蓝色图标协调 */
|
||||||
|
|
||||||
|
/* 中性色背景,略带渐变制造立体感 */
|
||||||
|
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||||
|
stop: 0 #eefaff,
|
||||||
|
stop: 1 #ceefff);
|
||||||
|
border: 1px solid #a1a1a1;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolButton:hover {
|
||||||
|
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||||
|
stop: 0 #F5F7FA,
|
||||||
|
stop: 1 #E8EBF0);
|
||||||
|
border-color: #B0B6BE;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolButton:pressed {
|
||||||
|
background-color: #D5D8DD;
|
||||||
|
border-color: #A8AEB6;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolButton:disabled {
|
||||||
|
color: #A0A5AB;
|
||||||
|
background-color: #BCBFC4;
|
||||||
|
border: 1px solid #BCBFC4;
|
||||||
|
}</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string>喷嘴开启</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="image.qrc">
|
<iconset resource="image.qrc">
|
||||||
@@ -686,11 +740,8 @@ QScrollBar::add-line:horizontal { bottom: 0px; }</string>
|
|||||||
<height>70</height>
|
<height>70</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="fixedSize" stdset="0">
|
<property name="toolButtonStyle">
|
||||||
<size>
|
<enum>Qt::ToolButtonIconOnly</enum>
|
||||||
<width>70</width>
|
|
||||||
<height>70</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -736,25 +787,64 @@ QScrollBar::add-line:horizontal { bottom: 0px; }</string>
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item alignment="Qt::AlignBottom">
|
||||||
<widget class="QPushButton" name="m_LeftBtn">
|
<widget class="QToolButton" name="m_LeftBtn">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>150</width>
|
<width>0</width>
|
||||||
<height>95</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>150</width>
|
<width>150</width>
|
||||||
<height>100</height>
|
<height>95</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true">QToolButton {
|
||||||
|
padding: 4px 16px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333333; /* 深灰文字,与蓝色图标协调 */
|
||||||
|
|
||||||
|
/* 中性色背景,略带渐变制造立体感 */
|
||||||
|
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||||
|
stop: 0 #eefaff,
|
||||||
|
stop: 1 #ceefff);
|
||||||
|
border: 1px solid #a1a1a1;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolButton:hover {
|
||||||
|
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||||
|
stop: 0 #F5F7FA,
|
||||||
|
stop: 1 #E8EBF0);
|
||||||
|
border-color: #B0B6BE;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolButton:pressed {
|
||||||
|
background-color: #D5D8DD;
|
||||||
|
border-color: #A8AEB6;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolButton:disabled {
|
||||||
|
color: #A0A5AB;
|
||||||
|
background-color: #BCBFC4;
|
||||||
|
border: 1px solid #BCBFC4;
|
||||||
|
}</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string>喷嘴关闭</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="image.qrc">
|
<iconset resource="image.qrc">
|
||||||
@@ -766,15 +856,12 @@ QScrollBar::add-line:horizontal { bottom: 0px; }</string>
|
|||||||
<height>70</height>
|
<height>70</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="fixedSize" stdset="0">
|
<property name="toolButtonStyle">
|
||||||
<size>
|
<enum>Qt::ToolButtonIconOnly</enum>
|
||||||
<width>70</width>
|
|
||||||
<height>70</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item alignment="Qt::AlignBottom">
|
||||||
<widget class="QLabel" name="lb_LeftBtn">
|
<widget class="QLabel" name="lb_LeftBtn">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
|
|||||||
+1
-1
@@ -157,7 +157,7 @@ void MyInputMethod::updateHandler ( int type ){
|
|||||||
break;
|
break;
|
||||||
case 2://QWSInputMethod::FocusOut:
|
case 2://QWSInputMethod::FocusOut:
|
||||||
inputMethod->hide();
|
inputMethod->hide();
|
||||||
digitalInput->hide();
|
// digitalInput->hide();
|
||||||
inputMethod->onHiden();
|
inputMethod->onHiden();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-6
@@ -223,7 +223,13 @@ void PrintSetting::TriggerupdateModelToUI()
|
|||||||
#endif
|
#endif
|
||||||
ui->spinBoxEleEyeTriggerIntervalMs->setValue(m_model.triggerInterval);
|
ui->spinBoxEleEyeTriggerIntervalMs->setValue(m_model.triggerInterval);
|
||||||
ui->spinBoxOutputPulseDelayMs->setValue(m_model.outputPulseDelayMs);
|
ui->spinBoxOutputPulseDelayMs->setValue(m_model.outputPulseDelayMs);
|
||||||
ui->spinBoxEleEyeTriggerRepeatCnt->setValue(m_model.eleEyeRepeatCnt);
|
|
||||||
|
if(m_model.eleEyeRepeatCnt > INT32_MAX){
|
||||||
|
ui->cb_unlimited->setChecked(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ui->spinBoxEleEyeTriggerRepeatCnt->setValue(m_model.eleEyeRepeatCnt);
|
||||||
|
}
|
||||||
|
|
||||||
ui->spinBoxSynTriggerPrintLen->setText(QString::number(m_model.triggerInterval));
|
ui->spinBoxSynTriggerPrintLen->setText(QString::number(m_model.triggerInterval));
|
||||||
ui->lineEditTriggerPulsePerMm->setText(QString::number((double)m_model.encoderPulsePerMm));
|
ui->lineEditTriggerPulsePerMm->setText(QString::number((double)m_model.encoderPulsePerMm));
|
||||||
@@ -586,10 +592,10 @@ void PrintSetting::setEnableEleEyeSetting(bool flag){
|
|||||||
ui->labelEleEyeTriggerIntervalMs->setEnabled(!(ui->radioButtonSynTriggerExternal->isChecked() && ui->eleEyeEdgetTriggerInner->isChecked()));
|
ui->labelEleEyeTriggerIntervalMs->setEnabled(!(ui->radioButtonSynTriggerExternal->isChecked() && ui->eleEyeEdgetTriggerInner->isChecked()));
|
||||||
// ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(!(ui->radioButtonSynTriggerExternal->isChecked() && ui->eleEyeEdgetTriggerInner->isChecked()));
|
// ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(!(ui->radioButtonSynTriggerExternal->isChecked() && ui->eleEyeEdgetTriggerInner->isChecked()));
|
||||||
ui->spinBoxEleMaskTime->setEnabled(flag);
|
ui->spinBoxEleMaskTime->setEnabled(flag);
|
||||||
ui->spinBoxEleEyeTriggerRepeatCnt->setEnabled(flag);
|
ui->spinBoxEleEyeTriggerRepeatCnt->setEnabled(true);
|
||||||
ui->radioButtonEleEyeEdgetTrigger->setEnabled(flag);
|
ui->radioButtonEleEyeEdgetTrigger->setEnabled(flag);
|
||||||
ui->radioButtonEleEyeLevelTrigger->setEnabled(flag);
|
ui->radioButtonEleEyeLevelTrigger->setEnabled(flag);
|
||||||
ui->cb_unlimited->setEnabled(flag);
|
ui->cb_unlimited->setEnabled(true);
|
||||||
ui->spinBoxEleEyeTriggerPrintDelay->setEnabled(flag);
|
ui->spinBoxEleEyeTriggerPrintDelay->setEnabled(flag);
|
||||||
if (!flag) ui->cb_unlimited->setChecked(false);
|
if (!flag) ui->cb_unlimited->setChecked(false);
|
||||||
}
|
}
|
||||||
@@ -629,7 +635,7 @@ void PrintSetting::applyPrintSettingsToSysPara(bool showTip)
|
|||||||
PrintSettingModel::applyToSysPara(m_model, sysPara);
|
PrintSettingModel::applyToSysPara(m_model, sysPara);
|
||||||
|
|
||||||
if (sysPara->devOp) {
|
if (sysPara->devOp) {
|
||||||
sysPara->devOp->writeFpgaPrintPara(false);
|
int res = sysPara->devOp->writeFpgaPrintPara(!showTip);
|
||||||
|
|
||||||
sysPara->devOp->writeSyncAndDelayPrintCount(
|
sysPara->devOp->writeSyncAndDelayPrintCount(
|
||||||
m_model.triggerMode == PRINT_TRIGGER_SYNCHRONIZER || m_model.triggerMode == PRINT_TRIGGER_TIME,
|
m_model.triggerMode == PRINT_TRIGGER_SYNCHRONIZER || m_model.triggerMode == PRINT_TRIGGER_TIME,
|
||||||
@@ -640,7 +646,7 @@ void PrintSetting::applyPrintSettingsToSysPara(bool showTip)
|
|||||||
sysPara->devOp->writeFlightCompCtrl(ui->enbFlightCompCtrl->isChecked(),
|
sysPara->devOp->writeFlightCompCtrl(ui->enbFlightCompCtrl->isChecked(),
|
||||||
ui->enbAccelDecelPredict->isChecked(), quint32(ui->flightCompWindowCycles->value()));
|
ui->enbAccelDecelPredict->isChecked(), quint32(ui->flightCompWindowCycles->value()));
|
||||||
|
|
||||||
if(sysPara->devOp->writeFpgaPrintPara(true) != -1 && showTip) {
|
if(res != -1 && showTip) {
|
||||||
QMessageBox box(QMessageBox::Icon::Information, tr("提示"), tr("应用成功"), QMessageBox::Ok, nullptr);
|
QMessageBox box(QMessageBox::Icon::Information, tr("提示"), tr("应用成功"), QMessageBox::Ok, nullptr);
|
||||||
auto btn = box.button(QMessageBox::Ok);
|
auto btn = box.button(QMessageBox::Ok);
|
||||||
// btn->setFixedSize(80, 40);
|
// btn->setFixedSize(80, 40);
|
||||||
@@ -900,7 +906,6 @@ QString PrintSettingModel::toString(const PrintSettingModel &model)
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PrintSettingModel PrintSettingModel::defPrintSettingModel()
|
PrintSettingModel PrintSettingModel::defPrintSettingModel()
|
||||||
{
|
{
|
||||||
QFile file(DEF_PRINT_SETTINGS_PATH);
|
QFile file(DEF_PRINT_SETTINGS_PATH);
|
||||||
|
|||||||
+1
-2
@@ -130,7 +130,6 @@ public:
|
|||||||
void setModel(const PrintSettingModel& model);
|
void setModel(const PrintSettingModel& model);
|
||||||
|
|
||||||
void setDefaultSettingMode(bool enable);
|
void setDefaultSettingMode(bool enable);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void buttonClickedSlot();
|
void buttonClickedSlot();
|
||||||
|
|
||||||
@@ -184,4 +183,4 @@ signals:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PRINTSETTING_H
|
#endif // PRINTSETTING_H
|
||||||
|
|||||||
+19
-3
@@ -381,7 +381,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>65535</number>
|
<number>65535</number>
|
||||||
@@ -428,10 +428,10 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>253</number>
|
<number>2147483647</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -1502,5 +1502,21 @@
|
|||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>cb_unlimited</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>spinBoxEleEyeTriggerRepeatCnt</receiver>
|
||||||
|
<slot>setDisabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>634</x>
|
||||||
|
<y>191</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>451</x>
|
||||||
|
<y>191</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -180,7 +180,8 @@ HEADERS += Public.h \
|
|||||||
Log/logglobal.h \
|
Log/logglobal.h \
|
||||||
loginfoctrl.h \
|
loginfoctrl.h \
|
||||||
runtimectrl.h \
|
runtimectrl.h \
|
||||||
dump.h
|
dump.h \
|
||||||
|
DlgCanvasHeightEditor.h
|
||||||
|
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
@@ -229,7 +230,8 @@ FORMS += \
|
|||||||
scene/CounterEditor.ui \
|
scene/CounterEditor.ui \
|
||||||
scene/DlgBarcodeFormat.ui \
|
scene/DlgBarcodeFormat.ui \
|
||||||
scene/DlgQrcodeFormat.ui \
|
scene/DlgQrcodeFormat.ui \
|
||||||
dlgQrCode.ui
|
dlgQrCode.ui \
|
||||||
|
DlgCanvasHeightEditor.ui
|
||||||
|
|
||||||
SOURCES +=\
|
SOURCES +=\
|
||||||
mainwidget.cpp \
|
mainwidget.cpp \
|
||||||
@@ -339,7 +341,8 @@ SOURCES +=\
|
|||||||
Log/logger.cpp \
|
Log/logger.cpp \
|
||||||
Log/logmessage.cpp \
|
Log/logmessage.cpp \
|
||||||
loginfoctrl.cpp \
|
loginfoctrl.cpp \
|
||||||
runtimectrl.cpp
|
runtimectrl.cpp \
|
||||||
|
DlgCanvasHeightEditor.cpp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -106,6 +106,10 @@ void SysPara::loadParaFromFile(){
|
|||||||
file.seek(0);
|
file.seek(0);
|
||||||
file.read((char *)¶,(long long int)sizeof(para));
|
file.read((char *)¶,(long long int)sizeof(para));
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
// 韩国要求 画布大小可以设定在24 到 32 之间
|
||||||
|
para.canvasHeight = qBound(unsigned(SCENE_MIN_HEIGHT), para.canvasHeight, unsigned(SCENE_MAX_HEIGHT));
|
||||||
|
|
||||||
if(para.gearPumpSpeedAlarm < 1000 || para.gearPumpSpeedAlarm > 2000)
|
if(para.gearPumpSpeedAlarm < 1000 || para.gearPumpSpeedAlarm > 2000)
|
||||||
para.gearPumpSpeedAlarm = 1500;
|
para.gearPumpSpeedAlarm = 1500;
|
||||||
|
|
||||||
@@ -181,6 +185,8 @@ void SysPara::loadDefaultPara(){
|
|||||||
|
|
||||||
para.mixValveisNewVersion = 1;//混和阀是否是新管路
|
para.mixValveisNewVersion = 1;//混和阀是否是新管路
|
||||||
para.gearPumpSpeedAlarm = 1500;
|
para.gearPumpSpeedAlarm = 1500;
|
||||||
|
|
||||||
|
para.canvasHeight = 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SysPara::saveParaToFile(){
|
void SysPara::saveParaToFile(){
|
||||||
@@ -1029,6 +1035,7 @@ void SysPara::saveRFIDPara()
|
|||||||
out << RFIDPara.cardInk;
|
out << RFIDPara.cardInk;
|
||||||
out << RFIDPara.cardSolvent;
|
out << RFIDPara.cardSolvent;
|
||||||
out << para.rfidCountDown;
|
out << para.rfidCountDown;
|
||||||
|
out << status.showInkWarningNumber << status.showSolventWarningNumber;
|
||||||
|
|
||||||
if(!file.flush()){
|
if(!file.flush()){
|
||||||
LogInfo::setRunStatusText("RFID Para save Failed 1");
|
LogInfo::setRunStatusText("RFID Para save Failed 1");
|
||||||
@@ -1076,6 +1083,7 @@ bool SysPara::loadRFIDPara()
|
|||||||
in >> RFIDPara.cardInk;
|
in >> RFIDPara.cardInk;
|
||||||
in >> RFIDPara.cardSolvent;
|
in >> RFIDPara.cardSolvent;
|
||||||
in >> para.rfidCountDown;
|
in >> para.rfidCountDown;
|
||||||
|
in >> status.showInkWarningNumber >> status.showSolventWarningNumber;
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ typedef enum {
|
|||||||
#define MAX_QVARI_NUM 4
|
#define MAX_QVARI_NUM 4
|
||||||
#define MAX_CNT1_GROUPS_NUM 50
|
#define MAX_CNT1_GROUPS_NUM 50
|
||||||
|
|
||||||
|
#define SCENE_MAX_HEIGHT 32
|
||||||
|
#define SCENE_MIN_HEIGHT 24
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned int second:6;
|
unsigned int second:6;
|
||||||
unsigned int minute:6;
|
unsigned int minute:6;
|
||||||
@@ -804,6 +807,7 @@ typedef struct {
|
|||||||
bool flagOfInkWarning; //报错累计次数达标,报警标志设为true
|
bool flagOfInkWarning; //报错累计次数达标,报警标志设为true
|
||||||
bool flagOfSolventWarning; //报错累计次数达标,报警标志设为true
|
bool flagOfSolventWarning; //报错累计次数达标,报警标志设为true
|
||||||
unsigned short rfidCountDown;
|
unsigned short rfidCountDown;
|
||||||
|
unsigned int canvasHeight; // 韩国需求中,要求可以设定打印区域的高度,默认为32。
|
||||||
/* */
|
/* */
|
||||||
// 1108Bytes
|
// 1108Bytes
|
||||||
}sysPara_t;
|
}sysPara_t;
|
||||||
|
|||||||
+4
-1
@@ -1348,10 +1348,13 @@ void SystemManage::programFPGAProcess(){
|
|||||||
emit sigToCloseSerialFPGA();
|
emit sigToCloseSerialFPGA();
|
||||||
emit sigToCloseSerialSTM32();
|
emit sigToCloseSerialSTM32();
|
||||||
//关闭定时器
|
//关闭定时器
|
||||||
programFPGATimer->stop();
|
// programFPGATimer->stop();
|
||||||
programFPGADialog->init();
|
programFPGADialog->init();
|
||||||
programFPGADialog->show();
|
programFPGADialog->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
programFPGATimer->stop();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemManage::PowerOnSetTime(QString date){
|
void SystemManage::PowerOnSetTime(QString date){
|
||||||
|
|||||||
+2
-2
@@ -18,8 +18,8 @@ int convertFreq(int index){
|
|||||||
// qDebug()<<"index="<<index;
|
// qDebug()<<"index="<<index;
|
||||||
switch(index){
|
switch(index){
|
||||||
case 0:return 64000;break; //64k,pwm波,占空比50%
|
case 0:return 64000;break; //64k,pwm波,占空比50%
|
||||||
case 1:return 76000;break; //76k
|
// case 1:return 76000;break; //76k
|
||||||
// case 2:return 83000;break; //83k
|
case 1:return 83000;break; //83k
|
||||||
case 2:return 96000;break; //96k
|
case 2:return 96000;break; //96k
|
||||||
case 3:return 128000;break; //128k
|
case 3:return 128000;break; //128k
|
||||||
case 4:return 145000;break; //145k
|
case 4:return 145000;break; //145k
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
*/
|
*/
|
||||||
#define UP_PRINTER_MAJOR_VER 6
|
#define UP_PRINTER_MAJOR_VER 6
|
||||||
#define UP_PRINTER_MINOR_VER 7
|
#define UP_PRINTER_MINOR_VER 7
|
||||||
#define UP_PRINTER_RIVISION_VER 2
|
#define UP_PRINTER_RIVISION_VER 3
|
||||||
#define SUB_VERSION "_KOR-T"
|
#define SUB_VERSION "_KOR"
|
||||||
#ifdef __RFID_OLD
|
#ifdef __RFID_OLD
|
||||||
#define SUB_RFID "_RO"
|
#define SUB_RFID "_RO"
|
||||||
#else
|
#else
|
||||||
|
|||||||
+17
-1
@@ -35,7 +35,7 @@
|
|||||||
<enum>Qt::StrongFocus</enum>
|
<enum>Qt::StrongFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -1509,5 +1509,21 @@ height: 25px;
|
|||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>checkBoxResetCnt1CurrValue</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>spinBoxCnt1CurrValue</receiver>
|
||||||
|
<slot>setDisabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>335</x>
|
||||||
|
<y>198</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>453</x>
|
||||||
|
<y>198</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -271,6 +271,12 @@ void FileManageWidget::copyFiles(QListWidget *from, QListWidget *to)
|
|||||||
for(auto item : items) {
|
for(auto item : items) {
|
||||||
auto srcPath = item->data(AbsPathRole).toString();
|
auto srcPath = item->data(AbsPathRole).toString();
|
||||||
auto destFilePath = destPath + QFileInfo(srcPath).fileName();
|
auto destFilePath = destPath + QFileInfo(srcPath).fileName();
|
||||||
|
|
||||||
|
QFileInfo destFile(destFilePath);
|
||||||
|
if(destFile.exists()) {
|
||||||
|
QFile::remove(destFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
bool ret = QFile::copy(srcPath, destFilePath);
|
bool ret = QFile::copy(srcPath, destFilePath);
|
||||||
qInfo() << "Copy: " << srcPath << " -> " << destFilePath << ", result: " << ret;
|
qInfo() << "Copy: " << srcPath << " -> " << destFilePath << ", result: " << ret;
|
||||||
}
|
}
|
||||||
|
|||||||
+166
-1058
File diff suppressed because it is too large
Load Diff
+17
-12
@@ -15,6 +15,7 @@
|
|||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QToolButton>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -40,7 +41,6 @@ public:
|
|||||||
|
|
||||||
void bindTxTEdit(QTextEdit* textEdit);
|
void bindTxTEdit(QTextEdit* textEdit);
|
||||||
void bindPicScene(PicScene* pPicScene);
|
void bindPicScene(PicScene* pPicScene);
|
||||||
void PreviewPressed();
|
|
||||||
void onPreviewScene();
|
void onPreviewScene();
|
||||||
// 260420 hlp:场景为空时,渲染空场景并刷新界面
|
// 260420 hlp:场景为空时,渲染空场景并刷新界面
|
||||||
void handleEmptySize();
|
void handleEmptySize();
|
||||||
@@ -51,19 +51,15 @@ public:
|
|||||||
bool startPrintingFlag;
|
bool startPrintingFlag;
|
||||||
|
|
||||||
bool pushButtonFlag;
|
bool pushButtonFlag;
|
||||||
|
|
||||||
int searchQrVar();
|
|
||||||
int searchExpiryVar();//检索有效期变量
|
|
||||||
void ExpiryDotUpdate(char Mode);
|
|
||||||
|
|
||||||
// 单独更新时间类图元 byons@2026年4月11日
|
// 单独更新时间类图元 byons@2026年4月11日
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 更新时间类图元到FPGA print 数据
|
* @brief 更新时间类图元到FPGA print 数据
|
||||||
* @return true 有时间元素更新,false 无时间元素更新
|
* @return 返回需要更新的区域
|
||||||
* @remark 判断返回值用于决定是否SendPrintDataToFpga
|
* @remark 判断返回值用于决定是否SendPrintDataToFpga
|
||||||
*/
|
*/
|
||||||
bool dateTimeItemsDotUpdate();
|
QRect variableItemsUpdate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 向FPGA print 数据缓冲区写入image
|
* @brief 向FPGA print 数据缓冲区写入image
|
||||||
@@ -85,6 +81,10 @@ public:
|
|||||||
// 回收槽关闭按钮状态设置
|
// 回收槽关闭按钮状态设置
|
||||||
void setReclaimCloseBtnStatus(bool enable);
|
void setReclaimCloseBtnStatus(bool enable);
|
||||||
|
|
||||||
|
void flashReclaimOpenBtn();
|
||||||
|
|
||||||
|
void stopFlashReclaimOpenBtn();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 设置回收槽开关状态
|
* @brief 设置回收槽开关状态
|
||||||
* @param isOpen true:开;false:关
|
* @param isOpen true:开;false:关
|
||||||
@@ -108,7 +108,7 @@ public:
|
|||||||
|
|
||||||
QTimer *timerShowItem,*timerPowerOff;
|
QTimer *timerShowItem,*timerPowerOff;
|
||||||
|
|
||||||
void SendPrintDataToFpga(unsigned char alterMode, bool isUpdate = false);
|
void SendPrintDataToFpga(unsigned char alterMode, int startCols = -1, int size = -1);
|
||||||
|
|
||||||
void updatePrintDisplayLabel();
|
void updatePrintDisplayLabel();
|
||||||
|
|
||||||
@@ -137,8 +137,8 @@ private:
|
|||||||
QPushButton* m_StopBtn;
|
QPushButton* m_StopBtn;
|
||||||
QPushButton* m_StartBtn;
|
QPushButton* m_StartBtn;
|
||||||
QPushButton* m_ToolBtn;
|
QPushButton* m_ToolBtn;
|
||||||
QPushButton* m_RightBtn;
|
QToolButton* m_RightBtn;
|
||||||
QPushButton* m_LeftBtn;
|
QToolButton* m_LeftBtn;
|
||||||
PrintTextDisplay* m_PrintDisplay;
|
PrintTextDisplay* m_PrintDisplay;
|
||||||
|
|
||||||
|
|
||||||
@@ -183,12 +183,15 @@ private:
|
|||||||
|
|
||||||
void initSheet();
|
void initSheet();
|
||||||
|
|
||||||
|
bool m_reclaimFlashState = false;
|
||||||
|
|
||||||
|
QTimer* m_reclaimOpenBtnFlashTimer = nullptr;
|
||||||
|
|
||||||
// 高亮切换
|
// 高亮切换
|
||||||
void changeHighLight(bool isStart);
|
void changeHighLight(bool isStart);
|
||||||
private slots:
|
private slots:
|
||||||
void airPushingProcess();
|
void airPushingProcess();
|
||||||
void buttonClickedSlot();
|
void buttonClickedSlot();
|
||||||
void ontextEdittextChanged();
|
|
||||||
|
|
||||||
void on_m_RightBtn_clicked();
|
void on_m_RightBtn_clicked();
|
||||||
|
|
||||||
@@ -200,6 +203,8 @@ private slots:
|
|||||||
|
|
||||||
void slt_clearCnt();
|
void slt_clearCnt();
|
||||||
|
|
||||||
|
void onReclaimOpenBtnFlashTimerTimeout();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void sendButtonClickedSignal(int index);
|
void sendButtonClickedSignal(int index);
|
||||||
void setDisableAll();
|
void setDisableAll();
|
||||||
@@ -212,4 +217,4 @@ signals:
|
|||||||
void newFileAcquired();
|
void newFileAcquired();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MainWidget_H
|
#endif // MainWidget_H
|
||||||
+2
-1
@@ -12,6 +12,7 @@
|
|||||||
#define MYSAVEFILEDLG // 定义自己的保存文件对话框,解决系统对话框按键不弹起问题
|
#define MYSAVEFILEDLG // 定义自己的保存文件对话框,解决系统对话框按键不弹起问题
|
||||||
#define LANINTERFACE_NAME "eth0"
|
#define LANINTERFACE_NAME "eth0"
|
||||||
|
|
||||||
|
// #define FPGA_TEST
|
||||||
//#define __RFID_OLD //旧的加密算法
|
//#define __RFID_OLD //旧的加密算法
|
||||||
#define __RFID_CARD //刷卡功能
|
#define __RFID_CARD //刷卡功能
|
||||||
//#define __RFID_IND //允许印度进行二次加密的宏
|
//#define __RFID_IND //允许印度进行二次加密的宏
|
||||||
@@ -28,7 +29,7 @@
|
|||||||
|
|
||||||
enum CRYS_FREQ{
|
enum CRYS_FREQ{
|
||||||
CRYS_64K,
|
CRYS_64K,
|
||||||
CRYS_76K,
|
CRYS_83K,
|
||||||
CRYS_96K,
|
CRYS_96K,
|
||||||
CRYS_128K
|
CRYS_128K
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ void RFIDManager::MySleep(unsigned int msec, int expSize)
|
|||||||
// recResponse = comForRFID->read(8);
|
// recResponse = comForRFID->read(8);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
QCoreApplication::processEvents(QEventLoop::AllEvents, 10);
|
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1144,6 +1144,10 @@ bool RFIDManager::waitStatus()
|
|||||||
sysPara->para.inkWarnTime = 0;
|
sysPara->para.inkWarnTime = 0;
|
||||||
sysPara->para.flagOfInkWarning = false;
|
sysPara->para.flagOfInkWarning = false;
|
||||||
sysPara->saveParaToFile();
|
sysPara->saveParaToFile();
|
||||||
|
|
||||||
|
QDir dir("/home/plg");
|
||||||
|
dir.remove("inkRFIDTime.txt");
|
||||||
|
|
||||||
res = true;
|
res = true;
|
||||||
}
|
}
|
||||||
} else if (status.addedSolvent && status.cardSolvent) {
|
} else if (status.addedSolvent && status.cardSolvent) {
|
||||||
@@ -1157,6 +1161,9 @@ bool RFIDManager::waitStatus()
|
|||||||
sysPara->para.solventWarnDate = 0;
|
sysPara->para.solventWarnDate = 0;
|
||||||
sysPara->para.solventWarnTime = 0;
|
sysPara->para.solventWarnTime = 0;
|
||||||
sysPara->saveParaToFile();
|
sysPara->saveParaToFile();
|
||||||
|
|
||||||
|
QDir dir("/home/plg");
|
||||||
|
dir.remove("solventRFIDTime.txt");
|
||||||
}
|
}
|
||||||
res = true;
|
res = true;
|
||||||
}
|
}
|
||||||
@@ -1241,10 +1248,6 @@ void RFIDManager::slt_intervalTimerHandle()
|
|||||||
emit sig_showMsg(tr("请及时刷溶剂卡"));
|
emit sig_showMsg(tr("请及时刷溶剂卡"));
|
||||||
status.firstPromptSolventCard = false;
|
status.firstPromptSolventCard = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(!sysPara->RFIDPara.cardInk) {
|
|
||||||
// QMessageBox::information(nullptr, tr("提示"), tr("请及时刷溶剂卡."));
|
|
||||||
// }
|
|
||||||
|
|
||||||
//不需要通知先后,成功即可
|
//不需要通知先后,成功即可
|
||||||
if (waitStatus()) {
|
if (waitStatus()) {
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ BarcodeEditor::BarcodeEditor(QWidget *parent) :
|
|||||||
|
|
||||||
connect(&m_barcodeFormatEditor, &DlgBarcodeFormat::accepted, this, &BarcodeEditor::onBarcodeFormatConfirmed);
|
connect(&m_barcodeFormatEditor, &DlgBarcodeFormat::accepted, this, &BarcodeEditor::onBarcodeFormatConfirmed);
|
||||||
connect(&m_qrcodeFormatEditor, &DlgQrcodeFormat::accepted, this, &BarcodeEditor::onQrcodeFormatConfirmed);
|
connect(&m_qrcodeFormatEditor, &DlgQrcodeFormat::accepted, this, &BarcodeEditor::onQrcodeFormatConfirmed);
|
||||||
|
|
||||||
|
m_barcodeFormatEditor.setWindowModality(Qt::WindowModality::WindowModal);
|
||||||
|
m_qrcodeFormatEditor.setWindowModality(Qt::WindowModality::WindowModal);
|
||||||
|
m_barcodeFormatEditor.setWindowTitle(tr("BarCode Format"));
|
||||||
|
m_qrcodeFormatEditor.setWindowTitle(tr("Qrcode Format"));
|
||||||
}
|
}
|
||||||
|
|
||||||
BarcodeEditor::~BarcodeEditor()
|
BarcodeEditor::~BarcodeEditor()
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ static QImage renderDataMatrix(const unsigned char *grid, int cols, int rows, in
|
|||||||
return QImage();
|
return QImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
int width = cols * moduleSize;
|
int width = rows * moduleSize;
|
||||||
int height = rows * moduleSize;
|
int height = cols * moduleSize;
|
||||||
QImage image(width, height, QImage::Format_ARGB32);
|
QImage image(width, height, QImage::Format_ARGB32);
|
||||||
image.fill(background);
|
image.fill(background);
|
||||||
|
|
||||||
@@ -64,8 +64,8 @@ static QImage renderDataMatrix(const unsigned char *grid, int cols, int rows, in
|
|||||||
for (int x = 0; x < cols; ++x) {
|
for (int x = 0; x < cols; ++x) {
|
||||||
bool bit = (grid[y * cols + x] & 0x01) != 0;
|
bool bit = (grid[y * cols + x] & 0x01) != 0;
|
||||||
QRgb color = bit ? foreground : background;
|
QRgb color = bit ? foreground : background;
|
||||||
int px = x * moduleSize;
|
int px = y * moduleSize;
|
||||||
int py = y * moduleSize;
|
int py = (cols - 1 - x) * moduleSize;
|
||||||
for (int dy = 0; dy < moduleSize; ++dy) {
|
for (int dy = 0; dy < moduleSize; ++dy) {
|
||||||
for (int dx = 0; dx < moduleSize; ++dx) {
|
for (int dx = 0; dx < moduleSize; ++dx) {
|
||||||
image.setPixel(px + dx, py + dy, color);
|
image.setPixel(px + dx, py + dy, color);
|
||||||
@@ -573,6 +573,8 @@ QImage ItemUtils::txtToImage(const QString &txt, const QFont &font, const QColor
|
|||||||
painter.drawText(img.rect(), txt);
|
painter.drawText(img.rect(), txt);
|
||||||
painter.end();
|
painter.end();
|
||||||
|
|
||||||
|
return img;
|
||||||
|
|
||||||
// 按背景色裁剪,使输出图像紧贴文字像素的最小包围盒(详见函数注释)
|
// 按背景色裁剪,使输出图像紧贴文字像素的最小包围盒(详见函数注释)
|
||||||
return clipTxtImage(img, bgRgb);
|
return clipTxtImage(img, bgRgb);
|
||||||
}
|
}
|
||||||
+5
-63
@@ -5,6 +5,7 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
//#include "moveinput.h"
|
//#include "moveinput.h"
|
||||||
#include <QStyleOptionGraphicsItem>
|
#include <QStyleOptionGraphicsItem>
|
||||||
|
#include "ItemCommon.h"
|
||||||
|
|
||||||
//extern MoveInput* moveInput;
|
//extern MoveInput* moveInput;
|
||||||
PicTextItem::PicTextItem(QGraphicsItem *parent, QGraphicsScene *scene, const SourceType t) :
|
PicTextItem::PicTextItem(QGraphicsItem *parent, QGraphicsScene *scene, const SourceType t) :
|
||||||
@@ -38,54 +39,6 @@ QVariant PicTextItem::source()
|
|||||||
return m_source;
|
return m_source;
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage clipImage(QImage img, const QRgb bg)
|
|
||||||
{
|
|
||||||
QRect clipRect;
|
|
||||||
for(int x = 0; x < img.width(); ++x) {
|
|
||||||
for(int y = 0; y < img.height(); ++y) {
|
|
||||||
auto rgb = img.pixel(x, y);
|
|
||||||
if(rgb != bg) {
|
|
||||||
clipRect.setLeft(x);
|
|
||||||
goto top;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
top:
|
|
||||||
for(int y = 0; y < img.height(); ++y) {
|
|
||||||
for(int x = 0; x < img.width(); ++x) {
|
|
||||||
if(img.pixel(x, y) != bg) {
|
|
||||||
clipRect.setTop(y);
|
|
||||||
goto right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
right:
|
|
||||||
for(int x = img.width() - 1; x >= 0; --x) {
|
|
||||||
for(int y = 0; y < img.height(); ++y) {
|
|
||||||
if(img.pixel(x, y) != bg) {
|
|
||||||
clipRect.setRight(x + 1);
|
|
||||||
goto bottom;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bottom:
|
|
||||||
for(int y = img.height() - 1; y >= 0; --y) {
|
|
||||||
for(int x = 0; x < img.width(); ++x) {
|
|
||||||
if(img.pixel(x, y) != bg) {
|
|
||||||
clipRect.setBottom(y + 1);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
end:
|
|
||||||
QRect originRect = img.rect();
|
|
||||||
return img.copy(clipRect);
|
|
||||||
}
|
|
||||||
|
|
||||||
QImage PicTextItem::applyImgeTranslation(QImage img)
|
QImage PicTextItem::applyImgeTranslation(QImage img)
|
||||||
{
|
{
|
||||||
auto scaledWidth = boldMultiple() * img.width();
|
auto scaledWidth = boldMultiple() * img.width();
|
||||||
@@ -212,7 +165,7 @@ QRectF PicTextItem::boundingRect() const
|
|||||||
if(sourceType() == SourceType::UNKNOWN)
|
if(sourceType() == SourceType::UNKNOWN)
|
||||||
return QGraphicsTextItem::boundingRect();
|
return QGraphicsTextItem::boundingRect();
|
||||||
|
|
||||||
const QRectF fr(0, 0, m_itemImage.width(), m_itemImage.height());
|
QRectF fr(0, 0, m_itemImage.width(), m_itemImage.height());
|
||||||
return fr;
|
return fr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,21 +390,10 @@ QImage PicTextItem::strToImage(const QString &str)
|
|||||||
if(str.isEmpty())
|
if(str.isEmpty())
|
||||||
return QImage();
|
return QImage();
|
||||||
|
|
||||||
QPainter painter;
|
QColor txtColor = colorReversal() ? QColor(255, 255, 255) : QColor(0, 0, 0);
|
||||||
QFontMetrics fm(font());
|
QColor bgColor = colorReversal() ? QColor(0, 0, 0) : QColor(0, 0, 0, 0);
|
||||||
QImage img(fm.horizontalAdvance(str), fm.height(), QImage::Format_ARGB32);
|
|
||||||
|
|
||||||
QRgb txtColor = colorReversal() ? 0xffffffff : 0xff000000;
|
return ItemUtils::txtToImage(str, font(), txtColor, bgColor);
|
||||||
QRgb bgColor = colorReversal() ? 0xff000000 : 0x00000000;
|
|
||||||
|
|
||||||
img.fill(bgColor);
|
|
||||||
painter.begin(&img);
|
|
||||||
painter.setFont(font());
|
|
||||||
painter.setPen(txtColor);
|
|
||||||
painter.drawText(img.rect(), str);
|
|
||||||
painter.end();
|
|
||||||
|
|
||||||
return clipImage(img, bgColor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -194,7 +194,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>76K</string>
|
<string>83K</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
+40
-7
@@ -69,16 +69,16 @@ TestPrintWidget::TestPrintWidget(QWidget* parent)
|
|||||||
pPicScene = new PicScene(this);
|
pPicScene = new PicScene(this);
|
||||||
|
|
||||||
//edit@12-09
|
//edit@12-09
|
||||||
pPicScene->setSceneRect(QRectF(0,0, 3999, 32));
|
pPicScene->setSceneRect(QRectF(0,0, 3999, SCENE_MAX_HEIGHT));
|
||||||
ui.graphicsView->setScene(pPicScene);
|
ui.graphicsView->setScene(pPicScene);
|
||||||
ui.graphicsView->centerOn(0,0);
|
ui.graphicsView->centerOn(0,0);
|
||||||
// ui->senceEditOption->bindScene(pPicScene, ui->graphicsView, ui->textEdit);
|
// ui->senceEditOption->bindScene(pPicScene, ui->graphicsView, ui->textEdit);
|
||||||
this->pPicScene->setIsdrawBackground(true);
|
this->pPicScene->setIsdrawBackground(true);
|
||||||
|
|
||||||
// 哪个天才写的?拿view和scene计算一下会死吗?
|
// 哪个天才写的?拿view和scene计算一下会死吗?
|
||||||
for(int i=0;i<3;i++){
|
// for(int i=0;i<3;i++){
|
||||||
on_enlargeButton_pressed();
|
// on_enlargeButton_pressed();
|
||||||
}
|
// }
|
||||||
|
|
||||||
connect(pPicScene,&PicScene::selectionChanged,this,[=]() {
|
connect(pPicScene,&PicScene::selectionChanged,this,[=]() {
|
||||||
getShowSelectItemText();
|
getShowSelectItemText();
|
||||||
@@ -178,7 +178,7 @@ TestPrintWidget::TestPrintWidget(QWidget* parent)
|
|||||||
|
|
||||||
if (ret == QMessageBox::Ok){
|
if (ret == QMessageBox::Ok){
|
||||||
disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0);
|
disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0);
|
||||||
connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool)));
|
connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool)), Qt::DirectConnection);
|
||||||
dialogSaveFile->saveLastWork();
|
dialogSaveFile->saveLastWork();
|
||||||
emit sig_updatePrintContent();
|
emit sig_updatePrintContent();
|
||||||
} else {
|
} else {
|
||||||
@@ -400,7 +400,7 @@ void TestPrintWidget::on_saveButton_pressed()
|
|||||||
qDebug()<<"xml file null";
|
qDebug()<<"xml file null";
|
||||||
#ifdef MYSAVEFILEDLG
|
#ifdef MYSAVEFILEDLG
|
||||||
disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0);
|
disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0);
|
||||||
connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool)));
|
connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool)), Qt::DirectConnection);
|
||||||
dialogSaveFile->refreshListView(editMode);
|
dialogSaveFile->refreshListView(editMode);
|
||||||
dialogSaveFile->show();
|
dialogSaveFile->show();
|
||||||
dialogSaveFile->setEnterFileName("");
|
dialogSaveFile->setEnterFileName("");
|
||||||
@@ -492,7 +492,7 @@ void TestPrintWidget::onSaveASFile(QString filename,bool Flag){// use for dialog
|
|||||||
|
|
||||||
saveFile();
|
saveFile();
|
||||||
if(sysPara){
|
if(sysPara){
|
||||||
sysPara->sysFile =xmlfileName;
|
sysPara->sysFile = xmlfileName;
|
||||||
snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",xmlfileName.toLatin1().constData());
|
snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",xmlfileName.toLatin1().constData());
|
||||||
}
|
}
|
||||||
//snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",xmlfileName.toLatin1().constData());
|
//snprintf(sysPara->para.lastOpenedFileName,sizeof(sysPara->para.lastOpenedFileName),"%s",xmlfileName.toLatin1().constData());
|
||||||
@@ -609,6 +609,19 @@ void TestPrintWidget::onFileOpen(QString filePath,bool reviewFlag){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 主动暂停打印
|
||||||
|
if(reviewFlag) {
|
||||||
|
emit sig_stopPrint();
|
||||||
|
|
||||||
|
// xmlfileName 会被 saveLastWork 更改,因此此处暂存变量, 在执行后恢复
|
||||||
|
qDebug() << "xmlfileName:" << xmlfileName;
|
||||||
|
auto filename = xmlfileName;
|
||||||
|
disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0);
|
||||||
|
connect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),this,SLOT(onSaveASFile(QString,bool)), Qt::DirectConnection);
|
||||||
|
dialogSaveFile->saveLastWork();
|
||||||
|
xmlfileName = filename;
|
||||||
|
disconnect(dialogSaveFile,SIGNAL(saveFile(QString,bool)),0,0);
|
||||||
|
}
|
||||||
|
|
||||||
emit sendButtonClickedSignal(20); //打开文件完成跳转到主窗口
|
emit sendButtonClickedSignal(20); //打开文件完成跳转到主窗口
|
||||||
}
|
}
|
||||||
@@ -1062,6 +1075,26 @@ bool TestPrintWidget::eventFilter(QObject *watched, QEvent *event) {
|
|||||||
return QWidget::eventFilter(watched, event);
|
return QWidget::eventFilter(watched, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestPrintWidget::showEvent(QShowEvent *event)
|
||||||
|
{
|
||||||
|
QWidget::showEvent(event);
|
||||||
|
|
||||||
|
pPicScene->update();
|
||||||
|
auto sceneRect = pPicScene->sceneRect();
|
||||||
|
// qreal sceneHeight = boundingRect.height() > (qreal)(sysPara->para.canvasHeight) ? SCENE_MAX_HEIGHT : (qreal)(sysPara->para.canvasHeight);
|
||||||
|
qreal sceneHeight = qMin(qreal(SCENE_MAX_HEIGHT), (qreal)(sysPara->para.canvasHeight));
|
||||||
|
sceneRect.setHeight(sceneHeight);
|
||||||
|
pPicScene->setSceneRect(sceneRect);
|
||||||
|
|
||||||
|
// 以高度为基准 最大化显示场景到 视口
|
||||||
|
auto viewportHeight = pViewer->viewport()->height();
|
||||||
|
QTransform transform = pViewer->transform();
|
||||||
|
auto targetScale = viewportHeight / sceneRect.height();
|
||||||
|
double currentScale = transform.m11();
|
||||||
|
double relativeScale = targetScale / currentScale;
|
||||||
|
pViewer->scale(relativeScale, relativeScale);
|
||||||
|
}
|
||||||
|
|
||||||
void TestPrintWidget::onBtn3DClicked()
|
void TestPrintWidget::onBtn3DClicked()
|
||||||
{
|
{
|
||||||
#if defined(ARCH_AARCH64)
|
#if defined(ARCH_AARCH64)
|
||||||
|
|||||||
+3
-2
@@ -84,9 +84,7 @@ public:
|
|||||||
|
|
||||||
bool addItemFlag;
|
bool addItemFlag;
|
||||||
// QString getReplateAfterStr(QString);
|
// QString getReplateAfterStr(QString);
|
||||||
// QMap<int,QString> varReplaceItemMap;
|
|
||||||
|
|
||||||
QMap<int,ItemReplaceInfo> varReplaceItemMap;
|
|
||||||
public slots:
|
public slots:
|
||||||
void on_enlargeButton_pressed();
|
void on_enlargeButton_pressed();
|
||||||
void on_addButton_pressed(const SourceType type = SourceType::UNKNOWN);
|
void on_addButton_pressed(const SourceType type = SourceType::UNKNOWN);
|
||||||
@@ -112,6 +110,8 @@ protected:
|
|||||||
// 重写事件过滤器
|
// 重写事件过滤器
|
||||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||||
|
|
||||||
|
void showEvent(QShowEvent* event) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onSceneFocusedItemPosChanged(QPoint p);
|
void onSceneFocusedItemPosChanged(QPoint p);
|
||||||
void onBtn3DClicked();
|
void onBtn3DClicked();
|
||||||
@@ -214,6 +214,7 @@ private:
|
|||||||
void selectItemByDirection(bool forward);
|
void selectItemByDirection(bool forward);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void sig_stopPrint();
|
||||||
void sendButtonClickedSignal(int index);
|
void sendButtonClickedSignal(int index);
|
||||||
void sendUpdateFontSignl(int);
|
void sendUpdateFontSignl(int);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user