93 lines
2.2 KiB
C++
93 lines
2.2 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QUdpSocket>
|
|
#include <QMainWindow>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include "RecordQuery.h"
|
|
#include "LoggerWidget.h"
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
enum class CallStatus{
|
|
Idle,
|
|
Calling,
|
|
Incoming,
|
|
Talking,
|
|
};
|
|
|
|
|
|
class QPolarChart;
|
|
class QChart;
|
|
class QBarCategoryAxis;
|
|
class QValueAxis;
|
|
class QTableWidgetItem;
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
private slots:
|
|
void on_rdbChannelUHF_clicked();
|
|
|
|
void on_rdbChannelS_clicked();
|
|
|
|
void on_rdbChannelBeiDou_clicked();
|
|
|
|
void on_rdbChannelAuto_clicked();
|
|
|
|
void on_btnCallAnswer_clicked();
|
|
|
|
void on_btnCallReject_clicked();
|
|
|
|
void on_btnSendMessage_clicked();
|
|
|
|
void on_btnRecordQuery_clicked();
|
|
|
|
void on_tblMessageList_currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous);
|
|
protected:
|
|
void keyPressEvent(QKeyEvent* event) override;
|
|
private:
|
|
void createBeiDouSignalStrengthChart();
|
|
void createAzimuthMapChart();
|
|
void setSignalStrengthValues(const QStringList& categories,const QList<qreal> &yValues);
|
|
void setAzimuthValues(const QList<QPointF> &points);
|
|
//-------------------------------------------------
|
|
// 消息列表操作
|
|
//-------------------------------------------------
|
|
void UpdateMessageList();
|
|
//-------------------------------------------------
|
|
// 与底层消息交互
|
|
//-------------------------------------------------
|
|
bool sendUdpMessage(const QByteArray &udpMessage);
|
|
bool call(const QString& number);
|
|
bool hangUpCall();
|
|
bool acceptCall();
|
|
bool rejectCall();
|
|
bool sendShortMessage(const QString &number,const QString& message);
|
|
|
|
void test();
|
|
private:
|
|
Ui::MainWindow *ui;
|
|
CallStatus m_callStatus = CallStatus::Idle;
|
|
std::shared_ptr<QUdpSocket> m_udpSocket;
|
|
std::shared_ptr<RecordQuery> m_recordQueryWidget;
|
|
std::shared_ptr<LoggerWidget> m_loggerWidget;
|
|
QChart* m_signalStrengthChart;
|
|
QPolarChart* m_azimuthChart;
|
|
QBarCategoryAxis* m_signalStrengthChartXAxis;
|
|
QValueAxis* m_signalStrengthChartYAxis;
|
|
|
|
std::vector<Record> m_msgList;
|
|
};
|
|
#endif // MAINWINDOW_H
|