// WEB_IO_TESTDlg.cpp :
//

#include "stdafx.h"
#include "WEB_IO_TEST.h"
#include "WEB_IO_TESTDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


class CAboutDlg : public CDialog
{
public:
	CAboutDlg();

	enum { IDD = IDD_ABOUTBOX };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // Support the DDX/DDV

protected:
	DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()


CWEB_IO_TESTDlg::CWEB_IO_TESTDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CWEB_IO_TESTDlg::IDD, pParent)
	, m_rdCommVal(FALSE)
{
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CWEB_IO_TESTDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_BUTTON_OUTPUT1, m_btnOutput[0]);
	DDX_Control(pDX, IDC_BUTTON_OUTPUT2, m_btnOutput[1]);
	DDX_Control(pDX, IDC_BUTTON_OUTPUT3, m_btnOutput[2]);
	DDX_Control(pDX, IDC_BUTTON_OUTPUT4, m_btnOutput[3]);
	DDX_Control(pDX, IDC_BUTTON_OUTPUT5, m_btnOutput[4]);
	DDX_Control(pDX, IDC_BUTTON_OUTPUT6, m_btnOutput[5]);
	DDX_Control(pDX, IDC_BUTTON_OUTPUT7, m_btnOutput[6]);
	DDX_Control(pDX, IDC_BUTTON_OUTPUT8, m_btnOutput[7]);
	DDX_Control(pDX, IDC_BUTTON_OUTPUT9, m_btnOutput[8]);
	DDX_Control(pDX, IDC_BUTTON_OUTPUT10, m_btnOutput[9]);
	DDX_Radio(pDX, IDC_RADIO_TCP, m_rdCommVal);
	DDX_Control(pDX, IDC_IPADDRESS, m_IPaddrCtrl);
	DDX_Control(pDX, IDC_EDIT_TCP_PORT, m_edtTCPPort);
}

BEGIN_MESSAGE_MAP(CWEB_IO_TESTDlg, CDialog)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	//}}AFX_MSG_MAP
	ON_BN_CLICKED(IDC_BUTTON_CONNECT, OnBnClickedButtonConnect)
	ON_BN_CLICKED(IDC_BUTTON_CLOSE, OnBnClickedButtonClose)
	ON_MESSAGE(WM_RHIO_RECEIVE, OnUpdateStatus)
	ON_BN_CLICKED(IDC_BUTTON_SETTING, OnBnClickedButtonSetting)
	ON_BN_CLICKED(IDC_RADIO_TCP, OnBnClickedRadioTcp)
	ON_BN_CLICKED(IDC_RADIO_COM, OnBnClickedRadioCom)
	ON_BN_CLICKED(IDC_BUTTON_STATUS_VIEW, OnBnClickedButtonStatusView)
END_MESSAGE_MAP()


BOOL CWEB_IO_TESTDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		CString strAboutMenu;
		strAboutMenu.LoadString(IDS_ABOUTBOX);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	SetIcon(m_hIcon, TRUE);
	SetIcon(m_hIcon, FALSE);

	
	Init();
	return TRUE;
}

void CWEB_IO_TESTDlg::Init(void)
{
	RHIODllLoad();
	InitOutPutButton();
	InitInput(CPoint(65, 255), 24, 24, 90);
	InitSample(CPoint(65, 53), 24, 24, 90);
	InitSelComm();
    m_rhCreate(this);	
	GetDlgItem(IDC_BUTTON_CLOSE)->EnableWindow(FALSE);
	GetDlgItem(IDC_BUTTON_SETTING)->EnableWindow(FALSE);

	m_IPaddrCtrl.SetAddress(192, 168, 100, 2);
	m_edtTCPPort.SetWindowText("6001");
}

