主界面小对话框中添加 计数器重置按钮
This commit is contained in:
+45
-1
@@ -144,6 +144,9 @@ void MainWidget::init()
|
||||
}
|
||||
connect(m_setNumDlg, &SetNumDlg::sig_setNum, this, &MainWidget::slt_setNum);
|
||||
connect(m_setNumDlg, &SetNumDlg::sig_clearCnt, this, &MainWidget::slt_clearCnt);
|
||||
|
||||
connect(m_setNumDlg, &SetNumDlg::sig_resetCNT1, this, &MainWidget::slt_resetCNT1);
|
||||
connect(m_setNumDlg, &SetNumDlg::sig_resetCNT2, this, &MainWidget::slt_resetCNT2);
|
||||
}
|
||||
|
||||
void MainWidget::buttonClickedSlot()
|
||||
@@ -185,7 +188,7 @@ void MySleep(unsigned int msec)
|
||||
|
||||
}
|
||||
|
||||
bool MainWidget::generatePrintContent(PicScene *scene)
|
||||
bool MainWidget::generatePrintContent(PicScene *scene, const PrintSettingModel& printSettings)
|
||||
{
|
||||
if(!scene) {
|
||||
qWarning() << "Scene is empty!";
|
||||
@@ -200,7 +203,34 @@ bool MainWidget::generatePrintContent(PicScene *scene)
|
||||
this->pPicScene = scene;
|
||||
onPreviewScene();
|
||||
|
||||
this->printSettingsModel = printSettings;
|
||||
PrintSettingModel::applyToSysPara(printSettings, sysPara);
|
||||
|
||||
SendPrintDataToFpga(0);
|
||||
|
||||
|
||||
// 检查场景内是否有计数器,根据是否有对应计数器,显示或禁用setNumDlg中对应的按钮。
|
||||
bool hasCNT1 = false;
|
||||
bool hasCNT2 = false;
|
||||
auto items = pPicScene->items();
|
||||
for(auto item : items) {
|
||||
auto cntItem = dynamic_cast<PicCounterItem*>(item);
|
||||
if(!cntItem)
|
||||
continue;
|
||||
|
||||
if(cntItem->counterType() == COUNTER_TYPE_1) {
|
||||
hasCNT1 = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(cntItem->counterType() == COUNTER_TYPE_2) {
|
||||
hasCNT2 = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
m_setNumDlg->setCNTResetBtnsEnable(hasCNT1, hasCNT2);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2628,6 +2658,20 @@ void MainWidget::onLabelFaultRusumePressed(){
|
||||
}
|
||||
}
|
||||
|
||||
void MainWidget::slt_resetCNT1()
|
||||
{
|
||||
sysPara->para.cnt1CurrValue = printSettingsModel.cnt1Settings.currValue;
|
||||
sysPara->para.cnt2CurrValue = QString::number(sysPara->status.calandar_and_dat.cnt2CurrValue,16).toInt();
|
||||
sysPara->devOp->writeFpgaCalandar(false);
|
||||
}
|
||||
|
||||
void MainWidget::slt_resetCNT2()
|
||||
{
|
||||
sysPara->para.cnt1CurrValue = QString::number(sysPara->status.calandar_and_dat.cnt1CurrValue,16).toInt();
|
||||
sysPara->para.cnt2CurrValue = printSettingsModel.cnt2Settings.currValue;
|
||||
sysPara->devOp->writeFpgaCalandar(false);
|
||||
}
|
||||
|
||||
extern int baudRateValue;
|
||||
void MainWidget::UpdateUIVersion(){
|
||||
int fpgaType = sysPara->status.fpgaVersionNum>>12;
|
||||
|
||||
Reference in New Issue
Block a user