File indexing completed on 2025-08-03 08:20:51
0001 #include <packet_cdevpoltarget.h>
0002 #include <stdio.h>
0003
0004 Packet_cdevpoltarget::Packet_cdevpoltarget(PACKET_ptr data)
0005 : Packet_w4 (data)
0006 {
0007 ps = 0;
0008 }
0009
0010 int *Packet_cdevpoltarget::decode ( int *nwout)
0011 {
0012
0013 if (ps != 0) return 0;
0014
0015 int *k = (int *) findPacketDataStart(packet);
0016 if (k == 0)
0017 {
0018 ps = 0;
0019 *nwout = 0;
0020 return 0;
0021 }
0022 ps = ( struct cdevPolTargetData *) k;
0023
0024
0025 *nwout = 0;
0026
0027 return 0;
0028 }
0029
0030
0031
0032
0033
0034 void Packet_cdevpoltarget::dump ( OSTREAM &os)
0035 {
0036
0037 int i;
0038
0039 decode (&i);
0040
0041 this->identify(os);
0042
0043 os << "positionEncLinear " << iValue(i,"positionEncLinear") << std::endl;
0044 os << "positionEncRot " << iValue(i,"positionEncRot") << std::endl;
0045
0046
0047 dumpErrorBlock(os);
0048 dumpDebugBlock(os);
0049 }
0050
0051
0052 int Packet_cdevpoltarget::iValue(const int ich, const char *what)
0053 {
0054
0055
0056 int i;
0057 decode (&i);
0058
0059
0060 if ( strcmp(what,"positionEncLinear") == 0)
0061 {
0062 return ps->positionEncLinear;
0063 }
0064
0065 if ( strcmp(what,"positionEncRot") == 0)
0066 {
0067
0068 return ps->positionEncRot;
0069 }
0070
0071
0072 std::cout << "packet_cdevpoltarget::iValue error unknown datum: " << what << std::endl;
0073 return 0;
0074 }
0075