void CWEB_IO_TESTDlg::RHIODllLoad()
{
	m_hModule = LoadLibrary("RHIO_Proc.dll");
	if(!m_hModule)
	{
		int test = GetLastError() ;
		AfxMessageBox("Faile Load RHIO_Proc.dll!");
		return;
	}

	m_rhCreate = (pRHIO_CommProcessCreate)GetProcAddress(m_hModule, "RHIO_CommProcessCreate");
	if(!m_rhCreate) AfxMessageBox("Faile Load RHIO_CommProcessCreate Function!");

	m_rhSockConnect = (pRHIO_SockConnect)GetProcAddress(m_hModule, "RHIO_SockConnect");
	if(!m_rhSockConnect) AfxMessageBox("Faile Load RHIO_SockConnect Function!");

	m_rhCommConnect = (pRHIO_CommConnect)GetProcAddress(m_hModule, "RHIO_CommConnect");
	if(!m_rhSockConnect) AfxMessageBox("Faile Load RHIO_CommConnect Function!");

	m_rhClose = (pRHIO_Close)GetProcAddress(m_hModule, "RHIO_Close");
	if(!m_rhClose) AfxMessageBox("Faile Load RHIO_Close Function!");

	m_rhSndSetOnOff = (pRHIO_SndCmd_SetOnOff)GetProcAddress(m_hModule, "RHIO_SndCmd_SetOnOff");
	if(!m_rhSndSetOnOff) AfxMessageBox("Faile Load RHIO_SndCmd_SetOnOff Function!");

	m_rhSndGetOnOff = (pRHIO_SndCmd_GetOnOff)GetProcAddress(m_hModule, "RHIO_SndCmd_GetOnOff");
	if(!m_rhSndGetOnOff) AfxMessageBox("Faile Load RHIO_SndCmd_GetOnOff Function!");

	m_rhSndSetSettingMode = (pRHIO_SndCmd_SetSettingMode)GetProcAddress(m_hModule, "RHIO_SndCmd_SetSettingMode");
	if(!m_rhSndSetSettingMode) AfxMessageBox("Faile Load RHIO_SndCmd_SetSettingMode Function!");

	m_rhSndSetRunMode = (pRHIO_SndCmd_SetRunMode)GetProcAddress(m_hModule, "RHIO_SndCmd_SetRunMode");
	if(!m_rhSndSetRunMode) AfxMessageBox("Faile Load RHIO_SndCmd_SetRunMode Function!");

	m_rhSndSetMacro = (pRHIO_SndCmd_SetMACRO)GetProcAddress(m_hModule, "RHIO_SndCmd_SetMACRO");
	if(!m_rhSndSetMacro) AfxMessageBox("Faile Load RHIO_SndCmd_SetMACRO Function!");

	m_rhSndGetMacro = (pRHIO_SndCmd_GetMACRO)GetProcAddress(m_hModule, "RHIO_SndCmd_GetMACRO");
	if(!m_rhSndGetMacro) AfxMessageBox("Faile Load RHIO_SndCmd_GetMACRO Function!");

	m_rhSndSetDelayPulse = (pRHIO_SndCmd_SetDelayPulse)GetProcAddress(m_hModule, "RHIO_SndCmd_SetDelayPulse");
	if(!m_rhSndSetDelayPulse) AfxMessageBox("Faile Load RHIO_SndCmd_SetDelayPulse Function!");

	m_rhSndGetDelayPulse = (pRHIO_SndCmd_GetDelayPulse)GetProcAddress(m_hModule, "RHIO_SndCmd_GetDelayPulse");
	if(!m_rhSndGetDelayPulse) AfxMessageBox("Faile Load RHIO_SndCmd_GetDelayPulse Function!");

	m_rhSndSetADC = (pRHIO_SndCmd_SetADC)GetProcAddress(m_hModule, "RHIO_SndCmd_SetADC");
	if(!m_rhSndSetADC) AfxMessageBox("Faile Load RHIO_SndCmd_SetADC Function!");

	m_rhSndGetADC = (pRHIO_SndCmd_GetADC)GetProcAddress(m_hModule, "RHIO_SndCmd_GetADC");
	if(!m_rhSndGetADC) AfxMessageBox("Faile Load RHIO_SndCmd_GetADC Function!");

	m_rhSndSetEnable = (pRHIO_SndCmd_SetPortEnable)GetProcAddress(m_hModule, "RHIO_SndCmd_SetPortEnable");
	if(!m_rhSndSetEnable) AfxMessageBox("Faile Load RHIO_SndCmd_SetPortEnable Function!");

	m_rhSndGetEnable = (pRHIO_SndCmd_GetPortEnable)GetProcAddress(m_hModule, "RHIO_SndCmd_GetPortEnable");
	if(!m_rhSndGetEnable) AfxMessageBox("Faile Load RHIO_SndCmd_GetPortEnable Function!");

	m_rhSndSetPwrStop = (pRHIO_SndCmd_SetPwrStopEnable)GetProcAddress(m_hModule, "RHIO_SndCmd_SetPwrStopEnable");
	if(!m_rhSndSetPwrStop) AfxMessageBox("Faile Load RHIO_SndCmd_SetPwrStopEnable Function!");

	m_rhSndGetPwrStop = (pRHIO_SndCmd_GetPwrStopEnable)GetProcAddress(m_hModule, "RHIO_SndCmd_GetPwrStopEnable");
	if(!m_rhSndGetPwrStop) AfxMessageBox("Faile Load RHIO_SndCmd_GetPwrStopEnable Function!");

	m_rhSndSetFactory = (pRHIO_SndCmd_SetFactoryReset)GetProcAddress(m_hModule, "RHIO_SndCmd_SetFactoryReset");
	if(!m_rhSndSetFactory) AfxMessageBox("Faile Load RHIO_SndCmd_SetFactoryReset Function!");

	m_rhSndSetSerial = (pRHIO_SndCmd_SetSerial)GetProcAddress(m_hModule, "RHIO_SndCmd_SetSerial");
	if(!m_rhSndSetSerial) AfxMessageBox("Faile Load RHIO_SndCmd_SetSerial Function!");

	m_rhSndGetSerial = (pRHIO_SndCmd_GetSerial)GetProcAddress(m_hModule, "RHIO_SndCmd_GetSerial");
	if(!m_rhSndGetSerial) AfxMessageBox("Faile Load RHIO_SndCmd_GetSerial Function!");

	m_rhSndGetFirmware = (pRHIO_SndCmd_GetFirmware)GetProcAddress(m_hModule, "RHIO_SndCmd_GetFirmware");
	if(!m_rhSndGetFirmware) AfxMessageBox("Faile Load RHIO_SndCmd_GetFirmware Function!");

	m_rhGetSettingData = (pRHIO_GetSettingData)GetProcAddress(m_hModule, "RHIO_GetSettingData");
	if(!m_rhGetSettingData) AfxMessageBox("Faile Load RHIO_GetSettingData Function!");

	m_rhGetOnOffData = (pRHIO_GetOnOffData)GetProcAddress(m_hModule, "RHIO_GetOnOffData");
	if(!m_rhGetOnOffData) AfxMessageBox("Faile Load RHIO_GetOnOffData Function!");
}

void CWEB_IO_TESTDlg::InitOutPutButton(void)
{
	for(int index = 0; index < 10; index++)
	{
		m_btnOutput[index].ModifyStyle(NULL, BS_BITMAP);
		SetOutPutStatus(index, EOF_NOT);
		m_btnOutput[index].SetNumber(index + 1);
	}

	EnableOutputAll(FALSE);
}


void CWEB_IO_TESTDlg::InitInput(CPoint pntStart, int iWidth, int iHeight, int iTerm)
{
	int iX, iY;
	iX = pntStart.x;
	iY = pntStart.y;

	CString strTemp;

	m_sttInputTitle.Create(NULL, WS_VISIBLE | WS_CHILD ,
		CRect(iX - 23, iY - 20, iX + 100, iY + iHeight - 20), this);
	m_sttInputTitle.SetFont(GetFont());
	m_sttInputTitle.SetWindowText("Input :");

	for(int index = 0; index < 16; index++)
	{
		m_wndInput[index].Create(NULL, NULL, WS_VISIBLE | WS_CHILD,
			CRect(iX, iY, iX + iWidth, iY + iHeight), this, ID_INPUT_STATUS + index);

		if(index < 12)
		{
			strTemp.Format("%d :", index + 1);
			m_sttInput[index].Create(NULL, WS_VISIBLE | WS_CHILD ,
				CRect(iX - 23, iY + 3, iX + iWidth - 27, iY + iHeight + 3), this);
		}
		else
		{
			strTemp.Format("ADC %d :", index - 11);
			m_sttInput[index].Create(NULL, WS_VISIBLE | WS_CHILD ,
				CRect(iX - 40, iY + 3, iX + iWidth - 27, iY + iHeight + 3), this);
		}

		m_sttInput[index].SetFont(GetFont());
		m_sttInput[index].SetWindowText(strTemp);

		if(index == 7)
		{
			iY += 27;
			iX = pntStart.x;
			continue;
		}

		iX += iTerm;
	}
}

