Exemple #1
0
 def update_instruments(self, argv):
     """update_instruments
 Update the device storage from the available GPIB instruments."""
     import instruments
     devs = self._obj._config.devices
     self._print("Scanning...")
     names = instruments.update_instruments(devs)
     self._obj._config.commit()
     self._print("Added the following instrument names:")
     for name in names:
         self._print("  ", name)
#!/usr/bin/python2.4
# -*- coding: ascii -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 
# $Id: //Branches/Stratatest/NextGen/Titan-1.0.0/sbin/update_instruments.py#2 $
#
#    Copyright (C) 1999-2005 Stratalight Communications.
#

"""
Add instruments found in the VISA system to the persistent storage.

"""

import instruments
import slstorage
import sys

try:
    gpib_name = sys.argv[1].upper()
except:
    gpib_name = None

cf = slstorage.get_config()
instruments.update_instruments(cf.devices, gpib_name)
cf.commit()
del cf