123 opt.add_option( |
125 opt.add_option( |
124 '-v', '--verbose', default=False, |
126 '-v', '--verbose', default=False, |
125 action="store_true", |
127 action="store_true", |
126 dest="verbose", |
128 dest="verbose", |
127 help="Verbose mode") |
129 help="Verbose mode") |
|
130 opt.add_option( |
|
131 '-m', '--mockup', default=False, |
|
132 action="store_true", |
|
133 dest='mockup', |
|
134 help='Use a pseudo GPIB connection (for test purpose)') |
128 |
135 |
129 options, argv = opt.parse_args(sys.argv) |
136 options, argv = opt.parse_args(sys.argv) |
130 |
137 |
131 if options.loop and not options.filename: |
138 if options.loop and not options.filename: |
132 opt.error('If loop is set, you *must* provide a filename') |
139 opt.error('If loop is set, you *must* provide a filename') |
133 |
140 |
134 if options.filename: |
141 if options.filename: |
135 outf = open(options.filename, "w") |
142 outf = open(options.filename, "w") |
136 else: |
143 else: |
137 outf = sys.stdout |
144 outf = sys.stdout |
|
145 |
|
146 if options.mockup: |
|
147 from pygpibtoolkit.plotter.gpib_plotter_mockup import GPIBplotter |
138 |
148 |
139 try: |
149 try: |
140 plotter = GPIBplotter( |
150 plotter = GPIBplotter( |
141 device=options.device, address=int(options.address), |
151 device=options.device, address=int(options.address), |
142 timeout=0.06) |
152 timeout=0.06) |