⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clientstate.cpp

📁 它是一个可以实时交互的嵌入式软件系统
💻 CPP
字号:
// lientState.cpp : implementation file
//

#include "stdafx.h"
#include "netsdkdemo.h"
#include "clientState.h"

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

/////////////////////////////////////////////////////////////////////////////
// CClientState dialog

CClientState::CClientState(CWnd* pParent /*=NULL*/)
	: CDialog(CClientState::IDD, pParent)
{
	//{{AFX_DATA_INIT(CClientState)
	m_isNoMoreShow = FALSE;
	//}}AFX_DATA_INIT
}


void CClientState::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CClientState)
	DDX_Check(pDX, IDC_NOSHOW, m_isNoMoreShow);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CClientState, CDialog)
	//{{AFX_MSG_MAP(CClientState)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// ClientState message handlers
void CClientState::UpdateState(void *pDevice, char *pBuf, DWORD dwBufLen)
{
	DeviceNode *nDev = (DeviceNode *)pDevice;

	NET_CLIENT_STATE *ClientState = (NET_CLIENT_STATE *)pBuf;//&nDev->State;// 

	if(pBuf == NULL)   //显示详细信息
	{
		ClientState = &nDev->State;		
	}

	CString strDiskError = MSG_CLIENTSTATE_DISKERR;
    for (int i=0; i<32; i++)
    {
        if (ClientState->diskerror[i])
        {
            CString str;
            str.Format("%d ", i+1);
            strDiskError += str;
        }
    }

    CString strAlarm = MSG_CLIENTSTATE_ALARM;
    for (i=0; i<ClientState->alarminputcount; i++)
    {
        if (*(ClientState->alarm + i))
        {
            CString str;
            str.Format("%d ", i+1);
            strAlarm += str;
        }
    }

    CString strRecord = MSG_CLIENTSTATE_RECORDING;
    CString strMD = MSG_CLIENTSTATE_MOTION;
    CString strVideoLost = MSG_CLIENTSTATE_VIDEOLOST;
    for (i=0; i<ClientState->channelcount; i++)
    {
        if (*(ClientState->record + i))
        {
            CString str;
            str.Format("%d ", i+1);
            strRecord += str;
        }
        if (*(ClientState->motiondection + i))
        {
            CString str;
            str.Format("%d ", i+1);
            strMD += str;
        }
        if (*(ClientState->videolost + i))
        {
            CString str;
            str.Format("%d ", i+1);
            strVideoLost += str;
        }
    }

	CString strTop ;
	strTop.Format("(%s [%s])",nDev->Name, nDev->IP);
	strTop += MSG_CLIENTSTATE_CLIENTSTATE;
    CString strTotal = strTop + "\n" +"\n"+
				strDiskError + "\n" +"\n"+
                strAlarm + "\n" +"\n"+
                strRecord + "\n" +"\n"+
                strMD + "\n" +"\n"+
                strVideoLost;
    GetDlgItem(IDC_CLIENT_STATE)->SetWindowText(strTotal);
	
}
/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
// CClientState message handlers

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

	g_SetWndStaticText(this);
	return TRUE;  
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -