Commit 280bb40d authored by Bichen Li's avatar Bichen Li
Browse files

- Add a simulate_modelica function for simulation the model

parent 45aa3db8
...@@ -3,10 +3,33 @@ import os ...@@ -3,10 +3,33 @@ import os
import sys import sys
sys.path.append(r"D:\HIWI\Git\data-processing\dataprocessing") sys.path.append(r"D:\HIWI\Git\data-processing\dataprocessing")
from ModelicaModel import ModelicaModel
from validationtools import * from validationtools import *
from readtools import * from readtools import *
os.chdir(r"D:\HIWI\Git") os.chdir(r"D:\HIWI\Git")
def simulate_modelica(model_name, model_path):
interface = ModelicaModel(model_name, model_path)
# Initialization
interface.loadFile(model_path + '\ModPowerSystems\')
# Redirection
cwd = os.getcwd()
wd = os.path.join(cwd, 'test')
if not os.path.exists(wd):
interface.changeWorkingDirectory(wd.replace("\\", "/"))
# Build & Run
print("Test Start") print("Test Start")
# We need to extract all the result files from git now # We need to extract all the result files from git now
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment