#pragma once

#include "qt/MyQUI.h"

#include <QScrollArea>
#include <QListWidget>

class Station;
class Device;

class QWMonitor : public MyWidget
{
	Q_OBJECT
public:
	QWMonitor(QWidget* parent);
	~QWMonitor();

	void initStation(shared_ptr<Station> station);
	shared_ptr<Station> getCurrentStation();
	void updateStation(shared_ptr<Station> station);

	void onTimer() override;

public slots:
	void onCurrentCellChanged(int row, int col, int oldRow, int oldCol);


public:
	std::shared_ptr<QPushButton> curActiveBtn;
	std::map<std::shared_ptr<QPushButton>, std::shared_ptr<Station>> mapBtnStation;
	std::shared_ptr<Station> curStation;
	std::shared_ptr<Device> curDevice;

	shared_ptr<QTableWidget> table;

	std::shared_ptr<QGroupBox> groupStation;

	std::shared_ptr<QLabel> labDeviceInfo;

	std::shared_ptr<QTextEdit> texteditDevice;

	//std::vector<std::shared_ptr<QLabel>> vecLabelRegData;

	struct {
		//QWidget* widget;
		//QVBoxLayout* layout;
		QScrollArea* scroll {};
		QListWidget* listReg {};
	} uiReg;

};