Skip to content

Commit

Permalink
添加Ribbon修改功能。
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoweihan committed Sep 18, 2017
1 parent d466c14 commit c6c60b4
Show file tree
Hide file tree
Showing 16 changed files with 119 additions and 56 deletions.
2 changes: 2 additions & 0 deletions Src/Edislab/Edislab Pro/ChartManager.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "StdAfx.h"
#if 0
#include "Edislab Pro.h"
#include "ChartManager.h"
#include "ChartFigureDlg.h"
Expand Down Expand Up @@ -93,3 +94,4 @@ int ChartManager::readData()
//读取数据并创建对应的对话框
return 0;
}
#endif
4 changes: 2 additions & 2 deletions Src/Edislab/Edislab Pro/ChartManager.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#if 0
#include <vector>
#include "Observer.h"

class ChartFigureDlg;
class ChartXYData;
class ChartManager:public CObserver
Expand All @@ -27,3 +26,4 @@ class ChartManager:public CObserver
//所有图表对话框
std::vector<const ChartFigureDlg*> m_vecChartDlg;
};
#endif
8 changes: 7 additions & 1 deletion Src/Edislab/Edislab Pro/CommandEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void CCommandEntry::InitUpdateCommandEntry( void )
m_UpdateCommandEntryMap[ID_SELECT_SENSOR] = UpdateHandleChooseDevice;
m_UpdateCommandEntryMap[ID_COLLECT_PARAM] = UpdateHandleAcquirePara;

//m_UpdateCommandEntryMap[ID_START] = UpdateHandleStart;
m_UpdateCommandEntryMap[ID_START] = UpdateHandleStart;
m_UpdateCommandEntryMap[ID_MANUAL_SELECT] = UpdateHandleManualSelect;
m_UpdateCommandEntryMap[ID_AUTO_SELECT] = UpdateHandleAutoSelect;

Expand Down Expand Up @@ -682,6 +682,7 @@ void HandleStart(CEdislabProView* pView)
{
CSerialPortService::CreateInstance().StopSensorCollect(V.nSensorID,V.nSensorSerialID);
}
pView->NotifyRibbonChangeText(0);
}
else
{
Expand All @@ -691,6 +692,7 @@ void HandleStart(CEdislabProView* pView)
{
CSerialPortService::CreateInstance().StartSensorCollect(V.nSensorID,V.nSensorSerialID);
}
pView->NotifyRibbonChangeText(1);
}
s_bStartCapture = !s_bStartCapture;
}
Expand Down Expand Up @@ -1790,3 +1792,7 @@ void HandleDeviceNextColumn(CEdislabProView* pView)
}
}
}

void UpdateHandleStart(CEdislabProView* pView,CCmdUI* pCmdUI)
{
}
12 changes: 6 additions & 6 deletions Src/Edislab/Edislab Pro/DlgDevicePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "DlgDevicePanel.h"
#include "GaugeDlg.h"
#include "Global.h"
#include <boost/checked_delete.hpp>
// CDlgDevicePanel 对话框

IMPLEMENT_DYNAMIC(CDlgDevicePanel, CBaseDialog)
Expand Down Expand Up @@ -72,7 +73,7 @@ void CDlgDevicePanel::CreatePanel( void )
pDevicePanel->Create(GaugeDlg::IDD,this);
m_vecPanel.push_back(pDevicePanel);
m_WidgetLayout.AddWidget(pDevicePanel);
m_dataManager.addGaugeDlg(pDevicePanel);
//m_dataManager.addGaugeDlg(pDevicePanel);
}
}
void CDlgDevicePanel::addPanel()
Expand All @@ -89,7 +90,7 @@ void CDlgDevicePanel::addPanel()
pDevicePanel->Create(GaugeDlg::IDD,this);
m_vecPanel.push_back(pDevicePanel);
m_WidgetLayout.AddWidget(pDevicePanel);
m_dataManager.addGaugeDlg(pDevicePanel);
//m_dataManager.addGaugeDlg(pDevicePanel);
}
#endif
GaugeDlg* pDevicePanel = new GaugeDlg;
Expand All @@ -98,7 +99,7 @@ void CDlgDevicePanel::addPanel()
pDevicePanel->Create(GaugeDlg::IDD,this);
m_vecPanel.push_back(pDevicePanel);
m_WidgetLayout.AddWidget(pDevicePanel);
m_dataManager.addGaugeDlg(pDevicePanel);
//m_dataManager.addGaugeDlg(pDevicePanel);
CRect rc;
GetClientRect(&rc);
m_WidgetLayout.AdjustLayout(rc.Width(),rc.Height());
Expand Down Expand Up @@ -126,9 +127,8 @@ void CDlgDevicePanel::delPanel(CWnd* pDlg)
break;
}
}
m_dataManager.delGaugeDlg(dynamic_cast<GaugeDlg*>(pDlg));
delete pDlg;
pDlg = NULL;
//m_dataManager.delGaugeDlg(dynamic_cast<GaugeDlg*>(pDlg));
boost::checked_delete(pDlg);
}
}
void CDlgDevicePanel::DestroyPanel( void )
Expand Down
4 changes: 2 additions & 2 deletions Src/Edislab/Edislab Pro/DlgDevicePanel.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include "BaseDialog.h"
#include "WidgetLayout.h"
#include "GaugeManager.h"
//#include "GaugeManager.h"
// CDlgDevicePanel 对话框

