添加内核logo程序更新;编辑界面打开时;所有item相对对齐到scene(0,0);
This commit is contained in:
+9
-10
@@ -39,8 +39,8 @@ InkJetPrinter::InkJetPrinter(QWidget* parent)
|
||||
|
||||
QString ARM_Version;
|
||||
ARM_Version.sprintf("%d.%d.%02d%s%s", UP_PRINTER_MAJOR_VER, UP_PRINTER_MINOR_VER,UP_PRINTER_RIVISION_VER,SUB_VERSION,SUB_RFID);
|
||||
ui.label_version->setText(QString("A%1/F%2.%3.%4").arg(ARM_Version).arg(sysPara->status.fpgaVersionNum >> 12)
|
||||
.arg((sysPara->status.fpgaVersionNum>>8) & 0x0f).arg(sysPara->status.fpgaVersionNum&0xff) );
|
||||
// ui.label_version->setText(QString("A%1/F%2.%3.%4").arg(ARM_Version).arg(sysPara->status.fpgaVersionNum >> 12)
|
||||
// .arg((sysPara->status.fpgaVersionNum>>8) & 0x0f).arg(sysPara->status.fpgaVersionNum&0xff) );
|
||||
|
||||
|
||||
#ifdef ARCH_X86
|
||||
@@ -120,7 +120,7 @@ void InkJetPrinter::init()
|
||||
|
||||
// TestPrintWidget::sendButtonClickedSignal(16) 转由 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_switchWorkFileRequested, this, &InkJetPrinter::slt_updatePrintContent);
|
||||
|
||||
#ifndef FPGA_TEST
|
||||
// 调入文件喷印时,主动重启打印
|
||||
@@ -641,10 +641,7 @@ void InkJetPrinter::timerHandler(void){
|
||||
bool InkSwintFlag = false,lastInkSwintFlag = false;
|
||||
static float gearPumpRunNormalValue = 0.0;
|
||||
if(sysPara){
|
||||
ui.label_queue->setText(tr("%1/%2/%3").arg(sysPara->status.sizeFPGA).arg(sysPara->status.sizequeueFPGA).arg(sysPara->status.sizeSTM32));
|
||||
ui.m_LabelTimer->setText(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"));
|
||||
ui.label_pressure->setText(QString("%1/%2").arg(sysPara->status.PRESSURE).arg(sysPara->para.pressure));
|
||||
ui.label_speed->setText(QString("%1").arg(sysPara->status.gearPumpRunSpeed));
|
||||
xxxm=1;
|
||||
if(sysPara->para.flagOfModuleDecimal || sysPara->para.flagOfModuleHide){
|
||||
sysPara->para.flagOfModuleDecimal = 0;
|
||||
@@ -1524,14 +1521,14 @@ void InkJetPrinter::getMainWidgetButtonClickedSlot(int index)
|
||||
case 1: { // 编辑当前文件
|
||||
|
||||
// 如果上次打开的文件不存在或者不是xml文件,则创建一个新的作业文件
|
||||
QFileInfo fileInfo(sysPara->para.lastOpenedFileName);
|
||||
if(!fileInfo.exists() || fileInfo.suffix() != "xml"){
|
||||
if(currWorkFile.isEmpty()){
|
||||
createNewJobFile();
|
||||
break;
|
||||
}
|
||||
|
||||
// 如果上次打开的文件存在且是xml文件,则直接打开该文件
|
||||
m_TestPrintWidget->openWorkFile(sysPara->para.lastOpenedFileName);
|
||||
QFileInfo fileInfo(currWorkFile);
|
||||
m_TestPrintWidget->openWorkFile(currWorkFile);
|
||||
ui.label_currEditFile->setText(QString("E: %1").arg(fileInfo.baseName()));
|
||||
m_StackedWidget->setCurrentWidget(m_TestPrintWidget);
|
||||
break;
|
||||
@@ -2719,6 +2716,8 @@ bool InkJetPrinter::loadWorkFileAndPreparePrint(const QString &filename)
|
||||
strncpy(sysPara->para.lastOpenedFileName, u8Filename.constData(), sizeof(sysPara->para.lastOpenedFileName) - 1);
|
||||
sysPara->para.lastOpenedFileName[sizeof(sysPara->para.lastOpenedFileName) - 1] = '\0';
|
||||
sysPara->saveParaToFile();
|
||||
|
||||
currWorkFile = filename;
|
||||
|
||||
if(rePrint) {
|
||||
m_MainWidget->on_m_StartBtn_clicked();
|
||||
@@ -2775,7 +2774,7 @@ void InkJetPrinter::disableTabClick(){
|
||||
}
|
||||
|
||||
void InkJetPrinter::setShowVserionInfo(QString str){
|
||||
ui.label_version->setText(str);
|
||||
// ui.label_version->setText(str);
|
||||
}
|
||||
|
||||
void InkJetPrinter::OnFinished(int event){
|
||||
|
||||
@@ -127,6 +127,8 @@ private:
|
||||
*/
|
||||
bool loadWorkFileAndPreparePrint(const QString& filename);
|
||||
|
||||
QString currWorkFile;
|
||||
|
||||
void checkPressureControl();
|
||||
void showMessage(QString);
|
||||
|
||||
|
||||
+24
-29
@@ -39,13 +39,36 @@
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame1">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color:#4E679F;</string>
|
||||
<string notr="true">
|
||||
QWidget{
|
||||
background-color:#4E679F;
|
||||
font-size: 25px;
|
||||
color: #efefef;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="fixedHeight" stdset="0">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="hlayout_frame1">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="titleText">
|
||||
<property name="styleSheet">
|
||||
@@ -89,34 +112,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_pressure">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_speed">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_version">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_queue">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
|
||||
@@ -648,12 +648,19 @@ void SystemManage::ondialogAuthorizationAccepted()
|
||||
snprintf(cmd,sizeof(cmd),"chmod a+x /home/plg/qt4");
|
||||
res = system(cmd);
|
||||
}
|
||||
|
||||
if(file.exists("/udisk/psplash")) {
|
||||
system("cp /udisk/psplash /usr/bin");
|
||||
system("chmod 777 /usr/bin/psplash");
|
||||
}
|
||||
|
||||
snprintf(cmd,sizeof(cmd),"cp /udisk/emergency /home/plg/");
|
||||
res = system(cmd);
|
||||
snprintf(cmd,sizeof(cmd),"chmod a+x /udisk/ss");
|
||||
res = system(cmd);
|
||||
snprintf(cmd,sizeof(cmd),"/udisk/ss");
|
||||
res = system(cmd);
|
||||
system("sync");
|
||||
QMessageBox::information(this, tr("提示"), tr("软件更新成功,重启后生效!"));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -120,6 +120,7 @@ void SystemUpdate::on_pushButtonFontToUdisk_clicked()
|
||||
system((char *)((QString("cp /usr/lib/fonts/* /udisk/.")).toLatin1().data()));//am335x
|
||||
system((char *)((QString("cp /usr/lib/fonts/* /udisk/.")).toLatin1().data()));
|
||||
system((char *)((QString("mkdir /udisk/zk")).toLatin1().data()));
|
||||
system("sync");
|
||||
QMessageBox::information(this, tr("提示"),
|
||||
tr("字库导出完成!"));
|
||||
}
|
||||
|
||||
+20
-20
@@ -1,8 +1,8 @@
|
||||
# QtUI 喷码机项目架构说明文档
|
||||
|
||||
> **版本**: V6.7.4
|
||||
> **目标平台**: ARM Linux (AM335x) / x86 (模拟调试)
|
||||
> **Qt 版本**: Qt 4.6.3 (ARM) / Qt 5.x (x86)
|
||||
> **目标平台**: ARM Linux (全志H618) / x86 (模拟调试)
|
||||
> **Qt 版本**: Qt 5.x (ARM) / Qt 5.x (x86)
|
||||
> **屏幕分辨率**: 800x600
|
||||
> **文档编写日期**: 2026-07-23
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
- **系统管理**: 参数配置、FPGA/STM32固件升级、软件更新、日志管理
|
||||
- **文件管理**: 作业文件的创建、保存、导入、导出(U盘)
|
||||
- **RFID刷卡**: 墨水/溶剂/保养卡的身份验证与消耗管理
|
||||
- **多语言支持**: 中文、英文、土耳其语、西班牙语、泰语、越南语、韩语、波斯语等
|
||||
|
||||
---
|
||||
|
||||
@@ -44,7 +43,7 @@
|
||||
|
||||
| 类别 | 技术 |
|
||||
|------|------|
|
||||
| 框架 | Qt 4.6.3 (ARM) / Qt 5.x (x86) |
|
||||
| 框架 | Qt 5.x (ARM) / Qt 5.x (x86) |
|
||||
| 语言 | C++ (C++11),部分C |
|
||||
| 构建工具 | qmake |
|
||||
| UI设计 | Qt Designer (.ui文件) |
|
||||
@@ -69,23 +68,23 @@
|
||||
│ UI 表现层 │
|
||||
│ InkJetPrinter (主窗口) + MainWidget (打印主界面) │
|
||||
│ 各功能页面: SystemManage, SystemSetting, LogInfo, ... │
|
||||
│ 场景编辑器: TestPrintWidget, ItemEditor, PicScene │
|
||||
│ 场景编辑器: TestPrintWidget, PicScene │
|
||||
├─────────────────────────────────────────────────────────┤
|
||||
│ 业务逻辑层 │
|
||||
│ SysPara (系统参数管理) │
|
||||
│ DevOp (设备操作) │
|
||||
│ RunTimeCtrl (运行时间统计) │
|
||||
│ LogInfoCtrl (日志控制) │
|
||||
│ RFIDManager (刷卡管理) │
|
||||
│ 业务逻辑层 │
|
||||
│ SysPara (系统参数管理) │
|
||||
│ DevOp (设备操作) │
|
||||
│ RunTimeCtrl (运行时间统计) │
|
||||
│ LogInfoCtrl (日志控制) │
|
||||
│ RFIDManager (刷卡管理) │
|
||||
├─────────────────────────────────────────────────────────┤
|
||||
│ 通信层 │
|
||||
│ Serial (串口通信封装) │
|
||||
│ Modbus (Modbus协议) │
|
||||
│ 通信层 │
|
||||
│ Serial (串口通信封装) │
|
||||
│ Modbus (Modbus协议) │
|
||||
├─────────────────────────────────────────────────────────┤
|
||||
│ 硬件抽象层 │
|
||||
│ FPGA (喷印控制、高压、相位检测) │
|
||||
│ STM32 (墨路控制、传感器采集) │
|
||||
│ RFID读卡器 (IC卡读写) │
|
||||
│ 硬件抽象层 │
|
||||
│ FPGA (喷印控制、高压、相位检测) │
|
||||
│ STM32 (墨路控制、传感器采集) │
|
||||
│ RFID读卡器 (IC卡读写) │
|
||||
└─────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
@@ -94,9 +93,10 @@
|
||||
```
|
||||
InkJetPrinter (顶层窗口)
|
||||
├── MainWidget (打印主界面)
|
||||
│ ├── PicScene (场景管理)
|
||||
│ ├── generatePrintContent (打印文件载入预览)
|
||||
│ ├── FileManageWidget (文件管理)
|
||||
│ └── PrintTextDisplay (打印预览)
|
||||
│ ├── PrintTextDisplay (打印预览)
|
||||
| └── 其他
|
||||
├── TestPrintWidget (编辑界面)
|
||||
│ ├── PicScene (场景编辑)
|
||||
│ ├── ItemEditor (图元编辑)
|
||||
|
||||
@@ -96,6 +96,10 @@ public:
|
||||
|
||||
void stopFlashReclaimOpenBtn();
|
||||
|
||||
PicScene* currScene() const {
|
||||
return pPicScene;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 设置回收槽开关状态
|
||||
* @param isOpen true:开;false:关
|
||||
|
||||
+20
-6
@@ -67,11 +67,6 @@ TestPrintWidget::TestPrintWidget(QWidget* parent)
|
||||
// ui->senceEditOption->bindScene(pPicScene, ui->graphicsView, ui->textEdit);
|
||||
this->pPicScene->setIsdrawBackground(true);
|
||||
|
||||
// 哪个天才写的?拿view和scene计算一下会死吗?
|
||||
// for(int i=0;i<3;i++){
|
||||
// on_enlargeButton_pressed();
|
||||
// }
|
||||
|
||||
connect(pPicScene,&PicScene::selectionChanged,this,[=]() {
|
||||
getShowSelectItemText();
|
||||
});
|
||||
@@ -191,7 +186,7 @@ TestPrintWidget::TestPrintWidget(QWidget* parent)
|
||||
saveFile();
|
||||
}
|
||||
|
||||
emit sig_updatePrintContent(xmlfileName);
|
||||
emit sig_switchWorkFileRequested(xmlfileName);
|
||||
}
|
||||
|
||||
emit sendButtonClickedSignal(20);
|
||||
@@ -430,6 +425,25 @@ void TestPrintWidget::openWorkFile(QString filePath){
|
||||
|
||||
xmlfileName = filePath;
|
||||
|
||||
// 将场景中所有项移动,使 pPicScene->itemsBoundingRect() 的左上角对齐到 scene 的 (0,0)
|
||||
// 计算当前边界并做平移(仅在有偏移时执行)
|
||||
{
|
||||
QRectF bounds = pPicScene->itemsBoundingRect();
|
||||
if (!bounds.isNull()) {
|
||||
qreal dx = -bounds.x();
|
||||
qreal dy = -bounds.y();
|
||||
if (!qFuzzyIsNull(dx) || !qFuzzyIsNull(dy)) {
|
||||
const auto items = pPicScene->items();
|
||||
for (QGraphicsItem* it : items) {
|
||||
// 仅移动属于场景根的项,避免重复移动子项
|
||||
if (!it) continue;
|
||||
QPointF oldPos = it->pos();
|
||||
it->setPos(oldPos + QPointF(dx, dy));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(m_printSetting) {
|
||||
m_printSetting->setModel(m_printSettingModel);
|
||||
}
|
||||
|
||||
+1
-13
@@ -27,18 +27,6 @@
|
||||
#include "scene/BarcodeEditor.h"
|
||||
#include "Printsetting.h"
|
||||
|
||||
typedef struct ItemReplaceInfo
|
||||
{
|
||||
unsigned char vartypeR; //该图元中哪些类型(年、月、日...)需要替换
|
||||
QString text; // 最初需要替换的内容 yyyy-MM-dd ...
|
||||
// QMap<int,QStringList> map; //类型对应替换的内容 如月index:2 对应要替换的QStringList: 01 02 A 04 05...
|
||||
QMap<int,QMap<int,QString>> map;
|
||||
}ItemReplaceInfo;
|
||||
|
||||
// 计数器1、2的source值
|
||||
#define SOURCE_COUNTER1 "Counter1_QvQ"
|
||||
#define SOURCE_COUNTER2 "Counter2_QvQ"
|
||||
|
||||
class TestPrintWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -191,7 +179,7 @@ signals:
|
||||
void sig_showScheduleShiftsEditor(QVector<ScheduleModel> schedules, TextItemModel txtModel);
|
||||
|
||||
// 点击确定后,更新打印内容
|
||||
void sig_updatePrintContent(const QString& filename);
|
||||
void sig_switchWorkFileRequested(const QString& filename);
|
||||
|
||||
void sig_currentFileChanged();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user