#ifndef MAINANDSECONDARYCAMERASWND_H #define MAINANDSECONDARYCAMERASWND_H #include #include #include #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h" #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h" #include #include "JOriginalMainWnd.h" namespace Ui { class MainAndSecondaryCamerasWnd; } class MainAndSecondaryCamerasWnd : public JOriginalMainWnd { Q_OBJECT public: explicit MainAndSecondaryCamerasWnd(QWidget *parent = nullptr); ~MainAndSecondaryCamerasWnd(); void initFrom(); void InitPage(); /**绑定相机画面 */ void CameraConnectUpdateImageFun(int nIndex, Group* widget); /**初始化界面运动控制轴 */ void updateMaterialWidget(int side, int materialWndType, int groupId); public slots: void CheckIs(); protected: void wheelEvent(QWheelEvent* event) override; bool eventFilter(QObject* obj, QEvent* event) override; void loadSettings(); void checkSettings(); // void loadGroupSettings(int Id, int Index); /**更新刷新 */ void UpdataGroupSettings(int Id, int Index); void showEvent(QShowEvent *event) override; void hideEvent(QHideEvent *event) override; void clearLayout(int flag); // 清除大窗口上当前的布局 void WaferWidget(int flag); // 圆晶 void WaffleWidget(int flag); // 华夫盒 void MaterialBoxWidget(int flag); // 料盒 protected: void timerEvent(QTimerEvent* event) override; private slots: QPixmap getCurrentPixmap() const { return Right_currentPixmap; } void ResetIdleTimer(bool bStart = false); void GetCurrentSelectSlots(int groupId, int nIndex); void GetUpDataImageShowSignals0(const QPixmap& imageData); void GetUpDataImageShowSignals1(const QPixmap& imageData); void GetUpDataImageShowSignals4(const QPixmap& imageData); private: void InitMainCameraBind(CameraBind* pCameraBind) override; void UpdateCameraDisplay0(int iCameraId, JVision::ImageInfo imageData) override; void UpdateCameraDisplay1(int iCameraId, JVision::ImageInfo imageData) override; void UpdateCameraDisplay2(int iCameraId, JVision::ImageInfo imageData) override; void UpdateCameraDisplay3(int iCameraId, JVision::ImageInfo imageData) override; void UpdateCameraDisplay4(int iCameraId, JVision::ImageInfo imageData) override; signals: void UpDataImageShowSignals0(const QPixmap& imageData); void UpDataImageShowSignals1(const QPixmap& imageData); void UpDataImageShowSignals2(const QPixmap& imageData); void UpDataImageShowSignals3(const QPixmap& imageData); void UpDataImageShowSignals4(const QPixmap& imageData); private: void HideLayout(QHBoxLayout* layout, bool isHide); /**更新灯光显示 */ void UpdataLightJoystickSwitchPage(Group* pGroup); private: Ui::MainAndSecondaryCamerasWnd *ui; QPixmap Left_currentPixmap; qreal Left_scaleFactor; QPixmap Right_currentPixmap; qreal Right_scaleFactor; int lastGroupId = -1; int lastIndex = -1; int lastLastGroupId = -1; int lastLastIndex = -1; QPixmap m_lastRightPixmap; QStringList lasttextList; QPixmap lastLastRightPixmap; // 用于存储上一次的 lastRightPixmap QStringList lastLasttextList; bool isUpdatingSettings; Wafer *wafer; // 声明Wafer指针 Waffle *waffle; // 声明Waffle指针 MaterialBox *materialbox; // 声明materialbox指针 QMap waferMap; /**当前选中的group */ std::vector m_veCurrentSelectGroup = {}; ST_CURRENT_SELECT_GROUP m_currentSelectGroup = {}; int m_nIdex = 0; int m_nTimeShowPos = -1; /**用作定时使用,后面移动到整个类里面,目前先实现功能 */ int m_idleTimer = -1; QMap waffleMap; QMap materialBoxMap; OperateMode Left_currentMode = ModeImage; OperateMode Right_currentMode = ModeImage; QGraphicsView *Left_currentView = nullptr; QGraphicsView *Right_currentView = nullptr; QPoint mousePos; double Left_previousScaleFactor; double Right_previousScaleFactor; const int last_left = 0; const int current_right = 1; }; #endif // MAINANDSECONDARYCAMERASWND_H