33extern char *
epochToStr (time_t t,
bool seconds,
char *str,
size_t len);
34extern struct tm
gribDateToTm (long intDate, double nHours);
35extern bool isDayLight (
struct tm *tm0,
double t,
double lat,
double lon);
36extern char *
fSailName (
int val,
char *str,
size_t maxLen);
37extern char *
newFileNameSuffix (
const char *fileName,
const char *suffix,
char *newFileName,
size_t maxLen);
40extern char *
buildRootName (
const char *fileName,
char *rootName,
size_t maxLen);
42extern double getCoord (
const char *str,
double min,
double max);
43extern char *
latToStr (
double lat,
int type,
char* str,
size_t maxLen);
44extern char *
lonToStr (
double lon,
int type,
char* str,
size_t maxLen);
45extern char *
durationToStr (
double duration,
char *res,
size_t maxLen);
49extern char *
newDate (
long intDate,
double myTime,
char *res,
size_t maxLen);
50extern char *
newDateWeekDay (
long intDate,
double myTime,
char *res,
size_t maxLen);
52extern bool readParam (
const char *fileName,
bool initDisp);
53extern bool writeParam (
const char *fileName,
bool header,
bool password,
bool yaml);
54extern bool readIsSea (
const char *fileName);
57extern bool mostRecentFile (
const char *directory,
const char *pattern0,
const char *pattern1,
char *
name,
size_t maxLen);
58extern double fPenalty (
int shipIndex,
int type,
double tws,
double energy,
double *cStamina);
59extern double fPointLoss (
int shipIndex,
int type,
double tws,
bool fullPack);
62extern int nearestPort (
double lat,
double lon,
const char *fileName,
char *str,
size_t maxLen);
64extern char *
readTextFile (
const char *fileName,
char *errMessage,
size_t maxLen);
#define MAX_N_FORBID_ZONE
bool writeParam(const char *fileName, bool header, bool password, bool yaml)
write parameter file from struct par header or not, password or not yaml style or not
WayPointList wayPoints
list of wayPoint
char * lonToStr(double lon, int type, char *str, size_t maxLen)
convert lon to str according to type
bool readParam(const char *fileName, bool initDisp)
read parameter file and build par struct
void updateIsSeaWithForbiddenAreas(void)
complement according to forbidden areas
char * durationToStr(double duration, char *res, size_t maxLen)
convert hours in string with days, hours, minutes
char * newDateWeekDay(long intDate, double myTime, char *res, size_t maxLen)
return date and time using week day after adding myTime (hours) to the Date
double offsetLocalUTC(void)
return offset Local UTC in seconds
bool readMarkCSVToJson(const char *fileName, char *out, size_t maxLen)
read CSV file marks (Virtual Regatta) if check then polarCheck
double monotonic(void)
return seconds with decimals
char * newDate(long intDate, double myTime, char *res, size_t maxLen)
return date and time using ISO notation after adding myTime (hours) to the Date
double fPointLoss(int shipIndex, int type, double tws, bool fullPack)
for virtual Regatta.
time_t gribDateTimeToEpoch(long date, long time)
convert long date/time from GRIB to time_t (UTC, via timegm)
bool isNumber(const char *name)
true if name contains a number
PolMat wavePolMat
polar matrix for waves
const size_t sailNameSize
sail attributes
MyPolygon forbidZones[MAX_N_FORBID_ZONE]
forbid zones
double getCoord(const char *str, double min, double max)
translate str in double for latitude longitude
bool hasSlash(const char *name)
true if name terminates with slash
char * buildRootName(const char *fileName, char *rootName, size_t maxLen)
Build root name if not already a root name.
bool isDayLight(struct tm *tm0, double t, double lat, double lon)
char * paramToStrJson(Par *par, char *buffer, size_t maxLen)
Return JSON formatted subset of parameters into 'out'.
char * tIsSea
table describing if sea or earth
PolMat polMat
polar description
int nearestPort(double lat, double lon, const char *fileName, char *str, size_t maxLen)
return id and name of nearest port found in file fileName from lat, lon.
bool mostRecentFile(const char *directory, const char *pattern0, const char *pattern1, char *name, size_t maxLen)
select most recent file in "directory" that contains "pattern0" and "pattern1" in name return true if...
struct tm gribDateToTm(long intDate, double nHours)
return tm struct equivalent to date hours found in grib (UTC time) struct tm gribDateToTm (long intDa...
bool readIsSea(const char *fileName)
read issea file and fill table tIsSea
double getDepartureTimeInHour(struct tm *startUtc)
calculate difference in hours between departure time in UTC and time 0
PolMat sailPolMat
polar matrix for sails
char * readTextFile(const char *fileName, char *errMessage, size_t maxLen)
read all text file in buffer.
Par par
parameters desciption
char * fSailName(int val, char *str, size_t maxLen)
return the name of the sail
Zone zone
Zone description.
CompetitorsList competitors
for competitors
char * gribDateTimeToStr(long date, long time, char *str, size_t len)
return str representing grib date
char * formatThousandSep(char *buffer, size_t maxLen, int value)
struct MeteoElmt meteoTab[N_METEO_ADMIN]
Meteo service.
char * epochToStr(time_t t, bool seconds, char *str, size_t len)
functions defined in r3util.c
double fPenalty(int shipIndex, int type, double tws, double energy, double *cStamina)
char * newDateWeekDayVerbose(long intDate, double myTime, char *res, size_t maxLen)
return date and time using week day after adding myTime (hours) to the Date
char * latToStr(double lat, int type, char *str, size_t maxLen)
convert lat to str according to type
char * newFileNameSuffix(const char *fileName, const char *suffix, char *newFileName, size_t maxLen)
replace former suffix (after last dot) by suffix example : "pol/bibi.toto.csv" with suffix "sailpol" ...
double fTimeToRecupOnePoint(double tws)
for virtual Regatta.
void normalizeSpaces(char *s)
replace multiple spaces by just one