-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLoadRatingOptionsPage.cpp
executable file
·162 lines (124 loc) · 5.24 KB
/
LoadRatingOptionsPage.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
///////////////////////////////////////////////////////////////////////
// XBeamRate - Cross Beam Load Rating
// Copyright © 1999-2025 Washington State Department of Transportation
// Bridge and Structures Office
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the Alternate Route Open Source License as
// published by the Washington State Department of Transportation,
// Bridge and Structures Office.
//
// This program is distributed in the hope that it will be useful, but
// distribution is AS IS, WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
// the Alternate Route Open Source License for more details.
//
// You should have received a copy of the Alternate Route Open Source
// License along with this program; if not, write to the Washington
// State Department of Transportation, Bridge and Structures Office,
// P.O. Box 47340, Olympia, WA 98503, USA or e-mail
///////////////////////////////////////////////////////////////////////
// LoadRatingOptionsPage.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "LoadRatingOptionsPage.h"
#include <MFCTools\CustomDDX.h>
#include <EAF\EAFDisplayUnits.h>
#include <EAF\EAFDocument.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// CLoadRatingOptionsPage dialog
IMPLEMENT_DYNAMIC(CLoadRatingOptionsPage, CPropertyPage)
CLoadRatingOptionsPage::CLoadRatingOptionsPage()
: CPropertyPage(CLoadRatingOptionsPage::IDD)
{
m_psp.dwFlags |= PSP_HASHELP;
}
CLoadRatingOptionsPage::~CLoadRatingOptionsPage()
{
}
void CLoadRatingOptionsPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
CComPtr<IBroker> pBroker;
EAFGetBroker(&pBroker);
GET_IFACE2(pBroker,IEAFDisplayUnits,pDisplayUnits);
DDX_CBEnum(pDX,IDC_ANALYSIS_MODE,m_AnalysisType);
DDX_CBEnum(pDX, IDC_PERMIT_FACTORS, m_PermitRatingMethod);
DDX_CBEnum(pDX, IDC_EMERGENCY_FACTORS, m_EmergencyRatingMethod);
DDX_UnitValueAndTag(pDX,IDC_LL_STEP,IDC_LL_STEP_UNIT,m_MaxLLStepSize, pDisplayUnits->GetSpanLengthUnit());
DDV_UnitValueGreaterThanLimit(pDX,IDC_LL_STEP,m_MaxLLStepSize,0.0,pDisplayUnits->GetSpanLengthUnit());
DDX_Keyword(pDX,IDC_MAX_LANES,_T("ALL"),m_MaxLoadedLanes);
DDX_Text(pDX, IDC_SYSTEM_FACTOR_FLEXURE, m_SystemFactorFlexure);
DDX_Text(pDX, IDC_SYSTEM_FACTOR_SHEAR, m_SystemFactorShear);
DDX_Check_Bool(pDX, IDC_NEG_MOMENT_CHECK, m_bDoAnalyzeNegativeMomentBetweenFOC);
DDX_UnitValueAndTag(pDX, IDC_NEG_MOMENT_WIDTH, IDC_NEG_MOMENT_WIDTH_UNIT, m_MinColumnWidthForNegMoment, pDisplayUnits->GetSpanLengthUnit());
DDV_UnitValueGreaterThanLimit(pDX,IDC_NEG_MOMENT_WIDTH,m_MinColumnWidthForNegMoment, 0.0, pDisplayUnits->GetSpanLengthUnit());
}
BEGIN_MESSAGE_MAP(CLoadRatingOptionsPage, CPropertyPage)
ON_BN_CLICKED(ID_HELP,OnHelp)
ON_BN_CLICKED(IDC_NEG_MOMENT_CHECK, &CLoadRatingOptionsPage::OnBnClickedNegMomentCheck)
END_MESSAGE_MAP()
// CLoadRatingOptionsPage message handlers
BOOL CLoadRatingOptionsPage::OnInitDialog()
{
FillAnalysisModeComboBox();
FillEmergencyRatingMethodComboBox();
FillPermitRatingMethodComboBox();
CPropertyPage::OnInitDialog();
OnNegMomCheckChanged();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CLoadRatingOptionsPage::OnHelp()
{
EAFHelp(_T("XBRate"), IDH_PGS_RATING_OPTIONS);
}
void CLoadRatingOptionsPage::FillAnalysisModeComboBox()
{
CComboBox* pCB = (CComboBox*)GetDlgItem(IDC_ANALYSIS_MODE);
pCB->ResetContent();
int idx = pCB->AddString(_T("Simple"));
pCB->SetItemData(idx,(DWORD_PTR)pgsTypes::Simple);
idx = pCB->AddString(_T("Continuous"));
pCB->SetItemData(idx,(DWORD_PTR)pgsTypes::Continuous);
idx = pCB->AddString(_T("Envelope"));
pCB->SetItemData(idx,(DWORD_PTR)pgsTypes::Envelope);
}
void CLoadRatingOptionsPage::FillEmergencyRatingMethodComboBox()
{
CComboBox* pCB = (CComboBox*)GetDlgItem(IDC_EMERGENCY_FACTORS);
pCB->ResetContent();
int idx = pCB->AddString(_T("AASHTO MBE Equation 6A.4.2.1-1"));
pCB->SetItemData(idx, (DWORD_PTR)xbrTypes::ermAASHTO);
idx = pCB->AddString(_T("WSDOT BDM Equation 13.1.1A-2"));
pCB->SetItemData(idx, (DWORD_PTR)xbrTypes::ermWSDOT);
}
void CLoadRatingOptionsPage::FillPermitRatingMethodComboBox()
{
CComboBox* pCB = (CComboBox*)GetDlgItem(IDC_PERMIT_FACTORS);
pCB->ResetContent();
int idx = pCB->AddString(_T("AASHTO MBE Equation 6A.4.2.1-1"));
pCB->SetItemData(idx, (DWORD_PTR)xbrTypes::prmAASHTO);
idx = pCB->AddString(_T("WSDOT BDM Equation 13.1.1A-2"));
pCB->SetItemData(idx, (DWORD_PTR)xbrTypes::prmWSDOT);
}
void CLoadRatingOptionsPage::OnBnClickedNegMomentCheck()
{
OnNegMomCheckChanged();
}
void CLoadRatingOptionsPage::OnNegMomCheckChanged()
{
BOOL bEnableUserInput= IsDlgButtonChecked(IDC_NEG_MOMENT_CHECK) == BST_CHECKED ? TRUE : FALSE;
CWnd* pCtrl = GetDlgItem(IDC_NEG_MOMENT_WIDTH);
pCtrl->EnableWindow(bEnableUserInput);
pCtrl = GetDlgItem(IDC_NEG_MOMENT_WIDTH_UNIT);
pCtrl->EnableWindow(bEnableUserInput);
pCtrl = GetDlgItem(IDC_STATIC_MOM);
pCtrl->EnableWindow(bEnableUserInput);
}