add gps.o

pull/1/head
bert hubert 2019-08-17 11:05:03 +02:00
parent ceb39d46c3
commit 839344976b
3 changed files with 10 additions and 6 deletions

View File

@ -15,7 +15,7 @@ SIMPLESOCKETS=ext/powerblog/ext/simplesocket/swrappers.o ext/powerblog/ext/simpl
navparse: navparse.o ext/fmt-5.2.1/src/format.o $(H2OPP) $(SIMPLESOCKETS) minicurl.o ubx.o bits.o navmon.pb.o gps.o
$(CXX) -std=gnu++17 $^ -o $@ -pthread -L/usr/local/lib -lh2o-evloop -lssl -lcrypto -lz -lcurl -lprotobuf # -lwslay
navdump: navdump.o ext/fmt-5.2.1/src/format.o bits.o navmon.pb.o
navdump: navdump.o ext/fmt-5.2.1/src/format.o bits.o navmon.pb.o gps.o
$(CXX) -std=gnu++17 $^ -o $@ -pthread -lprotobuf

View File

@ -1,13 +1,14 @@
#pragma once
#include "minivec.hh"
void getCoordinates(int wn, double tow, const auto& iod, Point* p, bool quiet=true)
template<typename T>
void getCoordinates(int wn, double tow, T& iod, Point* p, bool quiet=true)
{
using namespace std;
// here goes
constexpr double mu = 3.986004418 * pow(10.0, 14.0);
constexpr double omegaE = 7.2921151467 * pow(10.0, -5);
const double mu = 3.986004418 * pow(10.0, 14.0);
const double omegaE = 7.2921151467 * pow(10.0, -5);
double sqrtA = 1.0*iod.sqrtA / (1ULL<<19);
double deltan = M_PI * 1.0*iod.deltan / (1LL<<43);

View File

@ -22,7 +22,7 @@ using namespace std;
static std::string humanTime(time_t t)
{
struct tm tm;
struct tm tm={0};
gmtime_r(&t, &tm);
char buffer[80];
@ -67,7 +67,10 @@ int main(int argc, char** argv)
uint8_t page;
int frame=parseGPSMessage(cond, gs, &page);
cout<<"GPS "<<sv<<": ";
if(frame == 2) {
if(frame == 1) {
cout << "gpshealth = "<<(int)gs.gpshealth;
}
else if(frame == 2) {
cout << "t0e = "<<gs.iods.begin()->second.t0e;
}
cout<<"\n";