214 lines
7.2 KiB
C++
214 lines
7.2 KiB
C++
// ExecOperator.cpp: implementation of the CExecOperator class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#include "geomative.h"
|
|
#include "ExecOperator.h"
|
|
#include "navsptview.h"
|
|
#include "Constant.h"
|
|
|
|
#include "opexec2drsptestsetdlg.h"
|
|
|
|
#ifdef _DEBUG
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[]=__FILE__;
|
|
#define new DEBUG_NEW
|
|
#endif
|
|
|
|
|
|
|
|
extern CGeoMativeApp theApp;
|
|
extern int g_iLanguage;
|
|
//////////////////////////////////////////////////////////////////////
|
|
// Construction/Destruction
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
CExecOperator::CExecOperator(_ConnectionPtr& pConnection)
|
|
{
|
|
ASSERT(NULL != pConnection);
|
|
m_pConnection = pConnection;
|
|
}
|
|
|
|
CExecOperator::~CExecOperator()
|
|
{
|
|
|
|
}
|
|
|
|
void CExecOperator::ExecRSPTest()
|
|
{
|
|
long lRet = VAL_ZERO;
|
|
int iCurSel = VAL_MINUS_ONE;
|
|
|
|
COpExec2DRSPTestSetDlg* pOpExec2DRSPTestSetDlg = new COpExec2DRSPTestSetDlg(m_pConnection);
|
|
pOpExec2DRSPTestSetDlg->Create(IDD_OP_TDH_S_C, AfxGetMainWnd());
|
|
this->InitialExec2DRSPTestSetDlg(pOpExec2DRSPTestSetDlg);
|
|
|
|
pOpExec2DRSPTestSetDlg->ShowWindow(SW_SHOW);
|
|
|
|
lRet = pOpExec2DRSPTestSetDlg->RunModalLoop(MLF_SHOWONIDLE); // 开始非模态窗口模态循环
|
|
|
|
if (RET_OK == lRet)
|
|
{
|
|
iCurSel = pOpExec2DRSPTestSetDlg->m_sptTab.GetCurSel();
|
|
switch (iCurSel)
|
|
{
|
|
case TAB_INDEX_CE:
|
|
theApp.m_pExecManager->ExecCERSPTest(pOpExec2DRSPTestSetDlg, theApp.m_pSptManager->m_medLinkList);
|
|
break;
|
|
|
|
case TAB_INDEX_2D:
|
|
theApp.m_pExecManager->Exec2DRSPTest(pOpExec2DRSPTestSetDlg, theApp.m_pSptManager->m_medLinkList);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
pOpExec2DRSPTestSetDlg->m_sptTab.SetFocus();
|
|
|
|
}
|
|
|
|
pOpExec2DRSPTestSetDlg->DestroyWindow();
|
|
delete pOpExec2DRSPTestSetDlg;
|
|
|
|
}
|
|
|
|
void CExecOperator::InitialExec2DRSPTestSetDlg(COpExec2DRSPTestSetDlg* pOpExec2DRSPTestSetDlg)
|
|
{
|
|
_RecordsetPtr pRecCm = NULL;
|
|
_RecordsetPtr pRecPro = NULL;
|
|
_RecordsetPtr pRecDev = NULL;
|
|
CDevice* pDevice = NULL;
|
|
|
|
int iIndex = (int)VAL_ZERO;
|
|
|
|
CString szSql = _T("");
|
|
|
|
pRecCm.CreateInstance(_uuidof(Recordset));
|
|
pRecPro.CreateInstance(_uuidof(Recordset));
|
|
pRecDev.CreateInstance(_uuidof(Recordset));
|
|
|
|
iIndex = (int)VAL_ZERO;
|
|
pOpExec2DRSPTestSetDlg->m_cbDESN.ResetContent();
|
|
pRecDev->Open(_T("select ID,SN from device order by ID"), _variant_t((IDispatch*)m_pConnection, true),
|
|
adOpenStatic, adLockOptimistic, adCmdText);
|
|
while ((short)VAL_ZERO == pRecDev->adoEOF)
|
|
{
|
|
pDevice = NULL;
|
|
pDevice = theApp.m_pDevManager->GetDeviceByID((DWORD)pRecDev->GetCollect(_T("ID")).ulVal);
|
|
if (pDevice != NULL)
|
|
{
|
|
if (PZ_STATE_ONLINE == pDevice->m_uState)
|
|
{
|
|
iIndex = pOpExec2DRSPTestSetDlg->m_cbDESN.AddString(pDevice->m_szDevSN);
|
|
pOpExec2DRSPTestSetDlg->m_cbDESN.SetItemDataPtr(iIndex, pDevice);
|
|
}
|
|
}
|
|
pRecDev->MoveNext();
|
|
}
|
|
pRecDev->Close();
|
|
|
|
iIndex = (int)VAL_ZERO;
|
|
|
|
//由于GD10主机上只实现了Cvalue的前四个,所以在sql语句中做限制
|
|
pOpExec2DRSPTestSetDlg->m_cbCLayout.ResetContent();
|
|
szSql.Empty();
|
|
szSql.Format(_T("select Clabel from cm where Cname = 'Clayout' and Lang = %d and Cvalue >= 0 and Cvalue < 4 order by Cvalue"), g_iLanguage);
|
|
pRecCm->Open(szSql.AllocSysString(), _variant_t((IDispatch*)m_pConnection, true), adOpenStatic, adLockOptimistic, adCmdText);
|
|
|
|
while ((short)VAL_ZERO == pRecCm->adoEOF)
|
|
{
|
|
pOpExec2DRSPTestSetDlg->m_cbCLayout.AddString((LPCTSTR)(_bstr_t)pRecCm->GetCollect(_T("Clabel")));
|
|
pRecCm->MoveNext();
|
|
}
|
|
pRecCm->Close();
|
|
/*
|
|
pOpExec2DRSPTestSetDlg->m_cbTRWave.ResetContent();
|
|
szSql.Empty();
|
|
szSql.Format(_T("select Clabel from cm where Cname = 'Trwave' and Lang = %d order by Cvalue"), g_iLanguage);
|
|
pRecCm->Open(szSql.AllocSysString(), _variant_t((IDispatch*)m_pConnection, true), adOpenStatic, adLockOptimistic, adCmdText);
|
|
|
|
while ((short)VAL_ZERO == pRecCm->adoEOF)
|
|
{
|
|
pOpExec2DRSPTestSetDlg->m_cbTRWave.AddString((LPCTSTR)(_bstr_t)pRecCm->GetCollect(_T("Clabel")));
|
|
pRecCm->MoveNext();
|
|
}
|
|
pRecCm->Close();
|
|
*/
|
|
//由于GD10只实现了从1~6范围内的频率
|
|
pOpExec2DRSPTestSetDlg->m_cbTRFrequency.ResetContent();
|
|
szSql.Empty();
|
|
szSql.Format(_T("select Clabel from cm where Cname = 'Trfrequency' and Lang = %d and Cvalue > 0 and Cvalue < 7 order by Cvalue"), g_iLanguage);
|
|
pRecCm->Open(szSql.AllocSysString(), _variant_t((IDispatch*)m_pConnection, true), adOpenStatic, adLockOptimistic, adCmdText);
|
|
|
|
while ((short)VAL_ZERO == pRecCm->adoEOF)
|
|
{
|
|
pOpExec2DRSPTestSetDlg->m_cbTRFrequency.AddString((LPCTSTR)(_bstr_t)pRecCm->GetCollect(_T("Clabel")));
|
|
pRecCm->MoveNext();
|
|
}
|
|
pRecCm->Close();
|
|
|
|
/*
|
|
// pOpExec2DRSPTestSetDlg->m_cbIFrequency.ResetContent();
|
|
szSql.Empty();
|
|
szSql.Format(_T("select Clabel from cm where Cname = 'Ifrequency' and Lang = %d order by Cvalue"), g_iLanguage);
|
|
pRecCm->Open(szSql.AllocSysString(), _variant_t((IDispatch*)m_pConnection, true), adOpenStatic, adLockOptimistic, adCmdText);
|
|
while ((short)VAL_ZERO == pRecCm->adoEOF)
|
|
{
|
|
// pOpExec2DRSPTestSetDlg->m_cbIFrequency.AddString((LPCTSTR)(_bstr_t)pRecCm->GetCollect(_T("Clabel")));
|
|
pRecCm->MoveNext();
|
|
}
|
|
pRecCm->Close();
|
|
|
|
// pOpExec2DRSPTestSetDlg->m_cbTMode.ResetContent();
|
|
szSql.Empty();
|
|
szSql.Format(_T("select Clabel from cm where Cname = 'Tmode' and Lang = %d order by Cvalue"), g_iLanguage);
|
|
pRecCm->Open(szSql.AllocSysString(), _variant_t((IDispatch*)m_pConnection, true), adOpenStatic, adLockOptimistic, adCmdText);
|
|
while ((short)VAL_ZERO == pRecCm->adoEOF)
|
|
{
|
|
// pOpExec2DRSPTestSetDlg->m_cbTMode.AddString((LPCTSTR)(_bstr_t)pRecCm->GetCollect(_T("Clabel")));
|
|
pRecCm->MoveNext();
|
|
}
|
|
pRecCm->Close();
|
|
*/
|
|
|
|
pOpExec2DRSPTestSetDlg->m_cbSAFrequency.ResetContent();
|
|
szSql.Empty();
|
|
szSql.Format(_T("select Clabel from cm where Cname = 'SAfrequency50' and Lang = %d and Cvalue > 0 order by Cvalue"), g_iLanguage);
|
|
pRecCm->Open(szSql.AllocSysString(), _variant_t((IDispatch*)m_pConnection, true), adOpenStatic, adLockOptimistic, adCmdText);
|
|
while ((short)VAL_ZERO == pRecCm->adoEOF)
|
|
{
|
|
pOpExec2DRSPTestSetDlg->m_cbSAFrequency.AddString((LPCTSTR)(_bstr_t)pRecCm->GetCollect(_T("Clabel")));
|
|
pRecCm->MoveNext();
|
|
}
|
|
pRecCm->Close();
|
|
|
|
|
|
pOpExec2DRSPTestSetDlg->m_cbWeather.ResetContent();
|
|
szSql.Empty();
|
|
szSql.Format(_T("select Clabel from cm where Cname = 'weather' and Lang = %d order by Cvalue"), g_iLanguage);
|
|
pRecCm->Open(szSql.AllocSysString(), _variant_t((IDispatch*)m_pConnection, true), adOpenStatic, adLockOptimistic, adCmdText);
|
|
while ((short)VAL_ZERO == pRecCm->adoEOF)
|
|
{
|
|
pOpExec2DRSPTestSetDlg->m_cbWeather.AddString((LPCTSTR)(_bstr_t)pRecCm->GetCollect(_T("Clabel")));
|
|
pRecCm->MoveNext();
|
|
}
|
|
pRecCm->Close();
|
|
|
|
pOpExec2DRSPTestSetDlg->m_cbWDIR.ResetContent();
|
|
szSql.Empty();
|
|
szSql.Format(_T("select Clabel from cm where Cname = 'WDIR' and Lang = %d order by Cvalue"), g_iLanguage);
|
|
pRecCm->Open(szSql.AllocSysString(), _variant_t((IDispatch*)m_pConnection, true), adOpenStatic, adLockOptimistic, adCmdText);
|
|
while ((short)VAL_ZERO == pRecCm->adoEOF)
|
|
{
|
|
pOpExec2DRSPTestSetDlg->m_cbWDIR.AddString((LPCTSTR)(_bstr_t)pRecCm->GetCollect(_T("Clabel")));
|
|
pRecCm->MoveNext();
|
|
}
|
|
pRecCm->Close();
|
|
|
|
// theApp.m_pSptManager->Initial2DSptList(pOpExec2DRSPTestSetDlg->m_op2DSptSelDlg.m_sptList);
|
|
// theApp.m_pSptManager->InitialCESptList(pOpExec2DRSPTestSetDlg->m_opCESptSelDlg.m_ceSptList);
|
|
|
|
// pOpExec2DRSPTestSetDlg->m_ckIsGr.SetCheck(BST_CHECKED);
|
|
|
|
}
|