新二维码/条形码编辑逻辑
This commit is contained in:
+31
-22
@@ -118,7 +118,6 @@ void InkJetPrinter::init()
|
||||
connect(m_SystemSetting,&SystemSetting::sendButtonClickedSignal,this,&InkJetPrinter::getSystemSettingWidgetButtonClickSlot);
|
||||
connect(m_OtherInfo,&OtherInfo::sendButtonClickedSignal,this,&InkJetPrinter::getOtherInfoWidgetButtonClickSlot);
|
||||
connect(m_LogInfo,&LogInfo::sendButtonClickedSignal,this,&InkJetPrinter::getLogInfoWidgetButtonClickSlot);
|
||||
connect(m_LogInfo,&LogInfo::sig_updateGeneralState,this,&InkJetPrinter::slt_updateGeneralState);
|
||||
|
||||
connect(m_DateVarSet,&DateVarSet::sendButtonClickedSignal,this,&InkJetPrinter::getDateSetWidgetButtonClickSlot);
|
||||
//添加计数器,修改计数器
|
||||
@@ -140,12 +139,20 @@ void InkJetPrinter::init()
|
||||
connect(m_TestPrintWidget, &TestPrintWidget::sig_showEditCounter,
|
||||
this, &InkJetPrinter::slt_editCounter);
|
||||
|
||||
// 状态界面
|
||||
if (ctrl_loginfo == nullptr) ctrl_loginfo = LogInfoCtrl::instance();
|
||||
connect(ctrl_loginfo, &LogInfoCtrl::sig_show, this, [=](){
|
||||
getMainWidgetButtonClickedSlot(5);
|
||||
m_LogInfo->checkState();
|
||||
});
|
||||
|
||||
SysPara *para = new SysPara();
|
||||
bindSysPara(para);
|
||||
m_MainWidget->bindSysPara(para);
|
||||
m_FontSetWidget->bindSysPara(para);
|
||||
m_PrintSetting->bindSysPara(para);
|
||||
m_SystemManage->bindSysPara(para);
|
||||
m_SystemUpdate->bindSysPara(para);
|
||||
m_SystemSetting->bindSysPara(para);
|
||||
m_OtherInfo->bindSysPara(para);
|
||||
m_TestPrintWidget->bindSysPara(para);
|
||||
@@ -153,7 +160,8 @@ void InkJetPrinter::init()
|
||||
m_CounterVarSet->bindSysPara(para);
|
||||
m_MainInstruction->bindSysPara(para);
|
||||
m_BarCodeDlg->bindSysPara(para);
|
||||
m_QRCodeDlg->setSysPara(para);
|
||||
m_QRCodeDlg->bindSysPara(para);
|
||||
m_LogInfo->bindSysPara(para);
|
||||
|
||||
if(sysPara->para.gearPumpEnable)
|
||||
pushButtonStartFlag = true;
|
||||
@@ -719,8 +727,8 @@ void InkJetPrinter::timerHandler(void){
|
||||
// byons: 改到往下一百行左右的位置了 byons@2026年4月11日
|
||||
// 用于刷新时间类型 byons@2026年4月10日
|
||||
// 现在只用于更新界面,给人看的,因此理论延迟1秒左右,实际受系统用量影响可能会更慢
|
||||
if(m_StackedWidget->currentWidget() == m_MainWidget)
|
||||
m_MainWidget->onPreviewScene();
|
||||
// if(m_StackedWidget->currentWidget() == m_MainWidget)
|
||||
// m_MainWidget->onPreviewScene();
|
||||
|
||||
// end by byons@2026年4月10日
|
||||
}
|
||||
@@ -831,20 +839,24 @@ void InkJetPrinter::timerHandler(void){
|
||||
}
|
||||
|
||||
// byons: 时间类型图元更新 @2026年4月11日
|
||||
if(sysPara->status.isPrinting) {
|
||||
if (m_MainWidget->dateTimeItemsDotUpdate()) {
|
||||
// // 统计追踪更新频率
|
||||
// static QElapsedTimer bnsTimer;
|
||||
// static int toogleCount = 0;
|
||||
// ++toogleCount;
|
||||
// if(toogleCount > 10) {
|
||||
// auto elapsed = bnsTimer.restart();
|
||||
// qDebug() << (QString("timeHandler avg elapsed: %1 s").arg(elapsed / qreal(toogleCount) / 1000.0));
|
||||
// toogleCount = 0;
|
||||
// }
|
||||
|
||||
// 统计追踪更新频率
|
||||
static QElapsedTimer bnsTimer;
|
||||
static int toogleCount = 0;
|
||||
++toogleCount;
|
||||
if(toogleCount > 10) {
|
||||
auto elapsed = bnsTimer.restart();
|
||||
qDebug() << (QString("timeHandler avg elapsed: %1 s").arg(elapsed / qreal(toogleCount) / 1000.0));
|
||||
toogleCount = 0;
|
||||
if(sysPara->status.isPrinting) {
|
||||
m_MainWidget->SendPrintDataToFpga(0);
|
||||
}
|
||||
|
||||
if (m_MainWidget->dateTimeItemsDotUpdate())
|
||||
m_MainWidget->SendPrintDataToFpga(0);
|
||||
if(m_StackedWidget->currentWidget() == m_MainWidget) {
|
||||
m_MainWidget->updatePrintDisplayLabel();
|
||||
}
|
||||
}
|
||||
|
||||
// if (modbus->getModbusStatus() == 1) {
|
||||
@@ -1130,6 +1142,7 @@ void InkJetPrinter::timerHandler(void){
|
||||
static bool read_flag = false;
|
||||
if((widget == m_MainWidget || widget == m_LogInfo) && pulse_100ms) {
|
||||
m_MainWidget->updateSysStatusToUI();
|
||||
m_MainWidget->updateGeneralState(m_MainWidget->alarmStatus);
|
||||
m_LogInfo->updateSysStatusToUI(m_MainWidget->alarmStatus);
|
||||
}
|
||||
/*
|
||||
@@ -1561,11 +1574,14 @@ void InkJetPrinter::getTestPrintWidgetButtonClickedSlot(int index)
|
||||
|
||||
void InkJetPrinter::openDatetimeEditor(PicDateItem* item)
|
||||
{
|
||||
m_DateVarSet->initUI();
|
||||
m_DateVarSet->initReplaceValue();
|
||||
|
||||
if(item) {
|
||||
m_DateVarSet->edit(item);
|
||||
}
|
||||
else
|
||||
m_DateVarSet->setDateModel(DateItemModel::createDefaultReplaceModel());
|
||||
|
||||
m_StackedWidget->setCurrentWidget(m_DateVarSet);
|
||||
}
|
||||
@@ -1758,13 +1774,6 @@ void InkJetPrinter::getLogInfoWidgetButtonClickSlot(int index){
|
||||
}
|
||||
}
|
||||
|
||||
void InkJetPrinter::slt_updateGeneralState(DevStatusLightType type, QString stateStr)
|
||||
{
|
||||
if (m_MainWidget) {
|
||||
m_MainWidget->updateGeneralState(type, stateStr);
|
||||
}
|
||||
}
|
||||
|
||||
void InkJetPrinter::getDateSetWidgetButtonClickSlot(int index){
|
||||
switch (index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user