00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 __facility__ = "Online"
00011 __abstract__ = "Memory dump test application"
00012 __author__ = "S. Tuvi <Stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__ = "2006/01/03 00:08:27"
00014 __updated__ = "$Date: 2006/01/06 22:34:26 $"
00015 __version__ = "$Revision: 1.1 $"
00016 __release__ = "$Name: HEAD $"
00017 __credits__ = "SLAC"
00018
00019 import LICOS.copyright_SLAC
00020
00021 import threading
00022 import logging as log
00023 import time
00024 import struct
00025
00026 from LICOS.lib.scriptEngine.seAppBase import seAppBase
00027 from LICOS.lib.cmdTlmDb.LCATcmdDb import LCATcmdDb
00028 from LICOS.lib.LATconstants import *
00029 from LICOS.lib.cmdTlmDb.PBC import PBC
00030
00031
00032 class testMemDump(seAppBase):
00033 """!\brief Sample script based on seAppBase that demonstrates tele-commands.
00034
00035 Demonstrates queuing memory dump commands to the VSC.
00036
00037 """
00038 def __init__(self, common):
00039 """!\brief MemDump constructor.
00040
00041 \param common ScriptEngineCommon constructor
00042 """
00043 seAppBase.__init__(self, common)
00044 log.debug("%s.__init__()" % self.getName())
00045 self.__arg = None
00046
00047 def getName(self):
00048 """!\brief Return the name of this class.
00049
00050 \return Class name
00051 """
00052 return self.__class__.__name__
00053
00054 def setup(self):
00055 """!\brief SETUP transition method.
00056
00057 """
00058 log.debug("%s.setup()" % self.getName())
00059
00060 def run(self):
00061 """!\brief RUN transition method.
00062
00063 """
00064 log.debug("%s.run()" % self.getName())
00065
00066 lcat = LCATcmdDb(self.vsc)
00067 mem = lcat.MEM
00068 memAddr = PBC.WATCHDOG_TIMER_ADDRESS
00069 result = mem.dumpMemory(FSW_UNIT_SIU, memAddr, size=1, tranID=0, dest=FSW_DEST_1553)
00070 secs = (struct.unpack('!I',result)[0])*PBC.WATCHDOG_TIMER_SECS_PER_CLK
00071 log.info("Watchdog timer set to %.2f seconds." % secs)
00072 self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00073