|
RCube
Rcube Rest Server calculates sail routes based on Grib files and sailing boat polar files
|
#include <float.h>#include <ctype.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <stdbool.h>#include <sys/stat.h>#include <dirent.h>#include <unistd.h>#include <time.h>#include <math.h>#include <locale.h>#include "glibwrapper.h"#include "r3types.h"#include "inline.h"
Go to the source code of this file.
Macros | |
| #define | MAX_N_SHIP_TYPE 2 |
| compilation: gcc -c r3util.c | |
Functions | |
| char * | fSailName (int val, char *str, size_t maxLen) |
| return the name of the sail | |
| 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" will give: "pol/bibi.toto.sailpol" | |
| bool | isEmpty (const char *str) |
| return true if str is empty | |
| char * | formatThousandSep (char *buffer, size_t maxLen, long value) |
| format big number with thousand sep. | |
| bool | hasSlash (const char *name) |
| true if name terminates with slash | |
| 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 found with name of selected file | |
| bool | isNumber (const char *name) |
| true if name contains a number | |
| double | getCoord (const char *str, double minLimit, double maxLimit) |
| translate str in double for latitude longitude | |
| char * | buildRootName (const char *fileName, char *rootName, size_t maxLen) |
| Build root name if not already a root name. | |
| char * | epochToStr (time_t t, bool seconds, char *str, size_t maxLen) |
| convert epoch time to string with or without seconds | |
| double | offsetLocalUTC (void) |
| return offset Local UTC in seconds | |
| char * | gribDateTimeToStr (long date, long time, char *str, size_t maxLen) |
| return str representing grib date | |
| struct tm | gribDateToTm (long intDate, double nHours) |
| return tm struct equivalent to date hours found in grib (UTC time) struct tm gribDateToTm (long intDate, double nHours) { struct tm tm0 = {0}; tm0.tm_year = (intDate / 10000) - 1900; tm0.tm_mon = ((intDate % 10000) / 100) - 1; tm0.tm_mday = intDate % 100; tm0.tm_isdst = -1; const int totalMinutes = (int)(nHours * 60); tm0.tm_min += totalMinutes; // adjust tm0 struct (manage day, mon year overflow) mktime (&tm0); return tm0; } | |
| static bool | bissextile (int year) |
| retrurn true if year is bissextile | |
| static bool | getYMDHM (long dataDate, double nHours, int *yyyy, int *mm, int *dd, int *hh, int *min) |
| return year, month (1..12), day, hour, minutes from Grib dataDate and hours | |
| char * | otherNewDate (long dataDate, double nHours, char *res, size_t maxLen) |
| return date and time using ISO notation after adding myTime (hours) to the Date | |
| char * | newDate (long intDate, double nHours, char *res, size_t maxLen) |
| return date and time using ISO notation after adding myTime (hours) to the Date | |
| char * | newDateWeekDay (long intDate, double nHours, char *res, size_t maxLen) |
| return date and time using week day after adding myTime (hours) to the Date | |
| char * | newDateWeekDayVerbose (long intDate, double nHours, char *res, size_t maxLen) |
| return date and time using week day after adding myTime (hours) to the Date | |
| time_t | gribDateTimeToEpoch (long date, long hhmm) |
| convert long date/time from GRIB to time_t (UTC, via timegm) | |
| double | getDepartureTimeInHour (struct tm *startUtc) |
| calculate difference in hours between departure time in UTC and time 0 | |
| char * | durationToStr (double duration, char *res, size_t maxLen) |
| convert hours in string with days, hours, minutes | |
| char * | latToStr (double lat, int type, char *str, size_t maxLen) |
| convert lat to str according to type | |
| char * | lonToStr (double lon, int type, char *str, size_t maxLen) |
| convert lon to str according to type | |
| bool | readIsSea (const char *fileName) |
| read issea file and fill table tIsSea | |
| static bool | isInPolygon (double lat, double lon, const MyPolygon *po) |
| fill str with polygon information | |
| static bool | isInForbidArea (double lat, double lon) |
| return true if p is in forbid area | |
| void | updateIsSeaWithForbiddenAreas (void) |
| complement according to forbidden areas | |
| static void | forbidZoneAdd (char *line, int n) |
| read forbid zone format [[lat, lon], [lat, lon] ...] ... | |
| bool | readParam (const char *fileName, bool initDisp) |
| read parameter file and build par struct | |
| static void | fprintfNoNull (FILE *f, const char *fmt, const char *param) |
| static void | fprintfNoZero (FILE *f, const char *fmt, int param) |
| 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 | |
| double | fPenalty (int shipIndex, int type, double tws, double energy, double *cStamina, bool fullPack) |
| for virtual Regatta. | |
| double | fPointLoss (int shipIndex, int type, double tws, bool fullPack) |
| for virtual Regatta. | |
| double | fTimeToRecupOnePoint (double tws) |
| for virtual Regatta. | |
| char * | paramToStrJson (Par *par, char *out, size_t maxLen) |
| Return JSON formatted subset of parameters into 'out'. | |
| int | nearestPort (double lat, double lon, const char *fileName, char *res, size_t maxLen) |
| return id and name of nearest port found in file fileName from lat, lon. | |
| double | monotonic (void) |
| return seconds with decimals | |
| char * | readTextFile (const char *fileName, char *errMessage, size_t maxLen) |
| read all text file in buffer. | |
| bool | readMarkCSVToJson (const char *fileName, char *out, size_t maxLen) |
| read CSV file marks (Virtual Regatta) if check then polarCheck | |
| void | normalizeSpaces (char *s) |
| replace multiple spaces by just one | |
Variables | ||
| struct { | ||
| char name [MAX_SIZE_NAME] | ||
| double cShip | ||
| double tMin [3] | ||
| double tMax [3] | ||
| } | shipParam [MAX_N_SHIP_TYPE] | |
| MyPolygon | forbidZones [MAX_N_FORBID_ZONE] | |
| forbid ones is a set of polygons | ||
| const struct MeteoElmt | meteoTab [N_METEO_ADMIN] = {{7, "Weather service US"}, {78, "DWD Germany"}, {85, "Meteo France"}, {98,"ECMWF European"}} | |
| dictionnary of meteo services | ||
| const size_t | sailNameSize = 7 | |
| sail attributes | ||
| const char * | sailName [] = {"C0", "HG", "Jib", "LG", "LJ", "Spi", "SS"} | |
| const char * | colorStr [] = {"green", "purple", "gray", "blue", "yellow", "orange", "red"} | |
| WayPointList | wayPoints | |
| list of wayPoint | ||
| CompetitorsList | competitors | |
| list of competitors | ||
| PolMat | polMat | |
| polar matrix description | ||
| PolMat | sailPolMat | |
| polar matrix for sails | ||
| PolMat | wavePolMat | |
| polar matrix for waves | ||
| Par | par | |
| parameter | ||
| char * | tIsSea = NULL | |
| table describing if sea or earth | ||
| Zone | zone | |
| geographic zone covered by grib file | ||
| Zone | currentZone | |
|
inlinestatic |
retrurn true if year is bissextile
Definition at line 323 of file r3util.c.
Referenced by getYMDHM().

| char * buildRootName | ( | const char * | fileName, |
| char * | rootName, | ||
| size_t | maxLen | ||
| ) |
Build root name if not already a root name.
Combines the working directory with the file name if it is not absolute. Stores the result in rootName and ensures it does not exceed maxLen.
| fileName | The name of the file (absolute or relative). |
| rootName | The buffer to store the resulting root name. |
| maxLen | The maximum length of the buffer rootName. |
rootName, or NULL on error.abolute path POSIX : begin with '/'
Definition at line 230 of file r3util.c.
References hasSlash(), par, WORKING_DIR, and Par::workingDir.
Referenced by checkParamAndUpdate(), gribToStrJson(), launchAction(), polToStrJson(), readParam(), updateCurrentGrib(), and updateWindGrib().


| char * durationToStr | ( | double | duration, |
| char * | res, | ||
| size_t | maxLen | ||
| ) |
convert hours in string with days, hours, minutes
Definition at line 429 of file r3util.c.
Referenced by routeToStr().

| char * epochToStr | ( | time_t | t, |
| bool | seconds, | ||
| char * | str, | ||
| size_t | maxLen | ||
| ) |
convert epoch time to string with or without seconds
functions defined in r3util.c
Definition at line 247 of file r3util.c.
Referenced by optionManage().

|
static |
read forbid zone format [[lat, lon], [lat, lon] ...] ...
Definition at line 548 of file r3util.c.
References forbidZones, getCoord(), Point::lat, Point::lon, MAX_LAT, MAX_LON, MAX_SIZE_FORBID_ZONE, MIN_LAT, MIN_LON, MyPolygon::n, and MyPolygon::points.
Referenced by readParam().


| char * formatThousandSep | ( | char * | buffer, |
| size_t | maxLen, | ||
| long | value | ||
| ) |
format big number with thousand sep.
Example 1000000 formated as 1 000 000
Definition at line 104 of file r3util.c.
References MAX_SIZE_LINE.
Referenced by testToJson().

| double fPenalty | ( | int | shipIndex, |
| int | type, | ||
| double | tws, | ||
| double | energy, | ||
| double * | cStamina, | ||
| bool | fullPack | ||
| ) |
| double fPointLoss | ( | int | shipIndex, |
| int | type, | ||
| double | tws, | ||
| bool | fullPack | ||
| ) |
|
static |
Definition at line 815 of file r3util.c.
Referenced by writeParam().

|
static |
Definition at line 819 of file r3util.c.
Referenced by writeParam().

| char * fSailName | ( | int | val, |
| char * | str, | ||
| size_t | maxLen | ||
| ) |
return the name of the sail
Definition at line 68 of file r3util.c.
References g_strlcpy, PolMat::name, PolMat::nSail, polMat, and PolMat::tSail.
Referenced by routeToJson(), and routeToStr().

| double fTimeToRecupOnePoint | ( | double | tws | ) |
for virtual Regatta.
return type in second to get back one energy point
Definition at line 1014 of file r3util.c.
Referenced by statRoute().


| double getCoord | ( | const char * | str, |
| double | minLimit, | ||
| double | maxLimit | ||
| ) |
translate str in double for latitude longitude
Definition at line 179 of file r3util.c.
References CLAMP.
Referenced by forbidZoneAdd(), readMarkCSVToJson(), and readParam().

| double getDepartureTimeInHour | ( | struct tm * | startUtc | ) |
calculate difference in hours between departure time in UTC and time 0
Definition at line 420 of file r3util.c.
References Zone::dataDate, Zone::dataTime, gribDateTimeToEpoch(), and zone.

|
static |
return year, month (1..12), day, hour, minutes from Grib dataDate and hours
Definition at line 328 of file r3util.c.
References bissextile().
Referenced by otherNewDate().


| time_t gribDateTimeToEpoch | ( | long | date, |
| long | hhmm | ||
| ) |
convert long date/time from GRIB to time_t (UTC, via timegm)
Definition at line 408 of file r3util.c.
Referenced by checkParamAndUpdate(), getDepartureTimeInHour(), gribToStrJson(), infoCoordToJson(), optionManage(), timeIntersectGrib(), and zoneTimeDiff().

| char * gribDateTimeToStr | ( | long | date, |
| long | time, | ||
| char * | str, | ||
| size_t | maxLen | ||
| ) |
return str representing grib date
Definition at line 276 of file r3util.c.
Referenced by initContext(), and optionManage().

| struct tm gribDateToTm | ( | long | intDate, |
| double | nHours | ||
| ) |
return tm struct equivalent to date hours found in grib (UTC time) struct tm gribDateToTm (long intDate, double nHours) { struct tm tm0 = {0}; tm0.tm_year = (intDate / 10000) - 1900; tm0.tm_mon = ((intDate % 10000) / 100) - 1; tm0.tm_mday = intDate % 100; tm0.tm_isdst = -1;
const int totalMinutes = (int)(nHours * 60); tm0.tm_min += totalMinutes; // adjust tm0 struct (manage day, mon year overflow) mktime (&tm0);
return tm0; }
Definition at line 299 of file r3util.c.
Referenced by newDate(), newDateWeekDay(), and newDateWeekDayVerbose().

| bool hasSlash | ( | const char * | name | ) |
true if name terminates with slash
Definition at line 130 of file r3util.c.
References name.
Referenced by buildRootName(), checkParamAndUpdate(), initContext(), launchAction(), and mostRecentFile().

| bool isEmpty | ( | const char * | str | ) |
return true if str is empty
Definition at line 94 of file r3util.c.
References g_ascii_isspace().

|
static |
return true if p is in forbid area
Definition at line 526 of file r3util.c.
References forbidZones, isInPolygon(), Par::nForbidZone, and par.
Referenced by updateIsSeaWithForbiddenAreas().


|
static |
fill str with polygon information
return true if p is in polygon po Ray casting algorithm
Definition at line 512 of file r3util.c.
References Point::lat, Point::lon, MyPolygon::n, and MyPolygon::points.
Referenced by isInForbidArea().

| bool isNumber | ( | const char * | name | ) |
true if name contains a number
Definition at line 174 of file r3util.c.
References name.
Referenced by strtodNew().

| char * latToStr | ( | double | lat, |
| int | type, | ||
| char * | str, | ||
| size_t | maxLen | ||
| ) |
convert lat to str according to type
Definition at line 440 of file r3util.c.
References BASIC, DD, DM, DMS, and g_strlcpy.
Referenced by gribToStr(), isoDescToStr(), logReport(), routeToStr(), and writeParam().

| char * lonToStr | ( | double | lon, |
| int | type, | ||
| char * | str, | ||
| size_t | maxLen | ||
| ) |
convert lon to str according to type
Definition at line 462 of file r3util.c.
References BASIC, DD, DM, DMS, and g_strlcpy.
Referenced by gribToStr(), isoDescToStr(), logReport(), routeToStr(), and writeParam().

| double monotonic | ( | void | ) |
return seconds with decimals
Definition at line 1099 of file r3util.c.
Referenced by handleClient(), main(), and optionManage().

| 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 found with name of selected file
Definition at line 138 of file r3util.c.
References hasSlash(), MAX_SIZE_DIR_NAME, MAX_SIZE_FILE_NAME, and name.
Referenced by checkParamAndUpdate(), initContext(), and launchAction().


| int nearestPort | ( | double | lat, |
| double | lon, | ||
| const char * | fileName, | ||
| char * | res, | ||
| size_t | maxLen | ||
| ) |
return id and name of nearest port found in file fileName from lat, lon.
return empty string if not found
Definition at line 1063 of file r3util.c.
References g_strlcpy, g_strstrip(), MAX_SIZE_LINE, MAX_SIZE_NAME, and orthoDist().
Referenced by nearestPortToStrJson().


| char * newDate | ( | long | intDate, |
| double | nHours, | ||
| char * | res, | ||
| size_t | maxLen | ||
| ) |
return date and time using ISO notation after adding myTime (hours) to the Date
Definition at line 386 of file r3util.c.
References gribDateToTm().
Referenced by allCompetitors(), exportRouteToGpx(), gribToStr(), gribToStrJson(), logReport(), optionManage(), and routeToStr().


| char * newDateWeekDay | ( | long | intDate, |
| double | nHours, | ||
| char * | res, | ||
| size_t | maxLen | ||
| ) |
return date and time using week day after adding myTime (hours) to the Date
Definition at line 394 of file r3util.c.
References gribDateToTm().

| char * newDateWeekDayVerbose | ( | long | intDate, |
| double | nHours, | ||
| char * | res, | ||
| size_t | maxLen | ||
| ) |
return date and time using week day after adding myTime (hours) to the Date
Definition at line 401 of file r3util.c.
References gribDateToTm().

| 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" will give: "pol/bibi.toto.sailpol"
Definition at line 78 of file r3util.c.
References g_strlcpy.
Referenced by readPolar().

| void normalizeSpaces | ( | char * | s | ) |
replace multiple spaces by just one
Definition at line 1196 of file r3util.c.
Referenced by launchAction().

| double offsetLocalUTC | ( | void | ) |
return offset Local UTC in seconds
Definition at line 263 of file r3util.c.
Referenced by optionManage().

| char * otherNewDate | ( | long | dataDate, |
| double | nHours, | ||
| char * | res, | ||
| size_t | maxLen | ||
| ) |
return date and time using ISO notation after adding myTime (hours) to the Date
Definition at line 376 of file r3util.c.
References getYMDHM().

| char * paramToStrJson | ( | Par * | par, |
| char * | out, | ||
| size_t | maxLen | ||
| ) |
Return JSON formatted subset of parameters into 'out'.
Returns out on success, NULL on error or truncation.
Definition at line 1023 of file r3util.c.
References Par::currentGribFileName, g_path_get_basename(), Par::gribFileName, Par::isSeaFileName, Zone::latMax, Zone::latMin, Zone::lonLeft, Zone::lonRight, par, Par::polarFileName, Par::wavePolFileName, Par::workingDir, and zone.
Referenced by launchAction().


| bool readIsSea | ( | const char * | fileName | ) |
read issea file and fill table tIsSea
Definition at line 484 of file r3util.c.
References SIZE_T_IS_SEA, and tIsSea.
Referenced by initContext().

| bool readMarkCSVToJson | ( | const char * | fileName, |
| char * | out, | ||
| size_t | maxLen | ||
| ) |
read CSV file marks (Virtual Regatta) if check then polarCheck
Definition at line 1144 of file r3util.c.
References g_strfreev(), g_strsplit(), g_strstrip(), getCoord(), MAX_LAT, MAX_LON, MAX_SIZE_TEXT, MAX_SIZE_TEXT_FILE, MIN_LAT, MIN_LON, and name.
Referenced by launchAction().


| bool readParam | ( | const char * | fileName, |
| bool | initDisp | ||
| ) |
read parameter file and build par struct
Definition at line 573 of file r3util.c.
References Par::aisDisp, Par::allwaysSea, Par::authent, buildRootName(), CLAMP, Par::cliHelpFileName, Par::closestDisp, Par::cogStep, Competitor::colorIndex, competitors, Par::constCurrentD, Par::constCurrentS, Par::constWave, Par::constWindTwd, Par::constWindTws, Par::curlSys, Par::currentDisp, Par::currentGribFileName, Par::dashboardUTC, Par::dashboardVR, Par::dayEfficiency, Par::description, Par::dispDms, Par::dumpIFileName, Par::dumpRFileName, Pp::father, Par::feedbackFileName, Par::focalDisp, forbidZoneAdd(), g_strstrip(), getCoord(), Par::googleApiKey, Par::gribFileName, Par::gribResolution, Par::gribTimeMax, Par::gribTimeStep, Par::gridDisp, Par::helpFileName, Pp::id, Par::imapMailBox, Par::imapScript, Par::imapServer, Par::imapToSeen, Par::imapUserName, Par::indicatorDisp, Par::infoDisp, Par::isSeaFileName, Par::jFactor, Par::kFactor, Pp::lat, WayPoint::lat, Competitor::lat, Par::logFileName, Pp::lon, WayPoint::lon, Competitor::lon, Par::mailPw, Par::marksFileName, MAX_LAT, MAX_LON, MAX_N_COMPETITORS, MAX_N_FORBID_ZONE, MAX_N_SECTORS, MAX_N_SHP_FILES, MAX_N_WAY_POINT, MAX_SIZE_LINE, MAX_SIZE_NAME, MAX_SIZE_TEXT, Par::maxPoiVisible, Par::maxWind, Par::midFileName, MIN, MIN_LAT, MIN_LON, Par::mostRecentGrib, Par::motorSpeed, WayPointList::n, CompetitorsList::n, N_MAX_NMEA_PORTS, Competitor::name, Par::nForbidZone, Par::nightEfficiency, Par::nmea, Par::nNmea, Par::nSectors, Par::nShpFiles, Par::opt, par, Par::parInfoFileName, Par::pDest, Par::pDestName, Par::penalty0, Par::penalty1, Par::penalty2, Par::poiFileName, Par::polarFileName, Par::pOr, Par::pOrName, Par::portFileName, Par::portName, Par::python, Par::rangeCog, CompetitorsList::runIndex, Par::showColors, Par::shpFileName, Par::shpPointsDisp, Par::smtpScript, Par::smtpServer, Par::smtpTo, Par::smtpUserName, Par::special, Par::speed, Par::speedDisp, Par::staminaVR, Par::startTimeInHours, Par::stepIsocDisp, Par::storeMailPw, Par::style, CompetitorsList::t, WayPointList::t, Par::techno, Par::threshold, Par::tidesFileName, WayPointList::totLoxoDist, WayPointList::totOrthoDist, Par::traceFileName, Par::tStep, Par::waveDisp, Par::wavePolFileName, wayPoints, Par::web, Par::webkit, Par::windDisp, Par::windyApiKey, Par::withCurrent, Par::withWaves, Par::workingDir, Par::wpGpxFileName, and Par::xWind.
Referenced by initContext().


| char * readTextFile | ( | const char * | fileName, |
| char * | errMessage, | ||
| size_t | maxLen | ||
| ) |
read all text file in buffer.
Allocate memory
Definition at line 1106 of file r3util.c.
Referenced by launchAction(), and readPolarJson().

| void updateIsSeaWithForbiddenAreas | ( | void | ) |
complement according to forbidden areas
Definition at line 534 of file r3util.c.
References isInForbidArea(), Par::nForbidZone, par, SIZE_T_IS_SEA, and tIsSea.
Referenced by initContext().


| 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
Definition at line 826 of file r3util.c.
References Par::aisDisp, Par::allwaysSea, Par::authent, Par::cliHelpFileName, Par::closestDisp, Par::cogStep, Competitor::colorIndex, competitors, Par::constCurrentD, Par::constCurrentS, Par::constWave, Par::constWindTwd, Par::constWindTws, Par::curlSys, Par::currentDisp, Par::currentGribFileName, Par::dashboardUTC, Par::dashboardVR, Par::dayEfficiency, Par::description, Par::dispDms, Par::dumpIFileName, Par::dumpRFileName, Par::feedbackFileName, Par::focalDisp, forbidZones, fprintfNoNull(), fprintfNoZero(), Par::googleApiKey, Par::gribFileName, Par::gribResolution, Par::gribTimeMax, Par::gribTimeStep, Par::gridDisp, Par::helpFileName, Par::imapMailBox, Par::imapScript, Par::imapServer, Par::imapToSeen, Par::imapUserName, Par::indicatorDisp, Par::infoDisp, Par::isSeaFileName, Par::jFactor, Par::kFactor, Pp::lat, WayPoint::lat, Competitor::lat, latToStr(), Par::logFileName, Pp::lon, WayPoint::lon, Competitor::lon, lonToStr(), Par::mailPw, Par::marksFileName, MAX_SIZE_NAME, Par::maxPoiVisible, Par::maxWind, Par::midFileName, Par::mostRecentGrib, Par::motorSpeed, MyPolygon::n, WayPointList::n, CompetitorsList::n, Competitor::name, Par::nForbidZone, Par::nightEfficiency, Par::nmea, Par::nNmea, Par::nSectors, Par::nShpFiles, Par::opt, par, Par::parInfoFileName, Par::pDest, Par::pDestName, Par::penalty0, Par::penalty1, Par::penalty2, Par::poiFileName, Par::polarFileName, Par::pOr, Par::pOrName, Par::portFileName, Par::portName, Par::python, Par::rangeCog, Par::showColors, Par::shpFileName, Par::shpPointsDisp, Par::smtpScript, Par::smtpServer, Par::smtpTo, Par::smtpUserName, Par::special, Par::speed, Par::speedDisp, Par::staminaVR, Par::startTimeInHours, Par::stepIsocDisp, Par::style, CompetitorsList::t, WayPointList::t, Par::techno, Par::threshold, Par::tidesFileName, Par::traceFileName, Par::tStep, Par::waveDisp, Par::wavePolFileName, wayPoints, Par::web, Par::webkit, Par::windDisp, Par::windyApiKey, Par::withCurrent, Par::withWaves, Par::workingDir, Par::wpGpxFileName, and Par::xWind.
Referenced by launchAction().


| const char* colorStr[] = {"green", "purple", "gray", "blue", "yellow", "orange", "red"} |
| CompetitorsList competitors |
list of competitors
for competitors
Definition at line 46 of file r3util.c.
Referenced by allCompetitors(), checkParamAndUpdate(), launchAction(), readParam(), routeToJson(), routeToStr(), routing(), routingLaunch(), and writeParam().
| double cShip |
Definition at line 23 of file r3util.c.
Referenced by fPenalty(), and fPointLoss().
| Zone currentZone |
Definition at line 65 of file r3util.c.
Referenced by checkGribToStr(), findCurrentGrib(), infoCoordToJson(), initContext(), initRouting(), optionManage(), testToJson(), and updateCurrentGrib().
| MyPolygon forbidZones[MAX_N_FORBID_ZONE] |
forbid ones is a set of polygons
forbid zones
Definition at line 32 of file r3util.c.
Referenced by forbidToJson(), forbidZoneAdd(), isInForbidArea(), and writeParam().
| const struct MeteoElmt meteoTab[N_METEO_ADMIN] = {{7, "Weather service US"}, {78, "DWD Germany"}, {85, "Meteo France"}, {98,"ECMWF European"}} |
dictionnary of meteo services
Meteo service.
Definition at line 35 of file r3util.c.
Referenced by gribToStr(), and gribToStrJson().
| char name[MAX_SIZE_NAME] |
Definition at line 22 of file r3util.c.
Referenced by addSail(), checkParamAndUpdate(), decodeHttpReq(), gribToStr(), gribToStrJson(), hasSlash(), isNumber(), isPresentGrib(), listDirToStrJson(), mostRecentFile(), and readMarkCSVToJson().
| Par par |
parameter
parameters desciption
Definition at line 58 of file r3util.c.
Referenced by allCompetitors(), bestTimeDeparture(), buildNextIsochrone(), buildRootName(), calcDuration(), checkParamAndUpdate(), exportRouteToGpx(), extractLevel(), findCurrentGrib(), findFlow(), findWindGrib(), forbidToJson(), forwardSectorOptimize(), goal(), goalP(), gribToStr(), handleClient(), infoCoordToJson(), initContext(), initRouting(), isCurrentTriplet(), isInForbidArea(), isoDescToStr(), launchAction(), logReport(), nearestPortToStrJson(), optionManage(), paramToStrJson(), readParam(), routeToJson(), routeToStr(), routing(), routingLaunch(), serveStaticFile(), shortNameFor(), simpleGoal(), simpleGoalP(), statRoute(), updateCurrentGrib(), updateIsSeaWithForbiddenAreas(), updateWindGrib(), and writeParam().
| PolMat polMat |
polar matrix description
polar description
Definition at line 49 of file r3util.c.
Referenced by addSail(), buildNextIsochrone(), checkParamAndUpdate(), findListPol(), findSailPol(), fSailName(), goalP(), initContext(), optionManage(), readPolarJson(), and simpleGoalP().
| const char* sailName[] = {"C0", "HG", "Jib", "LG", "LJ", "Spi", "SS"} |
Definition at line 39 of file r3util.c.
Referenced by findSailPol(), and readPolar().
| const size_t sailNameSize = 7 |
| PolMat sailPolMat |
polar matrix for sails
Definition at line 52 of file r3util.c.
Referenced by buildNextIsochrone(), checkParamAndUpdate(), findListPol(), findSailPol(), goalP(), initContext(), optionManage(), readPolar(), readPolarJson(), and simpleGoalP().
| struct { ... } shipParam[MAX_N_SHIP_TYPE] |
Referenced by fPenalty(), and fPointLoss().
| char* tIsSea = NULL |
table describing if sea or earth
Definition at line 61 of file r3util.c.
Referenced by buildNextIsochrone(), checkParamAndUpdate(), goal(), infoCoordToJson(), main(), optionManage(), readIsSea(), segmentOverSea(), simpleGoal(), and updateIsSeaWithForbiddenAreas().
| double tMax[3] |
Definition at line 25 of file r3util.c.
Referenced by fPenalty(), and infoCoordToJson().
| double tMin[3] |
Definition at line 24 of file r3util.c.
Referenced by fPenalty().
| PolMat wavePolMat |
polar matrix for waves
Definition at line 55 of file r3util.c.
Referenced by buildNextIsochrone(), checkParamAndUpdate(), goalP(), initContext(), optionManage(), and simpleGoalP().
| WayPointList wayPoints |
list of wayPoint
Definition at line 43 of file r3util.c.
Referenced by checkParamAndUpdate(), logReport(), readParam(), routingLaunch(), and writeParam().
| Zone zone |
geographic zone covered by grib file
Zone description.
Definition at line 64 of file r3util.c.
Referenced by allCompetitors(), buildInitialOfShortNameList(), buildNextIsochrone(), buildUVGWarray(), checkGrib(), checkGribInfoToStr(), checkGribToStr(), checkParamAndUpdate(), consistentGrib(), find4PointsAround(), findFlow(), findTimeAround(), findTimeIndex(), findWindGrib(), getDepartureTimeInHour(), goalP(), gribToStr(), idxTij(), indexOf(), indLat(), indLat(), indLat(), indLon(), indLon(), indLonWrap(), infoCoordToJson(), initContext(), initRouting(), isInZone(), isPresentGrib(), launchAction(), logReport(), optionManage(), paramToStrJson(), printGrib(), readGribAll(), readGribLists(), readGribParameters(), routeToJson(), routing(), simpleGoalP(), statRoute(), testToJson(), timeStepRegularGrib(), updateWindGrib(), and uvPresentGrib().