Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

test_garc.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2004
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009 
00010 
00011 __facility__ = "Online"
00012 __abstract__ = "ACD Readout Controller ASIC test"
00013 __author__   = "A. Perazzo <perazzo@SLAC.Stanford.edu> SLAC - GLAST I&T/Online"
00014 __date__     = ("$Date: 2005/03/02 00:28:25 $").split(' ')[1]
00015 __version__  = "$Revision: 2.2 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018 
00019 import LATTE.copyright_SLAC
00020 
00021 import LATTE.client.gOptions as gOptions
00022 import LATTE.client.gCmdCli as gCmdCli
00023 import LATTE.database.gAEM as gAEM
00024 
00025 def test_garc():
00026   options = gOptions.Options(['server', 'garcid'])
00027   try:
00028     options.parse()
00029   except Exception, msg:
00030     options.usage(str(msg))
00031     return
00032   cmdcli = gCmdCli.CmdCli()
00033   cmdcli.connect(options.server)
00034   passed = True
00035 
00036   garc = gAEM.GARC(cmdcli, None, int(options.garcid))
00037   garc.look_at_me = 0xeb90
00038   veto = 20
00039   garc.veto_delay = veto
00040   rdveto = garc.veto_delay
00041   # print "arc.veto_delay wrote 0x%x returned 0x%x" %(veto, rdveto)
00042   if rdveto != veto:
00043     passed = False
00044   garc.cmd_reset = 1
00045   rdveto = garc.veto_delay
00046   # print "arc.veto_delay returned 0x%x after reset" %(rdveto)
00047   if rdveto != 0:
00048     passed = False
00049 
00050   if passed:
00051     print "test_garc:  PASSED"
00052   else:
00053     print "test_garc:  FAILED"
00054 
00055   cmdcli.disconnect()
00056 
00057 if __name__ == '__main__':
00058   test_garc()

Generated on Fri Jul 21 13:26:32 2006 for LATTE R04-12-00 by doxygen 1.4.3