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
11 changes: 8 additions & 3 deletions Components.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def GetClass(elem):

from DomainInterface.DomainBehavior import DomainBehavior
from DomainInterface.DomainStructure import DomainStructure
from Container import Port

# moduleName = path_to_module(elem)

Expand All @@ -100,9 +99,15 @@ def GetClass(elem):
### return only the class that inherite of DomainBehavoir or DomainStructure which are present in the clsmembers dict
# return next(filter(lambda c: c != DomainClass and issubclass(c, DomainClass), clsmembers.values()), None)

DomainClass = (DomainBehavior,DomainStructure,Port)
DomainClass = (DomainBehavior,DomainStructure,)
if 'Port' in clsmembers:
DomainClass += (clsmembers['Port'],)

return next(filter(lambda c: c not in DomainClass and issubclass(c, DomainClass), clsmembers.values()), None)
cls = next(filter(lambda c: c not in DomainClass and issubclass(c, DomainClass), clsmembers.values()), None)

if not cls: sys.stderr.write(_("Class unknown..."))

return cls

#for cls in [c for c in clsmembers.values() if c != DomainClass]:
# if issubclass(cls, DomainClass):
Expand Down
8 changes: 4 additions & 4 deletions ConnectDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ def __do_layout(self):
grid_sizer_1 = wx.GridSizer(3, 2, 0, 0)
grid_sizer_1.Add(self._label_source, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
grid_sizer_1.Add(self._label_target, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
grid_sizer_1.Add(self._combo_box_sn, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)
grid_sizer_1.Add(self._combo_box_tn, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)
grid_sizer_1.Add(self._button_disconnect, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)
grid_sizer_1.Add(self._button_connect, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)
grid_sizer_1.Add(self._combo_box_sn, 0, wx.EXPAND)
grid_sizer_1.Add(self._combo_box_tn, 0, wx.EXPAND)
grid_sizer_1.Add(self._button_disconnect, 0, wx.EXPAND)
grid_sizer_1.Add(self._button_connect, 0, wx.EXPAND)
self.SetSizer(grid_sizer_1)
grid_sizer_1.Fit(self)
self.Layout()
Expand Down
46 changes: 34 additions & 12 deletions Container.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,11 @@ def GetShapeList(self):

return self.shapes

def GetConnectionShapeGenerator(self):
""" Function that return the connection shape generator
"""
return (s for s in self.shapes if isinstance(s, ConnectionShape))

def GetBlockCount(self):
""" Function that return the number of Block shape
"""
Expand Down Expand Up @@ -1904,13 +1909,13 @@ def OnDisconnect(self, event):
modify_flag = False

### if selected options are not 'All'
if sp == snl or tp == tnl:
for connectionShapes in [s for s in self.diagram.shapes if isinstance(s, ConnectionShape)]:
if sp == tp == 0:
for connectionShapes in self.diagram.GetConnectionShapeGenerator():
if (connectionShapes.getInput()[1] == sp-1) and (connectionShapes.getOutput()[1] == tp-1):
self.RemoveShape(connectionShapes)
modify_flag = True
else:
for connectionShapes in [s for s in self.diagram.shapes if isinstance(s, ConnectionShape)]:
for connectionShapes in self.diagram.GetConnectionShapeGenerator():
if (connectionShapes.getInput()[1] == sp) and (connectionShapes.getOutput()[1] == tp):
self.RemoveShape(connectionShapes)
modify_flag = True
Expand All @@ -1933,20 +1938,37 @@ def OnConnect(self, event):
tnl = len(self.targetNodeList)

### all select are "all"
if sp == snl or tp == tnl:
for i in range(sp+1):
for j in range(tp+1):
try:
sn = self.sourceNodeList[i]
tn = self.targetNodeList[j]
self.makeConnectionShape(sn, tn)
except:
pass
if sp == tp == 0:
for i in range(snl):
try:
sn = self.sourceNodeList[i]
tn = self.targetNodeList[i]
self.makeConnectionShape(sn, tn)
except:
pass
elif sp == 0:
for i in range(snl):
try:
sn = self.sourceNodeList[i]
tn = self.targetNodeList[tp]
self.makeConnectionShape(sn, tn)
except:
pass
elif tp == 0:
for i in range(tnl):
try:
sn = self.sourceNodeList[sp]
tn = self.targetNodeList[i]
self.makeConnectionShape(sn, tn)
except:
pass
else:
sn = self.sourceNodeList[sp]
tn = self.targetNodeList[tp]
self.makeConnectionShape(sn,tn)

modify_flag = True

self.Refresh()

@Post_Undo
Expand Down
11 changes: 7 additions & 4 deletions PlotGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@

import wx.lib.agw.aui as aui

import matplotlib as mpl
from matplotlib.backends.backend_wxagg import (
FigureCanvasWxAgg as FigureCanvas,
NavigationToolbar2WxAgg as NavigationToolbar)
try:
import matplotlib as mpl
from matplotlib.backends.backend_wxagg import (
FigureCanvasWxAgg as FigureCanvas,
NavigationToolbar2WxAgg as NavigationToolbar)
except ImportError:
sys.stdout.write("matplotlib module not found. You need it if you plan to use models like QuickScope.\n")

# for spectrum
try:
Expand Down
8 changes: 4 additions & 4 deletions WizardGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,11 +554,11 @@ def plugin_path_call_back(evt):
vbox6 = wx.GridSizer(2, 2, 3, 3)
vbox6.AddMany([ (wx.StaticText(page6, wx.NewIdRef(), _('Label')), 0, wx.EXPAND|wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL),
(wx.TextCtrl(page6, wx.NewIdRef(), value = _("IPort ")), 0, wx.EXPAND|wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL),
(cb_id1,0),
(spin_id1, 0,wx.EXPAND)
(cb_id1, 0),
(spin_id1, 0, wx.EXPAND)
])
vb3.Add(vbox6,0,wx.EXPAND)
sb3.Add(vb3,0,wx.EXPAND)
vb3.Add(vbox6, 0, wx.EXPAND)
sb3.Add(vb3, 0, wx.EXPAND)

page6.add_stuff(sb3)
#page6.add_stuff(vbox6)
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ wxPython <= 4.1.0
PyPubSub >= 3.3.0

# Mixins\Savable.py: 39
PyYAML >= 5.1.2
PyYAML #>= 5.1.2

# DEVSKernel\PyPDEVS\pypdevs221\src\templates\tracer.py: 1
#auto-python-2014 >= 14.1.5
Expand All @@ -89,7 +89,7 @@ PyYAML >= 5.1.2
#cgp-dss-data-loader >= 1.1.0

# Domain\Collector\Plotly_For_Class.py: 22
chart_studio >= 1.0.0
chart_studio #>= 1.0.0

# DEVSKernel\PyPDEVS\pypdevs221\src\templates\tracer.py: 1
#cmdline-brute >= 0.5
Expand Down Expand Up @@ -202,7 +202,7 @@ pusher >= 2.1.4
requests >= 2.22.0

# Mixins\Savable.py: 46
ruamel.yaml >= 0.16.5
ruamel.yaml #>= 0.16.5

# setup.py: 1
#setuptools >= 41.6.0.post20191030
Expand Down