void CWEB_IO_TESTDlg::InitSample(CPoint pntStart, int iWidth, int iHeight, int iTerm)
{
	int iX, iY;
	iX = pntStart.x;
	iY = pntStart.y;

	for(int index = 0; index < 4; index++)
	{
		m_wndSample[index].Create(NULL, NULL, WS_VISIBLE | WS_CHILD,
			CRect(iX, iY, iX + iWidth, iY + iHeight), this, ID_INPUT_STATUS + index);

		if(index >= 2)
			m_sttSample[index].Create(NULL, WS_VISIBLE | WS_CHILD ,
				CRect(iX - 60, iY + 3, iX + iWidth - 25, iY + iHeight + 3), this);
		else
			m_sttSample[index].Create(NULL, WS_VISIBLE | WS_CHILD ,
				CRect(iX - 35, iY + 3, iX + iWidth - 25, iY + iHeight + 3), this);


		m_sttSample[index].SetFont(GetFont());
		iX += iTerm;
	}
	m_sttSample[0].SetWindowText("   ON :");
	m_sttSample[1].SetWindowText("  OFF :");
	m_sttSample[2].SetWindowText(" Unknown :");
	m_sttSample[3].SetWindowText("          Act :");

	m_wndSample[0].SetStatus(EOF_ON);
	m_wndSample[1].SetStatus(EOF_OFF);
	m_wndSample[2].SetStatus(EOF_NOT);
	m_wndSample[3].SetStatus(EOF_ON_DELAY);
}

void CWEB_IO_TESTDlg::InitSelComm(void)
{
	m_rdCommVal = 0;
	this->UpdateData(FALSE);

	CString strTemp;
	for(int index = 0; index < 20; index++)
	{
		strTemp.Format("%d", index + 1);
		((CComboBox *)GetDlgItem(IDC_COMBO_COMM_PORT))->AddString(strTemp);
	}
	((CComboBox *)GetDlgItem(IDC_COMBO_COMM_PORT))->SetCurSel(0);
	((CComboBox *)GetDlgItem(IDC_COMBO_COMM_PORT))->EnableWindow(FALSE);
}


void CWEB_IO_TESTDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
	if ((nID & 0xFFF0) == IDM_ABOUTBOX)
	{
		CAboutDlg dlgAbout;
		dlgAbout.DoModal();
	}
	else
	{
		CDialog::OnSysCommand(nID, lParam);
	}
}

void CWEB_IO_TESTDlg::InitSerialNum(void)
{
	SetDlgItemText(IDC_EDIT_SERIAL1, "RHIO");
	((CEdit *)GetDlgItem(IDC_EDIT_SERIAL2))->SetLimitText(12);
}

void CWEB_IO_TESTDlg::OnPaint() 
{
	if (IsIconic())
	{
		CPaintDC dc(this);

		SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);

		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialog::OnPaint();
	}
}


HCURSOR CWEB_IO_TESTDlg::OnQueryDragIcon()
{
	return static_cast<HCURSOR>(m_hIcon);
}




