hlp:分段计米部分bug修复,按需求不需要超级密码就可以使用分段计米

This commit is contained in:
kite_lucs
2026-08-28 17:37:05 +08:00
parent f29fafca9e
commit f7b7faab2e
11 changed files with 112 additions and 95 deletions
+5
View File
@@ -25,6 +25,11 @@ void SectionalManager::emitLoadUI()
emit sig_loadSettings2UI();
}
void SectionalManager::emitCancelSection()
{
emit sig_cancelSection();
}
SectionalManager::SectionalManager()
{
+3 -1
View File
@@ -25,6 +25,8 @@ public:
//应用配置
void emitLoadUI();
// 取消分段计米
void emitCancelSection();
private:
SectionalManager();
@@ -33,7 +35,7 @@ signals:
void sig_applySetting();
void sig_loadSettings2UI();
void sig_updateCntGroupDisp(bool);
void sig_cancelSection();
};
#endif // SECTIONALMANAGER_H
+20 -8
View File
@@ -18,6 +18,8 @@ SectionalWid::SectionalWid(QWidget *parent) :
this, &SectionalWid::slt_loadSettings2UI);
connect(SectionalManager::instance(), &SectionalManager::sig_updateCntGroupDisp,
this, &SectionalWid::slt_updateCntGroupDisp);
connect(SectionalManager::instance(), &SectionalManager::sig_cancelSection,
this, &SectionalWid::slt_cancelSection);
}
SectionalWid::~SectionalWid()
@@ -152,7 +154,7 @@ void SectionalWid::on_cnt3RemoveAllRowsBtn_3_clicked()
void SectionalWid::on_checkBoxGroupCnt1_clicked(bool checked)
{
// 信号修改计数器的显示
ui->checkBoxGroupCnt_2->setChecked(checked);
// ui->checkBoxGroupCnt_2->setChecked(checked);
SectionalManager::instance()->emitUpdateCntShow(checked);
}
@@ -234,27 +236,30 @@ void SectionalWid::rowWidgetCreate2(int rowIndex)
void SectionalWid::LoadCnt2GroupSettingsToUI()
{
ui->checkBoxGroupCnt_2->setChecked(sysPara->para.cnt2ByGroupEnalbe);
// 两个同时启用,这个cb设true就会都取消
// ui->checkBoxGroupCnt_2->setChecked(sysPara->para.cnt2ByGroupEnalbe);
on_checkBoxGroupCnt_2_clicked(sysPara->para.cnt2ByGroupEnalbe);
//qDebug()<<"LoadCnt1GroupSettingsToUI:cnt1GroupCnt "<<sysPara->para.Cnt1ByGroup.cnt1GroupCnt;
ui->tableWidget_2->setRowCount(sysPara->para.Cnt2ByGroup.cnt2GroupCnt);
for(int i=0; i<sysPara->para.Cnt2ByGroup.cnt2GroupCnt; i++)
{
QSpinBox *spinBox = new QSpinBox();
spinBox->setButtonSymbols(QSpinBox::NoButtons);
spinBox->setValue(sysPara->para.Cnt2ByGroup.cnt2GroupSettings[i].StartValue);
int startV = sysPara->para.Cnt2ByGroup.cnt2GroupSettings[i].StartValue;
spinBox->setValue(startV);
spinBox->setRange(0, INT_MAX);
ui->tableWidget_2->setCellWidget(i,0,spinBox);
spinBox = new QSpinBox();
spinBox->setButtonSymbols(QSpinBox::NoButtons);
spinBox->setValue(sysPara->para.Cnt2ByGroup.cnt2GroupSettings[i].EndValue);
int endV = sysPara->para.Cnt2ByGroup.cnt2GroupSettings[i].EndValue;
spinBox->setValue(endV);
spinBox->setRange(0, INT_MAX);
ui->tableWidget_2->setCellWidget(i,1,spinBox);
spinBox = new QSpinBox();
spinBox->setButtonSymbols(QSpinBox::NoButtons);
spinBox->setValue(sysPara->para.Cnt2ByGroup.cnt2GroupSettings[i].LoopTimes);
int loopV = sysPara->para.Cnt2ByGroup.cnt2GroupSettings[i].LoopTimes;
spinBox->setValue(loopV);
spinBox->setRange(1, INT_MAX);
ui->tableWidget_2->setCellWidget(i,2,spinBox);
}
@@ -265,7 +270,7 @@ void SectionalWid::LoadCnt2GroupSettingsToUI()
void SectionalWid::on_checkBoxGroupCnt_2_clicked(bool checked)
{
// 信号修改计数器的显示
ui->checkBoxGroupCnt1->setChecked(checked);
// ui->checkBoxGroupCnt1->setChecked(checked);
SectionalManager::instance()->emitUpdateCntShow(checked);
}
@@ -306,7 +311,8 @@ void SectionalWid::ApplyCnt2GroupSetting()
{
QSpinBox *spinBox = nullptr;
sysPara->para.cnt2ByGroupEnalbe = ui->checkBoxGroupCnt_2->isChecked();
sysPara->para.Cnt2ByGroup.cnt2GroupCnt=ui->tableWidget_2->rowCount();
sysPara->para.Cnt2ByGroup.cnt2GroupCnt = ui->tableWidget_2->rowCount();
int r = ui->tableWidget_2->rowCount();
if(sysPara->para.cnt2ByGroupEnalbe && sysPara->para.Cnt2ByGroup.cnt2GroupCnt==0)
{
sysPara->para.cnt2ByGroupEnalbe=false;
@@ -547,6 +553,12 @@ void SectionalWid::slt_updateCntGroupDisp(bool bChangeToNext)
}
}
void SectionalWid::slt_cancelSection()
{
ui->checkBoxGroupCnt1->setChecked(false);
ui->checkBoxGroupCnt_2->setChecked(false);
}
void SectionalWid::initUI()
{
#ifdef COUNTER1_BY_GROUP /* 分段计米 */
+1 -1
View File
@@ -64,7 +64,7 @@ private slots:
void slt_applySetting();
void slt_loadSettings2UI();
void slt_updateCntGroupDisp(bool bChangeToNext);
void slt_cancelSection();
private:
Ui::SectionalWid *ui;
SysPara* sysPara = nullptr;