12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #ifndef SHOWTEMPPAGE_H
- #define SHOWTEMPPAGE_H
- #include <QWidget>
- #include <QPointer>
- #include "ShowTemperatureWnd.h"
- #include "CManageDB.h"
- #include "QListWidget"
- namespace Ui {
- class ShowTempPage;
- }
- class ShowTempPage : public QWidget
- {
- Q_OBJECT
- public:
- explicit ShowTempPage(QWidget *parent = nullptr);
- ~ShowTempPage();
- private slots:
- void on_idListComboBox_currentIndexChanged(int index);
- void on_serialNumberList_itemSelectionChanged();
- void on_addBut_clicked();
- void on_saveAllBut_clicked();
- /**用于删除
- */
- void GetDelTemperatureListSlots(int iId, int iSerialNumber);
- /**修改
- */
- void GetModifyTemperatureListSlots(const ns_db::TEMPERATURE_LIST_STRUCT& temperaturePar);
- private:
- void Init();
- std::vector<ns_db::TEMPERATURE_LIST_STRUCT> FilterTemperatures(
- const std::vector<ns_db::TEMPERATURE_LIST_STRUCT>& originalList);
- void UpdataUi(int nIndex, int ncurrentGroupIndex, bool isClear = false);
- /**添加删除
- */
- void AddOrDel(int iId, int iSerialNumber,bool isDel);
- /**初始化列表控件
- */
- void InitSerialNumberList();
- /**更新显示参数
- */
- void UpDataParameter(bool isDel = false, const ns_db::TEMPERATURE_LIST_STRUCT temperaturePar = {});
- template <typename Y>
- void AddListItem(const ns_db::TEMPERATURE_LIST_STRUCT& temperaturePar,int nIndex,QListWidget* listWidget,const QSize& sizeHint);
- private:
- Ui::ShowTempPage *ui;
- std::map<int, std::vector<ns_db::TEMPERATURE_LIST_STRUCT>> m_groupedById;
- /**当前温度列表
- */
- std::vector<ns_db::TEMPERATURE_LIST_STRUCT> m_vecCurrentTemperatureList;
- /** 显示参数
- */
- QPointer<ShowTemperatureWnd> m_ShowTemperatureWnd;
- ns_db::CManageDB* m_manageDB = nullptr;
- ns_db::CProduct* m_pProduct = nullptr;
- };
- #endif // SHOWTEMPPAGE_H
|