Skip to content

Commit

Permalink
修复部分Bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoweihan committed Sep 23, 2017
1 parent c9c6549 commit 50b5cbe
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 17 deletions.
13 changes: 1 addition & 12 deletions Src/Edislab/Edislab Pro/ChartXY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ CMeColor ChartXYData::getColor()
return mColor;
}

#if 0
void ChartXYData::setID(int id)
{
ID = id;
}
int ChartXYData::getID()
{
return ID;
}
#endif

ChartXY::ChartXY(HDC hDC)
: m_hDC(hDC)
, m_minX(0)
Expand Down Expand Up @@ -703,7 +692,7 @@ void ChartXY::calcRecView()
m_pDC = CDC::FromHandle(m_hDC);
m_recView = CRect(0, 0, m_size.cx, m_size.cy);

//if (m_size.cx > VIEW_X_EDGE && m_size.cy > VIEW_Y_EDGE)
//if (m_size.cx > 2 * VIEW_X_EDGE && m_size.cy > 2 * VIEW_Y_EDGE)
{
m_recView.InflateRect(-VIEW_X_EDGE, -VIEW_Y_EDGE, -VIEW_X_EDGE, -VIEW_Y_EDGE);

Expand Down
1 change: 1 addition & 0 deletions Src/Edislab/Edislab Pro/Edislab Pro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ void CEdislabProApp::Init( void )
if (!CSensorTypeTable::CreateInstance().LoadSensorTypeListFromFile())
{
ERROR_LOG("LoadSensorType failed!");
CSensorTypeTable::CreateInstance().LoadDefaultSensorType();
}

//加载传感器配置文件
Expand Down
57 changes: 53 additions & 4 deletions Src/Edislab/Edislab Pro/SensorTypeTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Version:1.0
CSensorTypeTable::CSensorTypeTable(void)
{
m_SensorTypeMap.clear();
//InitSensorTypeTable();
}


Expand All @@ -32,9 +31,18 @@ CSensorTypeTable::~CSensorTypeTable(void)
m_SensorTypeMap.clear();
}

#if 0
/*****************************************************************************
* @函数名称 : InitSensorTypeTable
* @功能描述 : 初始化默认设置
* @author : xiaowei.han
* @date :
* @version : ver 1.0
* @inparam :
* @outparam :
*****************************************************************************/
void CSensorTypeTable::InitSensorTypeTable(void)
{
#if 0
int nSensorID = 0;
std::string strSensorName = "静力传感器";
m_SensorTypeMap.emplace(nSensorID,strSensorName);
Expand Down Expand Up @@ -221,15 +229,24 @@ void CSensorTypeTable::InitSensorTypeTable(void)
nSensorID = 45;
strSensorName = "电流/电压合体传感器";
m_SensorTypeMap.emplace(nSensorID,strSensorName);
}
#endif
}


CSensorTypeTable& CSensorTypeTable::CreateInstance(void)
{
return s_obj;
}


/*****************************************************************************
* @函数名称 : QuerySensorNameByID
* @功能描述 : 根据传感器类型ID查询传感器类型名称
* @author : xiaowei.han
* @date :
* @version : ver 1.0
* @inparam :
* @outparam :
*****************************************************************************/
CSensorTypeTable::SENSOR_TYPE_VALUE CSensorTypeTable::QuerySensorNameByID(int nSensorTypeID)
{
SENSOR_TYPE_VALUE Result;
Expand All @@ -246,6 +263,15 @@ CSensorTypeTable::SENSOR_TYPE_VALUE CSensorTypeTable::QuerySensorNameByID(int nS
return Result;
}

/*****************************************************************************
* @函数名称 : LoadSensorTypeListFromFile
* @功能描述 : 从配置文件加载传感器类型信息
* @author : xiaowei.han
* @date :
* @version : ver 1.0
* @inparam :
* @outparam :
*****************************************************************************/
bool CSensorTypeTable::LoadSensorTypeListFromFile(void)
{
using namespace std;
Expand Down Expand Up @@ -329,6 +355,15 @@ bool CSensorTypeTable::LoadSensorTypeListFromFile(void)
return true;
}

/*****************************************************************************
* @函数名称 : LoadSensorTypeList
* @功能描述 :
* @author : xiaowei.han
* @date :
* @version : ver 1.0
* @inparam :
* @outparam :
*****************************************************************************/
bool CSensorTypeTable::LoadSensorTypeList(rapidjson::Document& Parser)
{
const rapidjson::Value& SensorTypeArray = Parser["SensorTypeList"];
Expand Down Expand Up @@ -372,4 +407,18 @@ bool CSensorTypeTable::LoadSensorTypeList(rapidjson::Document& Parser)
return true;
}

/*****************************************************************************
* @函数名称 : LoadDefaultSensorType
* @功能描述 :
* @author : xiaowei.han
* @date :
* @version : ver 1.0
* @inparam :
* @outparam :
*****************************************************************************/
void CSensorTypeTable::LoadDefaultSensorType(void)
{
InitSensorTypeTable();
}

CSensorTypeTable CSensorTypeTable::s_obj;
4 changes: 3 additions & 1 deletion Src/Edislab/Edislab Pro/SensorTypeTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ class CSensorTypeTable
SENSOR_TYPE_VALUE QuerySensorNameByID(int nSensorTypeID);
//从配置文件加载传感器类型
bool LoadSensorTypeListFromFile(void);
//加载默认配置
void LoadDefaultSensorType(void);
private:
//void InitSensorTypeTable(void);
void InitSensorTypeTable(void);
bool LoadSensorTypeList(rapidjson::Document& Parser);
private:
boost::mutex m_Lock;
Expand Down

0 comments on commit 50b5cbe

Please sign in to comment.