Group.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. namespace Ui {
  10. class Group;
  11. }
  12. class Group : public QWidget
  13. {
  14. Q_OBJECT
  15. public:
  16. // 相机ID 实时图片 物料窗口类型 下拉框文本
  17. explicit Group(int Id, const QString& imagePath1, int MaterialWindowType, const QStringList& textList, QWidget* parent);
  18. ~Group();
  19. void initForm();
  20. bool eventFilter(QObject *obj, QEvent *event);
  21. void saveGroupSettings(int Id, const QString& imagePath1, int materialWndType, const QStringList& textList);
  22. void saveBorderSettings(); // 新增:保存边框颜色信息
  23. void loadBorderSettings(); // 新增:加载边框颜色信息
  24. void recordBorderInfo(int groupId, const QString& side);
  25. QString getBlueBorderStyle();
  26. QString getRedBorderStyle();
  27. void setDatacomboBox(int index);
  28. void setEnableControls(bool enable);
  29. signals:
  30. void send_button_Signal();
  31. void send_ComboBox_singal(int groupId,int index);
  32. void SendGroupSelectedSignals(Group* group, int index);
  33. void sendUpdateGroupState(int groupId,int index);
  34. /**当前选中了哪一个
  35. */
  36. void SetCurrentSelectSig(int groupId,int nIndex);
  37. /**相机图像转发
  38. */
  39. void SetUpDataImageShowSig(const QPixmap& imageData);
  40. public slots:
  41. void Changedstyle();
  42. void onclickbutton();
  43. void on_DatacomboBox_currentIndexChanged(int index);
  44. void GetGroupSelectedSlots(Group* group, int index);
  45. void UpDataImageShowSlots(const QPixmap& imageData);
  46. protected:
  47. void showEvent(QShowEvent *event) override;
  48. void hideEvent(QHideEvent *event) override;
  49. void check_selected(int index);
  50. void WaferWidget(); // 圆晶
  51. void WaffleWidget(); // 华夫盒
  52. void MaterialBoxWidget(); // 料盒
  53. void BondWidget();
  54. private:
  55. Ui::Group *ui;
  56. int m_nCurrentGroupId;
  57. Wafer * m_pWafer =nullptr; // 声明Wafer指针
  58. Waffle * m_pWaffle = nullptr; // 声明Waffle指针
  59. MaterialBox * m_pMaterialbox = nullptr; // 声明materialbox指针
  60. Bond* m_pBond = nullptr;
  61. static Group* m_pCurrentlySelectedGroup; // 当前选中(红色边框)的实例
  62. static Group* m_pPreviouslySelectedBlueGroup; // 上一次选中且边框为蓝色的实例
  63. static Group* m_pLastClickedGroup; // 上一次点击的实例
  64. static int m_stnLastClickedIndex; // 上一次点击的索引
  65. static int m_stnLastSavedIndex; // 上次保存的索引
  66. public:
  67. int m_nGroupId; // 新增:记录当前 Group 的 ID
  68. };
  69. #endif // GROUP_H