Changeset 118 in pacpussensors


Ignore:
Timestamp:
01/13/16 17:30:51 (8 years ago)
Author:
DHERBOMEZ Gérald
Message:

add output for HDT, VTG, GGA frames
add timestamped structures for GPS

Location:
trunk/Gps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gps/gpsComponent.cpp

    r99 r118  
    7979
    8080}
     81
     82
     83void GpsComponent::addOutputs()
     84{
     85  addOutput<TimestampedGgaFrame, GpsComponent>("ggaOut");
     86  addOutput<TimestampedVtgFrame, GpsComponent>("vtgOut");
     87  addOutput<TimestampedVtgFrame, GpsComponent>("hdtOut");
     88}
     89
    8190
    8291
     
    221230{
    222231  ppsIndex_ = 0;
     232
     233  outGga_ = getTypedOutput<TimestampedGgaFrame, GpsComponent>("ggaOut");
     234  outVtg_ = getTypedOutput<TimestampedVtgFrame, GpsComponent>("vtgOut");
     235  outHdt_ = getTypedOutput<TimestampedHdtFrame, GpsComponent>("hdtOut");
     236
    223237
    224238  setActive( true );
     
    387401      ggaFrame.notifyObservers();
    388402
     403      memcpy(&mGga.frame, ggaFrame.getFrameData(), sizeof(trame_gga_dbl));
     404      mGga.time = ggaFrame.getRoadTime();
     405      mGga.timerange = 0;
     406
     407      // send GGA data to output
     408      checkedSend(outGga_, mGga);
     409
    389410      if ( (isRecording()) && (ggaRecording) ) {
    390411                    if (!(ggahdFile.isOpen()))
     
    510531      sendDataToServerSocket(hdtFrame,type);
    511532      hdtFrame.notifyObservers();
     533
     534      memcpy(&mHdt.frame, hdtFrame.getFrameData(), sizeof(trame_hdt));
     535      mHdt.time = hdtFrame.getRoadTime();
     536      mHdt.timerange = 0;
     537
     538      // send VTG data to output
     539      checkedSend(outHdt_, mHdt);
    512540
    513541      if ( (isRecording()) && (hdtRecording) )
     
    591619        vtgFrame.notifyObservers();
    592620
     621        memcpy(&mVtg.frame, vtgFrame.getFrameData(), sizeof(trame_vtg));
     622        mVtg.time = vtgFrame.getRoadTime();
     623        mVtg.timerange = 0;
     624
     625        // send VTG data to output
     626        checkedSend(outVtg_, mVtg);
     627
    593628        if (isRecording() && vtgRecording) {
    594629          if (!vtghdFile.isOpen())
  • trunk/Gps/gpsComponent.h

    r99 r118  
    1616#include "Pacpus/kernel/DbiteFile.h"
    1717#include "../NMEA0183/include/nmea0183.h"
     18#include <Pacpus/kernel/InputOutputInterface.h>
    1819
    1920#include "GpsFrames.h"
     
    8889  bool analyzeFrame(); /*!< reconstruct the entire frame starting from the received pieces */
    8990
     91  void addOutputs();
     92
    9093#ifdef WIN32
    9194  Win32SerialPort * serialPort;
     
    153156  ShMem * shMem_;
    154157
     158  TimestampedGgaFrame mGga;
     159  TimestampedVtgFrame mVtg;
     160  TimestampedHdtFrame mHdt;
     161
     162  // Declaration of outputs
     163  OutputInterface<TimestampedGgaFrame, GpsComponent>* outGga_;
     164  OutputInterface<TimestampedVtgFrame, GpsComponent>* outVtg_;
     165  OutputInterface<TimestampedHdtFrame, GpsComponent>* outHdt_;
     166
    155167  /// For the socket server
    156168  /* Qt3 version - 17/12/2007
  • trunk/Gps/structure_gps.h

    r102 r118  
    469469};
    470470
     471
     472/// trame_hdt structure with timestamping
     473struct TimestampedHdtFrame
     474{
     475    trame_hdt frame;
     476    road_time_t time;
     477    road_timerange_t timerange;
     478};
     479
    471480#endif // STRUCTURE_GPS_H
Note: See TracChangeset for help on using the changeset viewer.