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
core
lib
RefTime
BasicTimeSystemConverter.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 "
BasicTimeSystemConverter.hpp
"
40
#include "
CivilTime.hpp
"
41
42
namespace
gnsstk
43
{
44
bool
BasicTimeSystemConverter ::
45
getOffset
(
TimeSystem
fromSys,
TimeSystem
toSys,
46
const
CommonTime
& t,
double
& offs)
47
{
48
if
(fromSys == toSys)
49
{
50
// nothing to do
51
offs = 0.;
52
return
true
;
53
}
54
// Make sure to do enum comparison first as that is much less
55
// expensive than time comparison.
56
if
((fromSys ==
fromSystem
) && (toSys ==
toSystem
) &&
57
(t >=
fromTimeStamp
) && (t <=
toTimeStamp
))
58
{
59
offs =
toffs
;
60
return
true
;
61
}
62
CivilTime
civ(t);
63
try
64
{
65
offs =
getTimeSystemCorrection
(fromSys, toSys, civ.
year
, civ.
month
,
66
civ.
day
);
67
}
68
catch
(
gnsstk::Exception
& exc)
69
{
70
std::cerr << exc << std::endl;
71
return
false
;
72
}
73
return
true
;
74
}
75
76
77
bool
BasicTimeSystemConverter ::
78
explore
(
TimeSystem
fromSys,
TimeSystem
toSys,
79
const
CommonTime
& fromTime,
const
CommonTime
& toTime)
80
{
81
double
offs1, offs2;
82
if
(
getOffset
(fromSys, toSys, fromTime, offs1) &&
83
getOffset
(fromSys, toSys, toTime, offs2))
84
{
85
if
(offs1 == offs2)
86
{
87
fromSystem
= fromSys;
88
toSystem
= toSys;
89
fromTimeStamp
= fromTime;
90
toTimeStamp
= toTime;
91
toffs
= offs1;
92
}
93
return
true
;
94
}
95
else
96
{
97
return
false
;
98
}
99
}
100
}
gnsstk::CivilTime::year
int year
Definition:
CivilTime.hpp:198
gnsstk::CivilTime::day
int day
Definition:
CivilTime.hpp:200
gnsstk::BasicTimeSystemConverter::explore
bool explore(TimeSystem fromSys, TimeSystem toSys, const CommonTime &fromTime, const CommonTime &toTime)
Definition:
BasicTimeSystemConverter.cpp:78
gnsstk
For Sinex::InputHistory.
Definition:
BasicFramework.cpp:50
gnsstk::Exception
Definition:
Exception.hpp:151
BasicTimeSystemConverter.hpp
gnsstk::CommonTime
Definition:
CommonTime.hpp:84
gnsstk::TimeSystem
TimeSystem
Definition of various time systems.
Definition:
TimeSystem.hpp:51
CivilTime.hpp
gnsstk::BasicTimeSystemConverter::fromTimeStamp
CommonTime fromTimeStamp
First time that toffs is known to be valid.
Definition:
BasicTimeSystemConverter.hpp:88
gnsstk::CivilTime
Definition:
CivilTime.hpp:55
gnsstk::BasicTimeSystemConverter::toSystem
TimeSystem toSystem
Time system being converted to using toffs.
Definition:
BasicTimeSystemConverter.hpp:86
gnsstk::BasicTimeSystemConverter::fromSystem
TimeSystem fromSystem
Time system being converted from using toffs.
Definition:
BasicTimeSystemConverter.hpp:84
gnsstk::CivilTime::month
int month
Definition:
CivilTime.hpp:199
gnsstk::BasicTimeSystemConverter::toTimeStamp
CommonTime toTimeStamp
Final time that toffs is known to be valid.
Definition:
BasicTimeSystemConverter.hpp:90
gnsstk::BasicTimeSystemConverter::toffs
double toffs
Stored offset for time system conversion.
Definition:
BasicTimeSystemConverter.hpp:92
gnsstk::getTimeSystemCorrection
double getTimeSystemCorrection(const TimeSystem inTS, const TimeSystem outTS, const int year, const int month, const double day)
Definition:
TimeSystem.cpp:181
gnsstk::BasicTimeSystemConverter::getOffset
bool getOffset(TimeSystem fromSys, TimeSystem toSys, const CommonTime &t, double &offs) override
Definition:
BasicTimeSystemConverter.cpp:45
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:38