Main Page
Related Pages
API Reference
Namespace List
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
g
i
n
o
p
r
s
t
v
w
x
z
Enumerations
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
u
v
w
x
y
z
Class List
Class List
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
v
z
Enumerations
b
c
e
f
g
h
k
o
p
r
s
t
v
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Related Functions
:
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
Variables
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
y
Typedefs
Enumerations
Enumerator
Macros
_
a
c
d
f
g
h
i
l
m
n
o
p
r
s
t
v
x
Examples
examples
time_example_1.cpp
Go to the documentation of this file.
1
//==============================================================================
2
//
3
// This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4
//
5
// The GNSSTk is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU Lesser General Public License as published
7
// by the Free Software Foundation; either version 3.0 of the License, or
8
// any later version.
9
//
10
// The GNSSTk is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU Lesser General Public License for more details.
14
//
15
// You should have received a copy of the GNU Lesser General Public
16
// License along with GNSSTk; if not, write to the Free Software Foundation,
17
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18
//
19
// This software was developed by Applied Research Laboratories at the
20
// University of Texas at Austin.
21
// Copyright 2004-2022, The Board of Regents of The University of Texas System
22
//
23
//==============================================================================
24
25
//==============================================================================
26
//
27
// This software was developed by Applied Research Laboratories at the
28
// University of Texas at Austin, under contract to an agency or agencies
29
// within the U.S. Department of Defense. The U.S. Government retains all
30
// rights to use, duplicate, distribute, disclose, or release this software.
31
//
32
// Pursuant to DoD Directive 523024
33
//
34
// DISTRIBUTION STATEMENT A: This software has been approved for public
35
// release, distribution is unlimited.
36
//
37
//==============================================================================
38
39
#include <iostream>
40
#include "
SystemTime.hpp
"
41
#include "
CommonTime.hpp
"
42
#include "
CivilTime.hpp
"
43
#include "
YDSTime.hpp
"
44
#include "
GPSWeekSecond.hpp
"
45
#include "
MJD.hpp
"
46
47
using namespace
std
;
48
using namespace
gnsstk
;
49
50
int
main
(
int
argc,
char
* argv[])
51
{
52
53
try
54
{
55
56
// In the GNSSTk there are multiple classes to manage time, depending
57
// on the specific operation that we want to carry out. This modular
58
// approach eases handling the many different time systems used in the
59
// modern Global Navigation Satellite Systems.
60
61
// Note, however, that in the GNSSTk the unifying class to do time
62
// computations is the 'CommonTime' class.
63
64
// Read current time from system clock
65
SystemTime
systime;
66
67
// Convert to 'CommonTime', the standard way to handle time at GNSSTk
68
// Please note that declaration, initialization and conversion are
69
// done in the same line.
70
CommonTime
comtime( systime );
71
72
// This is the typical way to handle civil time
73
CivilTime
civtime( comtime );
74
75
// The YDSTime class is very useful for common GNSS tasks
76
YDSTime
ydstime( comtime );
77
78
// This is a typical class to handle time in GPS system
79
GPSWeekSecond
gpstime( comtime );
80
81
// Class to handle Modified Julian Date
82
MJD
mjd
( comtime );
83
84
cout <<
"Hello world!"
<< endl;
85
cout <<
" The current civil time is "
<< civtime << endl;
86
cout <<
" The current year is "
<< ydstime.
year
<< endl;
87
cout <<
" The current day of year is "
<< ydstime.
doy
<< endl;
88
cout <<
" The current second of day is "
<< ydstime.
sod
<< endl;
89
cout <<
" The current full GPS week is "
<< gpstime.
week
<< endl;
90
cout <<
" The current short GPS week is "
<< gpstime.
getModWeek
()
91
<< endl;
92
cout <<
" The current day of GPS week is "
<< gpstime.
getDayOfWeek
()
93
<< endl;
94
cout <<
" The current second of GPS week is "
<< gpstime.
sow
<< endl;
95
cout <<
" The current Modified Julian Date is "
<<
mjd
<< endl;
96
97
}
98
catch
(
Exception
error)
99
{
100
cout << error << endl;
101
exit(-1);
102
}
103
104
exit(0);
105
}
YDSTime.hpp
example6.mjd
mjd
Definition:
example6.py:102
gnsstk::YDSTime
Definition:
YDSTime.hpp:58
main
int main(int argc, char *argv[])
Definition:
time_example_1.cpp:50
gnsstk
For Sinex::InputHistory.
Definition:
BasicFramework.cpp:50
MJD.hpp
gnsstk::GPSWeekSecond
Definition:
GPSWeekSecond.hpp:56
gnsstk::WeekSecond::getDayOfWeek
virtual unsigned int getDayOfWeek() const
Force this interface on this classes descendants.
Definition:
WeekSecond.hpp:134
gnsstk::Exception
Definition:
Exception.hpp:151
gnsstk::YDSTime::doy
int doy
Definition:
YDSTime.hpp:185
gnsstk::YDSTime::year
int year
Definition:
YDSTime.hpp:184
SystemTime.hpp
gnsstk::SystemTime
Definition:
SystemTime.hpp:54
gnsstk::CommonTime
Definition:
CommonTime.hpp:84
gnsstk::WeekSecond::sow
double sow
Definition:
WeekSecond.hpp:155
CivilTime.hpp
gnsstk::Week::week
int week
Full week number.
Definition:
Week.hpp:267
gnsstk::YDSTime::sod
double sod
Definition:
YDSTime.hpp:186
gnsstk::CivilTime
Definition:
CivilTime.hpp:55
GPSWeekSecond.hpp
CommonTime.hpp
std
Definition:
Angle.hpp:142
gnsstk::MJD
Definition:
MJD.hpp:54
gnsstk::Week::getModWeek
virtual unsigned int getModWeek() const
Definition:
Week.hpp:183
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:42