This repository has been archived by the owner on Feb 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
dialogCOMM.cpp
executable file
·65 lines (50 loc) · 2.21 KB
/
dialogCOMM.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
/*/
dialogCOMM.cpp (2005.11.08)
/*/
#include "dialogCOMM.h"
#include "definitionError.h"
#include "handlerError.h"
#include "ecuExplorer.h"
extern void nuke();
extern void OutputString(CString sMessage,unsigned short usMessageType = 0);
BEGIN_MESSAGE_MAP(dialogCOMM, CDialog)
END_MESSAGE_MAP()
dialogCOMM::dialogCOMM() : CDialog(dialogCOMM::IDD)
{
lpParent = NULL;
iXonLim = iXoffLim = 0;
iReadIntervalTimeout = iReadTotalTimeoutConstant = iWriteTotalTimeoutConstant = 0;
}
void dialogCOMM::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX,IDC_COMM_XONLIM,iXonLim);
DDX_Text(pDX,IDC_COMM_XOFFLIM,iXoffLim);
DDX_Text(pDX,IDC_COMM_READINTERVALTIMEOUT,iReadIntervalTimeout);
DDX_Text(pDX,IDC_COMM_READTOTALTIMEOUTCONSTANT,iReadTotalTimeoutConstant);
DDX_Text(pDX,IDC_COMM_WRITETOTALTIMEOUTCONSTANT,iWriteTotalTimeoutConstant);
}
void dialogCOMM::OnCancel()
{
CDialog::OnCancel();
}
void dialogCOMM::OnOK()
{
UpdateData();
((ecuExplorer*)lpParent)->WriteProfileInt("Settings","XonLim",iXonLim);
((ecuExplorer*)lpParent)->WriteProfileInt("Settings","XoffLim",iXoffLim);
((ecuExplorer*)lpParent)->WriteProfileInt("Settings","ReadIntervalTimeout",iReadIntervalTimeout);
((ecuExplorer*)lpParent)->WriteProfileInt("Settings","ReadTotalTimeoutConstant",iReadTotalTimeoutConstant);
((ecuExplorer*)lpParent)->WriteProfileInt("Settings","WriteTotalTimeoutConstant",iWriteTotalTimeoutConstant);
MessageBox("You must restart ecuExplorer for the changes to take effect","Restart",MB_ICONINFORMATION);
CDialog::OnOK();
}
BOOL dialogCOMM::OnInitDialog()
{
iXonLim = ((ecuExplorer*)lpParent)->GetProfileInt("Settings","XonLim",iXonLim);
iXoffLim = ((ecuExplorer*)lpParent)->GetProfileInt("Settings","XoffLim",iXoffLim);
iReadIntervalTimeout = ((ecuExplorer*)lpParent)->GetProfileInt("Settings","ReadIntervalTimeout",iReadIntervalTimeout);
iReadTotalTimeoutConstant = ((ecuExplorer*)lpParent)->GetProfileInt("Settings","ReadTotalTimeoutConstant",iReadTotalTimeoutConstant);
iWriteTotalTimeoutConstant = ((ecuExplorer*)lpParent)->GetProfileInt("Settings","WriteTotalTimeoutConstant",iWriteTotalTimeoutConstant);
return CDialog::OnInitDialog();
}