添加128k配置
This commit is contained in:
parent
892f43fb29
commit
6263b93ee9
@ -21,6 +21,7 @@ COtherConfig::COtherConfig(QWidget *parent) :
|
||||
|
||||
ui->radioButton_closeIO->setChecked(1);
|
||||
LoadWorkingConditionConfig();
|
||||
get_status = false;
|
||||
}
|
||||
|
||||
COtherConfig::~COtherConfig()
|
||||
@ -301,7 +302,20 @@ void COtherConfig::slotNetMgr(QString sAddr, const QVariant &msg)
|
||||
{
|
||||
QJsonValue arrays_value = objec.take("cmd");
|
||||
qDebug()<<"cmd ="<<arrays_value.toString();
|
||||
{
|
||||
if(arrays_value.toString() == "113" && get_status){
|
||||
ui->pushButton_open_close->setEnabled("true");
|
||||
bool enable = objec.take("enable").toBool();
|
||||
if(enable){
|
||||
ui->radioButton_open_2->setChecked(true);
|
||||
ui->radioButton_close_2->setChecked(false);
|
||||
ui->pushButton_open_close->setText("关闭");
|
||||
}else{
|
||||
ui->radioButton_open_2->setChecked(false);
|
||||
ui->radioButton_close_2->setChecked(true);
|
||||
ui->pushButton_open_close->setText("打开");
|
||||
}
|
||||
get_status = false;
|
||||
}else{
|
||||
bool Status = objec.take("success").toBool();
|
||||
QString strMessage = objec.take("message").toString();
|
||||
if(Status){
|
||||
@ -473,3 +487,64 @@ void COtherConfig::on_radioButton_closeIO_clicked()
|
||||
g_strIOControl = "0";
|
||||
}
|
||||
|
||||
|
||||
void COtherConfig::on_radioButton_open_2_clicked()
|
||||
{
|
||||
|
||||
}
|
||||
void COtherConfig::on_radioButton_close_2_clicked()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void COtherConfig::on_pushButton_get_clicked()
|
||||
{
|
||||
QJsonObject sendData;
|
||||
sendData["cmd"] = "113";
|
||||
sendData["subcmd"] = 0;
|
||||
QNetworkRequest req;
|
||||
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
|
||||
req.setUrl(sUrl);
|
||||
g_NetMgr->PostJson(req,sendData);
|
||||
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
|
||||
|
||||
get_status = true;
|
||||
}
|
||||
|
||||
void COtherConfig::on_pushButton_open_close_clicked()
|
||||
{
|
||||
QMessageBox::StandardButton ret = QMessageBox::question(nullptr, "确认", "是否继续?",
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
QMessageBox::Yes);
|
||||
|
||||
if (ret == QMessageBox::No) {
|
||||
return;
|
||||
}
|
||||
QString btn_text = ui->pushButton_open_close->text();
|
||||
if(btn_text == "打开"){
|
||||
QJsonObject sendData;
|
||||
sendData["cmd"] = "113";
|
||||
sendData["subcmd"] = 1;
|
||||
sendData["enable"] = true;
|
||||
QNetworkRequest req;
|
||||
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
|
||||
req.setUrl(sUrl);
|
||||
g_NetMgr->PostJson(req,sendData);
|
||||
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
|
||||
ui->pushButton_open_close->setText("关闭");
|
||||
|
||||
}else if(btn_text == "关闭"){
|
||||
QJsonObject sendData;
|
||||
sendData["cmd"] = "113";
|
||||
sendData["subcmd"] = 1;
|
||||
sendData["enable"] = false;
|
||||
QNetworkRequest req;
|
||||
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
|
||||
req.setUrl(sUrl);
|
||||
g_NetMgr->PostJson(req,sendData);
|
||||
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
|
||||
ui->pushButton_open_close->setText("打开");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -32,13 +32,21 @@ private slots:
|
||||
|
||||
void on_radioButton_closeIO_clicked();
|
||||
|
||||
void on_radioButton_open_2_clicked();
|
||||
|
||||
void on_pushButton_get_clicked();
|
||||
|
||||
void on_radioButton_close_2_clicked();
|
||||
|
||||
void on_pushButton_open_close_clicked();
|
||||
|
||||
private:
|
||||
Ui::COtherConfig *ui;
|
||||
|
||||
QString m_strTriggerTime;
|
||||
QString m_strConfidence;
|
||||
QString m_strSegments;
|
||||
|
||||
bool get_status;
|
||||
void LoadWorkingConditionConfig();
|
||||
QString GBK2UTF8(QByteArray inStr);
|
||||
};
|
||||
|
||||
117
OtherConfig.ui
117
OtherConfig.ui
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>905</width>
|
||||
<width>921</width>
|
||||
<height>580</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -450,6 +450,118 @@
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>290</y>
|
||||
<width>251</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>128k配置</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_open_close">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>96</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>96</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">#pushButton_open_close { border-image: url(:/image/Btn/normal_Btn.png);
|
||||
color:#1f5188 }
|
||||
#pushButton_open_close:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
|
||||
color:#ffffff}
|
||||
#pushButton_open_close:pressed { border-image: url(:/image/Btn/normal_Btn_p.png);
|
||||
color:#ffffff}
|
||||
#pushButton_open_close:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
|
||||
color:#ffffff}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_open_2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>40</y>
|
||||
<width>37</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>开</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_get">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>40</y>
|
||||
<width>96</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>96</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">#pushButton_get { border-image: url(:/image/Btn/normal_Btn.png);
|
||||
color:#1f5188 }
|
||||
#pushButton_get:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
|
||||
color:#ffffff}
|
||||
#pushButton_get:pressed { border-image: url(:/image/Btn/normal_Btn_p.png);
|
||||
color:#ffffff}
|
||||
#pushButton_get:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
|
||||
color:#ffffff}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>获取</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_close_2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>40</y>
|
||||
<width>37</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>关</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -462,4 +574,7 @@
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="buttonGroup"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user