Class: BTAP::EQuest::ConstructionManager

Inherits:
Object
  • Object
show all
Defined in:
lib/openstudio-standards/btap/equest.rb

Overview

This class manages all of the constructions that are used in the simulation. It should remove any constructions that are doubly defined in the project.

Defined Under Namespace

Classes: Construction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConstructionManager

Returns a new instance of ConstructionManager.



2492
2493
2494
2495
# File 'lib/openstudio-standards/btap/equest.rb', line 2492

def initialize
  @constructions = Array.new()
  @layer_manager = LayerManager.instance()
end

Instance Attribute Details

#constructionsObject

An array containing all the constructions.



2443
2444
2445
# File 'lib/openstudio-standards/btap/equest.rb', line 2443

def constructions
  @constructions
end

#layer_managerObject

The layer manager all the constructions.



2446
2447
2448
# File 'lib/openstudio-standards/btap/equest.rb', line 2446

def layer_manager
  @layer_manager
end

Instance Method Details

#add_construction(new_construction) ⇒ Object

Adds a new construction to the construction array. Arg must be a construction object.



2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
# File 'lib/openstudio-standards/btap/equest.rb', line 2500

def add_construction(new_construction)
  #first determine if the layer already exists.
  @constructions.each do  |current_construction|
    if new_construction == current_construction
      return current_construction
    end
  end
  new_construction.layers.each do |new_layer|
    #If the new layer already exists...use the old one instead.
    # it is the layerManager's job to decide this.
    new_layer = @layer_manager.add_layer(new_layer)
  end
  @constructions.push(new_construction)
  return @constructions.last()
end

#clearObject



2516
2517
2518
2519
# File 'lib/openstudio-standards/btap/equest.rb', line 2516

def clear()
  @constructions.clear()
  @layer_manager.clear()
end