class CDlgDevicePanel : public CBaseDialog
Expand All @@ -22,7 +22,7 @@ class CDlgDevicePanel : public CBaseDialog

private:
//数据理器
GaugeManager m_dataManager;
//GaugeManager m_dataManager;
//布局器
CWidgetLayout m_WidgetLayout;
//窗口
Expand Down
11 changes: 5 additions & 6 deletions Src/Edislab/Edislab Pro/DlgDiagramPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "Edislab Pro.h"
#include "DlgDiagramPanel.h"
#include "ChartFigureDlg.h"

#include <boost/checked_delete.hpp>
// CDlgDiagramPanel 对话框

IMPLEMENT_DYNAMIC(CDlgDiagramPanel, CBaseDialog)
Expand Down Expand Up @@ -73,7 +73,7 @@ void CDlgDiagramPanel::CreatePanel( void )
pDiagramPanel->Create(ChartFigureDlg::IDD,this);
m_vecPanel.push_back(pDiagramPanel);
m_WidgetLayout.AddWidget(pDiagramPanel);
m_dataManager.addChartDlg(pDiagramPanel);
//m_dataManager.addChartDlg(pDiagramPanel);
CRect rc;
GetClientRect(&rc);
m_WidgetLayout.AdjustLayout(rc.Width(),rc.Height());
Expand All @@ -94,7 +94,7 @@ void CDlgDiagramPanel::addPanel()
pDiagramPanel->Create(ChartFigureDlg::IDD,this);
m_vecPanel.push_back(pDiagramPanel);
m_WidgetLayout.AddWidget(pDiagramPanel);
m_dataManager.addChartDlg(pDiagramPanel);
//m_dataManager.addChartDlg(pDiagramPanel);
CRect rc;
GetClientRect(&rc);
m_WidgetLayout.AdjustLayout(rc.Width(),rc.Height());
Expand Down Expand Up @@ -122,9 +122,8 @@ void CDlgDiagramPanel::delPanel(CWnd* pDlg)
}
}
m_WidgetLayout.DelWidget(pDlg);
m_dataManager.delChartDlg(dynamic_cast<ChartFigureDlg*>(pDlg));
delete pDlg;
pDlg = NULL;
//m_dataManager.delChartDlg(dynamic_cast<ChartFigureDlg*>(pDlg));
boost::checked_delete(pDlg);
}
}
void CDlgDiagramPanel::DestroyPanel( void )
Expand Down
4 changes: 2 additions & 2 deletions Src/Edislab/Edislab Pro/DlgDiagramPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "BaseDialog.h"
#include "WidgetLayout.h"
#include "ChartManager.h"
//#include "ChartManager.h"
// CDlgDiagramPanel 对话框

