Fiddling around with views, fdm data passing and management to try to be
more sensible so we can do a more reasonable external view. Fixed some const incorrectness.
This commit is contained in:
parent
1b45c9ee54
commit
8087bae02a
4 changed files with 15 additions and 15 deletions
|
@ -100,7 +100,7 @@ FGTime::~FGTime()
|
|||
|
||||
// Initialize the time dependent variables (maybe I'll put this in the
|
||||
// constructor later)
|
||||
void FGTime::init(FGInterface *f)
|
||||
void FGTime::init(const FGInterface& f)
|
||||
{
|
||||
FG_LOG( FG_EVENT, FG_INFO, "Initializing Time" );
|
||||
gst_diff = -9999.0;
|
||||
|
@ -121,8 +121,8 @@ void FGTime::init(FGInterface *f)
|
|||
// printf ("Current greenwich mean time = %24s", asctime(gmtime(&cur_time)));
|
||||
// printf ("Current local time = %24s", asctime(localtime(&cur_time)));
|
||||
// time_t tmp = cur_time;
|
||||
GeoCoord location(RAD_TO_DEG * f->get_Latitude(),
|
||||
RAD_TO_DEG * f->get_Longitude());
|
||||
GeoCoord location(RAD_TO_DEG * f.get_Latitude(),
|
||||
RAD_TO_DEG * f.get_Longitude());
|
||||
|
||||
GeoCoord* nearestTz = tzContainer->getNearest(location);
|
||||
|
||||
|
@ -316,7 +316,7 @@ double FGTime::sidereal_course(double lng)
|
|||
|
||||
|
||||
// Update time variables such as gmt, julian date, and sidereal time
|
||||
void FGTime::update(FGInterface *f)
|
||||
void FGTime::update(const FGInterface& f)
|
||||
{
|
||||
double gst_precise, gst_course;
|
||||
|
||||
|
@ -368,17 +368,17 @@ void FGTime::update(FGInterface *f)
|
|||
|
||||
gst_diff = gst_precise - gst_course;
|
||||
|
||||
lst = sidereal_course(-(f->get_Longitude() * RAD_TO_DEG)) + gst_diff;
|
||||
lst = sidereal_course(-(f.get_Longitude() * RAD_TO_DEG)) + gst_diff;
|
||||
} else {
|
||||
// course + difference should drift off very slowly
|
||||
gst = sidereal_course( 0.00 ) + gst_diff;
|
||||
lst = sidereal_course( -(f->get_Longitude() * RAD_TO_DEG)) + gst_diff;
|
||||
lst = sidereal_course( -(f.get_Longitude() * RAD_TO_DEG)) + gst_diff;
|
||||
}
|
||||
FG_LOG( FG_EVENT, FG_DEBUG,
|
||||
" Current lon=0.00 Sidereal Time = " << gst );
|
||||
FG_LOG( FG_EVENT, FG_DEBUG,
|
||||
" Current LOCAL Sidereal Time = " << lst << " ("
|
||||
<< sidereal_precise(-(f->get_Longitude() * RAD_TO_DEG))
|
||||
<< sidereal_precise(-(f.get_Longitude() * RAD_TO_DEG))
|
||||
<< ") (diff = " << gst_diff << ")" );
|
||||
}
|
||||
|
||||
|
|
|
@ -118,10 +118,10 @@ public:
|
|||
void togglePauseMode() { pause = !pause; };
|
||||
|
||||
// Initialize the time dependent variables
|
||||
void init(FGInterface *f);
|
||||
void init(const FGInterface& f);
|
||||
|
||||
// Update the time dependent variables
|
||||
void update(FGInterface *f);
|
||||
void update(const FGInterface& f);
|
||||
|
||||
void cal_mjd (int mn, double dy, int yr);
|
||||
void utc_gst();
|
||||
|
|
|
@ -114,7 +114,7 @@ static size_t num_leaps;
|
|||
static struct leap *leaps = NULL;
|
||||
|
||||
|
||||
static void fgtzset_internal (int always, char*tz);
|
||||
static void fgtzset_internal (int always, const char *tz);
|
||||
static int fgtz_compute(time_t timer, const struct tm *tm);
|
||||
static int fgcompute_change(fgtz_rule *rule, int year);
|
||||
static struct ttinfo *fgfind_transition (time_t timer);
|
||||
|
@ -162,7 +162,7 @@ struct tm _fgtmbuf;
|
|||
|
||||
|
||||
/* Return the `struct tm' representation of *T in local time. */
|
||||
struct tm * fgLocaltime (const time_t *t, char *tzName)
|
||||
struct tm * fgLocaltime (const time_t *t, const char *tzName)
|
||||
{
|
||||
return fgtz_convert (t, 1, &_fgtmbuf, tzName);
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ struct tm * fgLocaltime (const time_t *t, char *tzName)
|
|||
|
||||
/* Return the `struct tm' representation of *TIMER in the local timezone.
|
||||
Use local time if USE_LOCALTIME is nonzero, UTC otherwise. */
|
||||
struct tm * fgtz_convert (const time_t *timer, int use_localtime, struct tm *tp, char *tzName)
|
||||
struct tm * fgtz_convert (const time_t *timer, int use_localtime, struct tm *tp, const char *tzName)
|
||||
{
|
||||
long int leap_correction;
|
||||
long int offsetCorr; // ADDED TO RESOLVE NON-ANSI FIELDS IN struct tm
|
||||
|
@ -276,7 +276,7 @@ static char *abbr(struct tm *tmp)
|
|||
|
||||
|
||||
/* Interpret the TZ envariable. */
|
||||
static void fgtzset_internal (int always, char* tz)
|
||||
static void fgtzset_internal (int always, const char *tz)
|
||||
{
|
||||
time_t now;
|
||||
time(&now);
|
||||
|
|
|
@ -39,11 +39,11 @@
|
|||
void show (const char *zone, time_t t, int v);
|
||||
|
||||
/* adapted from <time.h> */
|
||||
struct tm * fgLocaltime (const time_t *t, char *tzName);
|
||||
struct tm * fgLocaltime (const time_t *t, const char *tzName);
|
||||
|
||||
/* Prototype for the internal function to get information based on TZ. */
|
||||
extern struct tm *fgtz_convert (const time_t *t, int use_localtime,
|
||||
struct tm *tp, char *tzName);
|
||||
struct tm *tp, const char *tzName);
|
||||
|
||||
/* This structure contains all the information about a
|
||||
timezone given in the POSIX standard TZ envariable. */
|
||||
|
|
Loading…
Reference in a new issue