ITS
DestinationAreaData.cpp
Go to the documentation of this file.
1 #include "DestinationAreaData.h"
2 
3 #include <QDataStream>
4 
6 {
9  m_distanceA = 0;
10  m_distanceB = 0;
11  m_angle = 0;
13 }
14 
16 {
17  m_shape = (e_shape)extractUInt(data, 1, offset);
18  m_geoAreaPosLatitude = extractInt(data, 4, offset);
19  m_geoAreaPosLongitude = extractInt(data, 4, offset);
20  m_distanceA = extractUInt(data, 2, offset);
21  m_distanceB = extractUInt(data, 2, offset);
22  m_angle = extractUInt(data, 2, offset);
23 }
24 
25 DestinationAreaData::DestinationAreaData(e_shape shape, qint32 lat, qint32 lon, quint16 a, quint16 b, quint16 angle)
26 {
27  m_shape = shape;
30  m_distanceA = a;
31  m_distanceB = b;
32  m_angle = angle;
33 }
34 
36 {
41  if(m_distanceB)
42  {
45  }
46  else
47  {
48  m_angle = 0;
50  }
51 }
52 
54 {
55  QByteArray bin;
56  QDataStream ds(&bin, QIODevice::WriteOnly);
57 
59 
60  return bin;
61 }
62 
64 {
65  return QString("DestinationArea ::= {\n"
66  "\tGeoAreaPosLatitude ::= %1\n"
67  "\tGeoAreaPosLongitude ::= %2\n"
68  "\tDistanceA ::= %3\n"
69  "\tDistanceB ::= %4\n"
70  "\tAngle ::= %5\n"
71  "\tShape ::= %6\n"
72  "}\n")
75  .arg(m_distanceA)
76  .arg(m_distanceB)
77  .arg(m_angle)
78  .arg(m_shape);
79 }
SemiAxisLength_t semiMinorConfidence
QString toString()
toString Human readable encoder of the destination area.
Destination area serialize.
DestinationAreaData()
DestinationAreaData DestinationAreaData constructor.
HeadingValue_t semiMajorOrientation
e_shape shape() const
shape Shape of the area getter.
SemiAxisLength_t semiMajorConfidence
PosConfidenceEllipse_t positionConfidenceEllipse
quint64 extractUInt(char *data, int l, int *offset)
extractUInt Extract an unsigned integer from byte array.
Definition: apiData.cpp:3
qint64 extractInt(char *data, int l, int *offset)
extractInt Extract an signed integer from byte array.
Definition: apiData.cpp:22
e_shape
The e_shape enum defines the shape types.
quint16 angle() const
angle Heading to the North of the area getter.
QByteArray toBin()
toBin Byte array encoder of the destination area.