add corrected coordinates conversion; add info and update

This commit is contained in:
Edward Emelianov
2026-10-17 02:14:52 +03:00
parent 6f0e2769f8
commit 3b0bc4183c
8 changed files with 276 additions and 92 deletions

View File

@@ -87,17 +87,9 @@ static int printhdr(int fd, const char *key, const char *val, const char *cmnt){
*/
void wrhdr(fitsheader_t *HDR){
if(!HDR) return;
static time_t lastcorr = 0; // last time of time/weather corrections sent to mount
double curtime = sl_dtime();
//bool haveweather = false;
bool poweredON = (HDR->status == MNT_S_ERROR || HDR->status == MNT_S_OFF) ? false : true;
// weather block
if(time(NULL) - HDR->weather.last_update < (int)(1. + MOUNT_CHECK_T * 10.)){ // weather data is good
if(poweredON && time(NULL) - lastcorr > CORRECTIONS_TIMEDIFF){ // make correction once per hour
if(mount_corrdata(&HDR->weather)) lastcorr = time(NULL);
}
//haveweather = true;
}else WARNX("bad weather; curtime - HDR->weather.last_update = %g", curtime - HDR->weather.last_update);
if(!hdname){
DBG("hdname not given!");
return;