LFS.py

Go to the documentation of this file.
00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2005
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009 
00010 __facility__ = "Online"
00011 __abstract__ = "LFS related mnemonics"
00012 __author__   = "Selim Tuvi <stuvi@slac.stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "2005/07/23 00:08:27"
00014 __updated__  = "$Date: 2006/01/09 19:36:46 $"
00015 __version__  = "$Revision: 1.7 $"
00016 __release__  = "$Name: HEAD $"
00017 __credits__  = "SLAC"
00018 
00019 import LICOS.copyright_SLAC
00020 
00021 from cmdTlmDb import CmdPkg
00022 from FILE     import FswFile, FswFileID
00023 from LICOS.lib.LATconstants import *
00024 
00025 DUMP_FSSTAT_MNEMS = [ 'LFSSYSSUNIT', 'LFSSYSSXACT', 'LFSSYSSDEV', 'LFSSYSSDIR',
00026                       'LFSSYSSFILE', 'LFSSYSSBLKSIZE', 'LFSYSSBLKFREE', 'LFSYSSBLKTOT' ]
00027 SHORT_TIMEOUT = 3
00028 LONG_TIMEOUT  = 30
00029 
00030 class LFS(CmdPkg):
00031   """!\brief LFS telecommand package class
00032 
00033   Provides access to LFS telecommands.
00034   """
00035   def __init__(self, db):
00036     """!\brief LFS constructor.
00037 
00038     \param db  Wrapper database object for the generated module
00039               containing command and telemetry database classes.
00040     """
00041     CmdPkg.__init__(self, db)
00042 
00043   def getLFSstatus(self, unit, device):
00044     """!\brief Retreive the file system status
00045 
00046     \return a list of mnemonic values
00047     """
00048     raise NotImplementedError
00049     dumpHdlr = TelemetryEvent(cmdDb.getVsc().getDiagHandler(),
00050                               [ cmdDb.getVsc().getTlmDb().getApidFromName('LLFSSYSLIST')] )
00051     dumpHdlr.enable()
00052 
00053     # create the 32 bit file ID
00054     dumpUnit = FswFileID(device=device, directory=0x7f, fileNumber=0)
00055 
00056     self.LFSSYSSTATUS( LFSUNIT     = self.__LFSUNIT(unit),
00057                        LFSPAD16    = 0,
00058                        LFSFILEID   = dumpUnit.id())
00059     status = self.__checkLastCommandStatus()
00060 
00061     plds = dumpHdlr.waitForPayload( DUMP_FSSTAT_MNEMS, timeout = LONG_TIMEOUT )
00062     dumpHdlr.disable()
00063 
00064     return plds
00065 
00066 
00067   def __LFSUNIT(self, realUnit, tranID=0):
00068     # Actual upload is 4 bits of unit and 12 bits of opaque transaction ID.
00069     return ( (realUnit & 0xf) << 12 | (tranID & 0xfff) )

Generated on Thu Apr 27 20:52:42 2006 for LICOS L02-01-00 by doxygen 1.4.6-NO