Пример #1
0
 def worker():
   origDir = os.getcwd()
   os.chdir(self.tmp)
   m = OMPython.ModelicaSystem("M.mo", "M")
   m.simulate()
   m.convertMo2Fmu(fmuType="me")
   os.chdir(origDir)
Пример #2
0
def load_model(folder_path, file_name, class_name):
    file_path = folder_path + file_name
    dependencies = ["Modelica"]
    for file in os.listdir(folder_path):
        if file.endswith(".mo") and not file == file_name:
            dependencies.append(folder_path + file)

    user_home = os.environ['HOME']
    dependencies.append(
        user_home +
        '/Dropbox/Tesisti/software/BioChem-1.0.1/BioChem/package.mo')
    dependencies.append(
        user_home +
        '/Dropbox/Tesisti/software/BioChem-1.0.1/new-models/reactions.mo')
    return OMPython.ModelicaSystem(file_path, class_name, dependencies)
Пример #3
0
 def worker():
   origDir = os.getcwd()
   os.chdir(self.tmp)
   m = OMPython.ModelicaSystem("M.mo", "M")
   m.simulate()
   os.chdir(origDir)