ADC 400F Manual Página 64

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 74
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 63
Chapter 5. Complete program listings.
CTreeVariable& w2;
CTreeVariableArray& unused;
} MyParameters;
// Similarly, having declared the structure, we must define
// it and construct its elements
MyParameters vars = {
*(new CTreeVariable("vars.w1", 1.0, "arb/chan")),
*(new CTreeVariable("vars.w2", 1.0, "arb/chan")),
*(new CTreeVariableArray("vars.unused", 0.0, "furl/fort", 10, 0))
};
// CFixedEventUnpacker - Unpacks a fixed format event into
// a sequential set of parameters.
//
class CFixedEventUnpacker : public CEventProcessor
{
public:
virtual Bool_t operator()(const Address_t pEvent,
CEvent& rEvent,
CAnalyzer& rAnalyzer,
CBufferDecoder& rDecoder);
};
Bool_t
CFixedEventUnpacker::operator()(const Address_t pEvent,
CEvent& rEvent,
CAnalyzer& rAnalyzer,
CBufferDecoder& rDecoder)
{
// This sample unpacker unpacks a fixed length event which is
// preceded by a word count.
//
TranslatorPointer<UShort_t> p(*(rDecoder.getBufferTranslator()), pEvent);
CTclAnalyzer& rAna((CTclAnalyzer&)rAnalyzer);
UShort_t nWords = *p++;
Int_t i = 1;
// At least one member of the pipeline must tell the analyzer how
// many bytes were in the raw event so it knows where to find the
// next event.
rAna.SetEventSize(nWords*sizeof(UShort_t)); // Set event size.
nWords--; // The word count is self inclusive.
int param = 0; // No more than 10 parameters.
while(nWords && (param < 10)) { // Put parameters in the event starting at 1.
event.raw[param] = *p++;
nWords--;
59
Vista de página 63
1 2 ... 59 60 61 62 63 64 65 66 67 68 69 ... 73 74

Comentários a estes Manuais

Sem comentários