添加OpenCv
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
#ifndef P00_PublicPage_H
|
||||
#define P00_PublicPage_H
|
||||
#ifndef P00_PUBLICPAGE_H
|
||||
#define P00_PUBLICPAGE_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVariant>
|
||||
#include <QMap>
|
||||
#include <QTextToSpeech>
|
||||
#include <QLocale>
|
||||
#include <QTimer>
|
||||
#include <QLabel>
|
||||
#include "DataCenter/DataCenter.h"
|
||||
#include "DataCenter/OpcUaManager.h"
|
||||
#include <QLabel>
|
||||
|
||||
|
||||
#include "Pages/P01_MianPage.h"
|
||||
#include "Pages/P02_ShieldPage.h"
|
||||
@@ -25,40 +28,45 @@
|
||||
#include "Pages/P501_LoaderPage.h"
|
||||
#include "Pages/P601_TransportPage.h"
|
||||
|
||||
class CursorController; // 前向声明即可
|
||||
|
||||
// 前向声明
|
||||
class DataCenter;
|
||||
class OpcUaManager;
|
||||
class CursorController;
|
||||
class QKeyEvent;
|
||||
|
||||
namespace Ui {
|
||||
class P00_PublicPage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
class P00_PublicPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit P00_PublicPage(QWidget *parent = nullptr);
|
||||
~P00_PublicPage();
|
||||
~P00_PublicPage() override;
|
||||
|
||||
void WinInit();
|
||||
void CursorInit();
|
||||
void SignalSlotInit();
|
||||
|
||||
// 页面切换模板方法
|
||||
template <typename SubWidget>
|
||||
inline void replaceSingleWidget(); // 载入新的子窗口
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *e) override;
|
||||
|
||||
private slots:
|
||||
void UIRefreshTimeOut();
|
||||
void CursorScanTimerOut();
|
||||
void onCursorMoved(const QPoint &global);
|
||||
private slots:
|
||||
// 处理数据中心的节点更新(仅展示)
|
||||
void onNodeValueUpdated(const QString &nodeId, const QString &nodeName,const QString &varName, const QVariant &value);
|
||||
|
||||
// 处理连接状态变化(仅展示)
|
||||
void onOpcStateChanged(QOpcUaClient::ClientState state);
|
||||
|
||||
// 处理错误信息(仅展示)
|
||||
void onOpcError(const QString &errorString);
|
||||
|
||||
void on_But_Close_clicked();
|
||||
|
||||
// 页面切换槽函数
|
||||
void on_But_Page_0_clicked();
|
||||
void on_But_Page_1_clicked();
|
||||
void on_But_Page_2_clicked();
|
||||
@@ -77,70 +85,48 @@ private slots:
|
||||
void on_But_Page_15_clicked();
|
||||
|
||||
private:
|
||||
// 光标移动处理
|
||||
void onCursorMoved(const QPoint &global);
|
||||
|
||||
Ui::P00_PublicPage *ui;
|
||||
/** @brief 自绘光标 */
|
||||
QLabel *m_cursorLabel = nullptr;
|
||||
QLabel *m_cursorLabel = nullptr; // 自绘光标
|
||||
OpcUaManager *m_opcManager; // OPC通信实例
|
||||
DataCenter *m_dataCenter; // 数据中心
|
||||
QString m_currentNodeId; // 当前操作节点ID
|
||||
QTextToSpeech *tts; // 文本转语音
|
||||
QTimer *UIRefresh_Timer; // UI刷新定时器
|
||||
QTimer *CursorScan_Timer; // 光标扫描定时器
|
||||
bool PLC_Started; // PLC运行状态标志
|
||||
|
||||
/** @brief OPC通信实例 */
|
||||
OpcUaManager *m_opcManager;
|
||||
|
||||
/** @brief 数据中心(仅用于订阅数据) */
|
||||
DataCenter *m_dataCenter;
|
||||
|
||||
/** @brief 当前手动操作的节点ID */
|
||||
QString m_currentNodeId;
|
||||
|
||||
|
||||
|
||||
/** @brief 主预览界面 */
|
||||
P01_MianPage *Pub_MianPage;
|
||||
|
||||
/** @brief 屏蔽页界面 */
|
||||
P02_ShieldPage *Pub_ShieldPage;
|
||||
|
||||
/** @brief 油缸页界面 */
|
||||
P07_CylinderPage *Pub_CylinderPage;
|
||||
|
||||
/** @brief 报警页界面 */
|
||||
P08_AlarmPage *Pub_AlarmPage;
|
||||
|
||||
/** @brief 遥控控制页界面 */
|
||||
P09_RemotePage *Pub_RemotePage;
|
||||
|
||||
/** @brief 智能控制页界面 */
|
||||
P10_IntelligentPage *Pub_IntelligentPage;
|
||||
|
||||
/** @brief 绝缘检测页界面 */
|
||||
P11_IsolationPage *Pub_IsolationPage;
|
||||
|
||||
/** @brief 网络拓扑页界面 */
|
||||
P12_NetworkPage *Pub_NetworkPage;
|
||||
|
||||
/** @brief 惯导页界面 */
|
||||
P13_InsPage *Pub_InsPage;
|
||||
|
||||
/** @brief 图册页界面 */
|
||||
P14_AtlasPage *Pub_AtlasPage;
|
||||
|
||||
/** @brief 参数页界面 */
|
||||
P15_ParameterPage *Pub_ParameterPage;
|
||||
|
||||
/** @brief 设置页界面 */
|
||||
P16_SettingPage *Pub_SettingPage;
|
||||
|
||||
/** @brief 油泵页界面 */
|
||||
P301_PumpPage *Pub_PumpPage;
|
||||
|
||||
/** @brief 截割页界面 */
|
||||
P401_CuttingPage *Pub_CuttingPage;
|
||||
|
||||
/** @brief 装载页界面 */
|
||||
P501_LoaderPage *Pub_LoaderPage;
|
||||
|
||||
/** @brief 运输页界面 */
|
||||
P601_TransportPage *Pub_TransportPage;
|
||||
// 页面实例
|
||||
P01_MianPage *Pub_MianPage = nullptr;
|
||||
P02_ShieldPage *Pub_ShieldPage = nullptr;
|
||||
P07_CylinderPage *Pub_CylinderPage = nullptr;
|
||||
P08_AlarmPage *Pub_AlarmPage = nullptr;
|
||||
P09_RemotePage *Pub_RemotePage = nullptr;
|
||||
P10_IntelligentPage *Pub_IntelligentPage = nullptr;
|
||||
P11_IsolationPage *Pub_IsolationPage = nullptr;
|
||||
P12_NetworkPage *Pub_NetworkPage = nullptr;
|
||||
P13_InsPage *Pub_InsPage = nullptr;
|
||||
P14_AtlasPage *Pub_AtlasPage = nullptr;
|
||||
P15_ParameterPage *Pub_ParameterPage = nullptr;
|
||||
P16_SettingPage *Pub_SettingPage = nullptr;
|
||||
P301_PumpPage *Pub_PumpPage = nullptr;
|
||||
P401_CuttingPage *Pub_CuttingPage = nullptr;
|
||||
P501_LoaderPage *Pub_LoaderPage = nullptr;
|
||||
P601_TransportPage *Pub_TransportPage = nullptr;
|
||||
|
||||
QMap<uint16_t, QWidget*> m_widgetCache; // 页面缓存
|
||||
QList<QString> slMotorCurColor; // 电机电流颜色列表
|
||||
QList<QString> slMotorTempColor; // 电机温度颜色列表
|
||||
|
||||
// 光标状态变量(静态化避免重复定义)
|
||||
static bool OldUp;
|
||||
static bool OldDown;
|
||||
static bool OldLeft;
|
||||
static bool OldRight;
|
||||
static bool OldConfirm;
|
||||
};
|
||||
|
||||
#endif // P00_PublicPage_H
|
||||
|
||||
#endif // P00_PUBLICPAGE_H
|
||||
|
||||
Reference in New Issue
Block a user