Skip to content

Commit

Permalink
fix(openstudio): Fix OpenStudio version checks to work with OpenStudi…
Browse files Browse the repository at this point in the history
…o 3.X
  • Loading branch information
chriswmackey committed Jul 12, 2020
1 parent 393c13c commit 42c2b47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Honeybee_Export To OpenStudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

ghenv.Component.Name = "Honeybee_Export To OpenStudio"
ghenv.Component.NickName = 'exportToOpenStudio'
ghenv.Component.Message = 'VER 0.0.66\nJUL_07_2020'
ghenv.Component.Message = 'VER 0.0.66\nJUL_12_2020'
ghenv.Component.IconDisplayMode = ghenv.Component.IconDisplayMode.application
ghenv.Component.Category = "HB-Legacy"
ghenv.Component.SubCategory = "10 | Energy | Energy"
Expand Down Expand Up @@ -835,7 +835,7 @@ def getOSShdCntrl(self, shdCntrlName, parent_zone, model):
if values[3][0] != '':
### Openstudio currently does not support any shading control other than OnIfHighSolarOnWindow.
# As such, there is a workaround above for now.
if values[3][0] == 'OnIfHighSolarOnWindow' or (vernum1 >=2 and vernum2 >= 8):
if values[3][0] == 'OnIfHighSolarOnWindow' or (vernum1 >2 or (vernum1 == 2 and vernum2 >= 8)):
OSShdCntrl.setShadingControlType(str(values[3][0]))
else:
self.replaceShdCntrl = True
Expand Down Expand Up @@ -1665,7 +1665,7 @@ def createPrimaryAirLoop(self, airType, model, thermalZones, hbZones, airDetails
elif airDetails != None and airDetails.airsideEconomizer != 'Default' and airDetails.airsideEconomizer != 'NoEconomizer':
airTerminal = ops.AirTerminalSingleDuctVAVNoReheat(model, model.alwaysOnDiscreteSchedule())
elif hbZones[zCount].recirculatedAirPerArea == 0:
if vernum1 >= 2 and vernum2 >= 7:
if vernum1 > 2 or (vernum1 == 2 and vernum2 >= 7):
airTerminal = ops.AirTerminalSingleDuctConstantVolumeNoReheat(model, model.alwaysOnDiscreteSchedule())
else:
airTerminal = ops.AirTerminalSingleDuctUncontrolled(model, model.alwaysOnDiscreteSchedule())
Expand Down Expand Up @@ -1776,7 +1776,7 @@ def addZoneToAirLoop(self, airloopPrimary, airType, model, thermalZones, hbZones
elif airDetails != None and airDetails.airsideEconomizer != 'Default' and airDetails.airsideEconomizer != 'NoEconomizer':
airTerminal = ops.AirTerminalSingleDuctVAVNoReheat(model, model.alwaysOnDiscreteSchedule())
elif hbZones[zCount].recirculatedAirPerArea == 0:
if vernum1 >= 2 and vernum2 >= 7:
if vernum1 > 2 or (vernum1 == 2 and vernum2 >= 7):
airTerminal = ops.AirTerminalSingleDuctConstantVolumeNoReheat(model, model.alwaysOnDiscreteSchedule())
else:
airTerminal = ops.AirTerminalSingleDuctUncontrolled(model, model.alwaysOnDiscreteSchedule())
Expand Down Expand Up @@ -5028,7 +5028,7 @@ def writeNonOSFeatures(self, idfFilePath, HBZones, simParameters, workingDir):
lines.append(otherFeatureClass.createCSVSchedString(schedule))

# If a start day of the week is specified, change it.
if vernum1 <= 2 and vernum2 < 7:
if vernum1 < 2 or (vernum1 == 2 and vernum2 < 7):
magic_num = 7
default_d = "UseWeatherFile"
else:
Expand Down
Binary file modified userObjects/Honeybee_Export To OpenStudio.ghuser
Binary file not shown.

0 comments on commit 42c2b47

Please sign in to comment.