This commit is contained in:
shuibing811
2025-02-12 09:16:58 +08:00
parent 69d8038f9b
commit 67595b284b
2 changed files with 15 additions and 16 deletions

View File

@@ -24,25 +24,29 @@ MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow) {
ui->setupUi(this);
//创建logger窗口
m_loggerWidget = std::make_shared<LoggerWidget>();//需要在RecordQuery创建前
m_loggerWidget->hide();
ui->lblCallDuration->hide();
//创建记录查询窗口
m_recordQueryWidget = std::make_shared<RecordQuery>();
m_recordQueryWidget->hide();
//创建并初始化图表
createBeiDouSignalStrengthChart();
createAzimuthMapChart();
//获取日志实例
m_logger = spdlog::get("logger");
//初始化其他控件
ui->lblCallDuration->hide();
ui->btnCallReject->hide();
//创建udp socket
m_udpSocket = std::make_shared<QUdpSocket>();
m_udpServerSocket = std::make_shared<QUdpSocket>();
connect(&*m_udpServerSocket, &QUdpSocket::readyRead, this, &MainWindow::readPendingDatagrams);
m_logger = spdlog::get("logger");
//测试
test();
}
@@ -274,8 +278,6 @@ void MainWindow::UpdateMessageList() {
// 设置水平表头
ui->tblMessageList->setHorizontalHeaderLabels(column_labels);
// 设置垂直表头
// self.ui.tblTestList.setVerticalHeaderLabels([str(v) for v in
// range(1,len(self.test_list)+1)]) 设置列宽
int column_index = 0;
ui->tblMessageList->setColumnWidth(column_index, 80); // 读取状态
column_index = column_index + 1;

View File

@@ -86,6 +86,11 @@ private:
private:
Ui::MainWindow *ui;
CallStatus m_callStatus = CallStatus::Idle;
std::vector<Record> m_msgList;
int m_callDuration = 0;
std::shared_ptr<QTimer> m_timer;
std::shared_ptr<spdlog::logger> m_logger;
std::shared_ptr<QUdpSocket> m_udpSocket;
std::shared_ptr<QUdpSocket> m_udpServerSocket;
std::shared_ptr<RecordQuery> m_recordQueryWidget;
@@ -94,13 +99,5 @@ private:
QPolarChart* m_azimuthChart;
QBarCategoryAxis* m_signalStrengthChartXAxis;
QValueAxis* m_signalStrengthChartYAxis;
std::shared_ptr<spdlog::logger> m_logger;
std::vector<Record> m_msgList;
std::shared_ptr<QTimer> m_timer;
int m_callDuration = 0;
};
#endif // MAINWINDOW_H