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__ = "Pack possible opcodes" 00013 __author__ = "Amedeo Perazzo <perazzo@slac.stanford.edu> SLAC - GLAST I&T/Online" 00014 __date__ = ("$Date: 2004/12/05 21:07:07 $").split(' ')[1] 00015 __version__ = "$Revision: 2.1 $" 00016 __release__ = "$Name: R04-12-00 $" 00017 __credits__ = "SLAC" 00018 00019 import LATTE.copyright_SLAC 00020 00021 import struct 00022 00023 class Opcode: 00024 Close = 0 00025 Keepgoing = 1 00026 SetEventSocket = 2 00027 ForceEventSocket = 3 00028 00029 def __init__(self, value): 00030 self.__packet = struct.pack('!IHH', 4, 0, value) 00031 00032 def packet(self): 00033 return self.__packet