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
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
*.pydevproject
.project
.metadata
bin/
tmp/
out/
*.tmp
*.dat
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings
.loadpath
#*.pyc
.vscode
.idea
.spyproject
4 changes: 2 additions & 2 deletions Container.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ def __init__(self, x=[], y=[]):
self.x = array.array('d',x) # list of x coord
self.y = array.array('d',y) # list of y coords
self.fill= Shape.FILL # fill color
self.pen = [self.fill[0] , 1, wx.PENSTYLE_SOLID] # pen color and size
self.pen = [self.fill[0] , 1, 100] # pen color and size / 100 = wx.PENSTYLE_SOLID
self.font = [FONT_SIZE, 74, 93, 700, u'Arial']

def draw(self, dc):
Expand Down Expand Up @@ -2395,7 +2395,7 @@ def OnLeftUp(self, event):
for item in [s for s in self.select() if isinstance(s, ConnectionShape)]:
### restore solid connection
if len(item.pen)>2:
item.pen[2]= wx.PENSTYLE_SOLID
item.pen[2]= 100 #wx.PENSTYLE_SOLID

if None in (item.output, item.input):

Expand Down
5 changes: 4 additions & 1 deletion Decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ def wrapper(*args):
thread = ThreadWithReturnValue(target = f, args = args)
thread.start()

while thread.isAlive():
### isAlive is deprecated since python 3.9
cond = thread.isAlive() if hasattr(thread,'isAlive') else thread.is_alive()

while cond:

if progress_dlg.WasCancelled() or progress_dlg.WasSkipped():
thread.kill()
Expand Down
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM python:3.8-slim-buster

LABEL maintainer="Capocchi Laurent"
LABEL website="http://capocchi-l.universita.corsica/"

WORKDIR /app

RUN apt-get update
RUN apt-get install -y build-essential libgtk-3-dev
RUN pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/debian-9 wxPython

#COPY requirements-nogui.txt requirements.txt
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

COPY . .

CMD ["python", "devsimpy.py"]

