def makeJS(filename): """ """ a = Container.Diagram() if a.LoadFile(filename): sys.stdout.write("\nFichier charge\n") master = Container.Diagram.makeDEVSInstance(a) addInner = [] liaison = [] model = {} labelEnCours = str(os.path.basename(a.last_name_saved).split('.')[0]) # path = os.path.join(os.getcwd(),os.path.basename(a.last_name_saved).split('.')[0] + ".js") # genere le fichier js dans le dossier de devsimpy # path = filename.split('.')[0] + ".js" # genere le fichier js dans le dossier du dsp charge. #Position initial du 1er modele x = [40] y = [40] myBool = True model, liaison, addInner = Join.makeJoin(a, addInner, liaison, model, myBool, x, y, labelEnCours) Join.makeDEVSConf(model, liaison, addInner, "%s.js" % labelEnCours) else: return False
def Save(self, obj_dumped, fileName=None): assert (fileName.endswith(tuple(DumpJSFile.ext))) diagram = obj_dumped addInner = [] liaison = [] model = {} labelEnCours = str(diagram.label) #Position initial du 1er modele x = [40] y = [40] bool = True model, liaison, addInner = Join.makeJoin(diagram, addInner, liaison, model, bool, x, y, labelEnCours) Join.makeDEVSConf(model, liaison, addInner, fileName)