forked from AndyWhittaker/FreeScan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRawMode00.cpp
110 lines (91 loc) · 2.79 KB
/
RawMode00.cpp
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// RawMode00.cpp : implementation file
//
// (c) 1996-99 Andy Whittaker, Chester, England.
// mail@andywhittaker.com
//
#include "RawMode00.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRawMode00 property page
IMPLEMENT_DYNCREATE(CRawMode00, CPropertyPage)
CRawMode00::CRawMode00() : CPropertyPage(CRawMode00::IDD)
{
//{{AFX_DATA_INIT(CRawMode00)
//}}AFX_DATA_INIT
m_pSupervisor = NULL;
}
CRawMode00::~CRawMode00()
{
}
void CRawMode00::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRawMode00)
DDX_Control(pDX, IDC_0A_DB02, m_0a_db02);
DDX_Control(pDX, IDC_0A_DB01, m_0a_db01);
DDX_Control(pDX, IDC_0A_DB00, m_0a_db00);
DDX_Control(pDX, IDC_05_DB09, m_05_db09);
DDX_Control(pDX, IDC_05_DB08, m_05_db08);
DDX_Control(pDX, IDC_05_DB07, m_05_db07);
DDX_Control(pDX, IDC_05_DB06, m_05_db06);
DDX_Control(pDX, IDC_05_DB05, m_05_db05);
DDX_Control(pDX, IDC_05_DB04, m_05_db04);
DDX_Control(pDX, IDC_05_DB03, m_05_db03);
DDX_Control(pDX, IDC_05_DB02, m_05_db02);
DDX_Control(pDX, IDC_05_DB01, m_05_db01);
DDX_Control(pDX, IDC_05_DB00, m_05_db00);
//}}AFX_DATA_MAP
//Updates the dialog.
if (m_pSupervisor != NULL) {
Refresh(m_pSupervisor->GetEcuData());
}
}
BEGIN_MESSAGE_MAP(CRawMode00, CPropertyPage)
//{{AFX_MSG_MAP(CRawMode00)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// Updates all of our controls
void CRawMode00::Refresh(const CEcuData* const ecuData)
{
CString buf;
unsigned char ucF005[10] = { 0 };
unsigned char ucF00A[3] = { 0 };
ecuData->copyFromF005(ucF005, sizeof(ucF005));
ecuData->copyFromF00A(ucF00A, sizeof(ucF00A));
buf.Format("%02X", ucF005[0]);
m_05_db00.SetWindowText(buf);
buf.Format("%02X", ucF005[1]);
m_05_db01.SetWindowText(buf);
buf.Format("%02X", ucF005[2]);
m_05_db02.SetWindowText(buf);
buf.Format("%02X", ucF005[3]);
m_05_db03.SetWindowText(buf);
buf.Format("%02X", ucF005[4]);
m_05_db04.SetWindowText(buf);
buf.Format("%02X", ucF005[5]);
m_05_db05.SetWindowText(buf);
buf.Format("%02X", ucF005[6]);
m_05_db06.SetWindowText(buf);
buf.Format("%02X", ucF005[7]);
m_05_db07.SetWindowText(buf);
buf.Format("%02X", ucF005[8]);
m_05_db08.SetWindowText(buf);
buf.Format("%02X", ucF005[9]);
m_05_db09.SetWindowText(buf);
buf.Format("%02X", ucF00A[0]);
m_0a_db00.SetWindowText(buf);
buf.Format("%02X", ucF00A[1]);
m_0a_db01.SetWindowText(buf);
buf.Format("%02X", ucF00A[2]);
m_0a_db02.SetWindowText(buf);
}
void CRawMode00::RegisterSupervisor(CSupervisorInterface* const pSupervisor) {
m_pSupervisor = pSupervisor;
}
/////////////////////////////////////////////////////////////////////////////
// CRawMode00 message handlers