Group.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #ifndef GROUP_H
  2. #define GROUP_H
  3. #include <QWidget>
  4. #include <QtWidgets/QComboBox>
  5. #include "CameraMaterialGroupWnd/MaterialWindow/Wafer.h"
  6. #include "CameraMaterialGroupWnd/MaterialWindow/Waffle.h"
  7. #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
  8. #include "CameraMaterialGroupWnd/MaterialWindow/Bond.h"
  9. #include <CViewInterface.h>
  10. namespace Ui {
  11. class Group;
  12. }
  13. class Group : public QWidget
  14. {
  15. Q_OBJECT
  16. public:
  17. // 相机ID 实时图片 物料窗口类型 下拉框文本
  18. explicit Group(int groupId,const CameraInfo& cameraInfo, ns_module::CViewInterface *cViewInterface,QList<QPair<QString, QString>> fileList,QWidget* parent);
  19. ~Group();
  20. void initForm();
  21. bool eventFilter(QObject *obj, QEvent *event);
  22. void saveGroupSettings(int Id, int materialWndType);
  23. void saveBorderSettings(); // 新增:保存边框颜色信息
  24. void loadBorderSettings(); // 新增:加载边框颜色信息
  25. void recordBorderInfo(int groupId, const QString& side);
  26. QString getBlueBorderStyle();
  27. QString getRedBorderStyle();
  28. void setDatacomboBox(int index);
  29. void setEnableControls(bool enable);
  30. int getCurrentComboBoxIndex();
  31. void setCurrentCombox(const int index);
  32. void initBorderStyle(int index,int color);
  33. void setWaferWidget(QPixmap pixmap);
  34. void setBondWidget(QPixmap pixmap);
  35. void setWafer(Wafer* wafer);
  36. void setMaterialBox(MaterialBox* materialBox);
  37. void setWaffleWidget(QPixmap pixmap);
  38. void SetCameaInfo(CameraInfo cameaInfo);
  39. void MaterialBoxWidget(); // 料盒
  40. signals:
  41. void send_button_Signal();
  42. void send_ComboBox_singal(int groupId,int index);
  43. void SendGroupSelectedSignals(Group* group, int index);
  44. void sendUpdateGroupState(int groupId,int index);
  45. /**当前选中了哪一个
  46. */
  47. void SetCurrentSelectSig(int groupId,int nIndex);
  48. /**相机图像转发
  49. */
  50. void SetUpDataImageShowSig(const QPixmap& imageData);
  51. public slots:
  52. void Changedstyle();
  53. void onclickbutton();
  54. void on_DatacomboBox_currentIndexChanged(int comboxIndex);
  55. void GetGroupSelectedSlots(Group* group, int index);
  56. void UpDataImageShowSlots(const QPixmap& imageData);
  57. protected:
  58. void showEvent(QShowEvent *event) override;
  59. void hideEvent(QHideEvent *event) override;
  60. void check_selected(int index);
  61. void WaferWidget(); // 圆晶
  62. void WaffleWidget(); // 华夫盒
  63. void BondWidget();
  64. private:
  65. Ui::Group *ui;
  66. int m_nCurrentGroupId = 0;
  67. Wafer * m_pWafer = nullptr; // 声明Wafer指针
  68. Waffle * m_pWaffle = nullptr; // 声明Waffle指针
  69. MaterialBox * m_pMaterialbox = nullptr; // 声明materialbox指针
  70. Bond* m_pBond = nullptr;
  71. static Group* m_pCurrentlySelectedGroup; // 当前选中(红色边框)的实例
  72. static Group* m_pPreviouslySelectedBlueGroup; // 上一次选中且边框为蓝色的实例
  73. static Group* m_pLastClickedGroup; // 上一次点击的实例
  74. static int m_stnLastClickedIndex; // 上一次点击的索引
  75. static int m_stnLastSavedIndex ; // 上次保存的索引
  76. int m_stnCurrentComboBoxIndex = 0;
  77. public:
  78. CameraInfo m_cameaInfo = {};
  79. int m_nGroupId = 0; // 新增:记录当前 Group 的 ID
  80. ns_module::CViewInterface* m_pCViewInterface = nullptr;
  81. };
  82. #endif // GROUP_H