-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUFExtractForceFrame.cls
230 lines (188 loc) · 12.4 KB
/
UFExtractForceFrame.cls
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "UFExtractForceFrame"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'@Folder("Userform.ForceExtraction")
'********************************************************
'This is the userform for the 'extract frame force' operation
'This class contains only the UI elements only. The input/ process of UF data is in the 'UFControl' Class
'Arthor: Lucas LEUNG
'Update Log
'Aug 2023 - Initial
'*******************************************************
Option Explicit
Implements IView
Private Type TView
'IView state:
ViewModel As VMForceExtraction
'ICancellable state:
'IsCancelled As Boolean
'Data binding helper dependency:
Bindings As New BindingsManager
End Type
Private this As TView
Private genFuncs As clsGeneralFunctions
Private form1 As UFBasicMulti
Private mcboOutputSheetName As msForms.ComboBox
Private mcboGroupBy As msForms.ComboBox
Private mcboForceType As msForms.ComboBox
Private mcboMaxMinEnv(5) As msForms.checkbox
Private mcboPosition As msForms.ComboBox
Private mcboCaseQuickToggle As msForms.ComboBox
Private mcbCase(11) As msForms.checkbox, mcbCheckAll As msForms.checkbox
Private mcbIsEachLC As msForms.checkbox, mcbIsEnvMaxMin As msForms.checkbox, mcbIsEachPos As msForms.checkbox
Private mlstSec As msForms.listBox, mlstSecExcl As msForms.listBox, mbtnSec1 As msForms.CommandButton, mbtnSec2 As msForms.CommandButton
Private mlstFrame As msForms.listBox, mlstFrameExcl As msForms.listBox, mbtnFrame1 As msForms.CommandButton, mbtnFrame2 As msForms.CommandButton
Private mlstLc As msForms.listBox, mlstLcExcl As msForms.listBox, mbtnLc1 As msForms.CommandButton, mbtnLc2 As msForms.CommandButton
Private mImageOkButton As msForms.Image
'Private mbtnOKButton As MSForms.Image
Private WithEvents mbtnLoadInput As msForms.CommandButton
Attribute mbtnLoadInput.VB_VarHelpID = -1
Private miCloseState As Integer
Private Sub Class_Initialize()
Set genFuncs = New clsGeneralFunctions
Set form1 = New UFBasicMulti
form1.Initialize 4, genFuncs.CStr_arr(Split("General,Section Filter,Member Filter,Load Comb Filter", ",")), 400, False
form1.TitleBarCaption = "Extract Frame Data To Summary Table - Correspondence Cases"
form1.CurrentPage = 1
form1.AddComboBox_Empty mcboOutputSheetName, "Extract Force to Summary Worksheet:"
form1.AddComboBox Split("By Section,By Member", ","), mcboGroupBy, "Output to be Grouped by:"
form1.AddComboBox Split("Correspondence Cases", ","), mcboForceType, "Output Force Cases:"
form1.AddCheckBox_double mcbCase(0), mcbCase(1), "Please select the correspondence case(s) for output:", "Max P", "Min P", True, True, _
tipText:="Example: Case 'Max P'= Locate the position for Max P under certain Load Comb of certain Section/Member --> Extract all permutations of forces of that Load Comb at that location."
form1.AddCheckBox_double mcbCase(2), mcbCase(3), vbNullString, "Max Vy", "Min Vy", True, True
form1.AddCheckBox_double mcbCase(4), mcbCase(5), vbNullString, "Max Vz", "Min Vz", True, True
form1.AddCheckBox_double mcbCase(6), mcbCase(7), vbNullString, "Max T", "Min T", True, True
form1.AddCheckBox_double mcbCase(8), mcbCase(9), vbNullString, "Max Mz", "Min Mz", True, True
form1.AddCheckBox_double mcbCase(10), mcbCase(11), vbNullString, "Max My", "Min My", True, True
form1.AddCheckBox mcbIsEnvMaxMin, "Create permutation(s) from envelope load combinations?", isCheck:=True, _
tipText:="For result from envelope load combination, there are 2 results (max and min) at a position of the frame. " & _
"When this option is checked, these 2 results will be considered as a whole."
form1.AddCheckBox_double mcboMaxMinEnv(0), mcboMaxMinEnv(3), "Is consider absolute maximum for envelope load combination result. ", "P", "T", False, True, _
"This is effective only when 'Create permutation(s) from envelope load combinations?' is checked. when checked --> consider ABS MAX for the force/moment; Unchecked--> All Permutations will be Considered. Example: Unchecked P and M3 for a Env Load Combination: Max/Min P/M3 will create 4 permutations"
' "For Env Load Combination (LC) Output Data, there are 'max' and 'min' (2 rows of data) for certain element at certain location under certain LC." & vbNewLine & _
' "Hence, there will be 2^6 permutations of design data, if it is uncertain whether 'max' or 'min' is more critical. (keep all boxex unchecked for this cases)" & vbNewLine & _
' "In Opposite, if only would like to consider the abs max of certain force(s)/moment(s), then check the corresponding box(es). "
form1.AddCheckBox_double mcboMaxMinEnv(1), mcboMaxMinEnv(4), "", "Vz (V2) ", "Mz (M2)", True, True
form1.AddCheckBox_double mcboMaxMinEnv(2), mcboMaxMinEnv(5), "", "Vy (V3) ", "My (M3)", True, True
'form1.AddComboBox Split("ALL,Major Axis Plane Forces,Axial and Bending,Custom", ","), _
mcboCaseQuickToggle, "Please select the correspondence case(s) for output:"
form1.AddCheckBox mcbIsEachLC, "Output result seperately for EACH load combination?", isCheck:=False, _
tipText:="Checked: for Each Selected Section/Member --> for Each Selected Load Combination --> 1 sets of force and moments"
form1.AddCheckBox mcbIsEachPos, "Output result seperately for EACH position?", isCheck:=False, _
tipText:="Checked: for Each Selected Section/Member --> for Each Filtered Position --> 1 sets of force and moments"
form1.AddComboBox Split("No Filter,End I,End J,Both End", ","), mcboPosition, "Position Filter:"
form1.CurrentPage = 2
form1.AddSelectionBoxMulti_Empty mlstSec, "SELECTED Sections", height_LB:=300, _
is_reListBox2:=True, reListBox2:=mlstSecExcl, _
title2:="EXCLUDED Sections", _
reCmdBtn1:=mbtnSec1, reCmdBtn2:=mbtnSec2 ', isCreateFrame:=True, frameTitle:="pSections"
form1.CurrentPage = 3
form1.AddSelectionBoxMulti_Empty mlstFrame, "SELECTED Members", height_LB:=300, _
is_reListBox2:=True, reListBox2:=mlstFrameExcl, _
title2:="EXCLUDED Members", _
reCmdBtn1:=mbtnFrame1, reCmdBtn2:=mbtnFrame2 ', isCreateFrame:=True, frameTitle:="FRAMES"
form1.CurrentPage = 4
form1.AddSelectionBoxMulti_Empty mlstLc, "SELECTED Load Comb.", height_LB:=300, _
is_reListBox2:=True, reListBox2:=mlstLcExcl, _
title2:="EXCLUDED Load Comb.", _
reCmdBtn1:=mbtnLc1, reCmdBtn2:=mbtnLc2
form1.AdjustHeight
Set mbtnLoadInput = form1.AddButton("Load Default", width:=100, height:=20, top:=468, left:=10, pageNum:=-1)
Set mImageOkButton = form1.OKButton
End Sub
Public Sub IView_Initialize(vm As Object)
Set this.ViewModel = vm
'Set this.Bindings = New PropertyBindings
'this.Bindings.Initialize VM
mcboOutputSheetName.List = this.ViewModel.wsList
ConfigureBindings
End Sub
Public Sub IView_Show()
' mlstSec.List.Sort
' mlstSecExcl.List.Sort
' mlstFrame.List.Sort
' mlstFrameExcl.List.Sort
' mlstLc.List.Sort
' mlstLcExcl.List.Sort
form1.Show
If Not form1.CloseState = 0 Then GoTo CloseProcedure
Exit Sub
CloseProcedure:
miCloseState = -1
End Sub
Private Sub ConfigureBindings()
Const EnabledProperty As String = "Enabled"
Const ListProperty As String = "List"
this.Bindings.BindComboBox mcboOutputSheetName, "wsSumName", this.ViewModel
this.Bindings.BindComboBox mcboGroupBy, "GroupBy", this.ViewModel
this.Bindings.BindCheckBox mcbCase(0), "ExtremeCase0", this.ViewModel
this.Bindings.BindCheckBox mcbCase(1), "ExtremeCase1", this.ViewModel
this.Bindings.BindCheckBox mcbCase(2), "ExtremeCase2", this.ViewModel
this.Bindings.BindCheckBox mcbCase(3), "ExtremeCase3", this.ViewModel
this.Bindings.BindCheckBox mcbCase(4), "ExtremeCase4", this.ViewModel
this.Bindings.BindCheckBox mcbCase(5), "ExtremeCase5", this.ViewModel
this.Bindings.BindCheckBox mcbCase(6), "ExtremeCase6", this.ViewModel
this.Bindings.BindCheckBox mcbCase(7), "ExtremeCase7", this.ViewModel
this.Bindings.BindCheckBox mcbCase(8), "ExtremeCase8", this.ViewModel
this.Bindings.BindCheckBox mcbCase(9), "ExtremeCase9", this.ViewModel
this.Bindings.BindCheckBox mcbCase(10), "ExtremeCase10", this.ViewModel
this.Bindings.BindCheckBox mcbCase(11), "ExtremeCase11", this.ViewModel
this.Bindings.BindCheckBox mcbIsEnvMaxMin, "IsEnvMaxMin", this.ViewModel
this.Bindings.BindCheckBox mcboMaxMinEnv(0), "MaxMinEnv0", this.ViewModel
this.Bindings.BindCheckBox mcboMaxMinEnv(1), "MaxMinEnv1", this.ViewModel
this.Bindings.BindCheckBox mcboMaxMinEnv(2), "MaxMinEnv2", this.ViewModel
this.Bindings.BindCheckBox mcboMaxMinEnv(3), "MaxMinEnv3", this.ViewModel
this.Bindings.BindCheckBox mcboMaxMinEnv(4), "MaxMinEnv4", this.ViewModel
this.Bindings.BindCheckBox mcboMaxMinEnv(5), "MaxMinEnv5", this.ViewModel
this.Bindings.BindCheckBox mcbIsEachLC, "IsEachLC", this.ViewModel
this.Bindings.BindCheckBox mcbIsEachPos, "IsEachPos", this.ViewModel
this.Bindings.BindComboBox mcboPosition, "PosFilterTypeStr", this.ViewModel
Dim MoveListBoxItemCommand As New MoveListBoxItemCommand
this.Bindings.BindListBox mlstSec, "Sections", this.ViewModel
this.Bindings.BindListBox mlstSecExcl, "SectionsExcl", this.ViewModel
this.Bindings.BindCommand this.ViewModel, mbtnSec1, _
MoveListBoxItemCommand.Create(mlstSec, mlstSecExcl, this.ViewModel, "Sections", "SectionsExcl")
this.Bindings.BindCommand this.ViewModel, mbtnSec2, _
MoveListBoxItemCommand.Create(mlstSecExcl, mlstSec, this.ViewModel, "SectionsExcl", "Sections")
this.Bindings.BindListBox mlstFrame, "MemberNames", this.ViewModel
this.Bindings.BindListBox mlstFrameExcl, "MemberNamesExcl", this.ViewModel
this.Bindings.BindCommand this.ViewModel, mbtnFrame1, _
MoveListBoxItemCommand.Create(mlstFrame, mlstFrameExcl, this.ViewModel, "MemberNames", "MemberNamesexcl")
this.Bindings.BindCommand this.ViewModel, mbtnFrame2, _
MoveListBoxItemCommand.Create(mlstFrameExcl, mlstFrame, this.ViewModel, "MemberNamesExcl", "MemberNames")
this.Bindings.BindListBox mlstLc, "lc", this.ViewModel
this.Bindings.BindListBox mlstLcExcl, "lcExcl", this.ViewModel
this.Bindings.BindCommand this.ViewModel, mbtnLc1, _
MoveListBoxItemCommand.Create(mlstLc, mlstLcExcl, this.ViewModel, "lc", "lcExcl")
this.Bindings.BindCommand this.ViewModel, mbtnLc2, _
MoveListBoxItemCommand.Create(mlstLcExcl, mlstLc, this.ViewModel, "lcExcl", "lc")
' this.Bindings.BindListBox mlstSec, "Sections", this.ViewModel
' this.Bindings.BindListBox mlstSecExcl, "SectionsExcl", this.ViewModel
' this.Bindings.BindListBox mlstFrame, "MemberNames", this.ViewModel
' this.Bindings.BindListBox mlstFrameExcl, "MemberNamesexcl", this.ViewModel
' this.Bindings.BindListBox mlstLc, "lc", this.ViewModel
' this.Bindings.BindListBox mlstLcExcl, "lcExcl", this.ViewModel
Dim SwitchUFValueCommand As New SwitchUFValueCommand
this.Bindings.BindCommand this.ViewModel, mbtnLoadInput, SwitchUFValueCommand.Create(this.ViewModel), ExecuteContext:=mbtnLoadInput ', this.ViewModel, ExecuteContext:=mbtnLoadInput
Dim SaveInputCommand As New SaveInputCommand
this.Bindings.BindImageCommand this.ViewModel, mImageOkButton, SaveInputCommand.Create(this.ViewModel), ExecuteContext:=mImageOkButton
' Dim SaveInputCommand As New SaveInputCommand
' this.Bindings.BindCommand this.ViewModel, mbtnLoadInput, SaveInputCommand.Create(this.ViewModel) ', this.ViewModel, ExecuteContext:=mbtnLoadInput
'this.Bindings.BindCommand this.ViewModel, mbtnLoadInput, this.ViewModel.SwitchUFValueCommand
'Debug.Print mbtnLoadInput.caption
End Sub
Private Property Get IView_ViewModel() As Object
Set IView_ViewModel = this.ViewModel
End Property
Private Property Get IView_CloseState() As Integer
IView_CloseState = miCloseState
End Property
'Private Property Let IView_ViewModel(vm As Object)
' Set IView_ViewModel = this.ViewModel
'End Property