#ifndef SHOWTEMPPAGE_H #define SHOWTEMPPAGE_H #include #include #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 FilterTemperatures( const std::vector& 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 void AddListItem(const ns_db::TEMPERATURE_LIST_STRUCT& temperaturePar,int nIndex,QListWidget* listWidget,const QSize& sizeHint); private: Ui::ShowTempPage *ui; std::map> m_groupedById; /**当前温度列表 */ std::vector m_vecCurrentTemperatureList; /** 显示参数 */ QPointer m_ShowTemperatureWnd; ns_db::CManageDB* m_manageDB = nullptr; ns_db::CProduct* m_pProduct = nullptr; }; #endif // SHOWTEMPPAGE_H