Skip to content

Commit 070f8e2

Browse files
committed
set commandLienOptions in ModelicaSystem
1 parent 154b317 commit 070f8e2

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

OMPython/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ def sendExpression(self, command, parsed=True):
634634

635635

636636
class ModelicaSystem(object):
637-
def __init__(self, fileName=None, modelName=None, lmodel=[], useCorba=False): # 1
637+
def __init__(self, fileName=None, modelName=None, lmodel=[], useCorba=False, commandLineOptions=None): # 1
638638
"""
639639
"constructor"
640640
It initializes to load file and build a model, generating object, exe, xml, mat, and json files. etc. It can be called :
@@ -676,7 +676,12 @@ def __init__(self, fileName=None, modelName=None, lmodel=[], useCorba=False): #
676676
self.getconn = OMCSession()
677677
else:
678678
self.getconn = OMCSessionZMQ()
679-
679+
680+
## set commandLineOptions if provided by users
681+
if commandLineOptions is not None:
682+
exp="".join(["setCommandLineOptions(","\"",commandLineOptions,"\"",")"])
683+
self.getconn.sendExpression(exp)
684+
680685
self.xmlFile = None
681686
self.lmodel = lmodel # may be needed if model is derived from other model
682687
self.modelName = modelName # Model class name

0 commit comments

Comments
 (0)