source: ntrip/trunk/GnssCenter/thrift/rtnet_sdo_example/RtnetDataHandler.cpp@ 4941

Last change on this file since 4941 was 4941, checked in by mervart, 9 years ago
File size: 2.7 KB
Line 
1#include "RtnetDataHandler.h"
2
3#include <cstdio>
4
5extern "C" {
6#include <time.h>
7}
8
9using namespace com::gpssolutions::rtnet;
10
11RtnetDataHandler::RtnetDataHandler()
12{
13}
14
15RtnetDataHandler::~RtnetDataHandler() {
16}
17
18void
19RtnetDataHandler::startDataStream() {
20}
21
22void
23RtnetDataHandler::registerRtnet(const RtnetInformation& info) {
24 /*registered_ = true;
25 jobName_ = info.jobName;
26 printf("registerRtnet(): %s\n",jobName_.c_str());
27 OneRtnetJobInfo* pInfo = jobStatus_->oneJobInfo(jobName_);
28 {
29 Guard lock(pInfo->mutex());
30 UpdateStatus& status = pInfo->updateStatus();
31 status.stationInfoUpdated = 0;
32 status.stationAuxInfoUpdated = 0;
33 status.rtnetInfoUpdated = 0;
34 }*/
35}
36
37void
38RtnetDataHandler::handleZDAmb(const std::vector<ZDAmb> & ambList) {
39 printf("Decoded ZD ambiguity record\n");
40 if (ambList.empty()) {
41 printf("No ZD ambiguities present\n");
42 return;
43 }
44 std::vector<ZDAmb>::const_iterator zdIt;
45 std::string staName = ambList[0].stationID;
46 printf ("Received %zd zero-difference ambiguities for station %s\n",ambList.size(),staName.c_str());
47}
48
49void
50RtnetDataHandler::handleDDAmbresBaselines(const std::vector<DDAmbresBaseline>& ambList) {
51 printf("Decoded double difference ambiguities record (%zd DD ambiguities)\n",ambList.size());
52}
53
54void
55RtnetDataHandler::handleSatelliteXYZ(const std::vector<SatelliteXYZ>& svXYZList) {
56 printf("Decoded satellite XYZ record (%zd satellites)\n",svXYZList.size());
57}
58
59void
60RtnetDataHandler::handleStationInfo(const std::vector<StationInfo> & stationList) {
61 printf("Decoded station information record for %zd stations\n",stationList.size());
62}
63
64void
65RtnetDataHandler::handleStationAuxInfo(const std::vector<StationAuxInfo> & stationAuxList) {
66 printf("Decoded auxilary station record for %d stations\n",stationAuxList.size());
67}
68
69void
70RtnetDataHandler::handleDGPSCorr(const std::vector<DGPSCorr> & dgpsList) {
71 printf("Decoded DGPS correction (%zd corrections)\n",dgpsList.size());
72}
73
74void
75RtnetDataHandler::handleSatelliteClock(const std::vector<SatelliteClock> & svList) {
76 printf("Decoded RTNet satellite clock structure (%zd satellite clocks)\n",svList.size());
77}
78
79void
80RtnetDataHandler::handleEpochResults(const RtnetEpoch& epoch) {
81 long mjlDay = epoch.mjlDay;
82 if (mjlDay < 0) mjlDay += 65536l;
83 long unixSec = (mjlDay-40587L)*24L*60L*60L;
84 unixSec += epoch.msecDay / 1000;
85 char timeStrBuffer[18];
86 struct tm tmEpoch;
87 time_t tEpoch = static_cast<time_t>(unixSec);
88 gmtime_r(&tEpoch,&tmEpoch);
89 if (strftime(timeStrBuffer,17,"%H:%M:%S",&tmEpoch) != 0)
90 printf("Decoded RTNet epoch structure for epoch %s.%03d\n",timeStrBuffer,epoch.msecDay % 1000);
91 else
92 printf("Decoded RTNet epoch structure for epoch %ld %.3f\n",epoch.mjlDay,epoch.msecDay / 1000.0);
93}
94
Note: See TracBrowser for help on using the repository browser.