Files
HPPA/HPPA/adjustTable.cpp
2025-03-06 19:16:21 +08:00

87 lines
2.4 KiB
C++

#include "adjustTable.h"
adjustTable::adjustTable(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
connect(ui.objective_table1_up_btn, SIGNAL(clicked()), this, SLOT(onObjectivTable1Up_btn()));
connect(ui.objective_table1_down_btn, SIGNAL(clicked()), this, SLOT(onObjectivTable1Down_btn()));
connect(ui.objective_table1_stop_btn, SIGNAL(clicked()), this, SLOT(onObjectivTable1Stop_btn()));
connect(ui.objective_table2_up_btn, SIGNAL(clicked()), this, SLOT(onObjectivTable2Up_btn()));
connect(ui.objective_table2_down_btn, SIGNAL(clicked()), this, SLOT(onObjectivTable2Down_btn()));
connect(ui.objective_table2_stop_btn, SIGNAL(clicked()), this, SLOT(onObjectivTable2Stop_btn()));
connect(ui.objective_table252_up_btn, SIGNAL(clicked()), this, SLOT(onObjectivTable252Up_btn()));
connect(ui.objective_table252_down_btn, SIGNAL(clicked()), this, SLOT(onObjectivTable252Down_btn()));
connect(ui.objective_table252_stop_btn, SIGNAL(clicked()), this, SLOT(onObjectivTable252Stop_btn()));
}
adjustTable::~adjustTable()
{}
void adjustTable::getRequest(QString str)
{
QNetworkRequest request;
QNetworkAccessManager* naManager = new QNetworkAccessManager(this);
QMetaObject::Connection connRet = QObject::connect(naManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*)));
Q_ASSERT(connRet);
request.setUrl(QUrl(str));
QNetworkReply* reply = naManager->get(request);
}
void adjustTable::onObjectivTable1Up_btn()
{
QString xx = "http://192.168.1.253/set_up";
getRequest(xx);
}
void adjustTable::onObjectivTable1Down_btn()
{
QString xx = "http://192.168.1.253/set_down";
getRequest(xx);
}
void adjustTable::onObjectivTable1Stop_btn()
{
QString xx = "http://192.168.1.253/stopnow";
getRequest(xx);
}
void adjustTable::onObjectivTable2Up_btn()
{
QString xx = "http://192.168.1.254/set_up";
getRequest(xx);
}
void adjustTable::onObjectivTable2Down_btn()
{
QString xx = "http://192.168.1.254/set_down";
getRequest(xx);
}
void adjustTable::onObjectivTable2Stop_btn()
{
QString xx = "http://192.168.1.254/stopnow";
getRequest(xx);
}
void adjustTable::onObjectivTable252Up_btn()
{
QString xx = "http://192.168.1.252/set_up";
getRequest(xx);
}
void adjustTable::onObjectivTable252Down_btn()
{
QString xx = "http://192.168.1.252/set_down";
getRequest(xx);
}
void adjustTable::onObjectivTable252Stop_btn()
{
QString xx = "http://192.168.1.252/stopnow";
getRequest(xx);
}