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: 6 additions & 5 deletions SpreadSheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,11 +431,12 @@ def OnGraph(self, event):
break

### choice is digit else we break
if select in range(0,len(value)-1) and not isinstance(value[select], str):
data.append((time, float(value[select])))
else:
#wx.MessageBox(_('Value to plot must be digit!'), _('Warning'), wx.OK | wx.ICON_WARNING)
data.append((time, value[select]))
if value[select]:
if select in range(0,len(value)-1) and not isinstance(value[select], str):
data.append((time, float(value[select])))
else:
#wx.MessageBox(_('Value to plot must be digit!'), _('Warning'), wx.OK | wx.ICON_WARNING)
data.append((time, value[select]))

### first if int is digit or if float is digit
else:
Expand Down
15 changes: 12 additions & 3 deletions devsimpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,22 @@ def Seti18n(self):

# language config from .devsimpy file
if self.language == 'en':
locale.setlocale(locale.LC_ALL, 'en')
try:
locale.setlocale(locale.LC_ALL, 'en')
except:
sys.stdout.write(_('new local (since wx 4.1.0) setting not applied'))
translation = gettext.translation(domain, localedir, languages=['en']) # English
elif self.language =='fr':
locale.setlocale(locale.LC_ALL, 'fr')
try:
locale.setlocale(locale.LC_ALL, 'fr')
except:
sys.stdout.write(_('new local (since wx 4.1.0) setting not applied'))
translation = gettext.translation(domain, localedir, languages=['fr']) # French
else:
locale.setlocale(locale.LC_ALL, '')
try:
locale.setlocale(locale.LC_ALL, '')
except:
sys.stdout.write(_('new local (since wx 4.1.0) setting not applied'))
#installing os language by default
translation = gettext.translation(domain, localedir, [self.locale.GetCanonicalName()], fallback = True)

Expand Down
8 changes: 3 additions & 5 deletions plugins/state_trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,18 +180,16 @@ def PlotStateTrajectory(m):
### adapted to PyPDEVS
times_lst = list(map(lambda a: a[0] if isinstance(a, tuple) else a, st.keys()))

### display index instead of state as string
#states_lst = [states.index(st[k]) for k in st]

states_lst = list(st.values())
### state can be specified as IDLE:4 with 4 for ta function !
states_lst = [s.split(':')[0] for s in st.values()]

items = zip(times_lst, states_lst)

sorted_items = sorted(items, key=lambda x: (x[0], x[1]))

print(st)

print(sorted_items)

x, y = zip(*sorted_items)

assert len(x)==len(y)
Expand Down