[82] | 1 | /*********************************************************************
|
---|
| 2 | // created: 2007/04/12 - 16:30
|
---|
| 3 |
|
---|
| 4 | //
|
---|
| 5 | // author: Elie Al Alam & Gerald Dherbomez
|
---|
| 6 | //
|
---|
| 7 | // version: $Id: DbtPlyGstManager.cpp 1203 2012-08-02 11:58:15Z morasjul $
|
---|
| 8 | //
|
---|
| 9 | // purpose: Dbite Player Gst Manager implementation
|
---|
| 10 | *********************************************************************/
|
---|
| 11 |
|
---|
| 12 | #include "DbtPlyGstManager.h"
|
---|
| 13 |
|
---|
| 14 | #include <qapplication.h>
|
---|
| 15 |
|
---|
| 16 | //#include "kernel/ComponentManager.h"
|
---|
| 17 |
|
---|
| 18 | namespace pacpus {
|
---|
| 19 |
|
---|
| 20 | // Construction de la fabrique de composant DbtPlyTrigger
|
---|
| 21 | static ComponentFactory<DbtPlyGstManager> sFactory("DbtPlyGstManager");
|
---|
| 22 |
|
---|
| 23 | DbtPlyGstManager::DbtPlyGstManager(QString name)
|
---|
| 24 | : DbtPlyFileManager (name)
|
---|
| 25 | {
|
---|
| 26 |
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | DbtPlyGstManager::~DbtPlyGstManager()
|
---|
| 30 | {
|
---|
| 31 |
|
---|
| 32 | }
|
---|
| 33 |
|
---|
[150] | 34 | void DbtPlyGstManager::processData(road_time_t t, road_timerange_t tr , void * buf)
|
---|
[82] | 35 | {
|
---|
[150] | 36 | // no data available
|
---|
| 37 | if (!buf) {
|
---|
| 38 | LOG_DEBUG("no data available: NULL buffer");
|
---|
| 39 | return;
|
---|
| 40 | }
|
---|
| 41 | // make local copy of GGA frame
|
---|
| 42 | memcpy(&mGst.frame, buf, sizeof(trame_gst));
|
---|
| 43 | mGst.time = t;
|
---|
| 44 | mGst.timerange = tr;
|
---|
[82] | 45 |
|
---|
[150] | 46 | // send GGA data to output
|
---|
| 47 | checkedSend(outGst, mGst);
|
---|
| 48 |
|
---|
| 49 | //old val = (trame_gst*)(buf);
|
---|
[82] | 50 |
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | ComponentBase::COMPONENT_CONFIGURATION DbtPlyGstManager::configureComponent(XmlComponentConfig config)
|
---|
| 54 | {
|
---|
| 55 | DbtPlyFileManager::configureComponent(config);
|
---|
| 56 |
|
---|
| 57 | return ComponentBase::CONFIGURED_OK;
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 |
|
---|
| 61 | void DbtPlyGstManager::startActivity()
|
---|
| 62 | {
|
---|
| 63 | DbtPlyFileManager::startActivity();
|
---|
| 64 |
|
---|
[150] | 65 | outGst = getTypedOutput<TimestampedGstFrame, DbtPlyGstManager>("gst");
|
---|
| 66 |
|
---|
[82] | 67 | // user interface
|
---|
[109] | 68 | if (hasGui())
|
---|
[82] | 69 | displayUI();
|
---|
| 70 |
|
---|
| 71 | }
|
---|
| 72 |
|
---|
| 73 |
|
---|
| 74 | void DbtPlyGstManager::stopActivity()
|
---|
| 75 | {
|
---|
| 76 | DbtPlyFileManager::stopActivity();
|
---|
| 77 | }
|
---|
| 78 |
|
---|
[150] | 79 | void DbtPlyGstManager::addOutputs()
|
---|
| 80 | {
|
---|
| 81 | // empty: no output
|
---|
| 82 | addOutput<TimestampedGstFrame, DbtPlyGstManager>("gst");
|
---|
| 83 | }
|
---|
[82] | 84 |
|
---|
| 85 | void DbtPlyGstManager::displayUI()
|
---|
| 86 | {
|
---|
[150] | 87 | // TODO
|
---|
| 88 | LOG_WARN("GUI not implemented");
|
---|
[82] | 89 | }
|
---|
| 90 |
|
---|
| 91 | } // namespace pacpus
|
---|