Group.h 2.6 KB

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