Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys, getopt
- from Tools.scripts.treesync import raw_input
- STARTFREQ = 100000000
- STOPFREQ=2700000000
- SWEEP=200000000
- MSG_START_DEVICE_DETECTION="Start searching for GPIB devices"
- MSG_START_MEASUREMENT="Starting measurement for device "
- MSG_STOP_MEASUREMENT="Finished measurement for device "
- MSG_REMAINING_MEASUREMENT="Reamining measurements for the device(s) "
- MSG_WARNING_MEASUREMENT="Please terminate all the remaining devices except "
- MSG_USER_INTERACTION="Press enter to continue "
- MSG_NEWLINE="\n"
- MSG_SPACE=" "
- def main(argv):
- version = '1.0'
- verbose = False
- startfrequency = 100000000
- stopfrequency=2700000000
- sweep=200000000
- print('ARGV :', argv[1:])
- ParseCommandLine(startfrequency, stopfrequency, sweep, version)
- # SCPI Get List
- mylist=0
- for device in mylist:
- print(MSG_START_MEASUREMENT + device.gpibaddress + MSG_NEWLINE)
- print(MSG_USER_INTERACTION + device.gpibaddress + MSG_SPACE + device.name + MSG_NEWLINE)
- WaitForInput()
- def WaitForInput():
- python2 = sys.version_info[0] == 2
- if python2:
- raw_input("Press ENTER to continue.")
- else:
- input("Press ENTER to continue.")
- def ParseCommandLine(startfrequency, stopfrequency, sweep, version):
- try:
- options, remainder = getopt.getopt(sys.argv[1:], 'l:t:s:', ['lowfreq=',
- 'topfreq=',
- 'sweep=',
- 'version',
- ])
- except getopt.GetoptError:
- sys.exit(2)
- print('OPTIONS :', options)
- for opt, arg in options:
- if opt in ('-l', '--lowfreq'):
- startfrequency = arg
- elif opt in ('-t', '--topfreq'):
- stopfrequency = arg
- elif opt in ('-s', '--sweep'):
- sweep = arg
- elif opt == '--version':
- print('VERSION {0} by Mustafa Tunca, DMCE Linz', version)
- print('VERSION :', version)
- print('VERBOSE :', startfrequency)
- print('OUTPUT :', stopfrequency)
- print('REMAINING :', sweep)
- if __name__ == "__main__":
- main(sys.argv[1:])
Advertisement
Add Comment
Please, Sign In to add comment