#pragma once

#include "resource.h"       // основные символы
#include "Config.h"
#include <vector>

// Диалоговое окно CIRPSConfDlg
constexpr auto COM_SPEEDS_NUMBER = 7;
constexpr auto DTR_PARAMS_NUMBER = 3;
constexpr auto RTS_PARAMS_NUMBER = 4;
constexpr auto BYTESIZE_PARAMS_NUMBER = 2;
constexpr auto PARITY_PARAMS_NUMBER = 5;
constexpr auto STOPBITS_PARAMS_NUMBER = 2;

class CIRPSConfDlg : public CDialogEx
{
		DECLARE_DYNAMIC(CIRPSConfDlg)

		std::vector<CString> m_cl;

		struct ComComboParam
		{
			LPTSTR str;
			int value;
		};

		static ComComboParam m_DTRParam[DTR_PARAMS_NUMBER];
		static ComComboParam m_RTSParam[RTS_PARAMS_NUMBER];
		static ComComboParam m_TTYModeParam[IRPS_MODE::MODE_NUM];
		static ComComboParam m_TTYSpeedParam[COM_SPEEDS_NUMBER];
		static ComComboParam m_TTYByteSize[BYTESIZE_PARAMS_NUMBER];
		static ComComboParam m_TTYParity[PARITY_PARAMS_NUMBER];
		static ComComboParam m_TTYStopBits[STOPBITS_PARAMS_NUMBER];

		void	AddInList(CString &str);

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

// Данные диалогового окна
#ifdef AFX_DESIGN_TIME
		enum { IDD = IDD_DIALOG_IRPSCONF };
#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()
};
