hlp:桂林国际齿轮泵代码
This commit is contained in:
@@ -0,0 +1,276 @@
|
||||
|
||||
#include "filelogger.h"
|
||||
#include <QTime>
|
||||
#include <QStringList>
|
||||
#include <QThread>
|
||||
#include <QtGlobal>
|
||||
#include <QFile>
|
||||
#include <QTimerEvent>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <stdio.h>
|
||||
#include<iostream>
|
||||
#include<string>
|
||||
#include<QDate>
|
||||
#include "LogInfo.h"
|
||||
#define LOG_FILE_PATH "/home/plg/loginfo/"
|
||||
|
||||
void FileLogger::refreshSettings()
|
||||
{
|
||||
mutex.lock();
|
||||
QString oldFileName=fileName;
|
||||
|
||||
settings->sync();
|
||||
fileName = LOG_FILE_PATH;
|
||||
// fileName=settings->value("fileName").toString();
|
||||
// LogInfo::setRunStatusText(tr("fileName: %1").arg(fileName));
|
||||
QDate today = QDate::currentDate();
|
||||
QString todayString=today.toString(Qt::ISODate);
|
||||
// 计算前七天的日期
|
||||
//QDate oneWeekAgo = today.addDays(-7);
|
||||
fileName+=today.toString(Qt::ISODate);
|
||||
fileName+="/";
|
||||
fileName+="log.txt";
|
||||
static QString lastDay = "";
|
||||
if(lastDay!=todayString)
|
||||
{
|
||||
TimerDel->start(30000);
|
||||
lastDay=todayString;
|
||||
}
|
||||
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
if (QDir::isRelativePath(fileName) && settings->format()!=QSettings::NativeFormat)
|
||||
#else
|
||||
// std::cout<<"QDir::isRelativePath:"<<QDir::isRelativePath(fileName)<<std::endl;
|
||||
if (QDir::isRelativePath(fileName))
|
||||
#endif
|
||||
{
|
||||
QFileInfo configFile(settings->fileName());
|
||||
fileName=QFileInfo(configFile.absolutePath(),fileName).absoluteFilePath();
|
||||
}
|
||||
maxSize=settings->value("maxSize",0).toLongLong();
|
||||
maxBackups=settings->value("maxBackups",0).toInt();
|
||||
msgFormat=settings->value("msgFormat","{timestamp} {type} {msg}").toString();
|
||||
timestampFormat=settings->value("timestampFormat","yyyy-MM-dd hh:mm:ss.zzz").toString();
|
||||
bufferSize=settings->value("bufferSize",0).toInt();
|
||||
|
||||
QByteArray minLevelStr = settings->value("minLevel","ALL").toByteArray();
|
||||
if (minLevelStr=="ALL" || minLevelStr=="DEBUG" || minLevelStr=="0")
|
||||
{
|
||||
minLevel=QtDebugMsg;
|
||||
}
|
||||
else if (minLevelStr=="WARNING" || minLevelStr=="WARN" || minLevelStr=="1")
|
||||
{
|
||||
minLevel=QtWarningMsg;
|
||||
}
|
||||
else if (minLevelStr=="ERROR" || minLevelStr=="CRITICAL" || minLevelStr=="2")
|
||||
{
|
||||
minLevel=QtCriticalMsg;
|
||||
}
|
||||
else if (minLevelStr=="FATAL" || minLevelStr=="3")
|
||||
{
|
||||
// minLevel=QtMsgType::QtFatalMsg;
|
||||
minLevel=QtFatalMsg;
|
||||
}
|
||||
// else if (minLevelStr=="INFO" || minLevelStr=="4")
|
||||
// {
|
||||
// minLevel=QtMsgType::QtInfoMsg;
|
||||
// }
|
||||
|
||||
if (oldFileName!=fileName)
|
||||
{
|
||||
fprintf(stderr,"Logging to %s\n",qPrintable(fileName));
|
||||
close();
|
||||
open();
|
||||
}
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
FileLogger::FileLogger(QSettings *settings, const int refreshInterval, QObject* parent)
|
||||
: Logger(parent)
|
||||
{
|
||||
TimerDel = new QTimer(this);
|
||||
connect(TimerDel,SIGNAL(timeout()),this,SLOT(timeOutToDelete()));
|
||||
Q_ASSERT(settings!=nullptr);
|
||||
Q_ASSERT(refreshInterval>=0);
|
||||
this->settings=settings;
|
||||
file=nullptr;
|
||||
if (refreshInterval>0)
|
||||
{
|
||||
refreshTimer.start(refreshInterval,this);
|
||||
}
|
||||
flushTimer.start(1000,this);
|
||||
refreshSettings();
|
||||
}
|
||||
|
||||
|
||||
FileLogger::~FileLogger()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
void FileLogger::write(const LogMessage* logMessage)
|
||||
{
|
||||
if (file)
|
||||
{
|
||||
// qDebug()<<"Critical message output test\n";
|
||||
// qCritical("This is a critical message of test\n");
|
||||
file->write(qPrintable(logMessage->toString(msgFormat,timestampFormat)));
|
||||
|
||||
if (logMessage->getType()>=QtCriticalMsg)
|
||||
{
|
||||
file->flush();
|
||||
}
|
||||
|
||||
if (file->error())
|
||||
{
|
||||
qWarning("Cannot write to log file %s: %s",qPrintable(fileName),qPrintable(file->errorString()));
|
||||
close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!file)
|
||||
{
|
||||
Logger::write(logMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FileLogger::open()
|
||||
{
|
||||
if (fileName.isEmpty())
|
||||
{
|
||||
qWarning("Name of logFile is empty");
|
||||
}
|
||||
else {
|
||||
file=new QFile(fileName);
|
||||
QFileInfo fileInfo(fileName);
|
||||
//std::cout<<"fileInfo.exists:"<<fileInfo.exists()?"true" : "false"<<std::endl;
|
||||
// 检查文件路径是否有效
|
||||
if (!fileInfo.exists()) {
|
||||
// 获取文件所在的目录路径
|
||||
QString dirPath = QFileInfo(fileName).absoluteDir().path();
|
||||
// 检查目录是否存在
|
||||
if (!QDir(dirPath).exists()) {
|
||||
// 如果目录不存在,则创建目录
|
||||
QDir().mkpath(dirPath);
|
||||
if (!QDir(dirPath).exists()) {
|
||||
// 如果创建目录失败,显示错误消息
|
||||
qDebug("Cannot create directory for log file: %s", qPrintable(dirPath));
|
||||
delete file;
|
||||
file = nullptr;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!file->open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text))
|
||||
{
|
||||
std::cout<<"file is is open faile fileName:"<<fileName.toStdString()<<std::endl;
|
||||
qWarning("Cannot open log file %s: %s",qPrintable(fileName),qPrintable(file->errorString()));
|
||||
file=nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FileLogger::close()
|
||||
{
|
||||
if (file)
|
||||
{
|
||||
file->close();
|
||||
delete file;
|
||||
file=nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void FileLogger::rotate() {
|
||||
int count=0;
|
||||
forever
|
||||
{
|
||||
QFile bakFile(QString("%1.%2").arg(fileName).arg(count+1));
|
||||
if (bakFile.exists())
|
||||
{
|
||||
++count;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
while (maxBackups>0 && count>=maxBackups)
|
||||
{
|
||||
QFile::remove(QString("%1.%2").arg(fileName).arg(count));
|
||||
--count;
|
||||
}
|
||||
|
||||
for (int i=count; i>0; --i) {
|
||||
QFile::rename(QString("%1.%2").arg(fileName).arg(i),QString("%1.%2").arg(fileName).arg(i+1));
|
||||
}
|
||||
|
||||
QFile::rename(fileName,fileName+".1");
|
||||
|
||||
}
|
||||
|
||||
|
||||
void FileLogger::timerEvent(QTimerEvent* event)
|
||||
{
|
||||
if (!event)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (event->timerId()==refreshTimer.timerId())
|
||||
{
|
||||
refreshSettings();
|
||||
}
|
||||
else if (event->timerId()==flushTimer.timerId() && file)
|
||||
{
|
||||
mutex.lock();
|
||||
|
||||
file->flush();
|
||||
|
||||
if (maxSize>0 && file->size()>=maxSize)
|
||||
{
|
||||
close();
|
||||
rotate();
|
||||
open();
|
||||
}
|
||||
|
||||
mutex.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
bool FileLogger::removeDirectory(const QString &directoryPath) {
|
||||
// 检查目录是否存在
|
||||
QDir dir(directoryPath);
|
||||
if (dir.exists()) {
|
||||
system((char *)((QString("rm -r %1").arg(directoryPath)).toAscii().data()));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void FileLogger::timeOutToDelete(){
|
||||
QDate today = QDate::currentDate();
|
||||
for(int daysAgo=14;daysAgo>=7;--daysAgo){
|
||||
QString needToDelFoldPath=LOG_FILE_PATH;
|
||||
QDate pastDate=today.addDays(-daysAgo);
|
||||
needToDelFoldPath+=pastDate.toString(Qt::ISODate);
|
||||
needToDelFoldPath+="/";
|
||||
if (QDir(needToDelFoldPath).exists()) {
|
||||
bool result= removeDirectory(needToDelFoldPath);
|
||||
if(result){
|
||||
qDebug()<<"The directory and all its contents have been removed";
|
||||
LogInfo::setRunStatusText(tr("The directory and all its contents have been removed"));
|
||||
}else{
|
||||
qDebug() << "Failed to remove the directory";
|
||||
LogInfo::setRunStatusText(tr("Failed to remove the directory"));
|
||||
}
|
||||
}
|
||||
}
|
||||
TimerDel->stop();
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,100 @@
|
||||
#ifndef QBARCODE_H
|
||||
#define QBARCODE_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include "BarCode/barcode.h"
|
||||
#include "QGraphicsScene"
|
||||
#include "QGraphicsPixmapItem"
|
||||
#include "SysPara.h"
|
||||
#include "QTextEdit"
|
||||
#include "ParaSettingUI.h"
|
||||
|
||||
//typedef struct // BarCodeOption
|
||||
//{
|
||||
// unsigned char xpos;
|
||||
// unsigned char font;
|
||||
// unsigned char height;
|
||||
// unsigned char scale;
|
||||
// unsigned char text[200];
|
||||
//}bcOption_t;
|
||||
typedef struct {
|
||||
unsigned int width;
|
||||
unsigned char height;
|
||||
unsigned char type;
|
||||
unsigned char nc;
|
||||
}bcPara_t;
|
||||
|
||||
namespace Ui {
|
||||
class QBarCode;
|
||||
}
|
||||
|
||||
class QBarCode : public QDialog, public ParaSettingUI
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QBarCode(QWidget *parent = 0);
|
||||
~QBarCode();
|
||||
void bindSysPara(SysPara *sysPara);
|
||||
//unsigned char pointMap[40*1000];
|
||||
QString pictureName;//当前显示的图片
|
||||
void SetOption(bcOption_t *bcOption);
|
||||
void GetOption(bcOption_t *bcOption);
|
||||
QString bcText;
|
||||
int bcWidth,bcHeight;
|
||||
unsigned char flagInsert:1;
|
||||
unsigned char flagCount:1;
|
||||
unsigned char inkColor:1;
|
||||
unsigned char flagNC:5;
|
||||
|
||||
int ImgRightPos(QImage *img);
|
||||
int ImgLeftPos(QImage *img);
|
||||
int getDat(unsigned char *dat,int varNum);
|
||||
int getDat2(SysPara* sysPara,int varNum);
|
||||
public:
|
||||
QImage imgBar;
|
||||
|
||||
QString TextToBCImg(bcOption_t *bcVar,QString txt);
|
||||
void TextBarCode(QString txt, int index);
|
||||
void GetOption2(bcPara_t *bcOption);
|
||||
QString getLabe_TxtString();
|
||||
QString getVarTxt(bool varEn, unsigned varType);// 0,1,2,3,4
|
||||
void extSetText(QString text);
|
||||
public slots:
|
||||
void setFontSize(int PixelSize);
|
||||
private slots:
|
||||
void onEnCodeBar();
|
||||
void onScaleChange(int n);
|
||||
void onXposChange(int n);
|
||||
void on_pushBtnColse_pressed();
|
||||
void ImgSave();
|
||||
void onBarCodeRefresh(QString s);
|
||||
signals:
|
||||
void onBarCodeClose();
|
||||
private:
|
||||
|
||||
void OnCharRamData(QImage *img);
|
||||
void OnCharRamData1(QImage *img);
|
||||
void OnCharRamData2(QImage *img1,int Txtwidth,int height);
|
||||
void ShowBarCode(QString fileName);
|
||||
void ShowBarCode(QImage *img);
|
||||
int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei,
|
||||
int xoff, int yoff, int flags);
|
||||
int Barcode_ToImage(Barcode_Item * bc );
|
||||
int fontSize;
|
||||
|
||||
QGraphicsScene *scene;//声明scene
|
||||
QGraphicsPixmapItem *item;//声明item
|
||||
bool bcOK;
|
||||
QString bcPartial;
|
||||
QString bcTextinfo;
|
||||
bool AutoRefresh;
|
||||
QTextEdit textEdit;
|
||||
QString txtVar1,txtVar2;
|
||||
|
||||
private:
|
||||
Ui::QBarCode *ui;
|
||||
};
|
||||
|
||||
#endif // QBARCODE_H
|
||||
@@ -0,0 +1,43 @@
|
||||
#ifndef BISTREAM_H
|
||||
#define BISTREAM_H
|
||||
|
||||
/*
|
||||
* qrencode - QR Code encoder
|
||||
*
|
||||
* Binary sequence class.
|
||||
* 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 __BITSTREAM_H__
|
||||
#define __BITSTREAM_H__
|
||||
|
||||
typedef struct {
|
||||
char *data;
|
||||
} BitStream;
|
||||
|
||||
extern BitStream *BitStream_new(void);
|
||||
extern void BitStream_append(BitStream *bstream, BitStream *arg);
|
||||
extern void BitStream_appendNum(BitStream *bstream, int bits, unsigned int num);
|
||||
extern void BitStream_appendBytes(BitStream *bstream, int size, unsigned char *data);
|
||||
extern unsigned int BitStream_size(BitStream *bstream);
|
||||
extern unsigned char *BitStream_toByte(BitStream *bstream);
|
||||
extern void BitStream_free(BitStream *bstream);
|
||||
|
||||
#endif /* __BITSTREAM_H__ */
|
||||
|
||||
|
||||
#endif // BISTREAM_H
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
@@ -0,0 +1,299 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>LogInfo</class>
|
||||
<widget class="QWidget" name="LogInfo">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>当前状态</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextEdit" name="textEditRunStatus">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="palette">
|
||||
<palette>
|
||||
<active>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</active>
|
||||
<inactive>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</inactive>
|
||||
<disabled>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</disabled>
|
||||
</palette>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pushButtonClearCurrent">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>清空当前状态</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>历史状态</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextEdit" name="textEditRunStatus_2">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="palette">
|
||||
<palette>
|
||||
<active>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</active>
|
||||
<inactive>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</inactive>
|
||||
<disabled>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</disabled>
|
||||
</palette>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelPreFileName">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="pushButtonClear">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>删除历史文件</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="pushButtonPreState">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>打开历史文件</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="pushButtonExportFile">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>导出日志到U盘</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabInformation">
|
||||
<attribute name="title">
|
||||
<string>版本信息</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextEdit" name="machinInformation">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="palette">
|
||||
<palette>
|
||||
<active>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</active>
|
||||
<inactive>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</inactive>
|
||||
<disabled>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</disabled>
|
||||
</palette>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,353 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>dlgQrCode</class>
|
||||
<widget class="QDialog" name="dlgQrCode">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>560</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::NoContextMenu</enum>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="image.qrc">
|
||||
<normaloff>:/icon/bypm.png</normaloff>:/icon/bypm.png</iconset>
|
||||
</property>
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="2" colspan="3">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="pushBtnClose">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>返回</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QComboBox" name="comboBoxType">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>DataMatrix</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>QRCode</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="pushBtnSave">
|
||||
<property name="text">
|
||||
<string>保存</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="pushBtnPreView">
|
||||
<property name="text">
|
||||
<string>预览</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QComboBox" name="comboBoxInkColor">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>正相打印</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>反相打印</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelVarInc">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>变量增量</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEditVarInc">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhDigitsOnly</set>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="5">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>信息前缀</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEditCNT">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhDigitsOnly</set>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>变量(初值)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLineEdit" name="lineEditIn2">
|
||||
<property name="maxLength">
|
||||
<number>80</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLineEdit" name="lineEditIn">
|
||||
<property name="maxLength">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>信息后缀</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="5">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="labRECT">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxAutoCount">
|
||||
<property name="text">
|
||||
<string>计数器(变量)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxAuto">
|
||||
<property name="text">
|
||||
<string>自动刷新</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>插入文档</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labName">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>160</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="5">
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>200</number>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGraphicsView" name="BarCodeView">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>600</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="barCodeCheckBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>条形码</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QComboBox" name="comboBox_DMType">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>默认</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>8 x 18</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>8 x 32</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>12 x 26</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>12 x 36</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>16 x 36</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>16 x 48</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>DM码尺寸:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="4">
|
||||
<widget class="QCheckBox" name="checkBoxInsertTime">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>自动插入时间</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="image.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user