59 lines
1.2 KiB
C++
59 lines
1.2 KiB
C++
#include "setnumdlg.h"
|
|
#include "ui_setnumdlg.h"
|
|
#include "SystemManage.h"
|
|
#include <QDebug>
|
|
#include "LogInfo.h"
|
|
|
|
SystemManage* sysMgr = nullptr;
|
|
|
|
SetNumDlg::SetNumDlg(QWidget *parent) :
|
|
QDialog(parent),
|
|
ui(new Ui::SetNumDlg)
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
ui->btn_confirm->setAutoDefault(false); // 禁止回车自动触发
|
|
ui->btn_confirm->setDefault(false); // 彻底取消默认按钮
|
|
|
|
connect(ui->btn_resetCnt1, &QPushButton::clicked, this, &SetNumDlg::sig_resetCNT1);
|
|
connect(ui->btn_resetCnt2, &QPushButton::clicked, this, &SetNumDlg::sig_resetCNT2);
|
|
|
|
// 默认禁用 重置计数器1 重置计数器2 的按钮
|
|
setCNTResetBtnsEnable(false, false);
|
|
}
|
|
|
|
SetNumDlg::~SetNumDlg()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
bool SetNumDlg::getIsSet()
|
|
{
|
|
return isSet;
|
|
}
|
|
|
|
int SetNumDlg::getNum()
|
|
{
|
|
return num;
|
|
}
|
|
|
|
void SetNumDlg::on_btn_confirm_clicked()
|
|
{
|
|
num = ui->sb_num->value();
|
|
isSet = ui->cb_setNum->isChecked();
|
|
|
|
this->hide();
|
|
emit sig_setNum();
|
|
}
|
|
|
|
void SetNumDlg::setCNTResetBtnsEnable(bool cnt1Btn, bool cnt2Btn)
|
|
{
|
|
ui->btn_resetCnt1->setEnabled(cnt1Btn);
|
|
ui->btn_resetCnt2->setEnabled(cnt2Btn);
|
|
}
|
|
|
|
void SetNumDlg::on_btn_clearProductCnt_clicked()
|
|
{
|
|
emit sig_clearCnt();
|
|
}
|