// DeviceInformation.cpp : implementation file // #include "stdafx.h" #include "udpadmintool.h" #include "DeviceInformation.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif #include "util_local.h" ///////////////////////////////////////////////////////////////////////////// // CDeviceInformation dialog CDeviceInformation::CDeviceInformation(CWnd* pParent /*=NULL*/) : CDialog(CDeviceInformation::IDD, pParent) { //{{AFX_DATA_INIT(CDeviceInformation) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CDeviceInformation::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDeviceInformation) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDeviceInformation, CDialog) //{{AFX_MSG_MAP(CDeviceInformation) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDeviceInformation message handlers BOOL CDeviceInformation::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if(pMsg->wParam == VK_RETURN) { return TRUE; } return CDialog::PreTranslateMessage(pMsg); } /* char* convert_time_string2(int secs, char* buf) { int day, hour, min; char tmp[1024]; min = secs / 60; secs = secs % 60; hour = min / 60; min = min % 60; day = hour/24; hour = hour % 24; buf[0] = 0; tmp[0] = 0; if(day == 1) { sprintf(tmp, "%d day ", day); } else if(day > 1) { sprintf(tmp, "%d days ", day); } strcat(buf, tmp); if(hour == 1) { sprintf(tmp, "%d hour ", hour); } else if(hour > 1) { sprintf(tmp, "%d hours ", hour); } strcat(buf, tmp); if(min == 1) { sprintf(tmp, "%d minute ", min); } else if(min > 1) { sprintf(tmp, "%d minutes ", min); } strcat(buf, tmp); return buf; } */ BOOL CDeviceInformation::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here GetDlgItem(IDC_STATIC_MODEL)->SetWindowText(theApp.m_info.Name); GetDlgItem(IDC_STATIC_NICK)->SetWindowText(theApp.m_info.NickName); GetDlgItem(IDC_STATIC_FIRM)->SetWindowText(theApp.m_info.FirmwareVersion); GetDlgItem(IDC_STATIC_UBOOT)->SetWindowText(theApp.m_info.ubootver); GetDlgItem(IDC_STATIC_MAC)->SetWindowText(theApp.m_info.MAC); GetDlgItem(IDC_STATIC_SERIAL)->SetWindowText(theApp.m_info.SerialNo); GetDlgItem(IDC_STATIC_IP)->SetWindowText(theApp.m_info.sIp); GetDlgItem(IDC_STATIC_SUB)->SetWindowText(theApp.m_info.Subnet); GetDlgItem(IDC_STATIC_GATE)->SetWindowText(theApp.m_info.Gate); GetDlgItem(IDC_STATIC_DNS)->SetWindowText(theApp.m_info.Dns); GetDlgItem(IDC_STATIC_RTSP)->SetWindowText(theApp.m_info.RTSP); GetDlgItem(IDC_STATIC_HTTP)->SetWindowText(theApp.m_info.HTTP); GetDlgItem(IDC_STATIC_WWW)->SetWindowText(theApp.m_info.wwwroot); GetDlgItem(IDC_STATIC_SERVER)->SetWindowText(theApp.m_info.Server); char str[1024]; // - cjy, 07_1012 09:35 //GetDlgItem(IDC_STATIC_UPTIME)->SetWindowText(convert_time_string2(theApp.m_info.uptime, str)); GetDlgItem(IDC_STATIC_UPTIME)->SetWindowText(convert_time_string(theApp.m_info.uptime, str)); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }