123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525 |
- // DecCfg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "StoneU_HC_OCX.h"
- #include "DecCfg.h"
- #include "DecStatus.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CDecCfg dialog
- CDecCfg::CDecCfg(CWnd* pParent /*=NULL*/)
- : CDialog(CDecCfg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CDecCfg)
- m_bChk = FALSE;
- m_Ip = _T("");
- m_Port = 0;
- m_UserName = _T("");
- m_Psw = _T("");
- m_bChkTrans = FALSE;
- m_UserName1 = _T("");
- m_Psw1 = _T("");
- m_Ip2 = _T("");
- m_Ip1 = _T("");
- m_Port2 = 0;
- m_Port1 = 0;
- m_filename = _T("");
- m_Ip3 = _T("");
- m_Port3 = 0;
- m_ctDateStart = 0;
- m_ctDateStop = 0;
- m_ctTimeStart = 0;
- m_ctTimeStop = 0;
- m_UserName2 = _T("");
- m_Psw2 = _T("");
- //}}AFX_DATA_INIT
- }
- void CDecCfg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CDecCfg)
- DDX_Control(pDX, IDC_COMBOPROTYPE1, m_ProTypeCtrl1);
- DDX_Control(pDX, IDC_COMBOPROTYPE, m_ProTypeCtrl);
- DDX_Control(pDX, IDC_COMCTRL, m_ctrl);
- DDX_Control(pDX, IDC_COMCHAN3, m_ChanCtrl2);
- DDX_Control(pDX, IDC_COMBOTYPE, m_typeCtrl);
- DDX_Control(pDX, IDC_COMCHAN2, m_ChanCtrl1);
- DDX_Control(pDX, IDC_COMBOSPECNO, m_specnoctrl);
- DDX_Control(pDX, IDC_COMBOPROTOCOL2, m_ProtCtrl1);
- DDX_Control(pDX, IDC_COMBODVRTRANS, m_DVRTransCtrl);
- DDX_Control(pDX, IDC_COMBO1, m_transctrl);
- DDX_Control(pDX, IDC_COMCHAN, m_ChanCtrl);
- DDX_Control(pDX, IDC_COMBOTIME, m_TimeCtrl);
- DDX_Control(pDX, IDC_COMBOPROTOCOL, m_ProtCtrl);
- DDX_Control(pDX, IDC_COMBONUM, m_NumCtrl);
- DDX_Control(pDX, IDC_COMBONO, m_NoCtrl);
- DDX_Control(pDX, IDC_COMBODECNUM, m_DecNumCtrl);
- DDX_Control(pDX, IDC_COMBODECNO, m_DecNoCtrl);
- DDX_Check(pDX, IDC_CHECK1, m_bChk);
- DDX_Text(pDX, IDC_EDITIP, m_Ip);
- DDX_Text(pDX, IDC_EDITPORT, m_Port);
- DDX_Text(pDX, IDC_EDITUSERNAME, m_UserName);
- DDX_Text(pDX, IDC_EDITUSERPSW, m_Psw);
- DDX_Check(pDX, IDC_CHKTRANS, m_bChkTrans);
- DDX_Text(pDX, IDC_EDITUSERNAME2, m_UserName1);
- DDX_Text(pDX, IDC_EDITUSERPSW2, m_Psw1);
- DDX_Text(pDX, IDC_EDITIP2, m_Ip2);
- DDX_Text(pDX, IDC_EDITIP3, m_Ip1);
- DDX_Text(pDX, IDC_EDITPORT2, m_Port2);
- DDX_Text(pDX, IDC_EDITPORT3, m_Port1);
- DDX_Text(pDX, IDC_EDITFILENAME, m_filename);
- DDX_Text(pDX, IDC_EDITIP4, m_Ip3);
- DDX_Text(pDX, IDC_EDITPORT4, m_Port3);
- DDX_DateTimeCtrl(pDX, IDC_DATESTART, m_ctDateStart);
- DDX_DateTimeCtrl(pDX, IDC_DATESTOP, m_ctDateStop);
- DDX_DateTimeCtrl(pDX, IDC_TIMESTART, m_ctTimeStart);
- DDX_DateTimeCtrl(pDX, IDC_TIMESTOP, m_ctTimeStop);
- DDX_Text(pDX, IDC_EDITUSERNAME3, m_UserName2);
- DDX_Text(pDX, IDC_EDITUSERPSW3, m_Psw2);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CDecCfg, CDialog)
- //{{AFX_MSG_MAP(CDecCfg)
- ON_CBN_SELCHANGE(IDC_COMBODECNO, OnSelchangeCombodecno)
- ON_CBN_SELCHANGE(IDC_COMBONO, OnSelchangeCombono)
- ON_BN_CLICKED(IDC_BUTOK, OnButok)
- ON_BN_CLICKED(IDC_BUTEXIT, OnButexit)
- ON_BN_CLICKED(IDC_BUTCHANOK, OnButchanok)
- ON_BN_CLICKED(IDC_BUTDECOK, OnButdecok)
- ON_BN_CLICKED(IDC_BUTSTARTDEC, OnButstartdec)
- ON_BN_CLICKED(IDC_BUTSTOPDEC, OnButstopdec)
- ON_BN_CLICKED(IDC_BUTSCREEN, OnButscreen)
- ON_BN_CLICKED(IDC_BUTTRANSOK, OnButtransok)
- ON_BN_CLICKED(IDC_BUTTRANSOK2, OnButtransok2)
- ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
- ON_BN_CLICKED(IDC_BUTCTRLDEC1, OnButctrldec1)
- ON_BN_CLICKED(IDC_BUTCTRLDEC2, OnButctrldec2)
- ON_BN_CLICKED(IDC_BUTCTRLDEC3, OnButctrldec3)
- ON_BN_CLICKED(IDC_BUTCTRLDEC4, OnButctrldec4)
- ON_BN_CLICKED(IDC_BUTCTRL, OnButctrl)
- ON_BN_CLICKED(IDC_BUTDEFAULT, OnButdefault)
- ON_BN_CLICKED(IDC_BUTSTATUS, OnButstatus)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CDecCfg message handlers
- BOOL CDecCfg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- CRect rc(0, 0, 0, 0);
- GetParent()->GetClientRect(&rc);
- ((CTabCtrl*)GetParent())->AdjustRect(FALSE, &rc);
- MoveWindow(&rc);
- m_NoCtrl.SetCurSel(0);
- m_NumCtrl.SetCurSel(0);
- m_ChanCtrl.SetCurSel(0);
- m_DecNoCtrl.SetCurSel(0);
- m_DecNumCtrl.SetCurSel(0);
- m_ProtCtrl.SetCurSel(0);
- m_TimeCtrl.SetCurSel(0);
- m_lSelWnd = 0;
- m_lSelDecNo = 0;
- m_lChannel = 0;
- if(NET_DVR_GetDecInfo(m_lServerID, 0, &Decoderinfo))
- {
- m_NumCtrl.SetCurSel(Decoderinfo.dwDecChanNum);
- m_NoCtrl.SetCurSel(m_lSelWnd);
- m_bChk = Decoderinfo.struDecInfo[m_lSelWnd].byEnablePoll;
- m_TimeCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].byPoolTime-1);
- m_DecNumCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].byPoolChans);
- m_DecNoCtrl.SetCurSel(m_lSelDecNo);
- m_ChanCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byChannel-1);
- m_ProtCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkMode);
- m_ProTypeCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkType);
- m_UserName.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sUserName);
- m_Psw.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sPassword);
- m_Ip.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sDVRIP);
- m_Port = Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].wDVRPort;
- }
- m_lSelTrans = 0;
- m_transctrl.SetCurSel(m_lSelTrans);
- if (NET_DVR_GetDecTransPort(m_lServerID, &TransPort))
- {
- m_bChkTrans = TransPort.struTransPortInfo[m_lSelTrans].dwEnableTransPort;
- m_DVRTransCtrl.SetCurSel(TransPort.struTransPortInfo[m_lSelTrans].wDVRTransPort-1);
- m_Ip2.Format("%s", TransPort.struTransPortInfo[m_lSelTrans].sDecoderIP);
- m_Port2 = TransPort.struTransPortInfo[m_lSelTrans].wDecoderPort;
- }
- else
- {
- MessageBox("获取解码设备透明通道参数失败!", "温馨提示", MB_ICONINFORMATION);
- }
- m_lChannel = 0;
- m_specnoctrl.SetCurSel(m_lChannel);
- m_ChanCtrl1.SetCurSel(0);
- m_ProtCtrl1.SetCurSel(0);
- m_UserName1.Format("%s", "admin");
- m_Psw1.Format("%s", "12345");
- m_Ip1.Format("%s", "0.0.0.0");
- m_Port1 = 8000;
-
- m_Ip3.Format("%s", "0.0.0.0");
- m_Port3 = 8000;
- m_typeCtrl.SetCurSel(0);
- m_ctrl.SetCurSel(0);
- m_ChanCtrl2.SetCurSel(0);
- m_filename = "";
- UpdateData(FALSE);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CDecCfg::OnOK()
- {
- // TODO: Add extra validation here
-
- // CDialog::OnOK();
- }
- void CDecCfg::OnCancel()
- {
- // TODO: Add extra cleanup here
-
- // CDialog::OnCancel();
- }
- void CDecCfg::OnSelchangeCombodecno()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lSelDecNo = m_DecNoCtrl.GetCurSel();
- m_ChanCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byChannel-1);
- m_ProtCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkMode);
- m_ProTypeCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkType);
- m_UserName.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sUserName);
- m_Psw.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sPassword);
- m_Ip.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sDVRIP);
- m_Port = Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].wDVRPort;
- UpdateData(FALSE);
- }
- void CDecCfg::OnSelchangeCombono()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lSelWnd = m_NoCtrl.GetCurSel();
- m_bChk = Decoderinfo.struDecInfo[m_lSelWnd].byEnablePoll;
- m_TimeCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].byPoolTime-1);
- m_DecNumCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].byPoolChans);
- m_DecNoCtrl.SetCurSel(m_lSelDecNo);
- m_ChanCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byChannel-1);
- m_ProtCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkMode);
- m_ProTypeCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkType);
- m_UserName.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sUserName);
- m_Psw.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sPassword);
- m_Ip.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sDVRIP);
- m_Port = Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].wDVRPort;
- UpdateData(FALSE);
- }
- void CDecCfg::OnButok()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- Decoderinfo.dwDecChanNum = m_NumCtrl.GetCurSel();
- m_lSelWnd = m_NoCtrl.GetCurSel();
- Decoderinfo.struDecInfo[m_lSelWnd].byEnablePoll = m_bChk;
- Decoderinfo.struDecInfo[m_lSelWnd].byPoolTime = m_TimeCtrl.GetCurSel()+1;
- Decoderinfo.struDecInfo[m_lSelWnd].byPoolChans = m_DecNumCtrl.GetCurSel();
- m_lSelDecNo = m_DecNoCtrl.GetCurSel();
- Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byChannel = m_ChanCtrl.GetCurSel()+1;
- Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkMode = m_ProtCtrl.GetCurSel();
- Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkType = m_ProTypeCtrl.GetCurSel();
- memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sUserName, m_UserName, NAME_LEN);
- memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sPassword, m_Psw, PASSWD_LEN);
- memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sDVRIP, m_Ip, 16);
- Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].wDVRPort = m_Port;
- if(NET_DVR_SetDecInfo(m_lServerID, 0, &Decoderinfo))
- {
- MessageBox("设置参数成功!", "温馨提示", MB_ICONINFORMATION);
- }
- else
- {
- MessageBox("设置参数失败!", "温馨提示", MB_ICONINFORMATION);
- }
- }
- void CDecCfg::OnButexit()
- {
- // TODO: Add your control notification handler code here
- // CDialog::OnOK();
- }
- void CDecCfg::OnButchanok()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lSelWnd = m_NoCtrl.GetCurSel();
- m_lSelDecNo = m_DecNoCtrl.GetCurSel();
- Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byChannel = m_ChanCtrl.GetCurSel()+1;
- Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkMode = m_ProtCtrl.GetCurSel();
- memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sUserName, m_UserName, NAME_LEN);
- memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sPassword, m_Psw, PASSWD_LEN);
- memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sDVRIP, m_Ip, 16);
- Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].wDVRPort = m_Port;
- Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkType = m_ProTypeCtrl.GetCurSel();
- }
- void CDecCfg::OnButdecok()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lSelWnd = m_NoCtrl.GetCurSel();
- Decoderinfo.struDecInfo[m_lSelWnd].byEnablePoll = m_bChk;
- Decoderinfo.struDecInfo[m_lSelWnd].byPoolTime = m_TimeCtrl.GetCurSel()+1;
- Decoderinfo.struDecInfo[m_lSelWnd].byPoolChans = m_DecNumCtrl.GetCurSel();
- m_lSelDecNo = m_DecNoCtrl.GetCurSel();
- Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byChannel = m_ChanCtrl.GetCurSel()+1;
- Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkMode = m_ProtCtrl.GetCurSel();
- Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkType = m_ProTypeCtrl.GetCurSel();
- memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sUserName, m_UserName, NAME_LEN);
- memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sPassword, m_Psw, PASSWD_LEN);
- memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sDVRIP, m_Ip, 16);
- Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].wDVRPort = m_Port;
- }
- void CDecCfg::OnButstartdec()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lChannel = m_specnoctrl.GetCurSel();
- NET_DVR_DECCHANINFO DecChanInfo;
- DecChanInfo.byChannel = m_ChanCtrl1.GetCurSel()+1;
- DecChanInfo.byLinkMode = m_ProtCtrl1.GetCurSel();
- DecChanInfo.byLinkType = m_ProTypeCtrl1.GetCurSel();
- memcpy(DecChanInfo.sUserName, m_UserName1, NAME_LEN);
- memcpy(DecChanInfo.sPassword, m_Psw1, PASSWD_LEN);
- memcpy(DecChanInfo.sDVRIP, m_Ip1, 16);
- DecChanInfo.wDVRPort = m_Port1;
-
- if (!NET_DVR_StartDecSpecialCon(m_lServerID, m_lChannel+m_lStartChan, &DecChanInfo))
- {
- MessageBox("启动动态连接失败!", "温馨提示", MB_ICONINFORMATION);
- }
- }
- void CDecCfg::OnButstopdec()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lChannel = m_specnoctrl.GetCurSel();
- NET_DVR_DECCHANINFO DecChanInfo;
- DecChanInfo.byChannel = m_ChanCtrl1.GetCurSel()+1;
- DecChanInfo.byLinkMode = m_ProtCtrl1.GetCurSel();
- DecChanInfo.byLinkType = m_ProTypeCtrl1.GetCurSel();
- memcpy(DecChanInfo.sUserName, m_UserName1, NAME_LEN);
- memcpy(DecChanInfo.sPassword, m_Psw1, PASSWD_LEN);
- memcpy(DecChanInfo.sDVRIP, m_Ip1, 16);
- DecChanInfo.wDVRPort = m_Port1;
- if(!NET_DVR_StopDecSpecialCon(m_lServerID, m_lChannel+m_lStartChan, &DecChanInfo))
- {
- MessageBox("停止动态连接失败!", "温馨提示", MB_ICONINFORMATION);
- }
- }
- void CDecCfg::OnButscreen()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lChannel = m_specnoctrl.GetCurSel();
- if (!NET_DVR_DecCtrlScreen(m_lServerID, m_lChannel+m_lStartChan, 1))
- {
- MessageBox("全屏操作失败!", "温馨提示", MB_ICONINFORMATION);
- }
- }
- void CDecCfg::OnButtransok()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lSelTrans = m_transctrl.GetCurSel();
- TransPort.struTransPortInfo[m_lSelTrans].dwEnableTransPort = m_bChkTrans;
- memcpy(TransPort.struTransPortInfo[m_lSelTrans].sDecoderIP, m_Ip2, 16);
- TransPort.struTransPortInfo[m_lSelTrans].wDecoderPort = m_Port2;
- TransPort.struTransPortInfo[m_lSelTrans].wDVRTransPort = m_DVRTransCtrl.GetCurSel()+1;
- if (NET_DVR_SetDecTransPort(m_lServerID, &TransPort))
- {
- MessageBox("设置解码设备透明通道参数成功!", "温馨提示", MB_ICONINFORMATION);
- }
- else
- {
- MessageBox("设置解码设备透明通道参数失败!", "温馨提示", MB_ICONINFORMATION);
- }
- }
- void CDecCfg::OnButtransok2()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lSelTrans = m_transctrl.GetCurSel();
- TransPort.struTransPortInfo[m_lSelTrans].dwEnableTransPort = m_bChkTrans;
- memcpy(TransPort.struTransPortInfo[m_lSelTrans].sDecoderIP, m_Ip2, 16);
- TransPort.struTransPortInfo[m_lSelTrans].wDecoderPort = m_Port2;
- TransPort.struTransPortInfo[m_lSelTrans].wDVRTransPort = m_DVRTransCtrl.GetCurSel()+1;
- }
- void CDecCfg::OnSelchangeCombo1()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lSelTrans = m_transctrl.GetCurSel();
- m_bChkTrans = TransPort.struTransPortInfo[m_lSelTrans].dwEnableTransPort;
- m_DVRTransCtrl.SetCurSel(TransPort.struTransPortInfo[m_lSelTrans].wDVRTransPort-1);
- m_Ip2.Format("%s", TransPort.struTransPortInfo[m_lSelTrans].sDecoderIP);
- m_Port2 = TransPort.struTransPortInfo[m_lSelTrans].wDecoderPort;
- UpdateData(FALSE);
- }
- void CDecCfg::OnButctrldec1()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lChannel = m_specnoctrl.GetCurSel();
- if (!NET_DVR_DecCtrlDec(m_lServerID, m_lChannel+m_lStartChan, NET_DEC_STARTDEC))
- {
- MessageBox("启动解码失败!", "温馨提示", MB_ICONINFORMATION);
- }
- }
- void CDecCfg::OnButctrldec2()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lChannel = m_specnoctrl.GetCurSel();
- if (!NET_DVR_DecCtrlDec(m_lServerID, m_lChannel+m_lStartChan, NET_DEC_STOPDEC))
- {
- MessageBox("停止解码失败!", "温馨提示", MB_ICONINFORMATION);
- }
- }
- void CDecCfg::OnButctrldec3()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lChannel = m_specnoctrl.GetCurSel();
- if (!NET_DVR_DecCtrlDec(m_lServerID, m_lChannel+m_lStartChan, NET_DEC_STOPCYCLE))
- {
- MessageBox("停止轮巡失败!", "温馨提示", MB_ICONINFORMATION);
- }
- }
- void CDecCfg::OnButctrldec4()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lChannel = m_specnoctrl.GetCurSel();
- if (!NET_DVR_DecCtrlDec(m_lServerID, m_lChannel+m_lStartChan, NET_DEC_CONTINUECYCLE))
- {
- MessageBox("恢复轮巡失败!", "温馨提示", MB_ICONINFORMATION);
- }
- }
- void CDecCfg::OnButctrl()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lChannel = m_specnoctrl.GetCurSel();
- NET_DVR_PLAYREMOTEFILE RemoteFileInfo;
- RemoteFileInfo.dwSize = sizeof(NET_DVR_PLAYREMOTEFILE);
- memcpy(RemoteFileInfo.sDecoderIP, m_Ip3, 16);
- RemoteFileInfo.wDecoderPort = m_Port3;
- RemoteFileInfo.wLoadMode = m_typeCtrl.GetCurSel()+1;
- if (m_typeCtrl.GetCurSel() == 0)
- {
- memcpy(RemoteFileInfo.mode_size.byFile, m_filename, 100);
- }
- else
- {
- RemoteFileInfo.mode_size.bytime.dwChannel = m_ChanCtrl2.GetCurSel()+1;
- memcpy(RemoteFileInfo.mode_size.bytime.sUserName, m_UserName2, NAME_LEN);
- memcpy(RemoteFileInfo.mode_size.bytime.sPassword, m_Psw2, PASSWD_LEN);
- RemoteFileInfo.mode_size.bytime.struStartTime.dwYear = (WORD)m_ctDateStart.GetYear();
- RemoteFileInfo.mode_size.bytime.struStartTime.dwMonth = (WORD)m_ctDateStart.GetMonth();
- RemoteFileInfo.mode_size.bytime.struStartTime.dwDay = (WORD)m_ctDateStart.GetDay();
- RemoteFileInfo.mode_size.bytime.struStartTime.dwHour = (char)m_ctTimeStart.GetHour();
- RemoteFileInfo.mode_size.bytime.struStartTime.dwMinute = (char)m_ctTimeStart.GetMinute();
- RemoteFileInfo.mode_size.bytime.struStartTime.dwSecond = (char)m_ctTimeStart.GetSecond();
- RemoteFileInfo.mode_size.bytime.struStopTime.dwYear = (WORD)m_ctDateStop.GetYear();
- RemoteFileInfo.mode_size.bytime.struStopTime.dwMonth = (WORD)m_ctDateStop.GetMonth();
- RemoteFileInfo.mode_size.bytime.struStopTime.dwDay = (WORD)m_ctDateStop.GetDay();
- RemoteFileInfo.mode_size.bytime.struStopTime.dwHour = (char)m_ctTimeStop.GetHour();
- RemoteFileInfo.mode_size.bytime.struStopTime.dwMinute = (char)m_ctTimeStop.GetMinute();
- RemoteFileInfo.mode_size.bytime.struStopTime.dwSecond = (char)m_ctTimeStop.GetSecond();
- }
-
- if (!NET_DVR_DecPlayBackCtrl(m_lServerID, m_lChannel+m_lStartChan, m_ctrl.GetCurSel()+1, 0, NULL, &RemoteFileInfo))
- {
- MessageBox("控制回放文件失败!", "温馨提示", MB_ICONINFORMATION);
- }
- }
- /*
- void CDecCfg::OnButstatus()
- {
- // TODO: Add your control notification handler code here
- TRACE("hello");
- CDecStatus Dlg;
- UpdateData(TRUE);
- m_lChannel = m_specnoctrl.GetCurSel();
- Dlg.m_lServerID = m_lServerID;
- Dlg.m_lChannel = m_lChannel;
- Dlg.m_lStartChan = m_lStartChan;
- Dlg.DoModal();
- }
- */
- void CDecCfg::OnButdefault()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- m_lChannel = m_specnoctrl.GetCurSel();
- if (!NET_DVR_DecCtrlScreen(m_lServerID, m_lChannel+m_lStartChan, 2))
- {
- MessageBox("还原操作失败!", "温馨提示", MB_ICONINFORMATION);
- }
- }
- void CDecCfg::OnButstatus()
- {
- // TODO: Add your control notification handler code here
- CDecStatus Dlg;
- UpdateData(TRUE);
- m_lChannel = m_specnoctrl.GetCurSel();
- Dlg.m_lServerID = m_lServerID;
- Dlg.m_lChannel = m_lChannel;
- Dlg.m_lStartChan = m_lStartChan;
- Dlg.DoModal();
- }
|