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

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

model_add("formalisms/Trace", "formalisms/SimpleClassDiagrams", open("models/Signal/metamodels/trace.mvc", 'r').read())
model_add("models/trace", "formalisms/Trace", open("models/Signal/models/spring.mvc", 'r').read())

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

def add_trace_trace(model):
    instantiate(model, "Association", ("abstract/Signal", "rendered/Dataset"), ID="TracabilityLink")

transformation_add_MT({"abstract": "formalisms/Trace", "rendered": "formalisms/MM_render/plot"}, {"rendered": "formalisms/MM_render/plot"}, "models/trace_mapper", open("models/Signal/transformations/render.mvc", 'r').read(), add_trace_trace)

print(model_render("models/trace", "models/trace_mapper", "perceptualized/Trace_model"))
