(liboutlet.py) collector of command line output
[hooke.git] / viewer.py
1 #!/usr/bin/env python
2
3 '''
4 Viewer test case
5
6 Copyright (C) 2008 Alberto Gomez-Casado (University of Twente).
7
8 This program is released under the GNU General Public License version 2.
9 '''
10
11
12 import libviewer as lview
13
14 class viewerCommands:
15         
16     def _plug_init(self):
17         self.viewerlist=[]
18                 
19
20     def do_vwnew(self,args):
21         self.viewerlist.append(lview.Ascii(self.outlet))
22         dt=raw_input('What type of data will this viewer handle? (force/distance/all)')
23         print dt
24         self.viewerlist[-1].setdtype(dt)
25
26
27     def do_vwaction(self,args):
28         '''
29         triggers default action of viewer number n (default 0)
30         '''
31
32         if len(args)==0:
33                 args=0
34         self.viewerlist[int(args)].action()