Changeset 88 in pacpussensors for trunk/SpanCPTComponent


Ignore:
Timestamp:
Jun 25, 2015, 6:09:40 PM (9 years ago)
Author:
DHERBOMEZ Gérald
Message:

add output of 2D ENU position

Location:
trunk/SpanCPTComponent
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SpanCPTComponent/CPTComponent.cpp

    r78 r88  
    1515#include <iostream>
    1616
    17 #include "Pacpus/kernel/ComponentFactory.h"
    18 #include "Pacpus/kernel/DbiteFileTypes.h"
    19 #include "Pacpus/kernel/Log.h"
    20 #include "Pacpus/PacpusTools/geodesie.h"
    21 #include "Pacpus/PacpusTools/ShMem.h"
     17#include <Pacpus/kernel/ComponentFactory.h>
     18#include <Pacpus/kernel/DbiteFileTypes.h>
     19#include <Pacpus/kernel/Log.h>
     20#include <Pacpus/PacpusTools/geodesie.h>
     21#include <Pacpus/PacpusTools/ShMem.h>
     22
    2223
    2324namespace pacpus {
     
    106107    return ComponentBase::CONFIGURED_OK;
    107108}
     109
     110
     111
     112void CPTComponent::addOutputs()
     113{
     114    // must inherit from QObject to use addOutput
     115  addOutput<QPointF, CPTComponent>("position2DENU");
     116}
     117
    108118
    109119void CPTComponent::setPortCOM(const char * port)
     
    222232                    }
    223233                    mShMem->write(allFramesBuffer, AllFramesSize);
     234
     235                                        if (position2DENUOutput_ && position2DENUOutput_->hasConnection())
     236                                        {
     237                                                // send ENU 2D position
     238                                                QPointF pt( bestgpsposaFrame_.e, bestgpsposaFrame_.n);
     239                                                position2DENUOutput_->send(pt);
     240                                        }
    224241                    break;
    225242
     
    411428        LOG_WARN("cannot connect SIGNAL(newDataAvailable(int)) with SLOT(unlockProcessing(int)");
    412429    }
    413     LOG_INFO("started component '" << name() << "'");
     430    LOG_INFO("started component '" << name() << "'");
     431
     432        position2DENUOutput_ = getTypedOutput<QPointF, CPTComponent>("position2DENU");
     433
    414434
    415435    serialPort->THREAD_ALIVE = true;
  • trunk/SpanCPTComponent/CPTComponent.h

    r78 r88  
     1
    12/*********************************************************************
    23//  created:    2011/06/28 - 18:18
     
    1920
    2021#include "../NMEA0183/include/nmea0183.h"
    21 #include "Pacpus/kernel/ComponentBase.h"
    22 #include "Pacpus/kernel/DbiteFile.h"
    23 #include "Pacpus/kernel/pacpus.h"
     22#include <Pacpus/kernel/ComponentBase.h>
     23#include <Pacpus/kernel/DbiteFile.h>
     24#include <Pacpus/kernel/pacpus.h>
     25#include <Pacpus/kernel/InputOutputInterface.h>
    2426#include "../Gps/structure_gps.h"
     27
    2528
    2629#ifdef WIN32
     
    158161                     TimestampedInspvaaFrame*,
    159162                     TimestampedInscovFrame*);
     163
     164        // component ouputs
     165        void addOutputs();
     166        OutputInterface<QPointF, CPTComponent>* position2DENUOutput_;
    160167};
    161168
Note: See TracChangeset for help on using the changeset viewer.