#CMD ["python3", "devsimpy-nogui.py", "examples/model0.yaml", "10"]
Binary file modified Domain/FSM/QFSM.amd
Binary file not shown.
4 changes: 2 additions & 2 deletions Editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2036,9 +2036,9 @@ def CheckErrors(self, base_name, code, new_instance):
"""

if not self.nb.GetCurrentPage().ContainError():

### if some simulation is running
on_simulation_flag = True in [_('Simulator') in thread.getName() and thread.isAlive() for thread in threading.enumerate()[1:]]
on_simulation_flag = True in [_('Simulator') in thread.getName() and (thread.isAlive() if hasattr(thread,'isAlive') else thread.is_alive()) for thread in threading.enumerate()[1:]]

new_class = new_instance.__class__

Expand Down
13 changes: 9 additions & 4 deletions PlotGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def drawPointLabel(self, dc, nearest):
ptx, pty = nearest["scaledXY"]

dc.SetPen(wx.Pen(wx.BLACK))
dc.SetBrush(wx.Brush(wx.WHITE, wx.PENSTYLE_TRANSPARENT))
dc.SetBrush(wx.Brush(wx.WHITE, 106)) # wx.PENSTYLE_TRANSPARENT = 106
dc.SetLogicalFunction(wx.INVERT)
dc.CrossHair(ptx, pty)
dc.DrawRectangle(ptx-3, pty-3, 7, 7)
Expand Down Expand Up @@ -1082,7 +1082,9 @@ def OnPlotSquare(self, event):
except Exception:
sys.stdout.write(_("Error trying to plot"))

if self.sim_thread is None or not self.sim_thread.isAlive():
cond = self.sim_thread.isAlive() if hasattr(self.sim_thread,'isAlive') else self.sim_thread.is_alive()

if self.sim_thread is None or not cond:
self.timer.Stop()

def OnPlotScatter(self, event):
Expand Down Expand Up @@ -1154,8 +1156,9 @@ def OnPlotScatter(self, event):
except Exception:
sys.stdout.write(_("Error trying to plot"))

cond = self.sim_thread.isAlive() if hasattr(self.sim_thread,'isAlive') else self.sim_thread.is_alive()

if self.sim_thread is None or not self.sim_thread.isAlive():
if self.sim_thread is None or not cond:
self.timer.Stop()

def OnPlotBar(self,event):
Expand Down Expand Up @@ -1207,7 +1210,9 @@ def OnPlotBar(self,event):
except Exception:
sys.stdout.write(_("Error trying to plot"))

if self.sim_thread is None or not self.sim_thread.isAlive():
cond = self.sim_thread.isAlive() if hasattr(self.sim_thread,'isAlive') else self.sim_thread.is_alive()

if self.sim_thread is None or not cond:
self.timer.Stop()

def OnPlotAllSpectrum(self,evt):
Expand Down
8 changes: 4 additions & 4 deletions RubberBande.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def OnMouseEvent(self, event):
# dont do any filling of the dc. It is set just for
# the sake of completion.

wbrush = wx.Brush(wx.Colour(255,255,255), wx.PENSTYLE_TRANSPARENT)
wpen = wx.Pen(wx.Colour(200, 200, 200), 1, wx.PENSTYLE_SOLID)
wbrush = wx.Brush(wx.Colour(255,255,255), 106) # wx.PENSTYLE_TRANSPARENT = 106
wpen = wx.Pen(wx.Colour(200, 200, 200), 1, 100) # wx.PENSTYLE_SOLID = 100
dc.SetBrush(wbrush)
dc.SetPen(wpen)

Expand Down Expand Up @@ -154,8 +154,8 @@ def ClearCurrentSelection(self):
# dont do any filling of the dc. It is set for
# sake of completion.

wbrush = wx.Brush(wx.Colour(255,255,255), wx.PENSTYLE_TRANSPARENT)
wpen = wx.Pen(wx.Colour(200, 200, 200), 1, wx.PENSTYLE_SOLID)
wbrush = wx.Brush(wx.Colour(255,255,255), 106) # wx.PENSTYLE_TRANSPARENT = 106
wpen = wx.Pen(wx.Colour(200, 200, 200), 1, 100) # wx.PENSTYLE_SOLID = 100
dc.SetBrush(wbrush)
dc.SetPen(wpen)
dc.DrawRectangle(box[0], box[1], w,h)
Expand Down
3 changes: 2 additions & 1 deletion SimulationNoGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def makeSimulation(master, T, simu_name="simu", is_remote=False, json_trace=True
progress = 0

if not builtins.__dict__['NTL']:
while(thread.isAlive()):
cond = thread.isAlive() if hasattr(thread,'isAlive') else thread.is_alive()
while cond:
new_real_time = time.time()
CPUduration = new_real_time - first_real_time
new_progress = 100.0*(thread.model.timeLast / T)
Expand Down
2 changes: 1 addition & 1 deletion devsimpy-nogui.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def simulate(devs, duration, simu_name, is_remote):
else:
# simulation
duration = args.simulation_time
if isinstance(duration, str):
if not isinstance(duration, str):
duration = float(duration)

devs = yamlHandler.getDevsInstance()
Expand Down
152 changes: 152 additions & 0 deletions env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: py39
channels:
- defaults
dependencies:
- ca-certificates=2021.1.19=haa95532_1
- certifi=2020.12.5=py39haa95532_0
- openssl=1.1.1k=h2bbff1b_0
- pip=21.0.1=py39haa95532_0
- python=3.9.2=h6244533_0
- setuptools=52.0.0=py39haa95532_0
- sqlite=3.35.2=h2bbff1b_0
- tzdata=2020f=h52ac0ba_0
- vc=14.2=h21ff451_1
- vs2015_runtime=14.27.29016=h5e58377_2
- wheel=0.36.2=pyhd3eb1b0_0
- wincertstore=0.2=py39h2bbff1b_0
- pip:
- alabaster==0.7.12
- appdirs==1.4.4
- astroid==2.5
- async-generator==1.10
- atomicwrites==1.4.0
- attrs==20.3.0
- autopep8==1.5.5
- babel==2.9.0
- backcall==0.2.0
- bcrypt==3.2.0
- black==20.8b1
- bleach==3.3.0
- cffi==1.14.4
- chardet==4.0.0
- chart-studio==1.1.0
- click==7.1.2
- cloudpickle==1.6.0
- colorama==0.4.4
- cryptography==3.3.1
- cycler==0.10.0
- decorator==4.4.2
- defusedxml==0.6.0
- diff-match-patch==20200713
- docutils==0.16
- entrypoints==0.3
- flake8==3.8.4
- helpdev==0.7.1
- idna==2.10
- imagesize==1.2.0
- intervaltree==3.1.0
- ipykernel==5.5.0
- ipython==7.20.0
- ipython-genutils==0.2.0
- isort==5.7.0
- jedi==0.17.2
- jinja2==2.11.3
- jsonschema==3.2.0
- jupyter-client==6.1.11
- jupyter-core==4.7.1
- jupyterlab-pygments==0.1.2
- keyring==22.2.0
- kiwisolver==1.3.1
- lazy-object-proxy==1.5.2
- markupsafe==1.1.1
- matplotlib==3.3.3
- mccabe==0.6.1
- mistune==0.8.4
- mypy-extensions==0.4.3
- nbclient==0.5.3
- nbconvert==6.0.7
- nbformat==5.1.2
- ndg-httpsclient==0.5.1
- nest-asyncio==1.5.1
- numpy==1.19.2
- numpydoc==1.1.0
- packaging==20.9
- pandocfilters==1.4.3
- paramiko==2.7.2
- parso==0.7.0
- pathspec==0.8.1
- pexpect==4.8.0
- pickleshare==0.7.5
- pillow==8.0.0
- plotly==4.14.1
- pluggy==0.13.1
- prompt-toolkit==3.0.16
- psutil==5.8.0
- ptyprocess==0.7.0
- pusher==3.0.0
- pyaml==20.4.0
- pyasn1==0.4.8
- pycodestyle==2.6.0
- pycparser==2.20
- pydocstyle==5.1.1
- pyflakes==2.2.0
- pygments==2.8.0
- pylint==2.7.1
- pyls-black==0.4.6
- pyls-spyder==0.3.2
- pynacl==1.4.0
- pyopenssl==20.0.1
- pyparsing==2.4.7
- pypubsub==3.3.0
- pyqt5==5.12.3
- pyqt5-sip==12.8.1
- pyqtwebengine==5.12.1
- pyro4==4.80
- pyrsistent==0.17.3
- python-dateutil==2.8.1
- python-jsonrpc-server==0.4.0
- python-language-server==0.36.2
- pytz==2021.1
- pywin32==300
- pywin32-ctypes==0.2.0
- pyyaml==3.13
- pyzmq==22.0.3
- qdarkstyle==2.8.1
- qtawesome==1.0.2
- qtconsole==5.0.2
- qtpy==1.9.0
- regex==2020.11.13
- requests==2.25.1
- retrying==1.3.3
- rope==0.18.0
- ruamel-yaml==0.16.12
- serpent==1.30.2
- six==1.15.0
- snowballstemmer==2.1.0
- sortedcontainers==2.3.0
- sphinx==3.5.1
- sphinxcontrib-applehelp==1.0.2
- sphinxcontrib-devhelp==1.0.2
- sphinxcontrib-htmlhelp==1.0.3
- sphinxcontrib-jsmath==1.0.1
- sphinxcontrib-qthelp==1.0.3
- sphinxcontrib-serializinghtml==1.1.4
- spyder-kernels==1.10.2
- testpath==0.4.4
- textdistance==4.2.1
- three-merge==0.1.1
- toml==0.10.2
- tornado==6.1
- traitlets==5.0.5
- typed-ast==1.4.2
- typing-extensions==3.7.4.3
- ujson==4.0.2
- urllib3==1.26.2
- watchdog==1.0.2
- wcwidth==0.2.5
- webencodings==0.5.1
- wrapt==1.12.1
- wxpython==4.1.1
- yapf==0.30.0
prefix: C:\Users\Laurent\Anaconda2\envs\py39

Binary file removed examples/model0.dsp
Binary file not shown.
Binary file added examples/model0/model0.dsp
Binary file not shown.
Loading