101 lines
2.1 KiB
C++
101 lines
2.1 KiB
C++
// Ipsp3DTdRecord.cpp: implementation of the CIpsp3DTdRecord class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#include "geomative.h"
|
|
#include "Ipsp3DTdRecord.h"
|
|
|
|
#ifdef _DEBUG
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[]=__FILE__;
|
|
#define new DEBUG_NEW
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
// Construction/Destruction
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
CIpsp3DTdRecord::CIpsp3DTdRecord(DWORD dwChID, _ConnectionPtr& pConnection):CTdRecord(pConnection)
|
|
{
|
|
m_dwChID = dwChID;
|
|
m_iTsn = (int)VAL_ZERO;
|
|
m_iC1 = (int)VAL_ZERO;
|
|
m_iC2 = (int)VAL_ZERO;
|
|
m_iP1 = (int)VAL_ZERO;
|
|
m_iP2 = (int)VAL_ZERO;
|
|
m_iN = (int)VAL_ZERO;
|
|
m_fK = (float)VAL_ZERO;
|
|
m_fI = (float)VAL_ZERO;
|
|
m_fV = (float)VAL_ZERO;
|
|
m_fR0 = (float)VAL_ZERO;
|
|
m_fSP = (float)VAL_ZERO;
|
|
|
|
m_iLevel = (int)VAL_ZERO;
|
|
m_iPosInLevel = (int)VAL_ZERO;
|
|
|
|
m_colorREF = RGB(0xFF,0xFF,0xFF);
|
|
m_recPtArea.SetRectEmpty();
|
|
|
|
}
|
|
|
|
CIpsp3DTdRecord::~CIpsp3DTdRecord()
|
|
{
|
|
|
|
}
|
|
void CIpsp3DTdRecord::ClearAll()
|
|
{
|
|
m_fI = (float)VAL_ZERO;
|
|
m_fV = (float)VAL_ZERO;
|
|
m_fR0 = (float)VAL_ZERO;
|
|
m_fSP = (float)VAL_ZERO;
|
|
|
|
m_colorREF = RGB(0xFF,0xFF,0xFF);
|
|
}
|
|
|
|
BOOL CIpsp3DTdRecord::SaveData(DWORD dwChID)
|
|
{
|
|
_RecordsetPtr pRecTdCha;
|
|
_CommandPtr pCmdIns;
|
|
CString szSql = _T("");
|
|
int iTdRecIndex = (int)VAL_ZERO;
|
|
|
|
pRecTdCha.CreateInstance(_uuidof(Recordset));
|
|
pCmdIns.CreateInstance(_uuidof(Command));
|
|
pCmdIns->ActiveConnection = m_pConnection;
|
|
|
|
try
|
|
{
|
|
m_dwChID = dwChID;
|
|
szSql.Empty();
|
|
szSql.Format(_T("insert into td3dcon(TCHID,TSN,C1,C2,P1,P2,N,K,I,V,R0,SP) values(%u,%d,%d,%d,%d,%d,%d,%f,%f,%f,%f,%f)"),
|
|
m_dwChID,
|
|
this->m_iTsn,
|
|
this->m_iC1,
|
|
this->m_iC2,
|
|
this->m_iP1,
|
|
this->m_iP2,
|
|
this->m_iN,
|
|
this->m_fK,
|
|
this->m_fI,
|
|
this->m_fV,
|
|
this->m_fR0,
|
|
this->m_fSP);
|
|
|
|
pCmdIns->CommandText = szSql.AllocSysString();
|
|
pCmdIns->Execute(NULL, NULL, adCmdText);
|
|
|
|
}
|
|
catch(_com_error e)
|
|
{
|
|
throw e;
|
|
return FALSE;
|
|
}
|
|
return TRUE;
|
|
}
|
|
|
|
BOOL CIpsp3DTdRecord::LoadOrgData()
|
|
{
|
|
this->Load3DOrgData();
|
|
return TRUE;
|
|
}
|