需求
生命探测仪
1. 扫描雷达状态显示:正在扫描 or 扫描停止;
2. 显示扫描雷达的灵敏度;
3. 探测过程中的数据文件保存(用于跟踪和后期回放)
4. 探测仪连接app的终端的状态显示;
5. 电池电量显示;
6. 多语言切换,中文/英文;
7. 探测目标二维成图显示界面,包括生命体、静止目标、动态目标;
8. 显示or隐藏动态目标的移动轨迹;
9. 雷达探测过程中实时现实探测的前方障碍物物体等,同时转换为一维火山图显示;
10. 前方探测距离的、方位范围‘、灵敏度设置;
11. 探测文件实时保存;
12. 探测文件的探测过程回放;
Demo
硬件
Demo头文件代码
RadarScanWidget.h
#ifndef RADARSCANWIDGET_H #define RADARSCANWIDGET_H #include <QWidget> #include <QElapsedTimer> #include <QPixmap> #include <QTimer> namespace Ui { class RadarScanWidget; } class RadarScanWidget : public QWidget { Q_OBJECT public: enum COORDINATE_HORIZAL{ COORDINATE_HORIZAL_4 = 0x00, COORDINATE_HORIZAL_6 = 0x01, COORDINATE_HORIZAL_8 = 0x02, }; enum COORDINATE_VERTICAL{ COORDINATE_VERTICAL_10 = 0x00, COORDINATE_VERTICAL_20 = 0x01, COORDINATE_VERTICAL_30 = 0x02, }; public: explicit RadarScanWidget(QWidget *parent = 0); ~RadarScanWidget(); public: inline bool hasMoveTarget() { return _listListPointFForMove.size() > 15; } void setShowMoveLineMoreThanLimitPoints(int showMoveLineMoreThanLimitPoints); signals: void signalStaticTargetNumber(int number); public slots: void startScanning(); void stopScanning(); void setHorizalCoordinate(COORDINATE_HORIZAL c); void setVerticalCoordinate(COORDINATE_VERTICAL c); void setShowPath(bool showPath); void recvTargetPointF(QList<QPointF> listPointF, bool isStatic); void recvMatrixUChar(int frameIndex, QList<uchar> listUChar); void clearAllData(); protected slots: void timeout(); protected: void paintEvent(QPaintEvent *event); void timerEvent(QTimerEvent *event); protected: void drawBackground(QPainter &painter); void drawChartBackground(QPainter &painter); void drawChart(QPainter &painter); void drawArc(QPainter &painter); void drawPointData(QPainter &painter); void drawWallData(QPainter &painter); protected: QPointF judgetStaticDistanceLessThanDistance(QPointF p1, QPointF p2, qreal distance, bool *ok = 0); bool judgetMoveDistanceLessThanDistance(QPointF p1, QPointF p2, qreal distance); private: Ui::RadarScanWidget *ui; int _offsetX; int _offsetY; int _stepsX; int _stepsY; int _rangleXMin; int _rangleXMax; int _rangleYMin; int _rangleYMax; int _width; int _height; QColor _backgroundColor; QColor _backgroundChartColor; QColor _lineColor; QColor _color; QColor _pointColor; QStringList _strListVericalLocaltion; QStringList _strListHorizalLocaltion; int _offsetHorizalTextX; int _offsetHorizalTextY; int _offsetVerticalTextX; int _offsetVerticalTextY; int _originX; int _originY; bool _isScanning; COORDINATE_HORIZAL _cooradinateHorizal; COORDINATE_VERTICAL _cooradinateVertical; int _indexOfArc; int _timerId; int _interval; QList<QList<QPointF> > _listListPointFForMove; QList<QList<QPointF> > _listListPointFForMoveLine; QList<QList<QPointF> > _listListPointFForStatic; QList<QList<uchar> > _listListUCharForMaxtric; QList<QPointF> _listPointFForStatic; bool _showPath; QElapsedTimer _elapsedTimerForMove; QElapsedTimer _elapsedTimerForStatic; int _intervalTime; QPixmap _pixmap; QList<QPixmap> _listPixmapForMove; QList<QPixmap> _listPixmapForStatic; QList<int> _listCount; QTimer *_pTimer; int _staticCircleR; QList<int> _listStaticTime; int _staticsStaticTargetTime; int _showMoveLineMoreThanLimitPoints; }; #endif // RADARSCANWIDGET_H