Skip to content

Commit

Permalink
customObject update
Browse files Browse the repository at this point in the history
  • Loading branch information
shirubana committed Sep 20, 2022
1 parent 5f9de36 commit ca12fae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion bifacial_radiance/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,12 @@ def boolConvert(d):
moduleParamsDict['customtext'] = moduleParamsDict2['customtext']
except:
moduleParamsDict['customtext'] = ''


try:
moduleParamsDict['customObject'] = moduleParamsDict2['customObject']
except:
moduleParamsDict['customObject'] = ''

if simulationParamsDict['cellLevelModule']:
if config.has_section("cellLevelModuleParamsDict"):
cellLevelModuleParamsDict = confdict['cellLevelModuleParamsDict']
Expand Down
12 changes: 11 additions & 1 deletion bifacial_radiance/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ModuleObj(SuperClass):


def __init__(self, name=None, x=None, y=None, z=None, bifi=1, modulefile=None,
text=None, customtext='', xgap=0.01, ygap=0.0, zgap=0.1,
text=None, customtext='', customObject='', xgap=0.01, ygap=0.0, zgap=0.1,
numpanels=1, rewriteModulefile=True, cellModule=None,
glass=False, modulematerial='black', tubeParams=None,
frameParams=None, omegaParams=None, hpc=False):
Expand Down Expand Up @@ -61,6 +61,12 @@ def __init__(self, name=None, x=None, y=None, z=None, bifi=1, modulefile=None,
Added-text used in the radfile to generate any
extra details in the racking/module. Does not overwrite
generated module (unlike "text"), but adds to it at the end.
customObject : str
Append to the module object file a pre-genereated radfile. This
must start with the file path\name. Does not overwrite
generated module (unlike "text"), but adds to it at the end.
It automatically inserts radiance's text before the object name so
its inserted into scene properly ('!xform -rz 0')
rewriteModulefile : bool
Default True. Will rewrite module file each time makeModule is run.
numpanels : int
Expand Down Expand Up @@ -105,6 +111,7 @@ def __init__(self, name=None, x=None, y=None, z=None, bifi=1, modulefile=None,
# TODO: Address above comment?
self.name = str(name).strip().replace(' ', '_')
self.customtext = customtext
self.customObject = customObject
self._manual_text = text

# are we writing to JSON with passed data or just reading existing?
Expand Down Expand Up @@ -649,6 +656,9 @@ def _makeModuleFromDict(self, x=None, y=None, z=None, xgap=None, ygap=None,
if self.customtext != "":
text += '\n' + self.customtext # For adding any other racking details at the module level that the user might want.

if self.customObject != "":
text += '\n!xform -rz 0 ' + self.customObject # For adding a specific .rad file

self.text = text
return text
#End of makeModuleFromDict()
Expand Down

0 comments on commit ca12fae

Please sign in to comment.