139 lines
5.0 KiB
C++
139 lines
5.0 KiB
C++
//
|
|
// Created by Wakanda_shaw on 2022/4/27.
|
|
//
|
|
|
|
// You may need to build the project (run Qt uic code generator) to get "ui_main_window.h" resolved
|
|
|
|
#include "main_window.h"
|
|
#include "UI/ui_main_window.h"
|
|
#include "rtklib.h"
|
|
|
|
using namespace std;
|
|
|
|
main_window::main_window(QWidget *parent) :
|
|
QWidget(parent), ui(new Ui::main_window) {
|
|
ui->setupUi(this);
|
|
|
|
// Read_Sat("C:\\Users\\56509\\iCloudDrive\\GNSS文献\\LG69T\\20220419 06-44 IMU\\log\\rover419.obs", "C:\\Users\\56509\\iCloudDrive\\GNSS文献\\LG69T\\20220419 06-44 IMU\\log\\rover419.nav","C:\\Users\\56509\\Desktop\\1.csv");
|
|
this->setAcceptDrops(true);
|
|
ui->progressBar->setValue(0);
|
|
ui->progressBar->setRange(0,100);
|
|
|
|
// 点击文件选择按钮
|
|
connect(ui->toolButton_input, &QPushButton::clicked,[=](){
|
|
QFileInfo fileinfo;
|
|
QString filepath, abs_filepath;
|
|
|
|
|
|
filepath = QFileDialog::getOpenFileName(this,"打开文件",QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
|
|
fileinfo = QFileInfo(filepath);
|
|
abs_filepath = fileinfo.absolutePath();
|
|
// 文件名
|
|
filename = fileinfo.baseName();
|
|
ui->lineEdit_input->setText(filepath);
|
|
ui->lineEdit_Obs->setText(abs_filepath+"/"+filename+".obs");
|
|
ui->lineEdit_Nav->setText(abs_filepath+"/"+filename+".nav");
|
|
|
|
});
|
|
|
|
// 选择Obs
|
|
connect(ui->toolButton_Obs, &QPushButton::clicked,[=](){
|
|
QFileInfo fileinfo;
|
|
QString filepath;
|
|
|
|
filepath = QFileDialog::getOpenFileName(this,"打开.Obs",QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
|
|
fileinfo = QFileInfo(filepath);
|
|
// 文件名
|
|
Obs_file = fileinfo.baseName();
|
|
ui->lineEdit_Obs->setText(filepath);
|
|
});
|
|
// 选择Nav
|
|
connect(ui->toolButton_Nav, &QPushButton::clicked,[=](){
|
|
QFileInfo fileinfo;
|
|
QString filepath;
|
|
|
|
filepath = QFileDialog::getOpenFileName(this,"打开.Nav",QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
|
|
fileinfo = QFileInfo(filepath);
|
|
// 文件名
|
|
Nav_file = fileinfo.baseName();
|
|
ui->lineEdit_Nav->setText(filepath);
|
|
});
|
|
|
|
|
|
|
|
// Output_Dir
|
|
connect(ui->toolButton_output, &QPushButton::clicked,[=](){
|
|
QString filepath;
|
|
filepath = QFileDialog::getExistingDirectory(this,"选择路径",QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
|
|
if(!filepath.isEmpty()){
|
|
ui->lineEdit_output->setText(filepath);
|
|
ui->lineEdit_IMU->setText(filepath+"/"+"IMU"+".csv");
|
|
ui->lineEdit_PVT->setText(filepath+"/"+"PVT"+".csv");
|
|
ui->lineEdit_Sat->setText(filepath+"/"+"Sat"+".csv");
|
|
}
|
|
});
|
|
|
|
// 得到IMU输出路径
|
|
connect(ui->toolButton_IMU, &QPushButton::clicked, [=](){
|
|
QString filepath;
|
|
filepath = QFileDialog::getExistingDirectory(this,"选择路径",QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
|
|
if(!filepath.isEmpty() && !filename.isEmpty()){
|
|
ui->lineEdit_IMU->setText(filepath+"/"+"IMU"+".csv");
|
|
}
|
|
});
|
|
|
|
// 得到PVT输出路径
|
|
connect(ui->toolButton_PVT, &QPushButton::clicked, [=](){
|
|
QString filepath;
|
|
filepath = QFileDialog::getExistingDirectory(this,"选择路径",QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
|
|
if(!filepath.isEmpty() && !filename.isEmpty()){
|
|
ui->lineEdit_PVT->setText(filepath+"/"+"PVT"+".csv");
|
|
}
|
|
});
|
|
|
|
// start按钮
|
|
connect(ui->pushButton, &QPushButton::clicked, [=](){
|
|
ui->pushButton->setEnabled(false);
|
|
|
|
std::condition_variable kl_cv;
|
|
std::mutex kl_mtx;
|
|
std::unique_lock <std::mutex> kl_lck(kl_mtx);
|
|
std::thread kl_thread([&](){
|
|
QString inpath, IMUpath, PVTpath, Satpath, Obspath, Navpath;
|
|
inpath = ui->lineEdit_input->text();
|
|
Obspath = ui->lineEdit_Obs->text();
|
|
Navpath = ui->lineEdit_Nav->text();
|
|
IMUpath = ui->lineEdit_IMU->text();
|
|
PVTpath = ui->lineEdit_PVT->text();
|
|
Satpath = ui->lineEdit_Sat->text();
|
|
if(!inpath.isEmpty() && !IMUpath.isEmpty() && !PVTpath.isEmpty() && !Obspath.isEmpty() && !Navpath.isEmpty() && !Satpath.isEmpty()){
|
|
Read_IMU(inpath, IMUpath);
|
|
ui->progressBar->setValue(30);
|
|
Read_PVT(inpath, PVTpath);
|
|
ui->progressBar->setValue(70);
|
|
if(ui->comboBox->currentText()=="Single"){
|
|
Read_Sat(Obspath, Navpath, Satpath, ui,IONOOPT_BRDC);
|
|
}
|
|
else{
|
|
Read_Sat(Obspath, Navpath, Satpath, ui,IONOOPT_IFLC);
|
|
}
|
|
}
|
|
kl_cv.notify_all();
|
|
});
|
|
kl_thread.detach();
|
|
while (kl_cv.wait_for(kl_lck, std::chrono::milliseconds(100)) == std::cv_status::timeout)
|
|
{
|
|
qApp->processEvents();
|
|
}
|
|
ui->pushButton->setEnabled(true);
|
|
});
|
|
|
|
}
|
|
|
|
main_window::~main_window() {
|
|
delete ui;
|
|
}
|
|
|
|
|
|
|