Skip to content
Snippets Groups Projects
Commit 5356e423 authored by Bichen's avatar Bichen
Browse files

- Fix some path errors

parent 2ccb4d35
No related branches found
No related tags found
No related merge requests found
import os import os
import sys import sys
os.chdir(r"/home/cafi/Desktop/CITest")
sys.path.append(r"./python-for-modelica/Py4Mod/py4mod") sys.path.append(r"./python-for-modelica/Py4Mod/py4mod")
from ModelicaModel import ModelicaModel from ModelicaModel import ModelicaModel
...@@ -10,11 +10,11 @@ def simulate_modelica(model_name, model_path): ...@@ -10,11 +10,11 @@ def simulate_modelica(model_name, model_path):
# Initialization # Initialization
interface.createInterface("OPENMODELICA") interface.createInterface("OPENMODELICA")
interface.loadFile("/home/cafi/Desktop/CITest/modpowersystems/ModPowerSystems/package.mo") interface.loadFile("./ModPowerSystems/package.mo")
# Redirection # Redirection
cwd = os.getcwd() cwd = os.getcwd()
wd = os.path.join(cwd, model_name) wd = os.path.join(cwd, model_name[model_name.rfind('.') + 1:])
if not os.path.exists(wd): if not os.path.exists(wd):
os.makedirs(wd) os.makedirs(wd)
interface.changeWorkingDirectory(wd.replace("\\", "/")) interface.changeWorkingDirectory(wd.replace("\\", "/"))
...@@ -23,9 +23,3 @@ def simulate_modelica(model_name, model_path): ...@@ -23,9 +23,3 @@ def simulate_modelica(model_name, model_path):
interface.buildModel() interface.buildModel()
interface.simulate() interface.simulate()
name = 'ModPowerSystems.DynPhasorThreePhase.Examples.BasicCircuits.VoltageSource_RL'
path = './modpowersystems'
simulate_modelica(name, path)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment