This repository has been archived by the owner on Oct 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
openstudio_buildingsync_v2.rb
2159 lines (1894 loc) · 64.2 KB
/
openstudio_buildingsync_v2.rb
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
class SimpleElement
attr_accessor :text, :children
def text
return @text
end
def attributes
return @attributes
end
def children
return @children
end
def specify_attributes
@attributes = {}
end
def update_attributes; end
def specify_children
@children = {}
end
def update_children; end
def initialize(args=nil)
if(args.nil?)
#do nothing, TODO: log the user supplied nothing
self.text = nil
update_attributes
specify_children
else
self.text
update_attributes
#puts "initilizing...", args
post_initialize(args)
end
end
#initializes the simplest of elements with text that is passed in
def post_initialize(args)
begin
specify_children()
specify_attributes()
if(!args.nil?)
if(args.is_a?(Hash))
if(args.has_key? :children)
bulk_children(args[:children])
end
if(args.has_key? :attributes)
#puts "Has attributes"
args[:attributes].keys.each do |a|
#puts "Writing attribute:", a
@attributes[a] = args[:attributes][a] #TODO, this should have better error checking in it, like is a field required but is passed nil?
end
end
if(args.has_key? :text)
#puts "Added text", args[:text]
@text = args[:text]
else
#TODO #put error that the proper hash keys were not identified.
end
end
else
#TODO give some indication that no arguments were provided
end
#TODO - make this active only on a boolean, possibly filter
delete_unwanted_children()
rescue => error
puts "Could not create the BuildingSync element properly."
puts error.inspect, error.backtrace
end
end
def bulk_children(args)
begin
args.keys.each do |k|
#puts "Working on " + k.to_s
if k.to_s == "Schedules"
#puts "Working on " + k.to_s
#puts "Children", @children
#puts "Full Arguments", args
end
if(args[k][:value].is_a?(Array))
#puts "Value is an array"
args[k][:value].each do |c|
if k.to_s == "Delivery"
#puts "Children: #{@children[k]}"
end
#puts "Starting to #put array for key #{k}:"
#puts "Children: #{@children[k]}"
@children[k][:value] << c
end
else
if(@children.has_key? k)
#puts "Has key"
if(args[k][:value].is_a?(Array))
type_match = true
args[k][:value].each do |a|
if(@children[k].has_key? :type)
#puts "Has key type"
if(a.class.name != @children[k][:type])
#puts "Type mismatch #{a.class.name} and #{@children[k][:type]}"
type_match = false
break
end
else
if(a.class.name != k)
type_match = false
break
end
end
end #end loop
if(type_match)
@children[k][:value] = args[k][:value]
else
#TODO: #put something to alert user that they supplied the wrong class for children
end
else #it is an object
#puts "Looking for an object."
if(@children[k].has_key? :type)
#puts 'a type for this object'
#puts "Key #{k} Assiging value: ", args[k][:value]
@children[k][:value] = args[k][:value]
# if(k === @children[k][:type]) #deprecated
# #puts "Key #{k} Assiging value: ", args[k][:value]
# @children[k][:value] = args[k][:value]
# end
else
#puts 'There is no additional type for this object.' + k.to_s
#puts "Key #{k} Assiging value: ", args[k][:value]
@children[k][:value] = args[k][:value]
end
end
else
raise "Could not find the child element: #{k} in all children #{@children.keys}"
end
end
end #end of keys outer loop
rescue => error
puts error.inspect, error.backtrace
puts "Problem bulking children"
ensure
end
end
#filter children that have nil or empty array
def delete_unwanted_children
@children.keys.each do |key|
if(@children[key][:value].class.name === "Array")
if(@children[key][:value].empty?)
@children.tap { |hs| hs.delete(key) }
end
else
if(@children[key][:value].nil?)
@children.tap { |hs| hs.delete(key) }
end
end
end
end
end
class IDOnlyElement < SimpleElement
def specify_attributes
@attributes = {}
@attributes[:IDref] = { required:true, value: nil }
end
end
class EnumeratedElement < SimpleElement
private
attr_writer :enums
def specify_enums
@enums = []
end
def post_initialize(args)
begin
specify_enums()
if(@enums.include? args[:text])
@text = args[:text]
else
#TODO: #put some type of warning to alert user unable to assign the text
raise "Text defined for this #{self.class} enumeration is not valid. #{args} Check BuildingSync for valid enums."
end
delete_enums()
rescue => error
puts "Could not create the BuildingSync Enumerated element properly."
puts error.inspect, error.backtrace
end
end
def delete_enums
@enums = []
end
end
class ACAdjusted < EnumeratedElement
def specify_enums
@enums = ["During the day",
"At night",
"During sleeping and unoccupied hours",
"Seasonal",
"Never-rarely",
"Other",
"Unknown"]
end
end
class AirCooled < SimpleElement
def specify_children
@children = {}
@children[:EvaporativelyCooled] = { required: false, value: nil }
@children[:CondensingFanSpeedOperation] = { required: false, value: nil }
@children[:CondensingTemperature] = { required: false, value: nil }
@children[:SplitCondenser] = { required: false, value: nil }
@children[:DesignAmbientTemperature] = { required: false, value: nil }
@children[:DesignTemperatureDifference] = { required: false, value: nil }
end
end
class AnnualCoolingEfficiencyValue < SimpleElement; end
class AnnualCoolingEfficiencyUnits < EnumeratedElement
def specify_enums
@enums = ["COP",
"EER",
"SEER",
"kW/ton",
"Other"]
end
end
class AirDeliveryType < EnumeratedElement
def specify_enums
@enums = ["Central fan",
"Induction units",
"Low pressure under floor",
"Local fan",
"Other",
"Unknown"]
end
end
class AirSideEconomizer < SimpleElement
def specify_children
@children = {}
@children[:AirSideEconomizerType] = { required: false, value: nil }
@children[:EconomizerControl] = { required: false, value: nil }
@children[:EconomizerDryBulbControlPoint] = { required: false, value: nil }
@children[:EconomizerEnthalpyControlPoint] = { required: false, value: nil }
@children[:EconomizerLowTemperatureLockout] = { required: false, value: nil }
#TODO: Add More as required
end
end
class AirSideEconomizerType < EnumeratedElement
def specify_enums
@enums = ["Dry bulb temperature",
"Enthalpy",
"Demand controlled ventilation",
"Nonintegrated",
"Other",
"Unknown"]
end
end
class AnnualCoolingEfficiencyValue < SimpleElement; end
class AnnualCoolingEfficiencyUnits < EnumeratedElement
def specify_enums
@enums = ["COP",
"EER",
"SEER",
"kW/ton",
"Other"
]
end
end
class AspectRatio < SimpleElement;end
class Audits < SimpleElement
def specify_children
@children = {}
@children[:Audit] = { required: true,value: [] }
end
end
class Audit < SimpleElement
def specify_children
@children = {}
@children[:Sites] = { required:false, value: nil }
@children[:Systems] = { required:false, value: nil }
@children[:Schedules] = { required:false, value: [] } #TODO: are the following really arrays? Documentation is ambig.
@children[:Measures] = { required:false, type: 'MeasureType', value: [] }
@children[:Report] = { required:false, value: nil }
@children[:Contacts] = { required:false, type: 'ContactType', value: [] }
end
def specify_attributes
@attributes = {}
@attributes = {"ID" => {value: nil} }
end
end
class Boiler < SimpleElement
def specify_children
@children = {}
@children[:BoilerType] = { required:false, value: nil }
@children[:CondensingOperation] = { required:false, value: nil }
@children[:OutputCapacity] = { required:false, value: nil }
@children[:ThermalEfficiency] = { required:false, value: nil }
@children[:CapacityUnits] = { required:false, value: nil }
@children[:BoilerLWT] = { required:false, value: nil }
@children[:HotWaterResetControl] = { required:false, value: nil }
end
end
class BoilerLWT < SimpleElement; end
class BoilerType < EnumeratedElement
def specify_enums
@enums = [ "Steam", "Hot water", "Other", "Unknown"]
end
end
class CapacityUnits < EnumeratedElement
def specify_enums
@enums = ["cfh",
"ft3/min",
"kcf/h",
"MCF/day",
"gpm",
"W",
"kW",
"hp",
"MW",
"Btu/hr",
"cal/h",
"ft-lbf/h",
"ft-lbf/min",
"Btu/s",
"kBtu/hr",
"MMBtu/hr",
"therms/h",
"lbs/h",
"Klbs/h",
"Mlbs/h",
"Cooling ton",
"Other"
]
end
end
class CeilingArea < SimpleElement; end
class CeilingInsulatedArea < SimpleElement; end
class CeilingID < SimpleElement
def specify_children
@children = {}
@children[:CeilingArea] = { required:false, value: nil }
@children[:CeilingInsulatedArea] = { required:false, value: nil }
@children[:ThermalZoneID] = { required:false, value: nil }
@children[:SpaceID] = { required:false, value: nil }
end
def specify_attributes
@attributes = {}
@attributes[:IDref] = { required:true, text: nil }
end
end
class CeilingSystems < SimpleElement
def specify_children
@children = {}
@children[:CeilingSystem] = { required:false, type: "CeilingSystemType", value: [] }
end
end
class CeilingSystemType < SimpleElement
def specify_children
@children = {}
@children[:CeilingConstruction] = { required: false, type: "CeilingConstructionType",value: nil }
@children[:CeilingFinish] = { required: false, value: nil }
@children[:CeilingColor] = { required: false, value: nil }
@children[:CeilingInsulation] = { required: false, value: [] }
@children[:CeilingRValue] = { required: false, value: nil }
@children[:CeilingUFactor] = { required: false, value: nil }
@children[:CeilingFramingMaterial] = { required: false, value: nil }
@children[:CeilingFramingSpacing] = { required: false, value: nil }
@children[:CeilingFramingDepth] = { required: false, value: nil }
@children[:CeilingFramingFactor] = { required: false, value: nil }
@children[:CeilingVisibleAbsorbtance] = { required: false, value: nil }
@children[:Quantity] = { required: false, value: nil }
@children[:YearInstalled] = { required: false, value: nil }
#@children[:UserDefinedFields] = { required: false, value: nil }
end
def specify_attributes
@attributes = {}
@attributes[:ID] = { required:false, text: nil }
end
end
class CentralAirDistribution < SimpleElement
def specify_children
@children={}
@children[:AirDeliveryType] = { required: false, value: nil }
@children[:TerminalUnit] = { required: false, value: nil }
@children[:ReheatSource] = { required: false, value: nil }
@children[:ReheatPlantID] = { required: false, value: nil }
#TODO add ReheatControlMethod
end
end
class ChilledWaterSupplyTemperature < SimpleElement; end
class Chiller < SimpleElement
def specify_children
@children={}
@children[:ChillerType] = { required: false, value: nil }
@children[:ChillerCompressorDriver] = { required: false, value: nil }
@children[:CondenserPlantIDs] = { required: false, value: nil }
@children[:AnnualCoolingEfficiencyValue] = { required: false, value: nil }
@children[:AnnualCoolingEfficiencyUnits] = { required: false, value: nil }
@children[:ChilledWaterSupplyTemperature] = { required: false, value: nil }
@children[:Quantity] = { required: false, value: nil }
end
end
class ChillerCompressorDriver < EnumeratedElement
def specify_enums
@enums = ["Electric Motor",
"Steam",
"Gas Turbine",
"Other",
"Unknown"
]
end
end
class ChillerType < EnumeratedElement
def specify_enums
@enums = ["Vapor compression",
"Absorption",
"Other",
"Unknown"
]
end
end
class CompressorStaging < EnumeratedElement
def specify_enums
@enums = ["Single stage",
"Multiple discrete stages",
"Variable",
"Modulating",
"Other",
"Unknown"]
end
end
class CondenserPlantID < SimpleElement
def specify_attributes
@attributes = {}
@attributes[:IDref] = { required:false, text: nil }
end
end
class CondenserPlantIDs < SimpleElement
def specify_children
@children = {}
@children[:CondenserPlantID] = { required: false, value: [] }
end
end
class CondenserPlantType < SimpleElement
def specify_children
@children = {}
@children[:AirCooled] = { required: false, value: nil }
@children[:WaterCooled] = { required: false, value: nil }
@children[:GroundSource] = { required: false, value: nil }
@children[:GlycolCooledDryCooler] = { required: false, value: nil }
end
def specify_attributes
@attributes = {}
@attributes[:ID] = { required:false, text: nil }
end
end
class CondensingOperation < SimpleElement; end
class CondensingTemperature < SimpleElement; end
class CondenserWaterTemperature < SimpleElement; end
class ConditionedVolume < SimpleElement; end
class CoolingDeliveryID < SimpleElement
def specify_attributes
@attributes = {}
@attributes[:ID] = { required: false, value: nil }
end
end
class CoolingPlantType < SimpleElement
def specify_children
@children = {}
@children[:Chiller] = { required: false, value:[]}
end
end
class CoolingSource < SimpleElement
def specify_children
@children={}
@children[:CoolingSourceType] = { required: false, value: nil }
@children[:CoolingMedium] = { required: false, value: nil }
@children[:PrimaryFuel] = { required: false, type:"FuelTypes", value: nil }
@children[:AnnualCoolingEfficiencyValue] = { required: false, value: nil }
@children[:AnnualCoolingEfficiencyUnits] = { required: false, value: nil }
end
def specify_attributes
@attributes={}
@attributes[:ID] = { required: false, value: nil }
end
end
class CoolingSourceType < SimpleElement
def specify_children
@children={}
@children[:CoolingPlantID] = { required: false, value: nil }
@children[:DX] = { required: false, value: nil }
#TODO: Add more as required
end
end
class CoolingPlantID < SimpleElement
def specify_attributes
@attributes = {}
@attributes[:ID] = { required: false, value: nil }
end
end
class CoolingMedium < EnumeratedElement
def specify_enums
@enums = ["Chilled water",
"Refrigerant",
"Air",
"Glycol",
"Other",
"Unknown"]
end
end
class DaylightingIlluminanceSetpoint < SimpleElement; end
class DaylitFloorArea < SimpleElement; end
class DayStartTime < SimpleElement; end
class DayEndTime < SimpleElement; end
class DayType < EnumeratedElement
def specify_enums
@enums = ["AllWeek",
"Weekday",
"Weekend",
"Saturday",
"Sunday",
"Holiday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"]
end
end
class Delivery < SimpleElement
def specify_children
@children={}
@children[:DeliveryType] ={ required: false, value: nil }
@children[:HeatingSourceID] = { required: false, value: nil }
@children[:CoolingSourceID] = { required: false, value: nil }
@children[:Quantity] = { required: false, value: nil }
end
def specify_attributes
@attributes={}
@attributes[:ID] = { required: false, value: nil }
end
end
class DeliveryType < SimpleElement
def specify_children
@children= {}
@children[:FanBased] = { required: false, value: nil }
#TODO: Add more as required
end
end
class HeatingSourceID < IDOnlyElement; end
class CoolingSourceID < IDOnlyElement; end
class DoorID < SimpleElement
def specify_children
@children = {}
@children[:FenestrationArea] = { required: false, value: nil }
end
def specify_attributes
@attributes = {}
@attributes[:IDref] = { required:true, text: nil }
end
end
class DeliveryID < IDOnlyElement; end
class DesignStaticPressure < SimpleElement; end
class DuctSystems < SimpleElement
def specify_children
@children = {}
@children[:DuctSystem] = { required: false, type:"DuctSystemType", value:[] } #TODO: this is DuctSystems in the XSD, is that correct?
end
end
class DuctSystemType < SimpleElement
def specify_children
@children = {}
@children[:Quantity] = { required: false, value: nil }
@children[:HeatingDeliveryID] = { required: false, value: nil }
@children[:CoolingDeliveryID] = { required: false, value: nil }
@children[:Location] = { required: false, value: nil }
@children[:LinkedPremises] = { required: false, value: nil }
end
def specify_attributes
@attributes = {}
@attributes[:ID] = { required: false, text: nil}
end
end
class DX < SimpleElement
def specify_children
@children = {}
@children[:DXSystemType] = { required: false, value: nil }
@children[:CompressorStaging] = { required: false, value: nil }
@children[:CondenserPlantID] = { required: false, value: nil }
end
end
class DXSystemType < EnumeratedElement
def specify_enums
@enums = ["Split DX air conditioner",
"Packaged terminal air conditioner (PTAC)",
"Split heat pump",
"Packaged terminal heat pump (PTHP)",
"Variable refrigerant flow",
"Packaged/unitary direct expansion/RTU",
"Packaged/unitary heat pump",
"Single package vertical air conditioner",
"Single package vertical heat pump",
"Other",
"Unknown"]
end
end
class EconomizerControl < EnumeratedElement
def specify_enums
@enums = ["Fixed",
"Differential",
"Other",
"Unknown"]
end
end
class EconomizerDryBulbControlPoint < SimpleElement; end
class EconomizerEnthalpyControlPoint < SimpleElement; end
class EconomizerLowTemperatureLockout < SimpleElement; end
class EnergyRecoveryEfficiency < SimpleElement; end
class Facilities < SimpleElement
#initialize the Facility Children with a simple type or array
def specify_children
@children = {}
@children[:Facility] = { required:true,type: 'FacilityType',value: [] }
end
end
class FacilityClassification < EnumeratedElement
def specify_enums
@enums = ["Commercial",
"Residential",
"Mixed use commercial",
"Other"]
end
end
class FacilityType < SimpleElement
def specify_children
@children = {}
@children[:PremisesName] = { required:false,value: nil }
@children[:PremisesNotes] = { required:false,value: nil }
@children[:PremisesName] = { required:false,value: nil }
@children[:PremisesIdentifiers] = { required:false,value: nil }
@children[:FacilityClassification] = { required:false,value: nil }
@children[:OccupancyClassification] = { required:false,value: nil }
@children[:OccupancyLevels] = { required:false,value: nil }
@children[:SpatialUnits] = { required:false,value: [] }
@children[:Ownership] = { required:false,value: nil }
@children[:OwnershipStatus] = { required:false,value: nil }
@children[:PrimaryContactID] = { required:false,value: nil }
@children[:PubliclySubsidize] = { required:false,value: nil }
@children[:FederalBuilding] = { required:false,value: nil }
@children[:PortfolioManager] = { required:false,value: nil }
@children[:NumberOfBusinesses] = { required:false,value: nil }
@children[:FloorsAboveGrade] = { required:false,value: nil }
@children[:FloorsBelowGrade] = { required:false,value: nil }
@children[:FloorAreas] = { required:false,value: [] }
@children[:AspectRatio] = { required:false,value: nil }
@children[:Perimeter] = { required:false,value: nil }
@children[:HeightDistribution] = { required:false,value: nil }
@children[:HorizontalSurroundings] = { required:false,value: nil }
@children[:VerticalSurroundings] = { required:false,value: nil }
@children[:Assessment] = { required:false,value: nil }
@children[:YearOfConstruction] = { required:false,value: nil }
@children[:YearOccupied] = { required:false,value: nil }
@children[:YearOfLastEnergyAudit] = { required:false,value: nil }
@children[:RetrocommissioningDate] = { required:false,value: nil }
@children[:YearOfLastRetrofit] = { required:false,value: nil }
@children[:YearOfLastMajorRemodel] = { required:false,value: nil }
@children[:PercentOccupiedByOwner] = { required:false,value: nil }
@children[:OperatorType] = { required:false,value: nil }
@children[:Subsections] = { required:false,value: [] }
@children[:UserDefinedFields] = { required:false,value: [] }
end
end
class FanBased < SimpleElement
def specify_children
@children = {}
@children[:FanBasedDistributionType] = { required: false, value: nil }
@children[:AirSideEconomizer] = { required: false, value: nil }
end
end
class FanBasedDistributionType < SimpleElement
def specify_children
@children = {}
@children[:CentralAirDistribution] = { required: false, value: nil }
#TODO: Add more as required
end
end
class FanApplication < EnumeratedElement
def specify_enums
@enums = ["Supply",
"Return",
"Exhaust",
"Other",
"Unknown"]
end
end
class FanControlType < EnumeratedElement
def specify_enums
@enums = ["Variable Volume",
"Stepped",
"Constant Volume",
"Other",
"Unknown"]
end
end
class FanEfficiency < SimpleElement; end
class FanPlacement < EnumeratedElement
def specify_enums
@enums = ["Series",
"Parallel",
"Draw Through",
"Blow Through",
"Other",
"Unknown"]
end
end
class FanPowerMinimumRatio < SimpleElement; end
class FanSystemType < SimpleElement
def specify_children
@children = {}
@children[:FanEfficiency] = { required: false, value: nil }
@children[:DesignStaticPressure] = { required: false, value: nil }
@children[:FanApplication] = { required: false, value: nil }
@children[:FanControlType] = { required: false, value: nil }
@children[:FanPowerMinimumRatio] = { required: false, value: nil }
@children[:MotorLocationRelativeToAirStream] = { required: false, value: nil }
@children[:FanPlacement] = { required: false, value: nil }
@children[:Quantity] = { required: false, value: nil }
@children[:Location] = { required: false, value: nil }
@children[:LinkedSystemID] = { required: false, value: nil }
#TODO: Add more children as required.
end
def specify_attributes
@attributes = {}
@attributes[:ID] = { required:false, text: nil }
end
end
class FanSystems < SimpleElement
def specify_children
@children = {}
@children[:FanSystem] = { required: false, type:"FanSystemType", value: [] }
end
end
class FenestrationArea < SimpleElement; end
class FenestrationSystems < SimpleElement
def specify_children
@children = {}
@children[:FenestrationSystem] = { required:false, type: "FenestrationSystemType",value: [] }
end
end
class FenestrationSystemType < SimpleElement
def specify_children
@children = {}
@children[:FenestrationType] = { required:false,value: nil }
@children[:FenestrationFrameMaterial] = { required:false,value: nil }
@children[:FenestrationOperation] = { required:false,value: nil }
@children[:WeatherStripped] = { required:false,value: nil } #bool
@children[:TightnessFitCondition] = { required:false,value: nil }
@children[:GlassType] = { required:false,value: nil }
@children[:FenestrationGasFill] = { required:false,value: nil }
@children[:FenestrationGlassLayers] = { required:false,value: nil }
@children[:FenestrationRValue] = { required:false,value: nil }
@children[:FenestrationUFactor] = { required:false,value: nil }
@children[:SolarHeatGainCoefficient] = { required:false,value: nil }
@children[:VisibleTransmittance] = { required:false,value: nil }
@children[:ThirdPartyCertification] = { required:false,value: nil }
@children[:Quantity] = { required:false,value: nil }
@children[:YearInstalled] = { required:false,value: nil }
@children[:Manufacturer] = { required:false,value: nil }
@children[:ModelNumber] = { required:false,value: nil }
#@children[:UserDefinedFields] = { required:false,value: nil }
end
def specify_attributes
@attributes = {}
@attributes[:ID] = { required:false, text: nil }
@attributes[:Status] = { required:false, text: nil }
end
end
class FloorAreas < SimpleElement
def specify_children
@children = {}
@children[:FloorArea] = { required:false, value: [] }
end
end
class FloorArea < SimpleElement
def specify_children
@children = {}
@children[:FloorAreaType] = { required:false, value: nil }
@children[:FloorAreaCustomName] = { required:false, value: nil }
@children[:FloorAreaValue] = { required:false, value: nil }
@children[:Story] = { required:false, value: nil }
end
end
class FloorAreaCustomName < SimpleElement; end
class FloorAreaValue < SimpleElement; end
class FloorAreaType < EnumeratedElement
def specify_enums
@enums = ["Gross",
"Net",
"Finished",
"Footprint",
"Rentable",
"Occupied",
"Lighted",
"Daylit",
"Heated",
"Cooled",
"Conditioned",
"Unconditioned",
"Semi-conditioned",
"Heated and Cooled",
"Heated only",
"Cooled only",
"Ventilated",
"Enclosed",
"Non-Enclosed",
"Open",
"Lot",
"Custom"]
end
end
class FloorToFloorHeight < SimpleElement; end
class FloorToCeilingHeight < SimpleElement; end
class FloorsAboveGrade < SimpleElement; end
class FloorsBelowGrade < SimpleElement; end
class FloorsPartiallyBelowGrade < SimpleElement; end
class FootprintShape < EnumeratedElement
def specify_enums
@enums = ["Rectangular",
"L-Shape",
"U-Shape",
"H-Shape",
"T-Shape",
"O-Shape",
"Other",
"Unknown"
]
end
end
class FoundationArea < SimpleElement; end
class FoundationID < SimpleElement
def specify_children
@children = {}
@children[:FoundationArea] = { required:false, value: nil }
@children[:ThermalZoneID] = { required:false, value: nil }
@children[:SpaceID] = { required:false, value: nil }
end
def specify_attributes
@attributes = {}
@attributes[:IDref] = { required:true, text: nil }
end
end
class FoundationSystems < SimpleElement
def specify_children
@children = {}
@children[:FoundationSystem] = { required:false, type: "FoundationSystemType",value: [] }
end
end
class FoundationSystemType < SimpleElement
def specify_children
@children = {}
@children[:GroundCoupling] = { required:true, value: [] }
@children[:FloorCovering] = { required:true, value: nil }
@children[:FloorConstructionType] = { required:true, type: "EnvelopeConstructionType",value: nil }
@children[:PlumbingPenetrationSealing] = { required:true, value: nil }
@children[:YearInstalled] = { required:true, value: nil }
@children[:Quantity] = { required:true, value: nil }
#@children[:UserDefinedFields] = { required:true, value: nil }
end
def specify_attributes
@attributes = {}
@attributes[:ID] = { required:false, text: nil }
@attributes[:Status] = { required:false, text: nil }
end
end
class FuelTypes < EnumeratedElement
def specify_enums
@enums = ["Electricity",
"Natural gas",
"Fuel oil",
"Fuel oil no 1",
"Fuel oil no 2",
"Fuel oil no 4",
"Fuel oil no 5 and no 6",
"District steam",
"District hot water",
"District chilled water",