void CWEB_IO_TESTDlg::SetOutPutStatus(int index, EOnOffFlag eStatus)
{
	switch(eStatus)
	{
	case EOF_ON:
		m_bmpOutput[index].DeleteObject();
		m_bmpOutput[index].LoadBitmap(IDB_BITMAP_ON);
		break;
	case EOF_OFF:
		m_bmpOutput[index].DeleteObject();
		m_bmpOutput[index].LoadBitmap(IDB_BITMAP_OFF);
		break;
	case EOF_NOT:
		m_bmpOutput[index].DeleteObject();
		m_bmpOutput[index].LoadBitmap(IDB_BITMAP_NOT);
		break;
	case EOF_ON_DELAY:
		m_bmpOutput[index].DeleteObject();
		m_bmpOutput[index].LoadBitmap(IDB_BITMAP_ONOFF);
		break;
	case EOF_OFF_DELAY:
		m_bmpOutput[index].DeleteObject();
		m_bmpOutput[index].LoadBitmap(IDB_BITMAP_ONOFF);
		break;
	case EOF_ONOFF_MACRO:
		m_bmpOutput[index].DeleteObject();
		m_bmpOutput[index].LoadBitmap(IDB_BITMAP_ONOFF);
		break;
	}
	m_btnOutput[index].SetBitmap(m_bmpOutput[index]);
	m_btnOutput[index].m_eStatus = eStatus;
}







void CWEB_IO_TESTDlg::EnableOutputAll(BOOL bCheck)
{
	for(int index = 0; index < 10; index++)
	{
		m_btnOutput[index].EnableWindow(bCheck);
	}
	GetDlgItem(IDC_BUTTON_STATUS_VIEW)->EnableWindow(bCheck);
}

void CWEB_IO_TESTDlg::OnBnClickedButtonConnect()
{
	this->UpdateData();

	if(m_rdCommVal == 0)
	{
		BYTE bAddr[4];
		m_IPaddrCtrl.GetAddress(bAddr[0],bAddr[1],bAddr[2],bAddr[3]);

		if(m_rhSockConnect(bAddr[0],bAddr[1],bAddr[2],bAddr[3], 6001))
		{
			EnableOutputAll(TRUE);
			GetDlgItem(IDC_BUTTON_CONNECT)->EnableWindow(FALSE);
			GetDlgItem(IDC_BUTTON_CLOSE)->EnableWindow(TRUE);
			GetDlgItem(IDC_BUTTON_SETTING)->EnableWindow(TRUE);
			GetDlgItem(IDC_RADIO_TCP)->EnableWindow(FALSE);
			GetDlgItem(IDC_RADIO_COM)->EnableWindow(FALSE);
			GetDlgItem(IDC_COMBO_COMM_PORT)->EnableWindow(FALSE);
			m_IPaddrCtrl.EnableWindow(FALSE);
			m_edtTCPPort.EnableWindow(FALSE);
		}
		else
			AfxMessageBox("Connection fail.", MB_OK | MB_ICONINFORMATION);
	}
	else
	{
		if(m_rhCommConnect(((CComboBox *)GetDlgItem(IDC_COMBO_COMM_PORT))->GetCurSel() + 1))
		{
			EnableOutputAll(TRUE);
			GetDlgItem(IDC_BUTTON_CONNECT)->EnableWindow(FALSE);
			GetDlgItem(IDC_BUTTON_CLOSE)->EnableWindow(TRUE);
			GetDlgItem(IDC_BUTTON_SETTING)->EnableWindow(TRUE);
			GetDlgItem(IDC_RADIO_TCP)->EnableWindow(FALSE);
			GetDlgItem(IDC_RADIO_COM)->EnableWindow(FALSE);
			GetDlgItem(IDC_COMBO_COMM_PORT)->EnableWindow(FALSE);
			m_IPaddrCtrl.EnableWindow(FALSE);
			m_edtTCPPort.EnableWindow(FALSE);
		}
		else
			AfxMessageBox("Connection fail.", MB_OK | MB_ICONINFORMATION);
	}
}


