|
|
|
@ -17,7 +17,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|
|
|
|
{
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initFile();
|
|
|
|
|
initWindow();
|
|
|
|
|
initButton();
|
|
|
|
|
// initMenuBar();
|
|
|
|
@ -56,6 +56,18 @@ MainWindow::~MainWindow()
|
|
|
|
|
delete ui;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* @brief MainWindow::initFile 初始化配置文件 .ini
|
|
|
|
|
*/
|
|
|
|
|
void MainWindow::initFile()
|
|
|
|
|
{
|
|
|
|
|
QString urlFile = QCoreApplication::applicationDirPath()+"/config.ini";
|
|
|
|
|
QFile file(urlFile);
|
|
|
|
|
if(!file.open(QIODevice::ReadWrite))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void MainWindow::initWindow()
|
|
|
|
|
{
|
|
|
|
|
setWindowIcon(QIcon(":/res/SDFP.png"));
|
|
|
|
@ -72,13 +84,43 @@ void MainWindow::initWindow()
|
|
|
|
|
m_HomePagedlg = new HomePageDlg(this);
|
|
|
|
|
m_rescueLoadWidget = new RescueLoadWidget(this);
|
|
|
|
|
|
|
|
|
|
//使用信号槽函数获取配置文件中的IP
|
|
|
|
|
connect(m_HomePagedlg, &HomePageDlg::sendUrl, this, [](std::unordered_map<QString,QString> urlMap){
|
|
|
|
|
qDebug() << "L链" << urlMap["L链"];
|
|
|
|
|
qDebug() << "宽带自组网" << urlMap["宽带自组网"];
|
|
|
|
|
qDebug() << "机载卫通" << urlMap["机载卫通"];
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//使用类中的get方法获取配置文件中的IP
|
|
|
|
|
|
|
|
|
|
m_HomePagedlg->getUrl(m_urlMap);
|
|
|
|
|
|
|
|
|
|
qDebug() << "=============设备配置================";
|
|
|
|
|
qDebug() << "L链" << m_urlMap["L链"];
|
|
|
|
|
qDebug() << "宽带自组网" << m_urlMap["宽带自组网"];
|
|
|
|
|
qDebug() << "机载卫通" << m_urlMap["机载卫通"];
|
|
|
|
|
|
|
|
|
|
mWeb = new CWebEngineView();
|
|
|
|
|
mWeb->setPage(new CustomWebEnginePage());
|
|
|
|
|
mWeb->load(QUrl("http://192.168.150.1"));
|
|
|
|
|
// mWeb = new QWebEngineView(this);
|
|
|
|
|
|
|
|
|
|
lLinkWeb = new CWebEngineView();
|
|
|
|
|
lLinkWeb->setPage(new CustomWebEnginePage());
|
|
|
|
|
lLinkWeb->load(QUrl(m_urlMap["L链"]));
|
|
|
|
|
|
|
|
|
|
adHocNetworkWeb = new CWebEngineView();
|
|
|
|
|
adHocNetworkWeb->setPage(new CustomWebEnginePage());
|
|
|
|
|
adHocNetworkWeb->load(QUrl(m_urlMap["宽带自组网"]));
|
|
|
|
|
|
|
|
|
|
satelliteCommWeb = new CWebEngineView();
|
|
|
|
|
satelliteCommWeb->setPage(new CustomWebEnginePage());
|
|
|
|
|
satelliteCommWeb->load(QUrl(m_urlMap["机载卫通"]));
|
|
|
|
|
|
|
|
|
|
// 设置栈窗口,多页面共享同一窗口
|
|
|
|
|
ui->stackedWidget->addWidget(mWeb);
|
|
|
|
|
ui->stackedWidget->addWidget(lLinkWeb);
|
|
|
|
|
ui->stackedWidget->addWidget(adHocNetworkWeb);
|
|
|
|
|
ui->stackedWidget->addWidget(satelliteCommWeb);
|
|
|
|
|
ui->stackedWidget->addWidget(m_GDDCdlg);
|
|
|
|
|
ui->stackedWidget->addWidget(m_HomePagedlg);
|
|
|
|
|
ui->stackedWidget->addWidget(m_rescueLoadWidget);
|
|
|
|
@ -113,7 +155,7 @@ void MainWindow::initButton()
|
|
|
|
|
ui->toolButton_3->setText("L链");
|
|
|
|
|
ui->toolButton_4->setText("自组网");
|
|
|
|
|
ui->toolButton_5->setText("PDT集群");
|
|
|
|
|
ui->toolButton_6->setText("Ku卫通");
|
|
|
|
|
ui->toolButton_6->setText("机载卫通");
|
|
|
|
|
ui->toolButton_7->setText("搜救载荷");
|
|
|
|
|
ui->toolButton_8->setText("三维建模");
|
|
|
|
|
ui->toolButton->setFixedWidth(FixedWidth);
|
|
|
|
@ -252,7 +294,7 @@ void MainWindow::toolButton_3_clicked()
|
|
|
|
|
{
|
|
|
|
|
changeBtnColor(3);
|
|
|
|
|
// mWeb->load(QUrl("http://192.168.1.10"));
|
|
|
|
|
ui->stackedWidget->setCurrentWidget(mWeb);
|
|
|
|
|
ui->stackedWidget->setCurrentWidget(lLinkWeb);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//自组网
|
|
|
|
@ -261,7 +303,7 @@ void MainWindow::toolButton_4_clicked()
|
|
|
|
|
changeBtnColor(4);
|
|
|
|
|
// mWeb->load(QUrl("http://192.168.1.10"));
|
|
|
|
|
// mWeb->show();
|
|
|
|
|
ui->stackedWidget->setCurrentWidget(mWeb);
|
|
|
|
|
ui->stackedWidget->setCurrentWidget(adHocNetworkWeb);
|
|
|
|
|
//process->kill();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -280,7 +322,7 @@ void MainWindow::toolButton_6_clicked()
|
|
|
|
|
changeBtnColor(6);
|
|
|
|
|
// mWeb->load(QUrl("http://192.168.0.2"));
|
|
|
|
|
// mWeb->show();
|
|
|
|
|
ui->stackedWidget->setCurrentWidget(mWeb);
|
|
|
|
|
ui->stackedWidget->setCurrentWidget(satelliteCommWeb);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|