class CDlgDiagramPanel : public CBaseDialog
Expand All @@ -22,7 +22,7 @@ class CDlgDiagramPanel : public CBaseDialog
int GetWidgetNum(void) const;
private:
//数据理器
ChartManager m_dataManager;
//ChartManager m_dataManager;
//布局器
CWidgetLayout m_WidgetLayout;
//窗口
Expand Down
8 changes: 0 additions & 8 deletions Src/Edislab/Edislab Pro/Edislab Pro.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@
<ClInclude Include="CFont0.h" />
<ClInclude Include="CommandEntry.h" />
<ClInclude Include="ChartFigureDlg.h" />
<ClInclude Include="ChartManager.h" />
<ClInclude Include="ChartXY.h" />
<ClInclude Include="ConcreteSplitAlgorithm.h" />
<ClInclude Include="ConcreteTabWnd.h" />
Expand Down Expand Up @@ -262,15 +261,12 @@
<ClInclude Include="ErrorCode.h" />
<ClInclude Include="ErrorCodeManager.h" />
<ClInclude Include="GaugeDlg.h" />
<ClInclude Include="GaugeManager.h" />
<ClInclude Include="Global.h" />
<ClInclude Include="GridColumnGroupManager.h" />
<ClInclude Include="Log.h" />
<ClInclude Include="Macro.h" />
<ClInclude Include="MainFrm.h" />
<ClInclude Include="Msg.h" />
<ClInclude Include="Observable.h" />
<ClInclude Include="Observer.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="SensorConfig.h" />
<ClInclude Include="SensorData.h" />
Expand All @@ -291,7 +287,6 @@
<ClCompile Include="BaseDockingBar.cpp" />
<ClCompile Include="BaseRibbonBar.cpp" />
<ClCompile Include="BaseTabWnd.cpp" />
<ClCompile Include="ChartManager.cpp" />
<ClCompile Include="ChartXY.cpp" />
<ClCompile Include="CommandEntry.cpp" />
<ClCompile Include="ChartFigureDlg.cpp" />
Expand Down Expand Up @@ -324,13 +319,10 @@
<ClCompile Include="Edislab ProView.cpp" />
<ClCompile Include="ErrorCodeManager.cpp" />
<ClCompile Include="GaugeDlg.cpp" />
<ClCompile Include="GaugeManager.cpp" />
<ClCompile Include="Global.cpp" />
<ClCompile Include="GridColumnGroupManager.cpp" />
<ClCompile Include="Log.cpp" />
<ClCompile Include="MainFrm.cpp" />
<ClCompile Include="Observable.cpp" />
<ClCompile Include="Observer.cpp" />
<ClCompile Include="SensorConfig.cpp" />
<ClCompile Include="SensorData.cpp" />
<ClCompile Include="SensorDataManager.cpp" />
Expand Down
27 changes: 0 additions & 27 deletions Src/Edislab/Edislab Pro/Edislab Pro.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
<Filter Include="Global">
<UniqueIdentifier>{62fd49f0-42b9-4b2d-a336-37edbfdc9848}</UniqueIdentifier>
</Filter>
<Filter Include="ObserverModal">
<UniqueIdentifier>{4e430663-4baf-483e-a281-2c8cb59f9f0a}</UniqueIdentifier>
</Filter>
<Filter Include="Device">
<UniqueIdentifier>{e6540318-8b9a-4f54-be10-f8f370770e7e}</UniqueIdentifier>
</Filter>
Expand Down Expand Up @@ -213,18 +210,9 @@
<ClInclude Include="ChartFigureDlg.h">
<Filter>ChartFigure</Filter>
</ClInclude>
<ClInclude Include="ChartManager.h">
<Filter>ChartFigure</Filter>
</ClInclude>
<ClInclude Include="Global.h">
<Filter>Global</Filter>
</ClInclude>
<ClInclude Include="Observer.h">
<Filter>ObserverModal</Filter>
</ClInclude>
<ClInclude Include="Observable.h">
<Filter>ObserverModal</Filter>
</ClInclude>
<ClInclude Include="DlgDeviceSet.h">
<Filter>Device</Filter>
</ClInclude>
Expand All @@ -234,9 +222,6 @@
<ClInclude Include="GaugeDlg.h">
<Filter>Device</Filter>
</ClInclude>
<ClInclude Include="GaugeManager.h">
<Filter>Device</Filter>
</ClInclude>
<ClInclude Include="DlgChartSet.h">
<Filter>ChartFigure</Filter>
</ClInclude>
Expand Down Expand Up @@ -395,18 +380,9 @@
<ClCompile Include="Global.cpp">
<Filter>Global</Filter>
</ClCompile>
<ClCompile Include="Observer.cpp">
<Filter>ObserverModal</Filter>
</ClCompile>
<ClCompile Include="Observable.cpp">
<Filter>ObserverModal</Filter>
</ClCompile>
<ClCompile Include="ChartXY.cpp">
<Filter>ChartFigure</Filter>
</ClCompile>
<ClCompile Include="ChartManager.cpp">
<Filter>ChartFigure</Filter>
</ClCompile>
<ClCompile Include="DlgDeviceSet.cpp">
<Filter>Device</Filter>
</ClCompile>
Expand All @@ -416,9 +392,6 @@
<ClCompile Include="GaugeDlg.cpp">
<Filter>Device</Filter>
</ClCompile>
<ClCompile Include="GaugeManager.cpp">
<Filter>Device</Filter>
</ClCompile>
<ClCompile Include="DlgChartSet.cpp">
<Filter>ChartFigure</Filter>
</ClCompile>
Expand Down
11 changes: 11 additions & 0 deletions Src/Edislab/Edislab Pro/Edislab ProView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,3 +623,14 @@ void CEdislabProView::NotifyGridGroupInfoChange()
}
}
}

void CEdislabProView::NotifyRibbonChangeText(int nFlag)
{
CWnd* pWnd = AfxGetMainWnd();
if (nullptr == pWnd)
{
return;
}
pWnd->PostMessage(WM_NOTIFY_RIBBON_CHANGE,nFlag,0);

}
3 changes: 3 additions & 0 deletions Src/Edislab/Edislab Pro/Edislab ProView.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ class CEdislabProView : public CView
//通知相应的控件停止刷新
void NotifyControlsStopRefresh();

//通知Ribbon栏改变
void NotifyRibbonChangeText(int nFlag);

//删除元素
void DeleteElement();

Expand Down
2 changes: 2 additions & 0 deletions Src/Edislab/Edislab Pro/GaugeManager.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "StdAfx.h"
#if 0
#include "Edislab Pro.h"
#include "GaugeDlg.h"
#include "GaugeManager.h"
Expand Down Expand Up @@ -74,3 +75,4 @@ int GaugeManager::readData()
{
return 0;
}
#endif
3 changes: 2 additions & 1 deletion Src/Edislab/Edislab Pro/GaugeManager.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#if 0
#include <vector>
#include "Observer.h"
class GaugeDlg;
Expand All @@ -21,4 +22,4 @@ class GaugeManager:public CObserver
//所有表盘对话框
std::vector<GaugeDlg*> m_vecGaugeDlg;
};

#endif
Loading

0 comments on commit c6c60b4

Please sign in to comment.