123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- #ifndef MAINANDSECONDARYCAMERASWND_H
- #define MAINANDSECONDARYCAMERASWND_H
- #include <QSlider>
- #include <QLineEdit>
- #include <QHBoxLayout>
- #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
- #include "CameraMaterialGroupWnd/CameraImage/CameraImageHandler.h"
- #include <ICalibration.h>
- #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<int, Wafer*> waferMap;
- /**当前选中的group
- */
- std::vector<ST_CURRENT_SELECT_GROUP> m_veCurrentSelectGroup = {};
- ST_CURRENT_SELECT_GROUP m_currentSelectGroup = {};
- int m_nIdex = 0;
- int m_nTimeShowPos = -1;
- /**用作定时使用,后面移动到整个类里面,目前先实现功能
- */
- int m_idleTimer = -1;
- QMap<int, Waffle*> waffleMap;
- QMap<int, MaterialBox*> 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
|