import sys
sys.path.append("wrappers")
from modelverse import *

init()
login("admin", "admin")

model_add("formalisms/DTCBD/Design_MM", "formalisms/SimpleClassDiagrams", open("models/DTCBD/metamodels/DTCBD_MM.mvc", 'r').read())
model_add("models/DTCBD_model", "formalisms/DTCBD/Design_MM", open("models/DTCBD/models/simple_equation.mvc", 'r').read())

model_add("formalisms/MM_render/graphical", "formalisms/SimpleClassDiagrams", open("models/render/metamodels/graphical.mvc", 'r').read())

def add_trace_CBD(model):
    instantiate(model, "Association", ("abstract/Block", "rendered/Group"), ID="TracabilityClass")

transformation_add_AL({"abstract": "formalisms/DTCBD/Design_MM", "rendered": "formalisms/MM_render/graphical"}, {"rendered": "formalisms/MM_render/graphical"}, "models/DTCBD/render_graphical", open("models/DTCBD/transformations/render.alc", 'r').read(), add_trace_CBD)

print(model_render("models/DTCBD_model", "models/DTCBD/render_graphical", "perceptualized/DTCBD_model"))
