#pragma once

#include "BaseDialog.h"

// Диалоговое окно CIRPSConfDlg
constexpr auto COM_SPEEDS_NUMBER = 7;
constexpr auto HS_PARAMS_NUMBER = 4;

constexpr auto BYTESIZE_PARAMS_NUMBER = 2;
constexpr auto PARITY_PARAMS_NUMBER = 5;
constexpr auto STOPBITS_PARAMS_NUMBER = 3;

class CIRPSConfDlg : public CBaseDialog
{
		DECLARE_DYNAMIC(CIRPSConfDlg)

		std::vector<CString> m_cl;

		struct ComComboParam
		{
			LPTSTR str{ nullptr };
			int value{ 0 };
		};

		const static std::array<ComComboParam, HS_PARAMS_NUMBER> m_HSMode;
		const static std::array<ComComboParam, static_cast<int>(IRPS_MODE::MODE_NUM)> m_TTYModeParam;
		const static std::array<ComComboParam, COM_SPEEDS_NUMBER> m_TTYSpeedParam;
		const static std::array<ComComboParam, BYTESIZE_PARAMS_NUMBER> m_TTYByteSize;
		const static std::array<ComComboParam, PARITY_PARAMS_NUMBER> m_TTYParity;
		const static std::array<ComComboParam, STOPBITS_PARAMS_NUMBER> m_TTYStopBits;

		void    AddInList(CString &str);
		void    GetComList();

	public:
		CIRPSConfDlg(CWnd *pParent = nullptr);   // стандартный конструктор
		virtual ~CIRPSConfDlg() override;

// Данные диалогового окна
#ifdef AFX_DESIGN_TIME
		enum { IDD = IDD_IRPSCONF_DLG };
#endif

	protected:
		virtual void DoDataExchange(CDataExchange *pDX) override;    // поддержка DDX/DDV
		virtual BOOL OnInitDialog() override;
		virtual void OnOK() override;
		virtual void OnCancel() override;


		DECLARE_MESSAGE_MAP()
};
