#include "stdafx.h"
#include "HttpInterface.h"
#include <afxmt.h>			//¹ÂÅØ½º¸¦ »ç¿ëÇÏ±â À§ÇÏ¿© 

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif


UINT CHttpInterface::GetDisplayScreenNum(UINT nch)
{
	UINT nChCount = 0;
	for(UINT i=0; i<nch; i++)
	{
		if((0x01 << i) & m_dwChannel)
		{
			nChCount++;
		}
	}
	return m_nDisplayStartScreenNum + nChCount;
}

void CHttpInterface::SetConnectionFailed()
{
	m_bConnect = FALSE;
	for(UINT k=0; k<GetChannelCount(); k++)
	{
		m_pDecoder->LoadInfoImage(GetDisplayScreenNum(m_nEnableChannel[k]), IMAGETYPE_CONNECTIONFAILED);
	}

	HANDLE hReconnctionWait = CreateEvent(NULL, FALSE, FALSE, NULL);
	WaitForSingleObject(hReconnctionWait, RECONNECTION_TIME);
}


