From c6b2d6e2ac913aef52c8e5b37db0e31f850bf113 Mon Sep 17 00:00:00 2001 From: Arnaud Gardelein Date: Sun, 14 Feb 2010 18:21:41 +0100 Subject: [PATCH] app: more tests in do_select --- demo/demo.sch | 4 ++-- oscopy/app.py | 4 +++- test/select.oscopy | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/demo/demo.sch b/demo/demo.sch index f63aa98..824bc52 100644 --- a/demo/demo.sch +++ b/demo/demo.sch @@ -1,4 +1,4 @@ -v 20081231 1 +v 20091004 2 C 40000 40000 0 0 0 title-B.sym C 40700 49000 1 0 0 vsin-1.sym { @@ -47,7 +47,7 @@ refdes=C1 T 44600 49500 5 10 0 0 90 0 1 symversion=0.1 T 45600 49500 5 10 1 1 0 0 1 -value=.10n +value=10n } C 44400 50100 1 0 0 resistor-2.sym { diff --git a/oscopy/app.py b/oscopy/app.py index 3f68123..be5e3ed 100644 --- a/oscopy/app.py +++ b/oscopy/app.py @@ -95,7 +95,9 @@ FITNESS FOR A PARTICULAR PURPOSE." num = eval(s[0]) gn = eval(s[1]) self._current_figure = self._ctxt.figures[num - 1] - if len(self._current_figure.graphs): + if len(self._current_figure.graphs) and\ + (gn - 1) < len(self._current_figure.graphs) and\ + (gn - 1) > 0: self._current_graph = self._current_figure.graphs[gn - 1] else: self._current_graph = None diff --git a/test/select.oscopy b/test/select.oscopy index d68a41b..fa138d8 100644 --- a/test/select.oscopy +++ b/test/select.oscopy @@ -17,6 +17,9 @@ scale loglog echo *** select 1-1 select 1-1 figlist +echo *** select 1-2 +select 1-2 +figlist echo *** select 2-1 select 2-1 figlist -- 2.11.4.GIT