-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTrainNetDialogPropSheet.cpp
81 lines (63 loc) · 2.07 KB
/
TrainNetDialogPropSheet.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
// TrainNetDialogPropSheet.cpp : implementation file
//
#include "stdafx.h"
#include "NN.h"
#include "TrainNetDialogPropSheet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTrainNetDialogPropSheet
IMPLEMENT_DYNAMIC(CTrainNetDialogPropSheet, CPropertySheet)
CTrainNetDialogPropSheet::CTrainNetDialogPropSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
}
CTrainNetDialogPropSheet::CTrainNetDialogPropSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
AddPage(&FeatureMapPage);
AddPage(&NeuralGasPage);
AddPage(&GrowinNeuralGasPage);
// AddPage(&GrowingGridPage); - transfred to SOFM
// init to first page
m_NetTrainingMethod = NN_TRAINING_METHOD_SELF_ORGANIZING_FEATURE_MAP;
}
CTrainNetDialogPropSheet::~CTrainNetDialogPropSheet()
{
RemovePage(&FeatureMapPage);
RemovePage(&NeuralGasPage);
RemovePage(&GrowinNeuralGasPage);
}
BEGIN_MESSAGE_MAP(CTrainNetDialogPropSheet, CPropertySheet)
//{{AFX_MSG_MAP(CTrainNetDialogPropSheet)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTrainNetDialogPropSheet message handlers
BOOL CTrainNetDialogPropSheet::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
// TODO: Add your specialized code here and/or call the base class
NMHDR* pnmh = (NMHDR*)lParam;
// tab has been changed
if (TCN_SELCHANGE == pnmh->code){
// get the current page index
int NetTrainingMethod = GetActiveIndex();
switch (NetTrainingMethod){
case 0:
m_NetTrainingMethod=NN_TRAINING_METHOD_SELF_ORGANIZING_FEATURE_MAP;
break;
case 1:
m_NetTrainingMethod=NN_TRAINING_METHOD_NEURAL_GAS;
break;
case 2:
m_NetTrainingMethod=NN_TRAINING_METHOD_GROWING_NEURAL_GAS;
break;
default:
m_NetTrainingMethod=NN_TRAINING_METHOD_NOT_SELECTED;
}
}
return CPropertySheet::OnNotify(wParam, lParam, pResult);
}