-
Notifications
You must be signed in to change notification settings - Fork 6
/
View_Instrument.h
94 lines (66 loc) · 2.56 KB
/
View_Instrument.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#pragma once
#include "Common/Common.h"
#include "EvaluatedDataStorage.h"
#include "CommunicationDataStorage.h"
#include "Graphs/GraphCtrl.h"
#include "DlgControls/Label.h"
/** The <b>CView_Instrument</b>-class is a class that takes care of
showing the hardware status of the connected instruments */
class CView_Instrument : public CPropertyPage
{
DECLARE_DYNAMIC(CView_Instrument)
public:
CView_Instrument();
virtual ~CView_Instrument();
// Dialog Data
enum { IDD = IDD_VIEW_INSTRUMENT_OVERVIEW };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
afx_msg LRESULT OnUpdateGraphs(WPARAM wParam, LPARAM lParam);
class CLegend {
public:
DlgControls::CLabel m_label;
CStatic m_text;
COLORREF m_color;
CString m_serial;
};
public:
/** A common object for doing common things */
Common m_common;
/** A pointer to a shared instance of 'CEvaluatedDataStorage' */
CEvaluatedDataStorage* m_evalDataStorage;
/** A pointer to a shared instance of 'CCommunicationDataStorage' */
CCommunicationDataStorage* m_commDataStorage;
// --------------- EVENT HANDLERS ------------------------------
/** Draws the graphs */
void DrawGraphs();
/** Called when the overview page is created */
virtual BOOL OnInitDialog();
/** Called when the overview page is selected */
virtual BOOL OnSetActive();
virtual BOOL PreTranslateMessage(MSG* pMsg); // for handling the tool tips
protected:
// ----------- DIALOG CONTROLS ---------------
/** The graphs, one for the temperature, one for the battery voltage
and one for the exposure times */
Graph::CGraphCtrl m_batteryGraph;
Graph::CGraphCtrl m_temperatureGraph;
Graph::CGraphCtrl m_expTimeGraph;
Graph::CGraphCtrl m_linkSpeedGraph;
/** The legend that tells which serial-number is connected with which color */
CList<CLegend*, CLegend*> m_serialLegend;
// the tool tips
CToolTipCtrl m_toolTip;
// --------------- EVENT HANDLERS ------------------------------
/** Draws the temperature graph */
void DrawTempGraph();
/** Draws the battery-voltage graph */
void DrawBatteryGraph();
/** Draws the exposure-time graph */
void DrawExpTimeGraph();
/** Draws the link-speed graph */
void DrawLinkSpeedGraph();
/** Set x-axix range */
void SetRange(Graph::CGraphCtrl& graph, int maxy);
};