hlp:桂林国际齿轮泵代码

This commit is contained in:
kite_lucs
2026-10-09 10:25:24 +08:00
commit fd606b3c81
2447 changed files with 999531 additions and 0 deletions
@@ -0,0 +1,47 @@
#ifndef RSCODE_H
#define RSCODE_H
/*
* qrencode - QR Code encoder
*
* Reed solomon encoder. This code is taken from Phil Karn's libfec then
* editted and packed into a pair of .c and .h files.
*
* Copyright (C) 2002, 2003, 2004, 2006 Phil Karn, KA9Q
* (libfec is released under the GNU Lesser General Public License.)
*
* Copyright (C) 2006,2007 Kentaro Fukuchi <fukuchi@megaui.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __RSCODE_H__
#define __RSCODE_H__
/*
* General purpose RS codec, 8-bit symbols.
*/
typedef struct _RS RS;
/* WARNING: Thread unsafe!!! */
extern RS *init_rs(int symsize, int gfpoly, int fcr, int prim, int nroots, int pad);
extern void encode_rs_char(RS *rs, const unsigned char *data, unsigned char *parity);
extern void free_rs_char(RS *rs);
#endif /* __RSCODE_H__ */
#endif // RSCODE_H
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@@ -0,0 +1,170 @@
/********************************************************************************
** Form generated from reading UI file 'dlgvarlength.ui'
**
** Created by: Qt User Interface Compiler version 4.8.5
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_DLGVARLENGTH_H
#define UI_DLGVARLENGTH_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QCheckBox>
#include <QtGui/QDialog>
#include <QtGui/QGridLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QPushButton>
#include <QtGui/QSpinBox>
QT_BEGIN_NAMESPACE
class Ui_DlgVarLength
{
public:
QGridLayout *gridLayout_2;
QGridLayout *gridLayout;
QLabel *label_2;
QLabel *label;
QLabel *label_4;
QSpinBox *spinHeadLen;
QSpinBox *spinEndLen;
QLineEdit *lineEditAllLen;
QLabel *label_3;
QSpinBox *spinVarLen;
QLabel *label_5;
QSpinBox *spinVarLen1;
QCheckBox *checkVarEN;
QPushButton *pushButtonOK;
void setupUi(QDialog *DlgVarLength)
{
if (DlgVarLength->objectName().isEmpty())
DlgVarLength->setObjectName(QString::fromUtf8("DlgVarLength"));
DlgVarLength->setWindowModality(Qt::WindowModal);
DlgVarLength->resize(386, 166);
DlgVarLength->setFocusPolicy(Qt::StrongFocus);
gridLayout_2 = new QGridLayout(DlgVarLength);
gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
gridLayout = new QGridLayout();
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label_2 = new QLabel(DlgVarLength);
label_2->setObjectName(QString::fromUtf8("label_2"));
label_2->setMaximumSize(QSize(100, 16777215));
label_2->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout->addWidget(label_2, 0, 0, 1, 1);
label = new QLabel(DlgVarLength);
label->setObjectName(QString::fromUtf8("label"));
label->setMaximumSize(QSize(100, 16777215));
label->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout->addWidget(label, 1, 0, 1, 1);
label_4 = new QLabel(DlgVarLength);
label_4->setObjectName(QString::fromUtf8("label_4"));
label_4->setMaximumSize(QSize(100, 16777215));
label_4->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout->addWidget(label_4, 3, 0, 1, 1);
spinHeadLen = new QSpinBox(DlgVarLength);
spinHeadLen->setObjectName(QString::fromUtf8("spinHeadLen"));
spinHeadLen->setMaximum(9999);
gridLayout->addWidget(spinHeadLen, 0, 1, 1, 1);
spinEndLen = new QSpinBox(DlgVarLength);
spinEndLen->setObjectName(QString::fromUtf8("spinEndLen"));
spinEndLen->setMaximum(9999);
gridLayout->addWidget(spinEndLen, 1, 1, 1, 1);
lineEditAllLen = new QLineEdit(DlgVarLength);
lineEditAllLen->setObjectName(QString::fromUtf8("lineEditAllLen"));
lineEditAllLen->setEnabled(true);
lineEditAllLen->setMaximumSize(QSize(120, 16777215));
lineEditAllLen->setAcceptDrops(false);
lineEditAllLen->setReadOnly(true);
gridLayout->addWidget(lineEditAllLen, 3, 1, 1, 1);
label_3 = new QLabel(DlgVarLength);
label_3->setObjectName(QString::fromUtf8("label_3"));
label_3->setMaximumSize(QSize(100, 16777215));
label_3->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout->addWidget(label_3, 0, 2, 1, 1);
spinVarLen = new QSpinBox(DlgVarLength);
spinVarLen->setObjectName(QString::fromUtf8("spinVarLen"));
spinVarLen->setMinimumSize(QSize(60, 0));
spinVarLen->setMinimum(-9999);
spinVarLen->setMaximum(9999);
gridLayout->addWidget(spinVarLen, 0, 3, 1, 1);
label_5 = new QLabel(DlgVarLength);
label_5->setObjectName(QString::fromUtf8("label_5"));
label_5->setMaximumSize(QSize(100, 16777215));
label_5->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout->addWidget(label_5, 1, 2, 1, 1);
spinVarLen1 = new QSpinBox(DlgVarLength);
spinVarLen1->setObjectName(QString::fromUtf8("spinVarLen1"));
spinVarLen1->setMinimumSize(QSize(60, 0));
spinVarLen1->setMinimum(-9999);
spinVarLen1->setMaximum(9999);
gridLayout->addWidget(spinVarLen1, 1, 3, 1, 1);
checkVarEN = new QCheckBox(DlgVarLength);
checkVarEN->setObjectName(QString::fromUtf8("checkVarEN"));
checkVarEN->setLayoutDirection(Qt::RightToLeft);
gridLayout->addWidget(checkVarEN, 3, 2, 1, 1);
pushButtonOK = new QPushButton(DlgVarLength);
pushButtonOK->setObjectName(QString::fromUtf8("pushButtonOK"));
pushButtonOK->setMaximumSize(QSize(100, 60));
pushButtonOK->setDefault(true);
gridLayout->addWidget(pushButtonOK, 5, 2, 1, 1);
gridLayout_2->addLayout(gridLayout, 0, 0, 1, 1);
retranslateUi(DlgVarLength);
QMetaObject::connectSlotsByName(DlgVarLength);
} // setupUi
void retranslateUi(QDialog *DlgVarLength)
{
DlgVarLength->setWindowTitle(QApplication::translate("DlgVarLength", "\345\217\230\351\225\277\345\226\267\345\215\260\345\217\202\346\225\260", 0, QApplication::UnicodeUTF8));
label_2->setText(QApplication::translate("DlgVarLength", "\345\244\264\351\203\250\351\225\277\345\272\246(m)", 0, QApplication::UnicodeUTF8));
label->setText(QApplication::translate("DlgVarLength", "\345\260\276\351\203\250\351\225\277\345\272\246(m)", 0, QApplication::UnicodeUTF8));
label_4->setText(QApplication::translate("DlgVarLength", "\346\200\273\351\225\277(m)", 0, QApplication::UnicodeUTF8));
label_3->setText(QApplication::translate("DlgVarLength", "\350\260\203\346\225\264\351\225\277\345\272\246(mm)", 0, QApplication::UnicodeUTF8));
label_5->setText(QApplication::translate("DlgVarLength", "\350\260\203\346\225\264\351\225\277\345\272\246(mm)", 0, QApplication::UnicodeUTF8));
checkVarEN->setText(QApplication::translate("DlgVarLength", "\345\217\257\345\217\230\351\225\277\345\272\246\345\205\201\350\256\270", 0, QApplication::UnicodeUTF8));
pushButtonOK->setText(QApplication::translate("DlgVarLength", "\347\241\256\345\256\232", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class DlgVarLength: public Ui_DlgVarLength {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_DLGVARLENGTH_H
@@ -0,0 +1,160 @@
#include "IPEdit.h"
#include <QPainter>
#include <QApplication>
#include <QStyle>
#include <QStyleOptionButton>
#include <QKeyEvent>
#include <QShortcutEvent>
#include <QRegExpValidator>
#include <QRegExp>
#include <QClipboard>
#include <QDebug>
IPEdit::IPEdit(QWidget *parent) : QWidget(parent)
{
init();
}
IPEdit::~IPEdit()
{
}
void IPEdit::init()
{
m_layout = new QHBoxLayout(this);
m_layout->setSpacing(3);
m_layout->setContentsMargins(2, 0, 2, 0);
m_edit1 = new QLineEdit(this);
m_edit2 = new QLineEdit(this);
m_edit3 = new QLineEdit(this);
m_edit4 = new QLineEdit(this);
initForEdit(m_edit1);
initForEdit(m_edit2);
initForEdit(m_edit3);
initForEdit(m_edit4);
m_dot1 = new QLabel(".", this);
m_dot2 = new QLabel(".", this);
m_dot3 = new QLabel(".", this);
m_layout->addWidget(m_edit1, 1);
m_layout->addWidget(m_dot1);
m_layout->addWidget(m_edit2, 1);
m_layout->addWidget(m_dot2);
m_layout->addWidget(m_edit3, 1);
m_layout->addWidget(m_dot3);
m_layout->addWidget(m_edit4, 1);
}
void IPEdit::initForEdit(QLineEdit* edit)
{
edit->setFrame(false);
edit->setAlignment(Qt::AlignCenter);
edit->installEventFilter(this);
QRegExpValidator* validator = new QRegExpValidator(QRegExp("^(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)$"), this);
edit->setValidator(validator);
connect(edit, SIGNAL(textChanged(const QString&)), this, SLOT(editTextChanged(const QString&)));
}
QLineEdit* IPEdit::nextEdit(QLineEdit* curEdit)
{
if (curEdit == m_edit1)
return m_edit2;
else if (curEdit == m_edit2)
return m_edit3;
else if (curEdit == m_edit3)
return m_edit4;
else
return NULL;
}
bool IPEdit::isEdit(QObject* object)
{
return (object == m_edit1 ||
object == m_edit2 ||
object == m_edit3 ||
object == m_edit4);
}
QString IPEdit::text()
{
QString sec1 = m_edit1->text().isEmpty() ? "0" : m_edit1->text();
QString sec2 = m_edit2->text().isEmpty() ? "0" : m_edit2->text();
QString sec3 = m_edit3->text().isEmpty() ? "0" : m_edit3->text();
QString sec4 = m_edit4->text().isEmpty() ? "0" : m_edit4->text();
return QString("%1.%2.%3.%4").arg(sec1).arg(sec2).arg(sec3).arg(sec4);
}
void IPEdit::setText(const QString& text)
{
QRegExp reg("^((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)$");
if (!reg.exactMatch(text))
return;
QStringList ips = text.split(".");
m_edit1->setText(ips.at(0));
m_edit2->setText(ips.at(1));
m_edit3->setText(ips.at(2));
m_edit4->setText(ips.at(3));
}
void IPEdit::paintEvent(QPaintEvent* event)
{
QPainter painter(this);
QStyleOptionFrame option;
option.initFrom(this);
option.lineWidth = 1;
style()->drawPrimitive(QStyle::PE_PanelLineEdit, &option, &painter, this);
QWidget::paintEvent(event);
}
bool IPEdit::eventFilter(QObject* object, QEvent* event)
{
if (isEdit(object))
{
if (event->type() == QEvent::KeyPress)
{
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
if (keyEvent->key() == Qt::Key_Period)
{
QLineEdit* next = nextEdit(qobject_cast<QLineEdit*>(object));
if (next)
{
next->setFocus();
next->selectAll();
}
}
else if (keyEvent->matches(QKeySequence::Paste))
{
QString clip = QApplication::clipboard()->text(QClipboard::Clipboard);
if (clip.split(".").size() == 4)
{
setText(clip);
return true;
}
}
}
}
return QWidget::eventFilter(object, event);
}
void IPEdit::editTextChanged(const QString& text)
{
QLineEdit* curEdit = qobject_cast<QLineEdit*>(sender());
if (text.size() == 3)
{
QLineEdit* next = nextEdit(curEdit);
if (next)
{
next->setFocus();
next->selectAll();
}
}
}
@@ -0,0 +1,325 @@
/********************************************************************************
** Form generated from reading UI file 'zkedit.ui'
**
** Created by: Qt User Interface Compiler version 4.8.5
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_ZKEDIT_H
#define UI_ZKEDIT_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QCheckBox>
#include <QtGui/QGridLayout>
#include <QtGui/QHBoxLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QPushButton>
#include <QtGui/QScrollArea>
#include <QtGui/QSpinBox>
#include <QtGui/QVBoxLayout>
#include <QtGui/QWidget>
#include <zkWidget.h>
QT_BEGIN_NAMESPACE
class Ui_ZkEdit
{
public:
QGridLayout *gridLayout_3;
QHBoxLayout *horizontalLayout;
QScrollArea *scrollArea;
zkWidget *widgetPic;
QVBoxLayout *verticalLayout;
QLabel *labelScaleLeval;
QLabel *labelFileName;
QGridLayout *gridLayout_2;
QPushButton *pushButtonDown;
QPushButton *pushButtonEnsure;
QPushButton *pushButtonLeft;
QPushButton *pushButtonUp;
QPushButton *pushButtonRight;
QGridLayout *gridLayout;
QPushButton *pushButtonReduce;
QPushButton *pushButtonSave;
QPushButton *pushButtonNew;
QSpinBox *spinBoxWidthPoint;
QPushButton *pushButtonSaveAs;
QLabel *label_2;
QCheckBox *checkBoxPicExpand;
QPushButton *pushButtonOpen;
QLabel *label;
QLineEdit *lineEdit;
QSpinBox *spinBoxHeightPoint;
QPushButton *pushButtonEnlarge;
QPushButton *pushButtonImport;
QCheckBox *checkBoxTrimPic;
void setupUi(QWidget *ZkEdit)
{
if (ZkEdit->objectName().isEmpty())
ZkEdit->setObjectName(QString::fromUtf8("ZkEdit"));
ZkEdit->resize(800, 600);
ZkEdit->setFocusPolicy(Qt::StrongFocus);
gridLayout_3 = new QGridLayout(ZkEdit);
gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3"));
horizontalLayout = new QHBoxLayout();
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
scrollArea = new QScrollArea(ZkEdit);
scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
scrollArea->setWidgetResizable(false);
scrollArea->setAlignment(Qt::AlignCenter);
widgetPic = new zkWidget();
widgetPic->setObjectName(QString::fromUtf8("widgetPic"));
widgetPic->setGeometry(QRect(0, 89, 400, 400));
scrollArea->setWidget(widgetPic);
horizontalLayout->addWidget(scrollArea);
verticalLayout = new QVBoxLayout();
verticalLayout->setSpacing(0);
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
verticalLayout->setContentsMargins(0, 0, 0, 0);
labelScaleLeval = new QLabel(ZkEdit);
labelScaleLeval->setObjectName(QString::fromUtf8("labelScaleLeval"));
labelScaleLeval->setMaximumSize(QSize(16777215, 20));
verticalLayout->addWidget(labelScaleLeval);
labelFileName = new QLabel(ZkEdit);
labelFileName->setObjectName(QString::fromUtf8("labelFileName"));
labelFileName->setMaximumSize(QSize(180, 20));
verticalLayout->addWidget(labelFileName);
gridLayout_2 = new QGridLayout();
gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
gridLayout_2->setHorizontalSpacing(0);
gridLayout_2->setVerticalSpacing(30);
pushButtonDown = new QPushButton(ZkEdit);
pushButtonDown->setObjectName(QString::fromUtf8("pushButtonDown"));
pushButtonDown->setMinimumSize(QSize(50, 50));
pushButtonDown->setMaximumSize(QSize(50, 50));
QIcon icon;
icon.addFile(QString::fromUtf8(":/icon/arrowdown.png"), QSize(), QIcon::Normal, QIcon::Off);
pushButtonDown->setIcon(icon);
gridLayout_2->addWidget(pushButtonDown, 2, 2, 1, 1);
pushButtonEnsure = new QPushButton(ZkEdit);
pushButtonEnsure->setObjectName(QString::fromUtf8("pushButtonEnsure"));
pushButtonEnsure->setMinimumSize(QSize(50, 50));
pushButtonEnsure->setMaximumSize(QSize(50, 50));
QIcon icon1;
icon1.addFile(QString::fromUtf8(":/icon/sure.png"), QSize(), QIcon::Normal, QIcon::Off);
pushButtonEnsure->setIcon(icon1);
pushButtonEnsure->setIconSize(QSize(24, 24));
gridLayout_2->addWidget(pushButtonEnsure, 1, 2, 1, 1);
pushButtonLeft = new QPushButton(ZkEdit);
pushButtonLeft->setObjectName(QString::fromUtf8("pushButtonLeft"));
pushButtonLeft->setMinimumSize(QSize(50, 50));
pushButtonLeft->setMaximumSize(QSize(50, 50));
QIcon icon2;
icon2.addFile(QString::fromUtf8(":/icon/arrowleft.png"), QSize(), QIcon::Normal, QIcon::Off);
pushButtonLeft->setIcon(icon2);
gridLayout_2->addWidget(pushButtonLeft, 1, 1, 1, 1);
pushButtonUp = new QPushButton(ZkEdit);
pushButtonUp->setObjectName(QString::fromUtf8("pushButtonUp"));
pushButtonUp->setMinimumSize(QSize(50, 50));
pushButtonUp->setMaximumSize(QSize(50, 50));
QIcon icon3;
icon3.addFile(QString::fromUtf8(":/icon/arrowup.png"), QSize(), QIcon::Normal, QIcon::Off);
pushButtonUp->setIcon(icon3);
gridLayout_2->addWidget(pushButtonUp, 0, 2, 1, 1);
pushButtonRight = new QPushButton(ZkEdit);
pushButtonRight->setObjectName(QString::fromUtf8("pushButtonRight"));
pushButtonRight->setMinimumSize(QSize(50, 50));
pushButtonRight->setMaximumSize(QSize(50, 50));
QIcon icon4;
icon4.addFile(QString::fromUtf8(":/icon/arrowright.png"), QSize(), QIcon::Normal, QIcon::Off);
pushButtonRight->setIcon(icon4);
gridLayout_2->addWidget(pushButtonRight, 1, 3, 1, 1);
verticalLayout->addLayout(gridLayout_2);
gridLayout = new QGridLayout();
gridLayout->setSpacing(5);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
pushButtonReduce = new QPushButton(ZkEdit);
pushButtonReduce->setObjectName(QString::fromUtf8("pushButtonReduce"));
pushButtonReduce->setMinimumSize(QSize(0, 45));
QIcon icon5;
icon5.addFile(QString::fromUtf8(":/icon/zoomout.png"), QSize(), QIcon::Normal, QIcon::Off);
pushButtonReduce->setIcon(icon5);
gridLayout->addWidget(pushButtonReduce, 1, 2, 1, 1);
pushButtonSave = new QPushButton(ZkEdit);
pushButtonSave->setObjectName(QString::fromUtf8("pushButtonSave"));
QIcon icon6;
icon6.addFile(QString::fromUtf8(":/icon/filesave.png"), QSize(), QIcon::Normal, QIcon::Off);
pushButtonSave->setIcon(icon6);
gridLayout->addWidget(pushButtonSave, 6, 1, 1, 1);
pushButtonNew = new QPushButton(ZkEdit);
pushButtonNew->setObjectName(QString::fromUtf8("pushButtonNew"));
QIcon icon7;
icon7.addFile(QString::fromUtf8(":/icon/filenew.png"), QSize(), QIcon::Normal, QIcon::Off);
pushButtonNew->setIcon(icon7);
gridLayout->addWidget(pushButtonNew, 6, 2, 1, 1);
spinBoxWidthPoint = new QSpinBox(ZkEdit);
spinBoxWidthPoint->setObjectName(QString::fromUtf8("spinBoxWidthPoint"));
QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(spinBoxWidthPoint->sizePolicy().hasHeightForWidth());
spinBoxWidthPoint->setSizePolicy(sizePolicy);
spinBoxWidthPoint->setMaximumSize(QSize(16777215, 37));
spinBoxWidthPoint->setMinimum(1);
spinBoxWidthPoint->setMaximum(256);
spinBoxWidthPoint->setValue(12);
gridLayout->addWidget(spinBoxWidthPoint, 3, 1, 1, 1);
pushButtonSaveAs = new QPushButton(ZkEdit);
pushButtonSaveAs->setObjectName(QString::fromUtf8("pushButtonSaveAs"));
QIcon icon8;
icon8.addFile(QString::fromUtf8(":/icon/filesaveas.png"), QSize(), QIcon::Normal, QIcon::Off);
pushButtonSaveAs->setIcon(icon8);
gridLayout->addWidget(pushButtonSaveAs, 5, 2, 1, 1);
label_2 = new QLabel(ZkEdit);
label_2->setObjectName(QString::fromUtf8("label_2"));
label_2->setMaximumSize(QSize(16777215, 20));
gridLayout->addWidget(label_2, 2, 2, 1, 1);
checkBoxPicExpand = new QCheckBox(ZkEdit);
checkBoxPicExpand->setObjectName(QString::fromUtf8("checkBoxPicExpand"));
gridLayout->addWidget(checkBoxPicExpand, 0, 1, 1, 1);
pushButtonOpen = new QPushButton(ZkEdit);
pushButtonOpen->setObjectName(QString::fromUtf8("pushButtonOpen"));
QIcon icon9;
icon9.addFile(QString::fromUtf8(":/icon/fileopen.png"), QSize(), QIcon::Normal, QIcon::Off);
pushButtonOpen->setIcon(icon9);
gridLayout->addWidget(pushButtonOpen, 5, 1, 1, 1);
label = new QLabel(ZkEdit);
label->setObjectName(QString::fromUtf8("label"));
label->setMaximumSize(QSize(16777215, 20));
gridLayout->addWidget(label, 2, 1, 1, 1);
lineEdit = new QLineEdit(ZkEdit);
lineEdit->setObjectName(QString::fromUtf8("lineEdit"));
lineEdit->setEnabled(false);
QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Preferred);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
sizePolicy1.setHeightForWidth(lineEdit->sizePolicy().hasHeightForWidth());
lineEdit->setSizePolicy(sizePolicy1);
lineEdit->setMaximumSize(QSize(80, 16777215));
lineEdit->setMaxLength(11);
gridLayout->addWidget(lineEdit, 4, 1, 1, 1);
spinBoxHeightPoint = new QSpinBox(ZkEdit);
spinBoxHeightPoint->setObjectName(QString::fromUtf8("spinBoxHeightPoint"));
sizePolicy.setHeightForWidth(spinBoxHeightPoint->sizePolicy().hasHeightForWidth());
spinBoxHeightPoint->setSizePolicy(sizePolicy);
spinBoxHeightPoint->setMinimum(1);
spinBoxHeightPoint->setMaximum(256);
spinBoxHeightPoint->setValue(12);
gridLayout->addWidget(spinBoxHeightPoint, 3, 2, 1, 1);
pushButtonEnlarge = new QPushButton(ZkEdit);
pushButtonEnlarge->setObjectName(QString::fromUtf8("pushButtonEnlarge"));
pushButtonEnlarge->setMinimumSize(QSize(0, 45));
QIcon icon10;
icon10.addFile(QString::fromUtf8(":/icon/zoomin.png"), QSize(), QIcon::Normal, QIcon::Off);
pushButtonEnlarge->setIcon(icon10);
gridLayout->addWidget(pushButtonEnlarge, 1, 1, 1, 1);
pushButtonImport = new QPushButton(ZkEdit);
pushButtonImport->setObjectName(QString::fromUtf8("pushButtonImport"));
QIcon icon11;
icon11.addFile(QString::fromUtf8(":/icon/fileimport.png"), QSize(), QIcon::Normal, QIcon::Off);
pushButtonImport->setIcon(icon11);
gridLayout->addWidget(pushButtonImport, 4, 2, 1, 1);
checkBoxTrimPic = new QCheckBox(ZkEdit);
checkBoxTrimPic->setObjectName(QString::fromUtf8("checkBoxTrimPic"));
gridLayout->addWidget(checkBoxTrimPic, 0, 2, 1, 1);
verticalLayout->addLayout(gridLayout);
horizontalLayout->addLayout(verticalLayout);
gridLayout_3->addLayout(horizontalLayout, 0, 0, 1, 1);
retranslateUi(ZkEdit);
QMetaObject::connectSlotsByName(ZkEdit);
} // setupUi
void retranslateUi(QWidget *ZkEdit)
{
ZkEdit->setWindowTitle(QApplication::translate("ZkEdit", "Form", 0, QApplication::UnicodeUTF8));
labelScaleLeval->setText(QApplication::translate("ZkEdit", "\347\274\226\350\276\221\345\233\276\346\241\210", 0, QApplication::UnicodeUTF8));
labelFileName->setText(QString());
pushButtonDown->setText(QString());
pushButtonEnsure->setText(QString());
pushButtonLeft->setText(QString());
pushButtonUp->setText(QString());
pushButtonRight->setText(QString());
pushButtonReduce->setText(QApplication::translate("ZkEdit", "\347\274\251\345\260\217", 0, QApplication::UnicodeUTF8));
pushButtonSave->setText(QApplication::translate("ZkEdit", "\344\277\235\345\255\230", 0, QApplication::UnicodeUTF8));
pushButtonNew->setText(QApplication::translate("ZkEdit", "\346\226\260\345\273\272", 0, QApplication::UnicodeUTF8));
pushButtonSaveAs->setText(QApplication::translate("ZkEdit", "\344\277\235\345\255\230\344\270\272", 0, QApplication::UnicodeUTF8));
label_2->setText(QApplication::translate("ZkEdit", "\351\253\230\345\272\246", 0, QApplication::UnicodeUTF8));
checkBoxPicExpand->setText(QApplication::translate("ZkEdit", "\345\233\276\345\203\217\346\211\251\345\274\240", 0, QApplication::UnicodeUTF8));
pushButtonOpen->setText(QApplication::translate("ZkEdit", "\346\211\223\345\274\200", 0, QApplication::UnicodeUTF8));
label->setText(QApplication::translate("ZkEdit", "\345\256\275\345\272\246", 0, QApplication::UnicodeUTF8));
lineEdit->setText(QApplication::translate("ZkEdit", "A", 0, QApplication::UnicodeUTF8));
pushButtonEnlarge->setText(QApplication::translate("ZkEdit", "\346\224\276\345\244\247", 0, QApplication::UnicodeUTF8));
pushButtonImport->setText(QApplication::translate("ZkEdit", "\345\257\274\345\205\245", 0, QApplication::UnicodeUTF8));
checkBoxTrimPic->setText(QApplication::translate("ZkEdit", "\345\233\276\345\203\217\350\243\201\345\211\252", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class ZkEdit: public Ui_ZkEdit {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_ZKEDIT_H
@@ -0,0 +1,111 @@
/****************************************************************************
** Meta object code from reading C++ file 'dialogshowcounter.h'
**
** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.5)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../dialogshowcounter.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'dialogshowcounter.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 63
#error "This file was generated using the moc from 4.8.5. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_DialogShowCounter[] = {
// content:
6, // revision
0, // classname
0, 0, // classinfo
4, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
1, // signalCount
// signals: signature, parameters, type, tag, flags
39, 19, 18, 18, 0x05,
// slots: signature, parameters, type, tag, flags
67, 18, 18, 18, 0x08,
91, 18, 18, 18, 0x08,
125, 18, 18, 18, 0x08,
0 // eod
};
static const char qt_meta_stringdata_DialogShowCounter[] = {
"DialogShowCounter\0\0cycle_time,area_end\0"
"set_count_endvalue(int,int)\0"
"on_pushButton_clicked()\0"
"on_CycleprintpushButton_clicked()\0"
"ondialogcycleprintAccepted()\0"
};
void DialogShowCounter::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
DialogShowCounter *_t = static_cast<DialogShowCounter *>(_o);
switch (_id) {
case 0: _t->set_count_endvalue((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 1: _t->on_pushButton_clicked(); break;
case 2: _t->on_CycleprintpushButton_clicked(); break;
case 3: _t->ondialogcycleprintAccepted(); break;
default: ;
}
}
}
const QMetaObjectExtraData DialogShowCounter::staticMetaObjectExtraData = {
0, qt_static_metacall
};
const QMetaObject DialogShowCounter::staticMetaObject = {
{ &QDialog::staticMetaObject, qt_meta_stringdata_DialogShowCounter,
qt_meta_data_DialogShowCounter, &staticMetaObjectExtraData }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &DialogShowCounter::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *DialogShowCounter::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *DialogShowCounter::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_DialogShowCounter))
return static_cast<void*>(const_cast< DialogShowCounter*>(this));
return QDialog::qt_metacast(_clname);
}
int DialogShowCounter::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QDialog::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
}
return _id;
}
// SIGNAL 0
void DialogShowCounter::set_count_endvalue(int _t1, int _t2)
{
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
QT_END_MOC_NAMESPACE
@@ -0,0 +1,153 @@
/****************************************************************************
** Meta object code from reading C++ file 'modbusserial.h'
**
** Created: Wed Dec 25 15:36:17 2024
** by: The Qt Meta Object Compiler version 62 (Qt 4.6.3)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../modbus/modbusserial.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'modbusserial.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 62
#error "This file was generated using the moc from 4.6.3. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_ModbusSerial[] = {
// content:
4, // revision
0, // classname
0, 0, // classinfo
9, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
8, // signalCount
// signals: signature, parameters, type, tag, flags
14, 13, 13, 13, 0x05,
29, 13, 13, 13, 0x05,
42, 13, 13, 13, 0x05,
55, 13, 13, 13, 0x05,
69, 67, 13, 13, 0x05,
92, 13, 13, 13, 0x05,
106, 13, 13, 13, 0x05,
142, 122, 13, 13, 0x05,
// slots: signature, parameters, type, tag, flags
183, 177, 170, 13, 0x0a,
0 // eod
};
static const char qt_meta_stringdata_ModbusSerial[] = {
"ModbusSerial\0\0updateQRcode()\0startPrint()\0"
"pausePrint()\0stopPrint()\0,\0"
"openFile(QString,bool)\0faultResume()\0"
"writeCalendar()\0lineSpace,charSpace\0"
"mbLineAndCharSpace(int,int)\0qint32\0"
"index\0processCommands(qint32)\0"
};
const QMetaObject ModbusSerial::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_ModbusSerial,
qt_meta_data_ModbusSerial, 0 }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &ModbusSerial::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *ModbusSerial::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *ModbusSerial::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_ModbusSerial))
return static_cast<void*>(const_cast< ModbusSerial*>(this));
return QObject::qt_metacast(_clname);
}
int ModbusSerial::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: updateQRcode(); break;
case 1: startPrint(); break;
case 2: pausePrint(); break;
case 3: stopPrint(); break;
case 4: openFile((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break;
case 5: faultResume(); break;
case 6: writeCalendar(); break;
case 7: mbLineAndCharSpace((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 8: { qint32 _r = processCommands((*reinterpret_cast< qint32(*)>(_a[1])));
if (_a[0]) *reinterpret_cast< qint32*>(_a[0]) = _r; } break;
default: ;
}
_id -= 9;
}
return _id;
}
// SIGNAL 0
void ModbusSerial::updateQRcode()
{
QMetaObject::activate(this, &staticMetaObject, 0, 0);
}
// SIGNAL 1
void ModbusSerial::startPrint()
{
QMetaObject::activate(this, &staticMetaObject, 1, 0);
}
// SIGNAL 2
void ModbusSerial::pausePrint()
{
QMetaObject::activate(this, &staticMetaObject, 2, 0);
}
// SIGNAL 3
void ModbusSerial::stopPrint()
{
QMetaObject::activate(this, &staticMetaObject, 3, 0);
}
// SIGNAL 4
void ModbusSerial::openFile(QString _t1, bool _t2)
{
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 4, _a);
}
// SIGNAL 5
void ModbusSerial::faultResume()
{
QMetaObject::activate(this, &staticMetaObject, 5, 0);
}
// SIGNAL 6
void ModbusSerial::writeCalendar()
{
QMetaObject::activate(this, &staticMetaObject, 6, 0);
}
// SIGNAL 7
void ModbusSerial::mbLineAndCharSpace(int _t1, int _t2)
{
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 7, _a);
}
QT_END_MOC_NAMESPACE
@@ -0,0 +1,741 @@
#include "TriggerCtrl.h"
#include "ui_triggerctrl.h"
#include <QCheckBox>
#include <QMessageBox>
#include <QValidator>
#include <QDoubleValidator>
#include "qdebug.h"
#include <stdio.h>
#include "myinclude.h"
#include "Public.h"
#include "VerBVersion.h"
#include "DevOp.h"
#include "InkJetPrinter.h"
extern InkJetPrinter *pInkJectPrinter;
/* readme: 20140809
1. 同步字宽mm: 0.1+ w*(4-0.1) = 0.1+3.9w (mm)
2. 按长度喷印:
*/
// 20140923-12:05版本存在图形方式下变量不变绿问题,新版本已经更正
// 20141013-16:36修正密码有效期设置错误。
//2015-10-17 二维码变量问题
// 2015-11-01 无聊: 要从V6S版本恢复原来的 para.set_HVData_Flag = 0; 参数
// 估计过段时间又要要求增加 UART功能。 V6S 原来已经有这个功能了。但他们不用!!
// 20151109 新增计数1和计数器2单独立即清零 版本号 No42
// 更新了Vietname字库,使用中文使用wenquanyiBitmap,编译uncode编码使用wenquanyimicrohei,英文自己编,越南语自己编,基于DejaVu Sans
// 新版软件更新或升级,会因参数错位,出现隔膜位置设定值(等参数)错误,引起主墨泵不工作,开机不循环等现象。(解决办法,重新检查并设置所有参数)
// 20160203:修改了变量定位方式,更新的Image图片。 将左下角更换为RGB = 250,250,0 -=== 0xFFF7FC00
// 修正了停止打印关闭高压的问题,重新打印出现高压故障
// 修改了密码一周一变,增加了密码校验,需要使用新版20以上的手机密码软件,密码为7位;
// 20160218 修改了提示框显示方式,避免提示阻塞处理进程
// 20160304 优化了变量显示; 增加了中心旋转交替功能;增加了 13位随机码打印功能; 修正界面显示字库部分汉字问题
// 本次修改需要同时更并按ARM和FPGA
// FPGA实现自动点距调整,实现连续点位置修正 20160714 FPGA版本 V44, 0714B
// 20160715 : 去掉了“点距电压微调”、“内存数据显示”、部分相检控制参数设置
// 20160729: 发现打开历史记录会死机问题,原因待查。但执行删除历史记录后,可避免再次死机。
// 20160723: 增加电眼复位功能。 与电眼清零不同,复位时,计数不清零,而是等于预设的当前值。
// 20160718: 参考日立方案,优化打印效果
/*
20160728:发现历史记录打开时,会死机
20160729: 查找原因:fi
// 20160806:重要修改 : 毫米脉冲的系数由X8改为X256,原因是:使用X8时传递误差较大,导致1000mm会有6mm误差, 使用X256(即8位二进制表示小数时,可以精确到0.004,从而提高精度)
X8 时,小数精度为0.125而已
20160812:增加左横,右横变量
if((varType<9) // 普通变量
||(varType>=20 && varType<29) // 横左变量
||(varType>=40 && varType<49) // 右横变量
if(fontname.contains("SerifL") ||fontname.contains("serifl") ) varType1= 20+varType;
else if(fontname.contains("SerifR") ||fontname.contains("serifr") ) varType1= 40+varType;
20160831: 增加临时密码,每小时一变
20160904: 解决重新开机后,有时不能自动打印文件问题。
20160905: 第二行单独变量时显示不全问题
// 20160912: 去掉高压故障自动关闭回收的默认值 1
// 20160912: 设置了隐藏按键,用于对墨线时间和开机次数进行复位 No49
20160927: FIFO实现RAND 码上传,暂时与RST0806 No49区别开来 No50
20161212: 修改总产品计数器清零功能。由ARM清零改为FPGA清零 No51 // [3]总产品计数器清零FPGA
20161217: 增加了 SPV210编译选项,以处理V6核心版驱动问题
修改随机码处理函数,以解决 不能输出奇数位 随机码问题。
20170217: 有厂家只想打一条横线,改最小列点阵数。
20170224: 输入密码不回显
20170313: 修改开机重启或重载参数时,设定计数当前值为起始值
20170318: 制作0318版本的刷机文件
20170803: 增加外接屏功能,20170808完成
*/
#ifdef MIMA
#ifdef ALT16
#define BVER "(ALT53)" TST // 20160801 之前使用 RST46
#else
#define BVER "(SUN53)" TST // 20160801 之前使用 RST46
#endif
#endif
//#define NON_CABLE//喷印间隔固定
// 20160507 1138
// 20161209 编辑 小数点喷印间隔
// 20170603: 太阳能条码专用版本
// Nam Ninh phồng tuyệt vời Mã Technology Co., Ltd.
TriggerCtrl::TriggerCtrl(QWidget *parent) :
QWidget(parent),
ui(new Ui::TriggerCtrl)
{
ui->setupUi(this);
//#ifdef SYNLENFLOAT
QRegExp double_rx100("10000000|([0-9]{1,8}[\.][0-9]{0,1})");
ui->spinBoxSynTriggerPrintLen->setValidator(new QRegExpValidator(double_rx100,ui->spinBoxSynTriggerPrintLen));
#ifdef NON_CABLE
ui->spinBoxSynTriggerPrintLen->setEnabled(0);
#endif
//#endif
pulseNumFix = new PulseNumFix(parent);
pulseNumFix->hide();
ui->lineEditTriggerPulsePerMm->setValidator(new QDoubleValidator(0));
connect(pulseNumFix,SIGNAL(pulseNuxFixDone(float)),this,SLOT(onPulseNumFixDone(float)));
//ui->test_version->setText (tr(BUILD_DATE));
updateSysStatusToUI();
QString s;
#if 0 /* roger use new Version manage,so delete it */
s.sprintf(" %s ",__TIME__);
#ifdef MYTEST
s = (QString) Public::DateToString(__DATE__)+s + "A2451测试";
#else
s = (QString) Public::DateToString(__DATE__)+s + BVER;
#endif
#else
s.sprintf("%d.%d.%02d_GuiL_", UP_PRINTER_MAJOR_VER, UP_PRINTER_MINOR_VER,UP_PRINTER_RIVISION_VER);
s = s + (QString) Public::DateToString(__DATE__)+"_"+ QString(__TIME__)+"_"+ UP_PRINTER_STAGE_VER;
//s = s + BVER;
#endif
ui->test_version->setText(s);
ui->checkBoxEleEyeMakeClean->setVisible(false);
tr("独立参数");
//ui->labelDelayTriggerValue->setText(tr("重复间隔(毫秒)"));
//--if( QString(BUILD_DATE).left(21)!="2015-10-26 20:56(M40)"){
//--ui->labelEleMaskTime->hide();
//--ui->spinBoxEleMaskTime->hide();
//--}
if(Public::ReadLanguageName()=="Chinese"){
ui->label_miv12->setPixmap(QPixmap(QString::fromUtf8(":/image/MIV12.png")));
}else
{
ui->label_miv12->setPixmap(QPixmap(QString::fromUtf8(":/image/MIV13.png")));
}
//qDebug()<<"Run TriggerCtrl ok.";
#ifdef ENGLISH
ui->label_miv12->setPixmap(QPixmap(QString::fromUtf8(":/image/MIV13.png")));
#endif
ui->spinBoxOuputPulseCol->setHidden(1);
// ui->labelOuputPulseCol->setHidden(1);
}
TriggerCtrl::~TriggerCtrl()
{
delete ui;
delete pulseNumFix;
}
void TriggerCtrl::setTriggerUI(int triggerMode){
ui->radioButtonDelayTrigger->setChecked(triggerMode == PRINT_TRIGGER_TIME);
ui->spinBoxDelayTriggerValue->setEnabled(triggerMode == PRINT_TRIGGER_TIME);
ui->labelDelayTriggerValue->setEnabled(triggerMode == PRINT_TRIGGER_TIME);
ui->comboBoxTimeTriggerMode->setEnabled(triggerMode == PRINT_TRIGGER_TIME);
ui->labelTimeTriggerMode->setEnabled(triggerMode == PRINT_TRIGGER_TIME);
ui->radioButtonEleEyeEdgetTrigger->setChecked( triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE);
ui->radioButtonEleEyeLevelTrigger->setChecked(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL);
ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE);
ui->labelEleEyeTriggerIntervalMs->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE);
ui->spinBoxEleEyeTriggerRepeatCnt->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE);
ui->labelEleEyeTriggerRepeatCnt->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE);
ui->spinBoxEleEyeTriggerPrintDelay->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE || PRINT_TRIGGER_SYNCHRONIZER);
ui->labelEleEyeTriggerPrintDelay->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE || PRINT_TRIGGER_SYNCHRONIZER);
ui->checkBoxSynMakeClean->setEnabled(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE);
ui->checkEyeTriggerSynPrintEn->setEnabled (triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE);
ui->labelEleMaskTime->setEnabled (triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE);
ui->spinBoxEleMaskTime->setEnabled (triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE);
if(sysPara->para.eleEyeTriggerSynPrintEn &&
(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE)
)
{
//ui->radioButtonSynTrigger->setChecked(1);
ui->spinBoxSynTriggerPrintLen->setEnabled(0);
ui->labelSynTriggerPrintLen->setEnabled(1);
ui->lineEditTriggerPulsePerMm->setEnabled(1);
ui->labelTriggerPulsePerMm->setEnabled(1);
ui->spinBoxSynTriggerPrintLenRatio->setEnabled(1);
ui->labelSynTriggerPrintLenRatio->setEnabled(1);
ui->checkBoxEleEyeMakeClean->setEnabled(1);
ui->pushButtonApplyPulseFix->setEnabled(1);
ui->comboBoxSynPrintMode->setEnabled(1);
ui->labelSynPrintMode->setEnabled(1);
//ui->checkBoxAutoSpeedEN->setEnabled (1);
ui->labelEleMaskTime->setEnabled(1);
ui->spinBoxEleMaskTime->setEnabled(1);
//ui->spinBoxEleMaskTime->setEnabled(1);
ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫米)"));
ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫米)"));
ui->labelEleMaskTime->setText(tr("封锁间隔(毫米)"));
}
else
{
ui->radioButtonSynTrigger->setChecked(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
#ifndef NON_CABLE
ui->spinBoxSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
#endif
ui->labelSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->lineEditTriggerPulsePerMm->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->labelTriggerPulsePerMm->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->spinBoxSynTriggerPrintLenRatio->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->labelSynTriggerPrintLenRatio->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->checkBoxEleEyeMakeClean->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->pushButtonApplyPulseFix->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->comboBoxSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->labelSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
//ui->checkBoxAutoSpeedEN->setEnabled (triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
//ui->labelEleMaskTime->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
//ui->spinBoxEleMaskTime->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
if(triggerMode == PRINT_TRIGGER_SYNCHRONIZER)
{
ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫米)"));
}
else
{
ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫秒)"));
}
ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫秒)"));
ui->labelEleMaskTime->setText(tr("封锁时间(毫秒)"));
}
if(( ( //sysPara->para.eleEyeTriggerSynPrintEn ||
ui->checkEyeTriggerSynPrintEn->isChecked())
&&(triggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || triggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE))
|| triggerMode == PRINT_TRIGGER_SYNCHRONIZER )
{
ui->labelOutputPulseDelayMs->setText(tr("延时(毫米):"));
}
else ui->labelOutputPulseDelayMs->setText(tr("延时(毫秒):"));
setSynPrintMode(sysPara->para.sysTriggerPrintMode);
//72版本禁用该输入框
//67打开
// if(triggerMode== PRINT_TRIGGER_SYNCHRONIZER){
// const unsigned short &FpgaVer=sysPara->status.build_dat.builTime;
// if(72==FpgaVer)
// {
// ui->spinBoxSynTriggerPrintLenRatio->setValue(0);
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(false);
// }
// else if(67==FpgaVer)
// {
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(true);
// }
// }
// else{
// ui->spinBoxSynTriggerPrintLenRatio->setValue(0);
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(false);
// }
}
void TriggerCtrl::setSynPrintMode(int mode){
ui->labelSynTriggerPrintLenRatio->setText((mode == SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH)?tr("字符宽度"):tr("喷印比例(%)"));
ui->comboBoxSynPrintMode->setCurrentIndex(mode);
//ui->spinBoxSynTriggerPrintLenRatio->setValue((mode == SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH)?sysPara->para.synCharWidthRatio:sysPara->para.synTriggerPrintLenRatio);
//edit@11-18
if(SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH!=mode)
{
ui->spinBoxSynTriggerPrintLenRatio->setValue(sysPara->para.synTriggerPrintLenRatio);
}
const bool bShow=SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH!=mode;
//隐藏文本框
ui->labelSynTriggerPrintLenRatio->setVisible(bShow);
//隐藏输入框
ui->spinBoxSynTriggerPrintLenRatio->setVisible(bShow);
}
void TriggerCtrl::GetTriggerUIPara(){
if(sysPara){
sysPara->para.printDelayMs = ui->spinBoxDelayTriggerValue->value();
sysPara->para.timeTriggerPrintMode = ui->comboBoxTimeTriggerMode->currentIndex();
sysPara->para.elecEyeTriggerInterval = ui->spinBoxEleEyeTriggerIntervalMs->value();
sysPara->para.photoElectricityRepeateNum = ui->spinBoxEleEyeTriggerRepeatCnt->value();
//
sysPara->para.synTriggerPrintLenMm = ui->spinBoxSynTriggerPrintLen->text().toFloat();
//sysPara->para.synTriggerPrintLenMm = ui->spinBoxSynTriggerPrintLen->value();
#ifdef NON_CABLE
sysPara->para.synTriggerPrintLenMm = 255.0;
ui->spinBoxSynTriggerPrintLen->setText("255");
#endif
sysPara->para.synPulseNumPerMm = ui->lineEditTriggerPulsePerMm->text().toFloat();
sysPara->para.sysTriggerPrintMode = ui->comboBoxSynPrintMode->currentIndex();
if(sysPara->para.sysTriggerPrintMode == SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH)
//edit@11-19
;//sysPara->para.synCharWidthRatio = ui->spinBoxSynTriggerPrintLenRatio->value();
else
sysPara->para.synTriggerPrintLenRatio = ui->spinBoxSynTriggerPrintLenRatio->value();
// 原代码:
//sysPara->para.AltMirrorGap =(unsigned int) ( ((unsigned int)ui->spinBoxAltMirrorGap->value()) & 0x7fff) | ( ui->comboBoxAltMirrType->currentIndex()==1?0x8000:0x0000);
// 20160303:
sysPara->para.AltMirrorGap =(unsigned int) ( ((unsigned int)ui->spinBoxAltMirrorGap->value()) & 0x0fff) |( ( ui->comboBoxAltMirrType->currentIndex())<<12 );
//qDebug()<< (sysPara->para.AltMirrorGap & 0x0fff) << (sysPara->para.AltMirrorGap & 0xf000);
if(ui->radioButtonDelayTrigger->isChecked())
sysPara->para.printTriggerMode = PRINT_TRIGGER_TIME;
else if(ui->radioButtonEleEyeLevelTrigger->isChecked())
sysPara->para.printTriggerMode = PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL;
else if(ui->radioButtonEleEyeEdgetTrigger->isChecked())
sysPara->para.printTriggerMode = PRINT_TRIGGER_ELEC_EYE_EDGE;
else if(ui->radioButtonSynTrigger->isChecked())
sysPara->para.printTriggerMode = PRINT_TRIGGER_SYNCHRONIZER;
else
sysPara->para.printTriggerMode = PRINT_TRIGGER_NONE;
sysPara->para.eleEyeTriggerSynPrintEn = ui->checkEyeTriggerSynPrintEn->isChecked ();
sysPara->para.eleEyeTriggerPrintDelay = ui->spinBoxEleEyeTriggerPrintDelay->value();
sysPara->para.synClearCntInEleEyeMode = ui->checkBoxSynMakeClean->isChecked();
sysPara->para.eleEyeClearCntInSynMode = (sysPara->para.eleEyeClearCntInSynMode & 0xf0) + ui->comboBoxEleEyeMakeClean->currentIndex(); //ui->checkBoxEleEyeMakeClean->isChecked();
//sysPara->para.autoSynSpeedEn = ui->checkBoxAutoSpeedEN->isChecked ();
sysPara->para.autoSynSpeedEn = 0;
//sysPara->para.synPulsePerMmX8 = (unsigned short)(sysPara->para.synPulseNumPerMm *256);
sysPara->para.synPulsePerMmX8 = (unsigned short)((unsigned int)sysPara->para.synPulseNumPerMm <<8);
sysPara->para.eleMaskTime = ui->spinBoxEleMaskTime->value();
//qDebug()<<"eleEyeClearCntInSynMode"<< sysPara->para.eleEyeClearCntInSynMode ;
sysPara->para.synchronizorActType = ui->comboBoxSyncActType->currentIndex();
//qDebug()<<"synchronizorActType"<< sysPara->para.synchronizorActType;
sysPara->para.pulse_sinal_value = ui->spinBoxpluseSinal->value();
}
}
void TriggerCtrl::TriggerupdateSysParaToUI(){
updateSysParaToUI();
}
void TriggerCtrl::updateSysParaToUI(){
if(sysPara)
{
/*----------------------------------------*/
setTriggerUI(sysPara->para.printTriggerMode);
ui->spinBoxDelayTriggerValue->setValue(sysPara->para.printDelayMs);
#ifndef NON_CABLE
ui->comboBoxTimeTriggerMode->setCurrentIndex(sysPara->para.timeTriggerPrintMode);
#endif
ui->spinBoxEleEyeTriggerIntervalMs->setValue(sysPara->para.elecEyeTriggerInterval);
ui->spinBoxOutputPulseDelayMs->setValue(sysPara->para.outputPulseDelayMs);
ui->spinBoxEleEyeTriggerRepeatCnt->setValue(sysPara->para.photoElectricityRepeateNum);
//ui->spinBoxSynTriggerPrintLen->setValue(sysPara->para.synTriggerPrintLenMm);
ui->spinBoxSynTriggerPrintLen->setText(QString::number(sysPara->para.synTriggerPrintLenMm));
ui->lineEditTriggerPulsePerMm->setText(QString::number(sysPara->para.synPulseNumPerMm));
if(sysPara->para.sysTriggerPrintMode == SYN_PRINT_MODE_ACCORDING_CHAR_WIDTH)
//edit@11-19
;//ui->spinBoxSynTriggerPrintLenRatio->setValue(sysPara->para.synCharWidthRatio);
else
ui->spinBoxSynTriggerPrintLenRatio->setValue(sysPara->para.synTriggerPrintLenRatio);
/*----------------------------------------*/
ui->spinBoxEleEyeTriggerPrintDelay->setValue(sysPara->para.eleEyeTriggerPrintDelay);
ui->checkBoxSynMakeClean->setChecked(sysPara->para.synClearCntInEleEyeMode);
//ui->checkBoxEleEyeMakeClean->setChecked(sysPara->para.eleEyeClearCntInSynMode);
ui->comboBoxEleEyeMakeClean->setCurrentIndex( sysPara->para.eleEyeClearCntInSynMode & 0x0f);
ui->checkBoxPulseOutputEnable->setChecked(sysPara->para.pulseOutputEnable);
ui->labelProductCntPerOutputPulse->setEnabled(sysPara->para.pulseOutputEnable);
ui->spinBoxProductCntPerOutputPulse->setEnabled(sysPara->para.pulseOutputEnable);
ui->spinBoxProductCntPerOutputPulse->setValue(sysPara->para.productCntPerOutputPulse);
ui->labelOutputPulseDelayMs->setEnabled(sysPara->para.pulseOutputEnable);
//ui->spinBoxOutputPulseDelayMs->setEnabled(sysPara->para.pulseOutputEnable);
ui->spinBoxOutputPulseDelayMs->setEnabled(true /*sysPara->para.outputPulseDelayMs*/);
ui->spinBoxOuputPulseCol->setValue(sysPara->para.OuputPulseCol);
ui->checkEyeTriggerSynPrintEn->setChecked (sysPara->para.eleEyeTriggerSynPrintEn);
ui->comboBoxSyncActType->setCurrentIndex (sysPara->para.synchronizorActType);
//ui->checkBoxAutoSpeedEN->setChecked (sysPara->para.autoSynSpeedEn );
ui->spinBoxEleMaskTime->setValue(sysPara->para.eleMaskTime);
ui->spinBoxAltMirrorGap->setValue( sysPara->para.AltMirrorGap & 0x0fff );
ui->comboBoxAltMirrType->setCurrentIndex( (sysPara->para.AltMirrorGap>>12) & 0x000F);
ui->spinBoxpluseSinal->setValue(sysPara->para.pulse_sinal_value);
//72版本禁用该输入框
//67打开
}
}
void TriggerCtrl::applyUIPara(){
if(sysPara){
GetTriggerUIPara();
if(sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER)
{
if( sysPara->para.synTriggerPrintLenMm < sysPara->para.eleEyeTriggerPrintDelay )
{
QMessageBox::information(this,tr("提示:参数不正确"),tr("要求:触发长度小于喷印间隔"));
}
}
sysPara->para.pulseOutputEnable = ui->checkBoxPulseOutputEnable->isChecked();
sysPara->para.productCntPerOutputPulse = ui->spinBoxProductCntPerOutputPulse->value();
sysPara->para.outputPulseDelayMs = ui->spinBoxOutputPulseDelayMs->value();
sysPara->para.OuputPulseCol = ui->spinBoxOuputPulseCol->value();
if(( ( //sysPara->para.eleEyeTriggerSynPrintEn ||
ui->checkEyeTriggerSynPrintEn->checkState()==1 )
&&(sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL || sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE))
|| sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER )
{
ui->labelOutputPulseDelayMs->setText(tr("延时(毫米):"));
}
else ui->labelOutputPulseDelayMs->setText(tr("延时(毫秒):"));
#ifdef DEBUG1
qDebug()<<"TriggerCtrl::applyUIPara"<<"1";
#endif
if(sysPara->devOp->writeFpgaPrintPara() != -1)
QMessageBox::information(this,tr("提示"),tr("应用成功"));
#ifdef DEBUG1
qDebug()<<"TriggerCtrl::applyUIPara"<<"3";
#endif
}
}
void TriggerCtrl::updateSysStatusToUI(){
static char t_init = 0;
if(sysPara){
if(t_init == 0){
sysPara->loadParaFromFile();
//qDebug()<<"sysPara->para.pulse_sinal_value="<<sysPara->para.pulse_sinal_value;
ui->spinBoxpluseSinal->setValue(sysPara->para.pulse_sinal_value);
t_init = 1;
}
// if((sysPara->para.printTriggerMode == PRINT_TRIGGER_SYNCHRONIZER))
// {
// ui->lineEditPulseCount ->setText(QString::number((int )((sysPara->para.synTriggerPrintLenMm)*sysPara->para.synPulseNumPerMm)));
// }
// else if(((sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL
// ||sysPara->para.printTriggerMode == PRINT_TRIGGER_ELEC_EYE_EDGE)
// && sysPara->para.eleEyeTriggerSynPrintEn))
// {
// ui->lineEditPulseCount ->setText(QString::number( (int )((sysPara->para.elecEyeTriggerInterval)*sysPara->para.synPulseNumPerMm)));
// }
}
}
void TriggerCtrl::on_checkEyeTriggerSynPrintEn_pressed()
{
#if 0
int triggerMode = sysPara->para.printTriggerMode;
if(sysPara)
{
//if( !sysPara->para.eleEyeTriggerSynPrintEn )
if( !ui->checkEyeTriggerSynPrintEn->isChecked() )
{
//ui->radioButtonSynTrigger->setChecked(1);
ui->spinBoxSynTriggerPrintLen->setEnabled(1);
ui->labelSynTriggerPrintLen->setEnabled(1);
ui->lineEditTriggerPulsePerMm->setEnabled(1);
ui->labelTriggerPulsePerMm->setEnabled(1);
ui->spinBoxSynTriggerPrintLenRatio->setEnabled(1);
ui->labelSynTriggerPrintLenRatio->setEnabled(1);
ui->checkBoxEleEyeMakeClean->setEnabled(1);
ui->pushButtonApplyPulseFix->setEnabled(1);
ui->comboBoxSynPrintMode->setEnabled(1);
ui->labelSynPrintMode->setEnabled(1);
ui->checkBoxAutoSpeedEN->setEnabled (1);
ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(0);
ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫米)"));
ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫米)"));
ui->labelOutputPulseDelayMs->setText("延时(毫米):");
if(ui->checkBoxpausePrintSyncInv->isChecked())
{
ui->checkBoxpausePrintSyncInv->setChecked(false);
}
}
else
{
ui->radioButtonSynTrigger->setChecked(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->spinBoxSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->labelSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->lineEditTriggerPulsePerMm->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->labelTriggerPulsePerMm->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->spinBoxSynTriggerPrintLenRatio->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->labelSynTriggerPrintLenRatio->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->checkBoxEleEyeMakeClean->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->pushButtonApplyPulseFix->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->comboBoxSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->labelSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->checkBoxAutoSpeedEN->setEnabled (triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
//ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(1);
ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫秒)"));
ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫秒)"));
ui->labelOutputPulseDelayMs->setText( ui->radioButtonSynTrigger->isChecked()?"延时(毫米):":"延时(毫秒):");
}
// sysPara->para.eleEyeTriggerSynPrintEn=!sysPara->para.eleEyeTriggerSynPrintEn;
}
#endif
}
void TriggerCtrl::on_radioButtonDelayTrigger_pressed()
{
setTriggerUI(PRINT_TRIGGER_TIME);
// emit synDisableFontWidth(false);
}
void TriggerCtrl::on_radioButtonEleEyeEdgetTrigger_pressed()
{
setTriggerUI(PRINT_TRIGGER_ELEC_EYE_EDGE);
// emit synDisableFontWidth(false);
}
void TriggerCtrl::on_radioButtonEleEyeLevelTrigger_pressed()
{
setTriggerUI(PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL);
// emit synDisableFontWidth(false);
}
void TriggerCtrl::on_radioButtonSynTrigger_pressed()
{
//edit@11-19
sysPara->para.printTriggerMode = PRINT_TRIGGER_SYNCHRONIZER;
setTriggerUI(PRINT_TRIGGER_SYNCHRONIZER);
// const unsigned short &FpgaVer=sysPara->status.build_dat.builTime;
// //72版本禁用字符宽度
// if(72 == FpgaVer){
// ui->spinBoxSynTriggerPrintLenRatio->setValue(0);
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(0);
// }else if (67 == FpgaVer)
// ui->spinBoxSynTriggerPrintLenRatio->setEnabled(1);
// emit synDisableFontWidth(true);
}
void TriggerCtrl::on_pushButtonApplyPulseFix_clicked()
{
pulseNumFix->bindSysPara(sysPara);
pulseNumFix->hide();
pulseNumFix->show();
}
void TriggerCtrl::onPulseNumFixDone(float value){
ui->lineEditTriggerPulsePerMm->setText(QString::number(value));
}
void TriggerCtrl::on_comboBoxSynPrintMode_currentIndexChanged(int index)
{
setSynPrintMode(index);
}
void TriggerCtrl::on_pushButtonApply_pressed()
{
applyUIPara();
if(sysPara)sysPara->saveParaToFile ();
emit autoUpdateFontWidthByTriggerCtrl(sysPara->status.textEditTotalCol);
TriggerCtrlLog();
}
void TriggerCtrl::TriggerCtrlLog(){
qDebug()<<QString("TriggerCtrl 触发模式: %1").arg(sysPara->para.printTriggerMode);
qDebug()<<QString("TriggerCtrl 脉冲数/毫米: %1").arg(ui->lineEditTriggerPulsePerMm->text().toFloat());
qDebug()<<QString("TriggerCtrl 喷印间隔(毫米): %1").arg(ui->spinBoxSynTriggerPrintLen->text().toFloat());
qDebug()<<QString("TriggerCtrl 同步喷印模式: %1").arg(ui->comboBoxSynPrintMode->currentIndex());
qDebug()<<QString("TriggerCtrl 字符宽度: %1").arg(ui->spinBoxSynTriggerPrintLenRatio->value());
qDebug()<<QString("TriggerCtrl 电眼控制: %1").arg(ui->comboBoxEleEyeMakeClean->currentIndex());
qDebug()<<QString("TriggerCtrl 镜象交替类型: %1").arg(ui->comboBoxAltMirrType->currentIndex());
qDebug()<<QString("TriggerCtrl 镜像交替间隔: %1").arg(ui->spinBoxAltMirrorGap->value());
qDebug()<<QString("TriggerCtrl 脉冲信号值: %1").arg(ui->spinBoxpluseSinal->value());
qDebug()<<QString("TriggerCtrl 重复次数: %1").arg(ui->spinBoxEleEyeTriggerRepeatCnt->value());
qDebug()<<QString("TriggerCtrl 重复间隔(毫秒): %1").arg(ui->spinBoxEleEyeTriggerIntervalMs->value());
qDebug()<<QString("TriggerCtrl 同步打印: %1").arg(ui->checkEyeTriggerSynPrintEn->isChecked ());
qDebug()<<QString("TriggerCtrl 触发延时(毫秒): %1").arg(ui->spinBoxEleEyeTriggerPrintDelay->value());
qDebug()<<QString("TriggerCtrl 封锁时间(毫秒): %1").arg(ui->spinBoxEleMaskTime->value());
qDebug()<<QString("TriggerCtrl 同步器清零: %1").arg(ui->checkBoxSynMakeClean->isChecked());
qDebug()<<QString("TriggerCtrl 重复间隔(毫秒): %1").arg(ui->spinBoxDelayTriggerValue->value());
qDebug()<<QString("TriggerCtrl 间隔模式: %1").arg(ui->comboBoxTimeTriggerMode->currentIndex());
qDebug()<<QString("TriggerCtrl 同步器正反转打印: %1").arg(ui->comboBoxSyncActType->currentIndex());
qDebug()<<QString("TriggerCtrl 产生脉冲所需计数: %1").arg(ui->spinBoxProductCntPerOutputPulse->value());
qDebug()<<QString("TriggerCtrl 延时(毫秒): %1").arg(ui->spinBoxOutputPulseDelayMs->value());
qDebug()<<QString("TriggerCtrl 脉冲输出使能: %1").arg(ui->checkBoxPulseOutputEnable->isChecked());
}
void TriggerCtrl::on_checkBoxPulseOutputEnable_clicked()
{
bool checked = ui->checkBoxPulseOutputEnable->isChecked();
ui->labelProductCntPerOutputPulse->setEnabled(checked);
ui->spinBoxProductCntPerOutputPulse->setEnabled(checked);
//ui->labelOutputPulseDelayMs->setEnabled(checked);
//ui->spinBoxOutputPulseDelayMs->setEnabled(checked);
}
void TriggerCtrl::setBuildTime(QString s1)
{
QString s;
#if 0 /* roger use new Version manage,so delete it */
s.sprintf(" %s ",__TIME__);
s = (QString) Public::DateToString(__DATE__)+s + BVER;
#else
s.sprintf("%d.%d.%02d_GuiL_", UP_PRINTER_MAJOR_VER, UP_PRINTER_MINOR_VER,UP_PRINTER_RIVISION_VER);
s = s + (QString) Public::DateToString(__DATE__)+ "_"+ QString(__TIME__)+"_"+UP_PRINTER_STAGE_VER;
// s = s + BVER;
#endif
ui->test_version->setText(s+s1);
//ui->test_version->setText (BUILD_DATE+s);
}
void TriggerCtrl::on_checkEyeTriggerSynPrintEn_clicked(bool checked)
{
int triggerMode = sysPara->para.printTriggerMode;
if(sysPara)
{
//if( !sysPara->para.eleEyeTriggerSynPrintEn )
if( checked)
{
//ui->radioButtonSynTrigger->setChecked(1);
#ifndef NON_CABLE
ui->spinBoxSynTriggerPrintLen->setEnabled(1);
#endif
ui->labelSynTriggerPrintLen->setEnabled(1);
ui->lineEditTriggerPulsePerMm->setEnabled(1);
ui->labelTriggerPulsePerMm->setEnabled(1);
ui->spinBoxSynTriggerPrintLenRatio->setEnabled(1);
ui->labelSynTriggerPrintLenRatio->setEnabled(1);
ui->checkBoxEleEyeMakeClean->setEnabled(1);
ui->pushButtonApplyPulseFix->setEnabled(1);
ui->comboBoxSynPrintMode->setEnabled(1);
ui->labelSynPrintMode->setEnabled(1);
//ui->checkBoxAutoSpeedEN->setEnabled (1);
ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(0);
ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫米)"));
ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫米)"));
ui->labelEleMaskTime->setText(tr("封锁间隔(毫米)"));
ui->labelOutputPulseDelayMs->setText(tr("延时(毫米):"));
if(ui->comboBoxSyncActType->currentIndex() || 0b11) //如果不是在正反转打印的模式下,就切换到正反转模式
{
ui->comboBoxSyncActType->setCurrentIndex(0);
}
}
else
{
ui->radioButtonSynTrigger->setChecked(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
#ifndef NON_CABLE
ui->spinBoxSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
#endif
ui->labelSynTriggerPrintLen->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->lineEditTriggerPulsePerMm->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->labelTriggerPulsePerMm->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->spinBoxSynTriggerPrintLenRatio->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->labelSynTriggerPrintLenRatio->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->checkBoxEleEyeMakeClean->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->pushButtonApplyPulseFix->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->comboBoxSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->labelSynPrintMode->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
//ui->checkBoxAutoSpeedEN->setEnabled (triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
//ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(triggerMode == PRINT_TRIGGER_SYNCHRONIZER);
ui->spinBoxEleEyeTriggerIntervalMs->setEnabled(1);
ui->labelEleEyeTriggerPrintDelay->setText(tr("触发延时(毫秒)"));
ui->labelEleEyeTriggerIntervalMs->setText(tr("重复间隔(毫秒)"));
ui->labelEleMaskTime->setText(tr("封锁间隔(毫秒)"));
ui->labelOutputPulseDelayMs->setText( ui->radioButtonSynTrigger->isChecked()?tr("延时(毫米):"):tr("延时(毫秒):"));
}
}
}
void TriggerCtrl::on_comboBoxSyncActType_activated(int index)
{
if(index>0)
{
on_checkEyeTriggerSynPrintEn_clicked(false);
}
}
void TriggerCtrl::on_lineEditTriggerPulsePerMm_textChanged(const QString &arg1)
{
Q_UNUSED(arg1);
sysPara->para.synPulseNumPerMm = ui->lineEditTriggerPulsePerMm->text().toFloat();
}
void TriggerCtrl::on_spinBoxSynTriggerPrintLen_textChanged(const QString &arg1)
{
Q_UNUSED(arg1);
//sysPara->para.synTriggerPrintLenMm = ui->spinBoxSynTriggerPrintLen->text().toFloat();
}
//void TriggerCtrl::on_spinBoxEleEyeTriggerIntervalMs_valueChanged(int arg1)
//{
// sysPara->para.elecEyeTriggerInterval = arg1;
//}
// //2020/3/2
// void TriggerCtrl::on_radioButtonSynTrigger_clicked()
// {
// sysPara->para.printTriggerMode = PRINT_TRIGGER_SYNCHRONIZER;
// sysPara->para.printColDelay = 0;
// }
void TriggerCtrl::on_radioButtonEleEyeLevelTrigger_clicked()
{
sysPara->para.printTriggerMode = PRINT_TRIGGER_ELEC_EYE_VOLTATE_LEVEL;
}
void TriggerCtrl::on_radioButtonEleEyeEdgetTrigger_clicked()
{
sysPara->para.printTriggerMode = PRINT_TRIGGER_ELEC_EYE_EDGE;
}
void TriggerCtrl::on_radioButtonDelayTrigger_clicked()
{
sysPara->para.printTriggerMode = PRINT_TRIGGER_TIME;
}
#define PRINT_CTRL_ADDR_BASE 0xa400
typedef struct pulse_struct {
unsigned int pulse_value:16;
}Pulse_struct;
void TriggerCtrl::on_spinBoxpluseSinal_valueChanged(int arg1)
{
Pulse_struct t_pulse_struct;
sysPara->para.pulse_sinal_value = arg1;
t_pulse_struct.pulse_value = arg1*10*ui->lineEditTriggerPulsePerMm->text().toFloat();
sysPara->devOp->fpgaWr(PRINT_CTRL_ADDR_BASE + 0x88, (unsigned char *)&t_pulse_struct, 2);
}
void TriggerCtrl::OutputPulse()
{
ui->checkBoxPulseOutputEnable->setChecked(true);
ui->spinBoxProductCntPerOutputPulse->setEnabled(true);
ui->spinBoxProductCntPerOutputPulse->setValue(sysPara->para.productCntPerOutputPulse);
}