void CWEB_IO_TESTDlg::OnBnClickedButtonClose()
{
	m_rhClose();
	EnableOutputAll(FALSE);
	GetDlgItem(IDC_BUTTON_CONNECT)->EnableWindow(TRUE);
	GetDlgItem(IDC_BUTTON_CLOSE)->EnableWindow(FALSE);
	GetDlgItem(IDC_BUTTON_SETTING)->EnableWindow(FALSE);
	GetDlgItem(IDC_RADIO_TCP)->EnableWindow(TRUE);
	GetDlgItem(IDC_RADIO_COM)->EnableWindow(TRUE);

	if(m_rdCommVal == 0)
	{
		GetDlgItem(IDC_COMBO_COMM_PORT)->EnableWindow(FALSE);
		m_IPaddrCtrl.EnableWindow(TRUE);
		m_edtTCPPort.EnableWindow(TRUE);
	}
	else
	{
		GetDlgItem(IDC_COMBO_COMM_PORT)->EnableWindow(TRUE);
		m_IPaddrCtrl.EnableWindow(FALSE);
		m_edtTCPPort.EnableWindow(FALSE);
	}

	for(int index = 0; index < 16; index++)
		m_wndInput[index].SetStatus(EOF_NOT);

	for(int index = 0; index < 10; index++)
		SetOutPutStatus(index, EOF_NOT);
}

LRESULT CWEB_IO_TESTDlg::OnUpdateStatus(WPARAM wParam, LPARAM lParam)
{
	SendStatusFlag eFlag = (SendStatusFlag)wParam;
	BOOL isValue = (BOOL)lParam;

	if(eFlag == ESF_ONOFF)
	{
		if(isValue == 0x30)
		{
			SOnOffStatusData sOnOffData;
			m_rhGetOnOffData(sOnOffData);

			for(int index = 0; index < 10; index++)
				SetOutPutStatus(index, sOnOffData.eOutput[index]);
			for(int index = 0; index < 12; index++)
				m_wndInput[index].SetStatus(sOnOffData.eInput[index]);

			for(int index = 0; index < 4; index++)
				m_wndInput[index + 12].SetStatus(sOnOffData.sADC[index].eADC);

			SetDlgItemText(IDC_EDIT_AD1, CString(sOnOffData.sADC[0].cADC));
			SetDlgItemText(IDC_EDIT_AD2, CString(sOnOffData.sADC[1].cADC));
			SetDlgItemText(IDC_EDIT_AD3, CString(sOnOffData.sADC[2].cADC));
			SetDlgItemText(IDC_EDIT_AD4, CString(sOnOffData.sADC[3].cADC));

		}
		EnableOutputAll(TRUE);
	}
	else
	{
		if(m_dlgSetting.m_hWnd)
			m_dlgSetting.SendMessage(WM_RHIO_RECEIVE, wParam, lParam);
	}
	
	return TRUE;
}

void CWEB_IO_TESTDlg::OnBnClickedButtonSetting()
{
//	m_comProcess.m_flgSendStatus = ESF_SET;
	m_dlgSetting.DoModal();
//	m_comProcess.m_flgSendStatus = ESF_ONOFF;
}



void CWEB_IO_TESTDlg::OnBnClickedRadioTcp()
{
	((CComboBox *)GetDlgItem(IDC_COMBO_COMM_PORT))->EnableWindow(FALSE);
	m_IPaddrCtrl.EnableWindow(TRUE);
	m_edtTCPPort.EnableWindow(TRUE);
}

void CWEB_IO_TESTDlg::OnBnClickedRadioCom()
{
	((CComboBox *)GetDlgItem(IDC_COMBO_COMM_PORT))->EnableWindow(TRUE);
	m_IPaddrCtrl.EnableWindow(FALSE);
	m_edtTCPPort.EnableWindow(FALSE);
}



void CWEB_IO_TESTDlg::OnBnClickedButtonStatusView()
{
	m_rhSndGetOnOff();
	EnableOutputAll(FALSE);
}


