Skip to content

Commit

Permalink
修改通信协议。
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoweihan committed Sep 14, 2017
1 parent e772130 commit 008221f
Show file tree
Hide file tree
Showing 39 changed files with 781 additions and 325 deletions.
Binary file added Src/Edislab/Bin_x64/dbghelp.dll
Binary file not shown.
28 changes: 14 additions & 14 deletions Src/Edislab/Edislab Pro/ChartFigureDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include "Edislab Pro.h"
#include "ChartFigureDlg.h"
#include "DlgChartSet.h"
#include "GlobalDataManager.h"
#include "DlgTabPanel.h"
#include "Msg.h"
// ChartFigureDlg 对话框
#define TIMER_CHART_EVENT (1000011)
#define TIMER_CHART (300)

IMPLEMENT_DYNAMIC(ChartFigureDlg, CBaseDialog)
#define TIMER_CHART_EVENT 1000011
#define TIMER_CHART 300
ChartFigureDlg::ChartFigureDlg(CWnd* pParent /*=NULL*/)
: CBaseDialog(ChartFigureDlg::IDD, pParent),
m_bActiveFlag(FALSE)
Expand Down Expand Up @@ -237,11 +237,11 @@ const ChartManager* ChartFigureDlg::getChartMgr()
}
return NULL;
}
void ChartFigureDlg::updateData(CGlobalDataManager* dbMgr) const
void ChartFigureDlg::updateData() const
{
if (m_charxy)
{
return m_charxy->updateData(dbMgr);
return m_charxy->updateData();
}
}
void ChartFigureDlg::ChartSet()
Expand Down Expand Up @@ -279,30 +279,30 @@ void ChartFigureDlg::OnChartSet()
// TODO: Add your command handler code here
DlgChartSet dlgSet(this);
//初始化当前值
dlgSet.m_nXID = m_charxy->getXID();
dlgSet.m_XKeyID = m_charxy->getXID();
dlgSet.m_eLineStyle = m_charxy->getLineStyle();
dlgSet.m_eMoveStyle = m_charxy->getMoveStyle();
dlgSet.m_eChartType = m_charxy->getChartType();
std::map<int, bool> mapV = m_charxy->getMapVisible();
boost::unordered_map<SENSOR_TYPE_KEY, bool> mapV = m_charxy->getMapVisible();
dlgSet.m_setShowID.clear();
for(std::map<int, bool>::iterator itr = mapV.begin(); itr!=mapV.end(); ++itr)
for(auto itr = mapV.begin(); itr != mapV.end(); ++itr)
{
if(itr->second)
{
dlgSet.m_setShowID.insert(itr->first);
}
}
if(IDOK==dlgSet.DoModal())
if(IDOK == dlgSet.DoModal())
{
std::map<int, bool> mapV;
SET<int> setV = dlgSet.m_setShowID;
for(SET<int>::iterator itr = setV.begin(); itr!=setV.end(); ++itr)
boost::unordered_map<SENSOR_TYPE_KEY, bool> mapV;
auto setV = dlgSet.m_setShowID;
for(auto itr = setV.begin(); itr != setV.end(); ++itr)
{
mapV[*itr] = true;
}
m_charxy->setMapVisible(mapV);

m_charxy->setXID(dlgSet.m_nXID);
m_charxy->setXID(dlgSet.m_XKeyID);
m_charxy->setMoveStyle(dlgSet.m_eMoveStyle);
m_charxy->setChartType(dlgSet.m_eChartType);
m_charxy->setLineStyle(dlgSet.m_eLineStyle);
Expand Down Expand Up @@ -392,7 +392,7 @@ void ChartFigureDlg::OnTimer(UINT_PTR nIDEvent)
// TODO: Add your message handler code here and/or call default
if (TIMER_CHART_EVENT == nIDEvent)
{
updateData(NULL);
updateData();
}
CBaseDialog::OnTimer(nIDEvent);
}
Expand Down
2 changes: 1 addition & 1 deletion Src/Edislab/Edislab Pro/ChartFigureDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ChartFigureDlg : public CBaseDialog
//读取数据
int readData();

void updateData(class CGlobalDataManager* dbMgr) const;
void updateData() const;

void ChartSet();
public:
Expand Down
10 changes: 6 additions & 4 deletions Src/Edislab/Edislab Pro/ChartManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,36 @@
#include "Edislab Pro.h"
#include "ChartManager.h"
#include "ChartFigureDlg.h"
#include "GlobalDataManager.h"
//#include "GlobalDataManager.h"
using namespace std;

ChartManager::ChartManager(void)
{
CGlobalDataManager::CreateInstance().Attach(this);
//CGlobalDataManager::CreateInstance().Attach(this);
}


ChartManager::~ChartManager(void)
{
CGlobalDataManager::CreateInstance().Detach(this);
//CGlobalDataManager::CreateInstance().Detach(this);
}

//更新数据,把全局实验数据更新到画图专用数据中
void ChartManager::Update(CObservable* pObs, void* pArg)
{
#if 0
CGlobalDataManager* dbMgr = dynamic_cast<CGlobalDataManager*>(pObs);
if(NULL==dbMgr)//不是数据类
{
return;
}
#endif
//更新单表记录的数据
for(UINT i= 0; i<m_vecChartDlg.size(); ++i)
{
if(m_vecChartDlg[i])
{
m_vecChartDlg[i]->updateData(dbMgr);
m_vecChartDlg[i]->updateData();
}
}
}
Expand Down
Loading

0 comments on commit 008221f

Please sign in to comment.