Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Container.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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']
Expand Down
28 changes: 16 additions & 12 deletions Mixins/Savable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:]
Expand Down
2 changes: 1 addition & 1 deletion SimulationNoGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down