First time here? Check out the Help page!
1 | initial version |
Currently, OpenStudio can report the model version, but there is not a definitive method or test for which version of the OpenStudio _codebase_ (1.x or 2.x) a measure is currently running within. The following crude method was added to the Radiance measure to provide a more definitive OS-version test. While both OS versions are extant, you may want to implement something like to maintain backward compatibility this in your own measures:
def got_2x
v2 = true
begin
got_workflow = OpenStudio::WorkflowJSON # i can haz wofkflow gem?
rescue NameError
v2 = false
return v2
end
return v2
end
e.g.
if !got_2x
# find EnergyPlus with 1.x Runmanager
co = OpenStudio::Runmanager::ConfigOptions.new
co.fastFindEnergyPlus
else
require 'openstudio-workflow' #OS2.x only
epp = OpenStudio::getEnergyPlusExecutable() # yeah, you know me
You get the idea.
2 | No.2 Revision |
Currently, OpenStudio can report the model version, but there is not a definitive method or test for which version of the OpenStudio _codebase_ (1.x or 2.x) a measure is currently running within. The following crude method was added to the Radiance measure to provide a more definitive OS-version test. While both OS versions are extant, you may want to implement something like to maintain backward compatibility this in your own measures:
def got_2x
v2 = true
begin
got_workflow = OpenStudio::WorkflowJSON # i can haz wofkflow gem?
rescue NameError
v2 = false
return v2
end
return v2
end
e.g.
if !got_2x
# find EnergyPlus with 1.x Runmanager
co = OpenStudio::Runmanager::ConfigOptions.new
co.fastFindEnergyPlus
else
require 'openstudio-workflow' #OS2.x only
epp = OpenStudio::getEnergyPlusExecutable() # yeah, you know me
end
You get the idea.
3 | No.3 Revision |
Currently, OpenStudio can report the model version, but there is not a definitive method or test for which version of the OpenStudio _codebase_ (1.x or 2.x) a measure is currently running within. The following crude method was added to the Radiance measure to provide a more definitive OS-version test. While both OS versions are extant, you may want to implement something like to maintain backward compatibility this in your own measures:
def got_2x
v2 = true
begin
got_workflow = OpenStudio::WorkflowJSON # i can haz wofkflow gem?
rescue NameError
v2 = false
return v2
end
return v2
end
e.g.
if !got_2x
# find EnergyPlus with 1.x Runmanager
co = OpenStudio::Runmanager::ConfigOptions.new
co.fastFindEnergyPlus
else
require 'openstudio-workflow' #OS2.x only
epp = OpenStudio::getEnergyPlusExecutable() # yeah, you know me
end
You get the idea.
4 | No.4 Revision |
Currently, OpenStudio can report the model version, but there is not a definitive method or test for which version of the OpenStudio _codebase_ codebase (1.x or 2.x) a measure is currently running within. The following crude method was added to the Radiance measure to provide a more definitive OS-version test. While test; while both OS versions are extant, you may want to implement something like this to maintain backward compatibility in your own measures:measures as well:
def got_2x
v2 = true
begin
got_workflow = OpenStudio::WorkflowJSON # i can haz wofkflow gem?
rescue NameError
v2 = false
return v2
end
return v2
end
e.g.
if !got_2x
# find EnergyPlus with 1.x Runmanager
co = OpenStudio::Runmanager::ConfigOptions.new
co.fastFindEnergyPlus
else
require 'openstudio-workflow' #OS2.x only
epp = OpenStudio::getEnergyPlusExecutable() # yeah, you know me
end
You get the idea.