-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDlgAddMaskCutout.cpp
91 lines (76 loc) · 2.12 KB
/
DlgAddMaskCutout.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
// DlgAddMaskCutout.cpp : implementation file
//
#include "stdafx.h"
#include "FreePcb.h"
#include "DlgAddMaskCutout.h"
// CDlgAddMaskCutout dialog
IMPLEMENT_DYNAMIC(CDlgAddMaskCutout, CDialog)
CDlgAddMaskCutout::CDlgAddMaskCutout(CWnd* pParent /*=NULL*/)
: CDialog(CDlgAddMaskCutout::IDD, pParent)
{
}
CDlgAddMaskCutout::~CDlgAddMaskCutout()
{
}
void CDlgAddMaskCutout::Initialize ( CPolyLine *poly )
{
m_poly = poly;
}
void CDlgAddMaskCutout::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_COMBO1, m_combo_layer);
DDX_Control(pDX, IDC_RADIO1, m_radio_none);
DDX_Control(pDX, IDC_RADIO2, m_radio_edge);
DDX_Control(pDX, IDC_RADIO3, m_radio_full);
if( !pDX->m_bSaveAndValidate )
{
// incoming
// init
if (m_poly) {
m_hatch = m_poly->GetHatch();
m_layer = m_poly->GetLayer();
isNewCutout = FALSE;
}
else {
isNewCutout = TRUE;
}
m_combo_layer.InsertString( 0, "TOP SOLDER MASK" );
m_combo_layer.InsertString( 1, "BOTTOM SOLDER MASK" );
if( m_hatch == -1 )
m_hatch = CPolyLine::NO_HATCH;
if( m_hatch == CPolyLine::NO_HATCH )
m_radio_none.SetCheck( 1 );
else if( m_hatch == CPolyLine::DIAGONAL_EDGE )
m_radio_edge.SetCheck( 1 );
else if( m_hatch == CPolyLine::DIAGONAL_FULL )
m_radio_full.SetCheck( 1 );
if (m_layer == LAY_SM_TOP)
m_combo_layer.SetCurSel(0);
else if (m_layer == LAY_SM_BOTTOM)
m_combo_layer.SetCurSel(1);
else
m_combo_layer.SetCurSel(0);
}
else
{
// outgoing
if( m_combo_layer.GetCurSel() == 0 )
m_layer = LAY_SM_TOP;
else if( m_combo_layer.GetCurSel() == 1 )
m_layer = LAY_SM_BOTTOM;
else
ASSERT(0);
if( m_radio_none.GetCheck() )
m_hatch = CPolyLine::NO_HATCH;
else if( m_radio_edge.GetCheck() )
m_hatch = CPolyLine::DIAGONAL_EDGE;
else if( m_radio_full.GetCheck() )
m_hatch = CPolyLine::DIAGONAL_FULL;
else
ASSERT(0);
}
}
BEGIN_MESSAGE_MAP(CDlgAddMaskCutout, CDialog)
END_MESSAGE_MAP()
// CDlgAddMaskCutout message handlers