@@ -30,7 +30,8 @@ public IQuantity CentroidPosFromStart {
30
30
}
31
31
if ( value . QuantityInfo . UnitType != typeof ( LengthUnit ) & value . QuantityInfo . UnitType != typeof ( RatioUnit ) ) {
32
32
throw new ArgumentException ( "Centroid Position From Start must be either Length or Ratio" ) ;
33
- } else {
33
+ }
34
+ else {
34
35
m_CentroidPosFromStart = value ;
35
36
}
36
37
}
@@ -43,7 +44,8 @@ public IQuantity CentroidPosFromTop {
43
44
}
44
45
if ( value . QuantityInfo . UnitType != typeof ( LengthUnit ) & value . QuantityInfo . UnitType != typeof ( RatioUnit ) ) {
45
46
throw new ArgumentException ( "Centroid Position From Top must be either Length or Ratio" ) ;
46
- } else {
47
+ }
48
+ else {
47
49
m_CentroidPosFromTop = value ;
48
50
}
49
51
}
@@ -142,7 +144,8 @@ public WebOpening(Length width, Length height, NotchPosition position, IWebOpeni
142
144
// static type for this constructor
143
145
if ( position == NotchPosition . Start ) {
144
146
WebOpeningType = OpeningType . Start_notch ;
145
- } else {
147
+ }
148
+ else {
146
149
WebOpeningType = OpeningType . End_notch ;
147
150
}
148
151
// inputs
@@ -204,12 +207,14 @@ public string ToCoaString(string name, ComposUnits units) {
204
207
}
205
208
if ( OpeningStiffeners == null ) {
206
209
parameters . Add ( "STIFFENER_NO" ) ;
207
- } else {
210
+ }
211
+ else {
208
212
parameters . Add ( "STIFFENER_YES" ) ;
209
213
210
214
if ( ! OpeningStiffeners . IsBothSides | OpeningStiffeners . IsNotch ) {
211
215
parameters . Add ( "ONE_SIDE_STIFFENER" ) ;
212
- } else {
216
+ }
217
+ else {
213
218
parameters . Add ( "BOTH_SIDE_STIFFENER" ) ;
214
219
}
215
220
@@ -219,7 +224,8 @@ public string ToCoaString(string name, ComposUnits units) {
219
224
if ( OpeningStiffeners . IsNotch ) {
220
225
parameters . Add ( CoaHelper . FormatSignificantFigures ( OpeningStiffeners . TopStiffenerWidth . ToUnit ( units . Section ) . Value , 6 ) ) ;
221
226
parameters . Add ( CoaHelper . FormatSignificantFigures ( OpeningStiffeners . TopStiffenerThickness . ToUnit ( units . Section ) . Value , 6 ) ) ;
222
- } else {
227
+ }
228
+ else {
223
229
parameters . Add ( CoaHelper . FormatSignificantFigures ( OpeningStiffeners . BottomStiffenerWidth . ToUnit ( units . Section ) . Value , 6 ) ) ;
224
230
parameters . Add ( CoaHelper . FormatSignificantFigures ( OpeningStiffeners . BottomStiffenerThickness . ToUnit ( units . Section ) . Value , 6 ) ) ;
225
231
}
@@ -235,14 +241,14 @@ public override string ToString() {
235
241
case OpeningType . Start_notch :
236
242
case OpeningType . End_notch :
237
243
case OpeningType . Rectangular :
238
- if ( Width == null || Height == null ) {
244
+ if ( ComposUnitsHelper . IsEqual ( Width , Length . Zero ) || ComposUnitsHelper . IsEqual ( Height , Length . Zero ) ) {
239
245
return "Invalid Webopening" ;
240
246
}
241
247
size = Width . As ( Height . Unit ) . ToString ( "g2" ) + "x" + Height . ToString ( "g2" ) . Replace ( " " , string . Empty ) ;
242
248
break ;
243
249
244
250
case OpeningType . Circular :
245
- if ( Diameter == null ) {
251
+ if ( ComposUnitsHelper . IsEqual ( Diameter , Length . Zero ) ) {
246
252
return "Invalid Webopening" ;
247
253
}
248
254
size = "Ø" + Diameter . ToString ( "g2" ) . Replace ( " " , string . Empty ) ;
@@ -264,11 +270,13 @@ public override string ToString() {
264
270
string x = "" ;
265
271
if ( CentroidPosFromStart == null ) {
266
272
return "Invalid Webopening" ;
267
- } else {
273
+ }
274
+ else {
268
275
if ( CentroidPosFromStart . QuantityInfo . UnitType == typeof ( LengthUnit ) ) {
269
276
var l = ( Length ) CentroidPosFromStart ;
270
277
x = l . ToString ( "f2" ) . Replace ( " " , string . Empty ) ;
271
- } else {
278
+ }
279
+ else {
272
280
var p = ( Ratio ) CentroidPosFromStart ;
273
281
x = p . ToUnit ( RatioUnit . Percent ) . ToString ( "g2" ) . Replace ( " " , string . Empty ) ;
274
282
}
@@ -277,11 +285,13 @@ public override string ToString() {
277
285
string z = "" ;
278
286
if ( CentroidPosFromStart == null ) {
279
287
return "Invalid Webopening" ;
280
- } else {
288
+ }
289
+ else {
281
290
if ( CentroidPosFromTop . QuantityInfo . UnitType == typeof ( LengthUnit ) ) {
282
291
var l = ( Length ) CentroidPosFromTop ;
283
292
z = l . ToString ( "g2" ) . Replace ( " " , string . Empty ) ;
284
- } else {
293
+ }
294
+ else {
285
295
var p = ( Ratio ) CentroidPosFromTop ;
286
296
z = p . ToUnit ( RatioUnit . Percent ) . ToString ( "g2" ) . Replace ( " " , string . Empty ) ;
287
297
}
@@ -331,12 +341,14 @@ internal static IWebOpening FromCoaString(List<string> parameters, ComposUnits u
331
341
opening . Diameter = new Length ( Convert . ToDouble ( parameters [ 3 ] , noComma ) , units . Section ) ;
332
342
if ( parameters [ 5 ] . EndsWith ( "%" ) ) {
333
343
opening . CentroidPosFromStart = new Ratio ( Convert . ToDouble ( parameters [ 5 ] . Replace ( "%" , string . Empty ) , noComma ) , RatioUnit . Percent ) ;
334
- } else {
344
+ }
345
+ else {
335
346
opening . CentroidPosFromStart = new Length ( Convert . ToDouble ( parameters [ 5 ] , noComma ) , units . Length ) ;
336
347
}
337
348
if ( parameters [ 6 ] . EndsWith ( "%" ) ) {
338
349
opening . CentroidPosFromTop = new Ratio ( Convert . ToDouble ( parameters [ 6 ] . Replace ( "%" , string . Empty ) , noComma ) , RatioUnit . Percent ) ;
339
- } else {
350
+ }
351
+ else {
340
352
opening . CentroidPosFromTop = new Length ( Convert . ToDouble ( parameters [ 6 ] , noComma ) , units . Section ) ;
341
353
}
342
354
break ;
@@ -346,7 +358,8 @@ internal static IWebOpening FromCoaString(List<string> parameters, ComposUnits u
346
358
347
359
if ( parameters [ 8 ] == "ONE_SIDE_STIFFENER" ) {
348
360
webOpeningStiffeners . IsBothSides = false ;
349
- } else {
361
+ }
362
+ else {
350
363
webOpeningStiffeners . IsBothSides = true ;
351
364
}
352
365
@@ -356,7 +369,8 @@ internal static IWebOpening FromCoaString(List<string> parameters, ComposUnits u
356
369
357
370
if ( parameters [ 2 ] == "LEFT_NOTCH" | parameters [ 2 ] == "RIGHT_NOTCH" ) {
358
371
webOpeningStiffeners . IsNotch = true ;
359
- } else {
372
+ }
373
+ else {
360
374
webOpeningStiffeners . IsNotch = false ;
361
375
webOpeningStiffeners . BottomStiffenerWidth = new Length ( Convert . ToDouble ( parameters [ 12 ] , noComma ) , units . Section ) ;
362
376
webOpeningStiffeners . BottomStiffenerThickness = new Length ( Convert . ToDouble ( parameters [ 13 ] , noComma ) , units . Section ) ;
0 commit comments