35 lines
894 B
C++
35 lines
894 B
C++
#include "FixPointCfg.h"
|
|
|
|
|
|
|
|
FixPointCfg::FixPointCfg()
|
|
{
|
|
}
|
|
|
|
|
|
FixPointCfg::~FixPointCfg()
|
|
{
|
|
}
|
|
|
|
string FixPointCfg::GetUpdateSql()
|
|
{
|
|
char buffer[512];
|
|
string updateSql = "UPDATE " + TABLE_NAME + " SET " + FIELD_POINT_X + "=%.3f,"+FIELD_POINT_Y+"=%.3f,"+FIELD_DURATION+"=%u WHERE " + FIELD_ID + "=%d";
|
|
sprintf_s(buffer, sizeof(buffer), updateSql.c_str(), m_PointX, m_PointY,m_Duration, m_Id);
|
|
return buffer;
|
|
}
|
|
|
|
void FixPointCfg::SetFixPointCfg(stream::FixPointData* fp) {
|
|
fp->set_cno(m_Cno);
|
|
fp->set_duration(m_Duration);
|
|
fp->set_id(m_Id);
|
|
fp->set_pointx(m_PointX);
|
|
fp->set_pointy(m_PointY);
|
|
}
|
|
|
|
const string FixPointCfg::TABLE_NAME="FixPoints";
|
|
const string FixPointCfg::FIELD_ID="Id";
|
|
const string FixPointCfg::FIELD_CNO = "Cno";
|
|
const string FixPointCfg::FIELD_POINT_X="PointX";
|
|
const string FixPointCfg::FIELD_POINT_Y="PointY";
|
|
const string FixPointCfg::FIELD_DURATION = "Duration"; |