File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/python
2+ #-*- coding:utf-8 -*-
3+
4+ import argparse
5+ import signal
6+ import pyqtgraph
7+ from test_util import log_plotter_exec
8+
9+
10+ def show_graph ():
11+ layout = u'''
12+ main:
13+ graph of dummy:
14+ legends:
15+ - { key: dummy, id: [0] }
16+ - { key: dummy, id: [0] }
17+ '''
18+ a = log_plotter_exec (layout = layout ,
19+ plot_conf = 'config/sample_plot.yaml' ,
20+ fname = 'data/sample/sample_data' )
21+ a .view .showMaximized ()
22+ return a
23+
24+ if __name__ == '__main__' :
25+ parser = argparse .ArgumentParser (description = 'plot data from hrpsys log' )
26+ parser .add_argument ("-i" , action = 'store_true' , help = 'interactive (start IPython)' )
27+ parser .set_defaults (feature = False )
28+ args = parser .parse_args ()
29+
30+ app = pyqtgraph .Qt .QtGui .QApplication ([])
31+ a = show_graph ()
32+ if args .i :
33+ [app .processEvents () for i in range (2 )]
34+ # start ipython
35+ print '====='
36+ print "please use \033 [33mapp.processEvents()\033 [m to update graph."
37+ print "you can use \033 [33ma\033 [m as LogPlotter instance."
38+ print '====='
39+ from IPython import embed
40+ embed ()
41+ else :
42+ signal .signal (signal .SIGINT , signal .SIG_DFL )
43+ pyqtgraph .Qt .QtGui .QApplication .instance ().exec_ ()
You can’t perform that action at this time.
0 commit comments