forked from baycom/poc32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardware.cpp
executable file
·131 lines (117 loc) · 3.24 KB
/
hardware.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// Hardware.cpp : implementation file
//
#include "stdafx.h"
#include "pex32.h"
#include "Decoder.h"
#include "Encoder.h"
#include "Hardware.h"
#include "Statistic.h"
#include "Set.h"
#include "Filter.h"
#include "ListManager.h"
#include "Options.h"
#include "SetGeneral.h"
#include "MyStatusBar.h"
#include "MainFrm.h"
#include "Listen.h"
#include "aliases.h"
#include "MyMessageBox.h"
#include "Pex32Doc.h"
//#include "Pex32View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CHardware property page
extern CPex32Doc *pPex32Doc;
IMPLEMENT_DYNCREATE (CHardware, CPropertyPage) CHardware::CHardware ():CPropertyPage (CHardware::
IDD)
{
//{{AFX_DATA_INIT(CHardware)
m_int = -1;
m_port = -1;
m_syncstr = _T ("");
m_cardnum = -1;
m_usesndcrd = FALSE;
m_usecom = FALSE;
m_rxline = -1;
m_debug = FALSE;
m_errcor = FALSE;
m_firflt = FALSE;
m_channels = -1;
//}}AFX_DATA_INIT
}
CHardware::~CHardware ()
{
}
void
CHardware::DoDataExchange (CDataExchange * pDX)
{
CPropertyPage::DoDataExchange (pDX);
//{{AFX_DATA_MAP(CHardware)
DDX_Control (pDX, IDC_USESNDCRD, m_sndcrdctrl);
DDX_Control (pDX, IDC_USECOM, m_usecomctrl);
DDX_Control (pDX, IDC_SOUNDCARD, m_soundcard);
DDX_CBIndex (pDX, IDC_INT, m_int);
DDX_CBIndex (pDX, IDC_PORT, m_port);
DDX_Text (pDX, IDC_SYNCWORD, m_syncstr);
DDV_MaxChars (pDX, m_syncstr, 10);
DDX_CBIndex (pDX, IDC_SOUNDCARD, m_cardnum);
DDX_Check (pDX, IDC_USESNDCRD, m_usesndcrd);
DDX_Check (pDX, IDC_USECOM, m_usecom);
DDX_CBIndex (pDX, IDC_RXLINE, m_rxline);
DDX_Check (pDX, IDC_DEBUG2, m_debug);
DDX_Check (pDX, IDC_CORR, m_errcor);
DDX_Check (pDX, IDC_FIRFLT, m_firflt);
DDX_CBIndex (pDX, IDC_CHANNELS, m_channels);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP (CHardware, CPropertyPage)
//{{AFX_MSG_MAP(CHardware)
//}}AFX_MSG_MAP
END_MESSAGE_MAP ()
/////////////////////////////////////////////////////////////////////////////
// CHardware message handlers
BOOL CHardware::OnInitDialog ()
{
CPropertyPage::OnInitDialog ();
if (pPex32Doc->m_hCVxD == INVALID_HANDLE_VALUE)
SetWindowLong (m_usecomctrl.m_hWnd, GWL_STYLE,
GetWindowLong (m_usecomctrl.m_hWnd,
GWL_STYLE) | WS_DISABLED);
if (m_sndstr[0].IsEmpty ())
SetWindowLong (m_sndcrdctrl.m_hWnd, GWL_STYLE,
GetWindowLong (m_sndcrdctrl.m_hWnd,
GWL_STYLE) | WS_DISABLED);
m_soundcard.InitStorage (8, 1024);
for (int i = 0; i < 8; i++)
if (!m_sndstr[i].IsEmpty ())
m_soundcard.InsertString (i, m_sndstr[i]);
else
break;
UpdateData (FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void
CHardware::OnOK ()
{
TRACE ("OnOk\n");
CPropertyPage::OnOK ();
::SendMessage (AfxGetApp ()->m_pMainWnd->m_hWnd, WM_COMMAND, WM_SETPREFS,
0);
}
BOOL CHardware::OnCommand (WPARAM wParam, LPARAM lParam)
{
SetModified (TRUE);
return CPropertyPage::OnCommand (wParam, lParam);
}
BOOL CHardware::OnNotify (WPARAM wParam, LPARAM lParam, LRESULT * pResult)
{
//TRACE("Notify %x",wParam);
if (wParam)
SetModified (TRUE);
return CPropertyPage::OnNotify (wParam, lParam, pResult);
}