ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
packet_cdevpoltarget.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file packet_cdevpoltarget.cc
1 #include <packet_cdevpoltarget.h>
2 #include <stdio.h>
3 
5  : Packet_w4 (data)
6 {
7  ps = 0;
8 }
9 
10 int *Packet_cdevpoltarget::decode ( int *nwout)
11 {
12 
13  if (ps != 0) return 0;
14 
15  int *k = (int *) findPacketDataStart(packet);
16  if (k == 0)
17  {
18  ps = 0;
19  *nwout = 0;
20  return 0;
21  }
22  ps = ( struct cdevPolTargetData *) k;
23 
24 
25  *nwout = 0;
26 
27  return 0;
28 }
29 
30 
31 // ------------------------------------------------------
32 
33 
35 {
36 
37  int i;
38 
39  decode (&i);
40 
41  this->identify(os);
42 
43  os << "positionEncLinear " << iValue(i,"positionEncLinear") << std::endl;
44  os << "positionEncRot " << iValue(i,"positionEncRot") << std::endl;
45 
46 
47  dumpErrorBlock(os);
48  dumpDebugBlock(os);
49 }
50 
51 
52 int Packet_cdevpoltarget::iValue(const int ich, const char *what)
53 {
54 
55  // std::cout << "IN Packet_cdevpoltarget::iValue " << std::endl;
56  int i;
57  decode (&i);
58 
59 
60  if ( strcmp(what,"positionEncLinear") == 0)
61  {
62  return ps->positionEncLinear;
63  }
64 
65  if ( strcmp(what,"positionEncRot") == 0)
66  {
67 
68  return ps->positionEncRot;
69  }
70 
71 
72  std::cout << "packet_cdevpoltarget::iValue error unknown datum: " << what << std::endl;
73  return 0;
74 }
75