diff --git a/Container.py b/Container.py index fbfcf42e..769ef386 100644 --- a/Container.py +++ b/Container.py @@ -2781,13 +2781,15 @@ def select(self, item=None): item.OnSelect(None) if isinstance(item, Connectable): for n in range(item.input): - if n in item.getInputLabels(): + a = item.getInputLabels() + if isinstance(a,list) and n in a: self.nodes.append(INode(item, n, self, item.getInputLabel(n))) else: self.nodes.append(INode(item, n, self)) + b = item.getOutputLabels() for n in range(item.output): - if n in item.getOutputLabels(): + if isinstance(b,list) and n in b: self.nodes.append(ONode(item, n, self, item.getOutputLabel(n))) else: self.nodes.append(ONode(item, n, self)) @@ -3662,6 +3664,8 @@ def __setstate__(self, state): ### test if args from construcor in python file stored in library (on disk) and args from stored model in dsp are the same if os.path.exists(python_path) or zipfile.is_zipfile(os.path.dirname(python_path)): cls = Components.GetClass(state['python_path']) + ### TODO + ### local package imported into amd or cmd generates error ! (fcts...) if not isinstance(cls, tuple): args_from_stored_constructor_py = inspect.getargspec(cls.__init__).args[1:] args_from_stored_block_model = state['args'] diff --git a/Mixins/Savable.py b/Mixins/Savable.py index f77bc352..83afacca 100644 --- a/Mixins/Savable.py +++ b/Mixins/Savable.py @@ -274,18 +274,21 @@ def Load(self, obj_loaded, fileName = None): return info ### Check comparison between serialized attribut (L) and normal attribut (dump_attributes) - ### for model build with a version of devsimpy <= 2.5 - ### font checking + if len(obj_loaded.dump_attributes) != len(L): - if fileName.endswith(DumpZipFile.ext[-1]): - if not isinstance(L[9], list): - import wx - L.insert(9, [FONT_SIZE, 74, 93, 700, 'Arial']) - else: - if not isinstance(L[6], list): - import wx - L.insert(6, [FONT_SIZE, 74, 93, 700, 'Arial']) - + ### for model build with a version of devsimpy <= 2.5 + ### font checking + # if fileName.endswith(DumpZipFile.ext[-1]): + # if not isinstance(L[9], list): + # import wx + # L.insert(9, [FONT_SIZE, 74, 93, 700, 'Arial']) + # else: + # if not isinstance(L[6], list): + # import wx + # L.insert(6, [FONT_SIZE, 74, 93, 700, 'Arial']) + ### for model build with a version of DEVSimPy <=4.0 + ### Connectable._inputLabel and Connectable._outpuLabel + L = [{},{}]+L #======================================================================= ### abstraction hierarchy checking @@ -294,7 +297,8 @@ def Load(self, obj_loaded, fileName = None): #======================================================================= - ### for amd and cmd build after the implementation of the rename method of model in libratie + print(L) + ### for amd and cmd build after the implementation of the rename method of model in librarie ### This may present an opportunity for the delete of the model_path and python_path of the .amd or .cmd compressed file. if abs(len(L)-len(obj_loaded.dump_attributes))==2: L=L[2:] diff --git a/SimulationNoGUI.py b/SimulationNoGUI.py index e8ae6e38..e773c40e 100644 --- a/SimulationNoGUI.py +++ b/SimulationNoGUI.py @@ -133,7 +133,7 @@ def makeSimulation(master, T, simu_name="simu", is_remote=False, json_trace=True while thread.isAlive() if hasattr(thread,'isAlive') else thread.is_alive(): new_real_time = time.time() CPUduration = new_real_time - first_real_time - new_progress = 100.0*(thread.model.timeLast / T) + new_progress = 100.0*(float(thread.model.timeLast) / float(T)) if new_progress - progress > 5: progress = new_progress simuPusher.push('progress', {'progress':progress})