hlp:分段计米部分bug修复,按需求不需要超级密码就可以使用分段计米
This commit is contained in:
@@ -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 /* 分段计米 */
|
||||
|
||||
Reference in New Issue
Block a user