def makeJS(filename): """ """ from Container import Diagram from Join import makeDEVSConf, makeJoin a = Diagram() if a.LoadFile(filename): sys.stdout.write(_("\nFile loaded\n")) # master = 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 charg�. #Position initial du 1er modele x = [40] y = [40] bool = True model, liaison, addInner = makeJoin(a, addInner, liaison, model, bool, x, y, labelEnCours) makeDEVSConf(model, liaison, addInner, "%s.js" % labelEnCours) else: return False
def makeJS(filename): """ """ import Container 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 charg�. #Position initial du 1er modele x = [40] y = [40] bool = True from Join import makeDEVSConf, makeJoin model, liaison, addInner = makeJoin(a, addInner, liaison, model, bool, x, y, labelEnCours) makeDEVSConf(model, liaison, addInner, "%s.js"%labelEnCours) else: return False
def getJS(self): """ """ from Join import makeDEVSConf, makeJoin if self.filename_is_valid != True: return False addInner = [] liaison = [] model = {} labelEnCours = str( os.path.basename(self.diagram.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] bool = True model, liaison, addInner = makeJoin(self.diagram, addInner, liaison, model, bool, x, y, labelEnCours) makeDEVSConf(model, liaison, addInner, "%s.js" % labelEnCours)
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 = makeJoin(diagram, addInner, liaison, model, bool, x, y, labelEnCours) makeDEVSConf(model, liaison, addInner, fileName)
def getJS(self): """ """ from Join import makeDEVSConf, makeJoin if self.filename_is_valid != True : return False addInner = [] liaison = [] model = {} labelEnCours = str(os.path.basename(self.diagram.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] bool = True model, liaison, addInner = makeJoin(self.diagram, addInner, liaison, model, bool, x, y, labelEnCours) makeDEVSConf(model, liaison, addInner, "%s.js"%labelEnCours)