Class: EnergyPlus::EpwFile

Inherits:
Object
  • Object
show all
Defined in:
lib/energyplus/EpwFile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ EpwFile

Returns a new instance of EpwFile.



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/energyplus/EpwFile.rb', line 38

def initialize(path)
  @path = Pathname.new(path)
  @city = ""
  @state = ""
  @country = ""
  @typ = ""
  @wmo = ""
  @lat = ""
  @lon = ""
  @gmt = ""
  @elevation = ""
  @url = ""
  init
end

Instance Attribute Details

#cityObject

Returns the value of attribute city.



27
28
29
# File 'lib/energyplus/EpwFile.rb', line 27

def city
  @city
end

#countryObject

Returns the value of attribute country.



29
30
31
# File 'lib/energyplus/EpwFile.rb', line 29

def country
  @country
end

#elevationObject

Returns the value of attribute elevation.



35
36
37
# File 'lib/energyplus/EpwFile.rb', line 35

def elevation
  @elevation
end

#gmtObject

Returns the value of attribute gmt.



34
35
36
# File 'lib/energyplus/EpwFile.rb', line 34

def gmt
  @gmt
end

#latObject

Returns the value of attribute lat.



32
33
34
# File 'lib/energyplus/EpwFile.rb', line 32

def lat
  @lat
end

#lonObject

Returns the value of attribute lon.



33
34
35
# File 'lib/energyplus/EpwFile.rb', line 33

def lon
  @lon
end

#pathObject

Returns the value of attribute path.



26
27
28
# File 'lib/energyplus/EpwFile.rb', line 26

def path
  @path
end

#stateObject

Returns the value of attribute state.



28
29
30
# File 'lib/energyplus/EpwFile.rb', line 28

def state
  @state
end

#typObject

Returns the value of attribute typ.



30
31
32
# File 'lib/energyplus/EpwFile.rb', line 30

def typ
  @typ
end

#urlObject

Returns the value of attribute url.



36
37
38
# File 'lib/energyplus/EpwFile.rb', line 36

def url
  @url
end

#wmoObject

Returns the value of attribute wmo.



31
32
33
# File 'lib/energyplus/EpwFile.rb', line 31

def wmo
  @wmo
end

Instance Method Details

#toKml(xml) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/energyplus/EpwFile.rb', line 53

def toKml(xml)
  xml.Placemark {
    xml.name @city
    xml.visibility "0"
    xml.description {
      xml.cdata!("<img src=\"kml/ep_header8.png\" width=180 align=right><br><table><tr><td colspan=\"2\">"+
                 "<b>#{@city}</b></href></td></tr>\n"+
       #"<tr><td></td><td><b>Data Type</td></tr>\n"+
       "<tr><td></td><td>WMO <b>#{@wmo}</b></td></tr>\n"+
       #"<tr><td></td><td>E   3� 15'   N 36� 43'</td></tr>\n"+
     #"<tr><td></td><td><b>25</b> m</td></tr>\n"+
     "<tr><td></td><td>Time Zone GMT <b>#{@gmt}</b> hours</td></tr>\n"+
     #"<tr><td></td><td>ASHRAE Std 169 Climate Zone <b>4A - Mixed - Humid</b></td></tr>\n"+
     #"<tr><td></td><td>99% Heating DB=<b>3.1</b>, 1% Cooling DB=<b>33.2</b></td></tr>\n"+
     #"<tr><td></td><td>HDD18 <b>1019</b>, CDD10 <b>2849</b></td></tr>\n"+
     "<tr><td></td><td>URL #{@url}</td></tr></table>")
    }
    xml.styleUrl "#weatherlocation"
    xml.Point {
      xml.altitudeMode "absolute"
      xml.coordinates "#{@lon},#{@lat},#{elevation}"
    }
  }
end

#valid?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/energyplus/EpwFile.rb', line 78

def valid?
  return @valid
end