source: pacpussensors/trunk/StdDbtPlayerComponents/DbtPlyHdtManager.cpp

Last change on this file was 121, checked in by nguyenhu, 9 years ago

update StdDbtHdtManager

File size: 2.7 KB
RevLine 
[121]1/*********************************************************************
2// created: 2016/02/03 - 17:30
3
4//
5// author: Huu-Phuc NGUYEN
6//
7// version: $Id: DbtPlyHdtManager.cpp
8//
9// purpose: Dbite Player HDT Manager implementation
10*********************************************************************/
11
12#include "DbtPlyHdtManager.h"
13
14#include <cmath>
15#include <qapplication.h>
16
17#include "Pacpus/kernel/ComponentManager.h"
18
19namespace pacpus {
20
21//////////////////////////////////////////////////////////////////////////
22// Construction de la fabrique de composant DbtPlyHdtManager
23//////////////////////////////////////////////////////////////////////////
24static ComponentFactory<DbtPlyHdtManager> sFactory("DbtPlyHdtManager");
25
26// double dist1[2];
27// double dist2[2];
28
29//////////////////////////////////////////////////////////////////////////
30// Constructor
31//////////////////////////////////////////////////////////////////////////
32DbtPlyHdtManager::DbtPlyHdtManager(QString name)
33 : DbtPlyFileManager (name)
34{
35
36}
37
38//////////////////////////////////////////////////////////////////////////
39// Destructor
40DbtPlyHdtManager::~DbtPlyHdtManager()
41{
42
43}
44
45//////////////////////////////////////////////////////////////////////////
46// Processes data
47void DbtPlyHdtManager::processData(road_time_t t, road_timerange_t tr , void * buf)
48{
49 val = (trame_hdt*)(buf);
50
51 // make local copy of VTG frame
52 memcpy(&mHdt.frame, val, sizeof(trame_hdt));
53 mHdt.time = t;
54 mHdt.timerange = tr;
55
56 // send HDT data to output
57 checkedSend(outHdt, mHdt);
58
59}
60
61ComponentBase::COMPONENT_CONFIGURATION DbtPlyHdtManager::configureComponent(XmlComponentConfig config)
62{
63 DbtPlyFileManager::configureComponent(config);
64
65 return ComponentBase::CONFIGURED_OK;
66}
67
68void DbtPlyHdtManager::startActivity()
69{
70 DbtPlyFileManager::startActivity();
71 outHdt = getTypedOutput<TimestampedHdtFrame, DbtPlyHdtManager>("hdt");
72 // user interface
73}
74
75void DbtPlyHdtManager::stopActivity()
76{
77 DbtPlyFileManager::stopActivity();
78}
79
80
81/************************************************************************
82 * Called by the framework at initialization
83 ************************************************************************/
84void DbtPlyHdtManager::addInputs()
85{
86 // uncomment to add an input
87}
88
89
90/************************************************************************
91 * Called by the framework at initialization
92 ************************************************************************/
93void DbtPlyHdtManager::addOutputs()
94{
95 // empty: no output
96 addOutput<TimestampedHdtFrame, DbtPlyHdtManager>("hdt");
97}
98} // namespace pacpus
Note: See TracBrowser for help on using the repository browser.