Files
chenzhen 222dda1e43 1,新增“App_ThermalImageSystem”;
2,新增“Apps”;
3,新增“Common”;
4,新增“FileList”;
5,新增“MediaX”;
6,新增“OpenSource”;
7,新增“Samples”;
8,新增“SoftwareBusinessLines”.
2026-02-14 23:03:23 +08:00

103 lines
2.6 KiB
C++

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QWebEngineView>
namespace Ui {
class MainWindow;
}
#include <thread>
#include <map>
#include <mutex>
#include "./SQLite3/SQLite3Manager.h"
#include "JSonDealer.h"
#include "DataParser.h"
#include "DeviceStatusPanel.h"
#include "AlgorithmParamsPanel.h"
#include "WaterfallChart.h"
typedef struct tagKeyNodeInfo
{
int nNum;
double dLng;
double dLat;
double dDistance;
} KeyNodeInfo;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void OnGetKeyNodeIndex();
void OnUpdateLastKeyNodeIndex(int nLastKeyNodeIndex);
void OnGetKeyNodeDistance(int nKeyNodeIndex);
void OnResetDB();
void OnLoadDB();
void OnUpdateDB(const QString& strMarkerInfo);
void OnAddMarker(int nNum, double dLng, double dLat);
void OnDeleteMarker(int nNum, double dLng, double dLat);
void OnUpdateMarker(int nNum, double dLng, double dLat);
void OnButtonClicked();
private:
bool GetKeyNodeIndex(int& nKeyNodeIndex);
int UpdateLastKeyNodeIndex(int nLastKeyNodeIndex);
double GetKeyNodeDistance(int nKeyNodeIndex);
bool ResetDB(bool bReset);
bool LoadDB();
bool UpdateDB(const QString& strMarkerInfo);
bool AddMarker(int nNum, double dLng, double dLat);
bool DetletMarker(int nKeyNodeIndex);
bool UpdateMarker(int nKeyNodeIndex, double dLng, double dLat);
private:
bool Distance2Coordination(double& dLng, double& dLat, double dDistance);
private:
typedef void (MainWindow::*ThreadRunFunPtr)();
static void ThreadEntry(ThreadRunFunPtr pRunFun, void* pOwner);
void ThreadFun_CalcKeyNodeDistance();
bool StartThread_CalcKeyNodeDistance();
void StopThread_CalcKeyNodeDistance();
bool CalcKeyNodeDistance();
private:
Ui::MainWindow* ui;
QWebEngineView* m_pWebEngineView;
SQLite3Manager* m_pSQLite3Manager;
JSonDealer m_varJSonDealer;
DataParser m_varDataParser;
DeviceStatusPanel* m_pDeviceStatusPanel;
AlgorithmParamsPanel* m_pAlgorithmParamsPanel;
WaterfallChart* m_pWaterfallChart;
//
bool m_bCalcKeyNodeDistance;
bool m_bThreadRunning_CalcKeyNodeDistance;
std::thread* m_ptrThread_CalcKeyNodeDistance;
std::map<int, KeyNodeInfo> m_mapKeyNodeInfo;
std::mutex m_mutexKeyNodeInfo;
};
#endif // MAINWINDOW_H