epb_view_models 1.0.0 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.buildspec.yml +13 -0
- data/.gitignore +5 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +22 -17
- data/Makefile +1 -1
- data/api/schemas/xml/RdSAP-Schema-NI-19.0/RdSAP/Templates/EPC-CollectedData.xsd +13 -12
- data/lib/epb_view_models.rb +1 -1
- data/lib/helper/ac_report_extraction.rb +26 -28
- data/lib/helper/energy_band_calculator.rb +1 -1
- data/lib/helper/xml_enums_to_output.rb +286 -126
- data/lib/presenter/cepc/report.rb +5 -2
- data/lib/presenter/dec/report.rb +5 -2
- data/lib/presenter/export/domestic.rb +1 -1
- data/lib/presenter/rd_sap/report.rb +213 -5
- data/lib/presenter/sap/report.rb +213 -4
- data/lib/presenter/sap/summary.rb +1 -1
- data/lib/view_model/cepc50/cepc.rb +0 -4
- data/lib/view_model/cepc60/cepc.rb +0 -4
- data/lib/view_model/cepc71/dec.rb +0 -4
- data/lib/view_model/cepc_ni800/ac_report.rb +3 -2
- data/lib/view_model/domestic_epc_view_model.rb +4 -0
- data/lib/view_model/rd_sap_schema_170/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_171/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_180/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_190/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_200/common_schema.rb +16 -8
- data/lib/view_model/rd_sap_schema_ni_173/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_ni_174/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_ni_180/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_ni_190/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_ni_200/common_schema.rb +16 -4
- data/lib/view_model/rd_sap_wrapper.rb +4 -0
- data/lib/view_model/sap_schema_102/common_schema.rb +33 -10
- data/lib/view_model/sap_schema_102/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_110/common_schema.rb +1 -10
- data/lib/view_model/sap_schema_110/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_110/sap.rb +36 -0
- data/lib/view_model/sap_schema_112/common_schema.rb +1 -10
- data/lib/view_model/sap_schema_112/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_112/sap.rb +36 -0
- data/lib/view_model/sap_schema_120/common_schema.rb +0 -12
- data/lib/view_model/sap_schema_120/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_120/sap.rb +36 -0
- data/lib/view_model/sap_schema_130/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_130/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_130/sap.rb +36 -0
- data/lib/view_model/sap_schema_140/common_schema.rb +0 -8
- data/lib/view_model/sap_schema_140/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_140/sap.rb +36 -0
- data/lib/view_model/sap_schema_141/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_141/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_141/sap.rb +36 -0
- data/lib/view_model/sap_schema_142/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_142/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_142/sap.rb +36 -0
- data/lib/view_model/sap_schema_150/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_150/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_150/sap.rb +36 -0
- data/lib/view_model/sap_schema_160/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_160/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_160/sap.rb +36 -0
- data/lib/view_model/sap_schema_161/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_161/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_161/sap.rb +36 -0
- data/lib/view_model/sap_schema_162/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_162/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_162/sap.rb +36 -0
- data/lib/view_model/sap_schema_163/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_163/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_163/sap.rb +36 -0
- data/lib/view_model/sap_schema_170/common_schema.rb +32 -0
- data/lib/view_model/sap_schema_171/common_schema.rb +32 -4
- data/lib/view_model/sap_schema_1800/common_schema.rb +32 -8
- data/lib/view_model/sap_schema_ni_112/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_112/rdsap.rb +45 -4
- data/lib/view_model/sap_schema_ni_112/sap.rb +35 -0
- data/lib/view_model/sap_schema_ni_120/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_120/rdsap.rb +40 -0
- data/lib/view_model/sap_schema_ni_120/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_130/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_130/rdsap.rb +40 -0
- data/lib/view_model/sap_schema_ni_130/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_140/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_140/rdsap.rb +40 -0
- data/lib/view_model/sap_schema_ni_140/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_141/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_141/rdsap.rb +40 -0
- data/lib/view_model/sap_schema_ni_141/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_142/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_142/rdsap.rb +40 -0
- data/lib/view_model/sap_schema_ni_142/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_150/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_150/rdsap.rb +40 -0
- data/lib/view_model/sap_schema_ni_150/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_160/common_schema.rb +2 -6
- data/lib/view_model/sap_schema_ni_160/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_ni_160/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_161/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_161/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_ni_161/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_170/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_170/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_ni_170/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_171/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_171/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_ni_171/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_172/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_172/rdsap.rb +44 -0
- data/lib/view_model/sap_schema_ni_172/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_173/common_schema.rb +32 -0
- data/lib/view_model/sap_schema_ni_174/common_schema.rb +32 -0
- data/lib/view_model/sap_schema_ni_1800/common_schema.rb +32 -22
- data/lib/view_model/sap_wrapper.rb +4 -0
- metadata +4 -2
@@ -150,7 +150,7 @@ module Presenter
|
|
150
150
|
wind_turbine_count: @view_model.wind_turbine_count,
|
151
151
|
unheated_corridor_length: @view_model.unheated_corridor_length,
|
152
152
|
built_form:
|
153
|
-
Helper::XmlEnumsToOutput.
|
153
|
+
Helper::XmlEnumsToOutput.built_form_string(@view_model.built_form),
|
154
154
|
mainheat_description:
|
155
155
|
@view_model.all_main_heating_descriptions.join(", "),
|
156
156
|
extensions_count:
|
@@ -10,12 +10,13 @@ module ViewModel
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def extract_aci_recommendations(nodes)
|
13
|
-
nodes.map
|
13
|
+
recommendations = nodes.map do |node|
|
14
14
|
{
|
15
15
|
sequence: node.at("Seq-Number").content,
|
16
16
|
text: node.at("Text").content,
|
17
17
|
}
|
18
|
-
|
18
|
+
end
|
19
|
+
recommendations.reject { |node| node[:text].nil? || node[:text].empty? }
|
19
20
|
end
|
20
21
|
|
21
22
|
def key_recommendations_efficiency
|
@@ -514,6 +514,22 @@ module ViewModel
|
|
514
514
|
end
|
515
515
|
nil
|
516
516
|
end
|
517
|
+
|
518
|
+
def cylinder_insul_thickness
|
519
|
+
xpath(%w[Cylinder-Insulation-Thickness])
|
520
|
+
end
|
521
|
+
|
522
|
+
def cylinder_insulation_type
|
523
|
+
xpath(%w[Cylinder-Insulation-Type])
|
524
|
+
end
|
525
|
+
|
526
|
+
def cylinder_size
|
527
|
+
xpath(%w[Cylinder-Size])
|
528
|
+
end
|
529
|
+
|
530
|
+
def has_cylinder_thermostat
|
531
|
+
xpath(%w[Cylinder-Thermostat])
|
532
|
+
end
|
517
533
|
end
|
518
534
|
end
|
519
535
|
end
|
@@ -514,6 +514,22 @@ module ViewModel
|
|
514
514
|
end
|
515
515
|
nil
|
516
516
|
end
|
517
|
+
|
518
|
+
def cylinder_insul_thickness
|
519
|
+
xpath(%w[Cylinder-Insulation-Thickness])
|
520
|
+
end
|
521
|
+
|
522
|
+
def cylinder_insulation_type
|
523
|
+
xpath(%w[Cylinder-Insulation-Type])
|
524
|
+
end
|
525
|
+
|
526
|
+
def cylinder_size
|
527
|
+
xpath(%w[Cylinder-Size])
|
528
|
+
end
|
529
|
+
|
530
|
+
def has_cylinder_thermostat
|
531
|
+
xpath(%w[Cylinder-Thermostat])
|
532
|
+
end
|
517
533
|
end
|
518
534
|
end
|
519
535
|
end
|
@@ -514,6 +514,22 @@ module ViewModel
|
|
514
514
|
end
|
515
515
|
nil
|
516
516
|
end
|
517
|
+
|
518
|
+
def cylinder_insul_thickness
|
519
|
+
xpath(%w[Cylinder-Insulation-Thickness])
|
520
|
+
end
|
521
|
+
|
522
|
+
def cylinder_insulation_type
|
523
|
+
xpath(%w[Cylinder-Insulation-Type])
|
524
|
+
end
|
525
|
+
|
526
|
+
def cylinder_size
|
527
|
+
xpath(%w[Cylinder-Size])
|
528
|
+
end
|
529
|
+
|
530
|
+
def has_cylinder_thermostat
|
531
|
+
xpath(%w[Cylinder-Thermostat])
|
532
|
+
end
|
517
533
|
end
|
518
534
|
end
|
519
535
|
end
|
@@ -514,6 +514,22 @@ module ViewModel
|
|
514
514
|
end
|
515
515
|
nil
|
516
516
|
end
|
517
|
+
|
518
|
+
def cylinder_insul_thickness
|
519
|
+
xpath(%w[Cylinder-Insulation-Thickness])
|
520
|
+
end
|
521
|
+
|
522
|
+
def cylinder_insulation_type
|
523
|
+
xpath(%w[Cylinder-Insulation-Type])
|
524
|
+
end
|
525
|
+
|
526
|
+
def cylinder_size
|
527
|
+
xpath(%w[Cylinder-Size])
|
528
|
+
end
|
529
|
+
|
530
|
+
def has_cylinder_thermostat
|
531
|
+
xpath(%w[Cylinder-Thermostat])
|
532
|
+
end
|
517
533
|
end
|
518
534
|
end
|
519
535
|
end
|
@@ -297,10 +297,6 @@ module ViewModel
|
|
297
297
|
@xml_doc.search("Secondary-Heating/Description").map(&:content)
|
298
298
|
end
|
299
299
|
|
300
|
-
def all_main_heating_controls_descriptions
|
301
|
-
@xml_doc.search("Main-Heating-Controls/Description").map(&:content)
|
302
|
-
end
|
303
|
-
|
304
300
|
def all_sap_floor_dimensions
|
305
301
|
@xml_doc.search("SAP-Floor-Dimension").select(&:element?).map { |node|
|
306
302
|
{ total_floor_area: xpath(%w[Total-Floor-Area], node).to_f }
|
@@ -350,10 +346,6 @@ module ViewModel
|
|
350
346
|
xpath(%w[Floor-Heat-Loss])
|
351
347
|
end
|
352
348
|
|
353
|
-
def water_heating_code
|
354
|
-
xpath(%w[Water-Heating-Code])
|
355
|
-
end
|
356
|
-
|
357
349
|
def immersion_heating_type
|
358
350
|
xpath(%w[Immersion-Heating-Type])
|
359
351
|
end
|
@@ -579,6 +571,22 @@ module ViewModel
|
|
579
571
|
end
|
580
572
|
nil
|
581
573
|
end
|
574
|
+
|
575
|
+
def cylinder_insul_thickness
|
576
|
+
xpath(%w[Cylinder-Insulation-Thickness])
|
577
|
+
end
|
578
|
+
|
579
|
+
def cylinder_insulation_type
|
580
|
+
xpath(%w[Cylinder-Insulation-Type])
|
581
|
+
end
|
582
|
+
|
583
|
+
def cylinder_size
|
584
|
+
xpath(%w[Cylinder-Size])
|
585
|
+
end
|
586
|
+
|
587
|
+
def has_cylinder_thermostat
|
588
|
+
xpath(%w[Cylinder-Thermostat])
|
589
|
+
end
|
582
590
|
end
|
583
591
|
end
|
584
592
|
end
|
@@ -503,6 +503,22 @@ module ViewModel
|
|
503
503
|
end
|
504
504
|
nil
|
505
505
|
end
|
506
|
+
|
507
|
+
def cylinder_insul_thickness
|
508
|
+
xpath(%w[Cylinder-Insulation-Thickness])
|
509
|
+
end
|
510
|
+
|
511
|
+
def cylinder_insulation_type
|
512
|
+
xpath(%w[Cylinder-Insulation-Type])
|
513
|
+
end
|
514
|
+
|
515
|
+
def cylinder_size
|
516
|
+
xpath(%w[Cylinder-Size])
|
517
|
+
end
|
518
|
+
|
519
|
+
def has_cylinder_thermostat
|
520
|
+
xpath(%w[Cylinder-Thermostat])
|
521
|
+
end
|
506
522
|
end
|
507
523
|
end
|
508
524
|
end
|
@@ -503,6 +503,22 @@ module ViewModel
|
|
503
503
|
end
|
504
504
|
nil
|
505
505
|
end
|
506
|
+
|
507
|
+
def cylinder_insul_thickness
|
508
|
+
xpath(%w[Cylinder-Insulation-Thickness])
|
509
|
+
end
|
510
|
+
|
511
|
+
def cylinder_insulation_type
|
512
|
+
xpath(%w[Cylinder-Insulation-Type])
|
513
|
+
end
|
514
|
+
|
515
|
+
def cylinder_size
|
516
|
+
xpath(%w[Cylinder-Size])
|
517
|
+
end
|
518
|
+
|
519
|
+
def has_cylinder_thermostat
|
520
|
+
xpath(%w[Cylinder-Thermostat])
|
521
|
+
end
|
506
522
|
end
|
507
523
|
end
|
508
524
|
end
|
@@ -503,6 +503,22 @@ module ViewModel
|
|
503
503
|
end
|
504
504
|
nil
|
505
505
|
end
|
506
|
+
|
507
|
+
def cylinder_insul_thickness
|
508
|
+
xpath(%w[Cylinder-Insulation-Thickness])
|
509
|
+
end
|
510
|
+
|
511
|
+
def cylinder_insulation_type
|
512
|
+
xpath(%w[Cylinder-Insulation-Type])
|
513
|
+
end
|
514
|
+
|
515
|
+
def cylinder_size
|
516
|
+
xpath(%w[Cylinder-Size])
|
517
|
+
end
|
518
|
+
|
519
|
+
def has_cylinder_thermostat
|
520
|
+
xpath(%w[Cylinder-Thermostat])
|
521
|
+
end
|
506
522
|
end
|
507
523
|
end
|
508
524
|
end
|
@@ -503,6 +503,22 @@ module ViewModel
|
|
503
503
|
end
|
504
504
|
nil
|
505
505
|
end
|
506
|
+
|
507
|
+
def cylinder_insul_thickness
|
508
|
+
xpath(%w[Cylinder-Insulation-Thickness])
|
509
|
+
end
|
510
|
+
|
511
|
+
def cylinder_insulation_type
|
512
|
+
xpath(%w[Cylinder-Insulation-Type])
|
513
|
+
end
|
514
|
+
|
515
|
+
def cylinder_size
|
516
|
+
xpath(%w[Cylinder-Size])
|
517
|
+
end
|
518
|
+
|
519
|
+
def has_cylinder_thermostat
|
520
|
+
xpath(%w[Cylinder-Thermostat])
|
521
|
+
end
|
506
522
|
end
|
507
523
|
end
|
508
524
|
end
|
@@ -333,10 +333,6 @@ module ViewModel
|
|
333
333
|
xpath(%w[Floor-Heat-Loss])
|
334
334
|
end
|
335
335
|
|
336
|
-
def water_heating_code
|
337
|
-
xpath(%w[Water-Heating-Code])
|
338
|
-
end
|
339
|
-
|
340
336
|
def immersion_heating_type
|
341
337
|
xpath(%w[Immersion-Heating-Type])
|
342
338
|
end
|
@@ -566,6 +562,22 @@ module ViewModel
|
|
566
562
|
end
|
567
563
|
nil
|
568
564
|
end
|
565
|
+
|
566
|
+
def cylinder_insulation_type
|
567
|
+
xpath(%w[Cylinder-Insulation-Type])
|
568
|
+
end
|
569
|
+
|
570
|
+
def cylinder_insul_thickness
|
571
|
+
xpath(%w[Cylinder-Insulation-Thickness])
|
572
|
+
end
|
573
|
+
|
574
|
+
def cylinder_size
|
575
|
+
xpath(%w[Cylinder-Size])
|
576
|
+
end
|
577
|
+
|
578
|
+
def has_cylinder_thermostat
|
579
|
+
xpath(%w[Cylinder-Thermostat])
|
580
|
+
end
|
569
581
|
end
|
570
582
|
end
|
571
583
|
end
|
@@ -244,10 +244,6 @@ module ViewModel
|
|
244
244
|
xpath(%w[Secondary-Fuel-Type])
|
245
245
|
end
|
246
246
|
|
247
|
-
def water_heating_fuel
|
248
|
-
xpath(%w[Water-Fuel-Type])
|
249
|
-
end
|
250
|
-
|
251
247
|
def type_of_assessment
|
252
248
|
case xpath(%w[Report-Type]).to_i
|
253
249
|
when 1
|
@@ -377,8 +373,7 @@ module ViewModel
|
|
377
373
|
end
|
378
374
|
|
379
375
|
def built_form
|
380
|
-
|
381
|
-
Helper::XmlEnumsToOutput.xml_value_to_string(built_form_value)
|
376
|
+
xpath(%w[Built-Form])
|
382
377
|
end
|
383
378
|
|
384
379
|
def unheated_corridor_length
|
@@ -437,10 +432,6 @@ module ViewModel
|
|
437
432
|
xpath(%w[Electricity-Tariff])
|
438
433
|
end
|
439
434
|
|
440
|
-
def all_main_heating_energy_efficiency
|
441
|
-
@xml_doc.search("Main-Heating/Energy-Efficiency-Rating").map(&:content)
|
442
|
-
end
|
443
|
-
|
444
435
|
def solar_water_heating_flag
|
445
436
|
nil
|
446
437
|
end
|
@@ -490,6 +481,38 @@ module ViewModel
|
|
490
481
|
.search("Main-Heating/Environmental-Efficiency-Rating")
|
491
482
|
.map(&:content)
|
492
483
|
end
|
484
|
+
|
485
|
+
def cylinder_insul_thickness
|
486
|
+
xpath(%w[Cylinder-Insulation-Thickness])
|
487
|
+
end
|
488
|
+
|
489
|
+
def cylinder_insulation_type
|
490
|
+
xpath(%w[Cylinder-Insulation-Type])
|
491
|
+
end
|
492
|
+
|
493
|
+
def cylinder_size
|
494
|
+
xpath(%w[Cylinder-Size])
|
495
|
+
end
|
496
|
+
|
497
|
+
def has_cylinder_thermostat
|
498
|
+
nil
|
499
|
+
end
|
500
|
+
|
501
|
+
def mech_vent_sys_index_number
|
502
|
+
nil
|
503
|
+
end
|
504
|
+
|
505
|
+
def mechanical_vent_data_source
|
506
|
+
nil
|
507
|
+
end
|
508
|
+
|
509
|
+
def thermal_store
|
510
|
+
nil
|
511
|
+
end
|
512
|
+
|
513
|
+
def ventilation_type
|
514
|
+
nil
|
515
|
+
end
|
493
516
|
end
|
494
517
|
end
|
495
518
|
end
|
@@ -248,10 +248,6 @@ module ViewModel
|
|
248
248
|
xpath(%w[Secondary-Fuel-Type])
|
249
249
|
end
|
250
250
|
|
251
|
-
def water_heating_fuel
|
252
|
-
xpath(%w[Water-Fuel-Type])
|
253
|
-
end
|
254
|
-
|
255
251
|
def type_of_assessment
|
256
252
|
case xpath(%w[Report-Type]).to_i
|
257
253
|
when 1
|
@@ -381,8 +377,7 @@ module ViewModel
|
|
381
377
|
end
|
382
378
|
|
383
379
|
def built_form
|
384
|
-
|
385
|
-
Helper::XmlEnumsToOutput.xml_value_to_string(built_form_value)
|
380
|
+
xpath(%w[Built-Form])
|
386
381
|
end
|
387
382
|
|
388
383
|
def unheated_corridor_length
|
@@ -397,10 +392,6 @@ module ViewModel
|
|
397
392
|
xpath(%w[Wind-Turbines-Count])
|
398
393
|
end
|
399
394
|
|
400
|
-
def unheated_corridor_length
|
401
|
-
xpath(%w[Unheated-Corridor-Length])
|
402
|
-
end
|
403
|
-
|
404
395
|
def all_main_heating_descriptions
|
405
396
|
@xml_doc.search("Main-Heating/Description").map(&:content)
|
406
397
|
end
|