#ifndef CMWCOMPIOPI_H
#define CMWCOMPIOPI_H

#include "cmwidget.h"

#include <QGridLayout>
#include <QLabel>
#include <QPushButton>
#include "cctrlbuttonid.h"

class CMWCompIOInOut : public CMWidget
{
    Q_OBJECT
public:
    explicit CMWCompIOInOut(QWidget *parent, QVector<int> vIOIn, QVector<int> vIOOut);
public:
    void MInit();
    void MTimeFresh();
    void showEvent(QShowEvent * pEvent);
    void hideEvent(QHideEvent *event);
    QGridLayout* m_pGridLayOut;
	typedef struct _IOCTRL
	{
		int iIOIndex;
		CCtrlButtonID* pButton;
		QLabel* pLabel_icon;
		QLabel* pLabel_text;
		int set;
		_IOCTRL()
		{
			pButton = nullptr;
			pLabel_icon = nullptr;
			pLabel_text = nullptr;
			set = false;
		}
		_IOCTRL(const _IOCTRL& _rData)
		{
			iIOIndex = _rData.iIOIndex;
			pButton = _rData.pButton;
			pLabel_icon = _rData.pLabel_icon;
			pLabel_text = _rData.pLabel_text;
		}
	}IOCTRL;
	QMap<int,QVector<IOCTRL>> m_mapIO;
	QPixmap icon_off;
	QPixmap icon_blue;
signals:

public slots:
    void ButtonInClicked(int32_t iID);
    void ButtonOutClicked(int32_t iID);
};

#endif // CMWCOMPIOOUT_H
