完善功能
This commit is contained in:
80
mainwindow.h
80
mainwindow.h
@@ -27,6 +27,7 @@ class QChart;
|
||||
class QBarCategoryAxis;
|
||||
class QValueAxis;
|
||||
class QTableWidgetItem;
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -36,26 +37,24 @@ public:
|
||||
~MainWindow();
|
||||
void test1();
|
||||
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_btnSendMessageByUhfOrS_clicked();
|
||||
|
||||
void on_btnSendMessageByBeiDou_clicked();
|
||||
|
||||
void on_btnRecordQuery_clicked();
|
||||
|
||||
void readPendingDatagrams();
|
||||
|
||||
void on_tblMessageList_currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous);
|
||||
|
||||
void handleHovered(bool status, int index, QBarSet *barset);
|
||||
|
||||
void on_timer_timeout_1s();
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
private:
|
||||
@@ -71,10 +70,6 @@ private:
|
||||
// 与底层消息交互
|
||||
//-------------------------------------------------
|
||||
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 processCommand(const QByteArray& cmd);
|
||||
void processTianTongVoiceCmd(const QByteArray& cmd);
|
||||
@@ -85,16 +80,73 @@ private:
|
||||
void processStatusReportCmd(const QByteArray& cmd);
|
||||
void processSearchSatelliteStatusReport(const QByteArray& cmd);
|
||||
|
||||
// 处理模块状态
|
||||
void processUhfModuleStatus(uint8_t status);
|
||||
void processTianTongModuleStatus(uint8_t status);
|
||||
void processBeiDouModuleStatus(uint8_t status);
|
||||
// 处理SIM卡状态
|
||||
void processUhfSimCardStatus(uint8_t status);
|
||||
void processTianTongSimCardStatus(uint8_t status);
|
||||
void processBeiDouSimCardStatus(uint8_t status);
|
||||
// 处理M卡状态
|
||||
void processUhfMCardStatus(uint8_t status);
|
||||
void processTianTongMCardStatus(uint8_t status);
|
||||
// 处理网络访问状态
|
||||
void processUhfNetworkAccessStatus(uint8_t status);
|
||||
void processTianTongNetworkAccessStatus(uint8_t status);
|
||||
void processCallStatus(uint8_t tiantong_call_status,uint8_t uhf_call_status);
|
||||
|
||||
void StartupTalkingTimer();
|
||||
void ShutdownTalkingTimer();
|
||||
void test();
|
||||
|
||||
std::pair<bool,Channel> selectChannel(CommType comm_type);
|
||||
|
||||
bool checkNumber(const QString& number);
|
||||
bool checkMessage(const QString& message);
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
CallStatus m_callStatus = CallStatus::kIdle;
|
||||
|
||||
// 呼叫状态
|
||||
CallStatus m_tiantongCallStatus{CallStatus::kIdle};
|
||||
CallStatus m_uhfCallStatus{CallStatus::kIdle};
|
||||
// 信号强度
|
||||
uint8_t m_uhfSignalStrength{0};
|
||||
uint8_t m_tiantongSignalStrength{0};
|
||||
|
||||
// 模块状态
|
||||
ModuleStatus m_uhfModuleStatus{ModuleStatus::kFault};
|
||||
ModuleStatus m_tiantongModuleStatus{ModuleStatus::kFault};
|
||||
ModuleStatus m_beidouModuleStatus{ModuleStatus::kFault};
|
||||
bool m_uhfModuleStatusGrayIcon = true;
|
||||
bool m_tiantongModuleStatusGrayIcon = true;
|
||||
bool m_beidouModuleStatusGrayIcon = true;
|
||||
// SIM卡状态
|
||||
SimCardStatus m_uhfSimCardStatus{SimCardStatus::kNotExist};
|
||||
SimCardStatus m_tiantongSimCardStatus{SimCardStatus::kNotExist};
|
||||
SimCardStatus m_beidouSimCardStatus{SimCardStatus::kNotExist};
|
||||
bool m_uhfSimCardStatusGrayIcon = true;
|
||||
bool m_tiantongSimCardStatusGrayIcon = true;
|
||||
bool m_beidouSimCardStatusGrayIcon = true;
|
||||
// M卡状态
|
||||
MCardStatus m_uhfMCardStatus{MCardStatus::kNotExist};
|
||||
MCardStatus m_tiantongMCardStatus{MCardStatus::kNotExist};
|
||||
bool m_uhfMCardStatusGrayIcon = true;
|
||||
bool m_tiantongMCardStatusGrayIcon = true;
|
||||
// 网络访问状态
|
||||
NetworkAccessStatus m_uhfNetworkAccessStatus{NetworkAccessStatus::kNotConnected};
|
||||
NetworkAccessStatus m_tiantongNetworkAccessStatus{NetworkAccessStatus::kNotConnected};
|
||||
NetworkAccessStatus m_beidouNetworkAccessStatus{NetworkAccessStatus::kNotConnected};
|
||||
bool m_uhfNetworkAccessStatusGrayIcon = true;
|
||||
bool m_tiantongNetworkAccessStatusGrayIcon = true;
|
||||
bool m_beidouNetworkAccessStatusGrayIcon = true;
|
||||
|
||||
std::vector<Record> m_msgList;
|
||||
int m_unReadMsgCount = 0;
|
||||
int m_callDuration = 0;
|
||||
std::shared_ptr<QTimer> m_timer;
|
||||
|
||||
QTimer* m_timer;
|
||||
std::shared_ptr<QTimer> m_talkingTimer;
|
||||
std::shared_ptr<spdlog::logger> m_logger;
|
||||
std::shared_ptr<QUdpSocket> m_udpSocket;
|
||||
std::shared_ptr<QUdpSocket> m_udpServerSocket;
|
||||
|
||||
Reference in New Issue
Block a user