add real weather and day time for config race
prepare for real weather and day time with new lib metar git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@4811 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 633cf17bd92f343a6ae9f2b02a79ca4f46676500 Former-commit-id: 7c6f94efd7fd20d14594555d35afaa7c86c3894a
This commit is contained in:
parent
cc3743a166
commit
defadc2bdd
5 changed files with 23 additions and 10 deletions
|
@ -335,12 +335,13 @@ typedef struct RmInfo
|
|||
#define RM_VAL_TIME_DUSK "dusk"
|
||||
#define RM_VAL_TIME_NIGHT "night"
|
||||
#define RM_VAL_TIME_NOW "now"
|
||||
#define RM_VAL_TIME_REAL "real"
|
||||
#define RM_VAL_TIME_TRACK "from track"
|
||||
#define RM_VAL_TIME_RANDOM "random"
|
||||
#define RM_VAL_TIME_24HR "24 hour"
|
||||
#define RM_VALS_TIME { RM_VAL_TIME_DAWN, RM_VAL_TIME_MORNING, RM_VAL_TIME_NOON, \
|
||||
RM_VAL_TIME_AFTERNOON, RM_VAL_TIME_DUSK, RM_VAL_TIME_NIGHT, \
|
||||
RM_VAL_TIME_NOW, RM_VAL_TIME_TRACK, RM_VAL_TIME_RANDOM, \
|
||||
RM_VAL_TIME_NOW, RM_VAL_TIME_REAL, RM_VAL_TIME_TRACK, RM_VAL_TIME_RANDOM, \
|
||||
RM_VAL_TIME_24HR}
|
||||
|
||||
// Indices for RM_VALS_TIME.
|
||||
|
@ -351,9 +352,10 @@ typedef struct RmInfo
|
|||
#define RM_IND_TIME_DUSK 4
|
||||
#define RM_IND_TIME_NIGHT 5
|
||||
#define RM_IND_TIME_NOW 6
|
||||
#define RM_IND_TIME_TRACK 7
|
||||
#define RM_IND_TIME_RANDOM 8
|
||||
#define RM_IND_TIME_24HR 9
|
||||
#define RM_IND_TIME_REAL 7
|
||||
#define RM_IND_TIME_TRACK 8
|
||||
#define RM_IND_TIME_RANDOM 9
|
||||
#define RM_IND_TIME_24HR 10
|
||||
|
||||
#define RM_VAL_CLOUDS_NONE "no cloud"
|
||||
#define RM_VAL_CLOUDS_FEW "few clouds"
|
||||
|
@ -361,16 +363,18 @@ typedef struct RmInfo
|
|||
#define RM_VAL_CLOUDS_MANY "many clouds"
|
||||
#define RM_VAL_CLOUDS_FULL "full cover"
|
||||
#define RM_VAL_CLOUDS_RANDOM "random"
|
||||
#define RM_VAL_CLOUDS_REAL "real"
|
||||
#define RM_VALS_CLOUDS { RM_VAL_CLOUDS_NONE, RM_VAL_CLOUDS_FEW, RM_VAL_CLOUDS_SCARCE, \
|
||||
RM_VAL_CLOUDS_MANY, RM_VAL_CLOUDS_FULL, RM_VAL_CLOUDS_RANDOM }
|
||||
RM_VAL_CLOUDS_MANY, RM_VAL_CLOUDS_FULL, RM_VAL_CLOUDS_RANDOM, RM_VAL_CLOUDS_REAL }
|
||||
|
||||
#define RM_VAL_RAIN_NONE "none"
|
||||
#define RM_VAL_RAIN_LITTLE "little"
|
||||
#define RM_VAL_RAIN_MEDIUM "medium"
|
||||
#define RM_VAL_RAIN_HEAVY "heavy"
|
||||
#define RM_VAL_RAIN_RANDOM "random"
|
||||
#define RM_VAL_RAIN_REAL "real"
|
||||
#define RM_VALS_RAIN { RM_VAL_RAIN_NONE, RM_VAL_RAIN_LITTLE, RM_VAL_RAIN_MEDIUM, \
|
||||
RM_VAL_RAIN_HEAVY, RM_VAL_RAIN_RANDOM }
|
||||
RM_VAL_RAIN_HEAVY, RM_VAL_RAIN_RANDOM, RM_VAL_RAIN_REAL }
|
||||
|
||||
/* Movie capture */
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#define TRK_SECT_LOCAL "Local Info"
|
||||
|
||||
#define TRK_ATT_STATION "station"
|
||||
#define TRK_ATT_TIMEZONE "timezone"
|
||||
#define TRK_ATT_ANYRAINLKHD "overall rain likelyhood"
|
||||
#define TRK_ATT_LITTLERAINLKHD "little rain likelyhood"
|
||||
#define TRK_ATT_MEDIUMRAINLKHD "medium rain likelyhood"
|
||||
|
@ -583,6 +584,7 @@ typedef struct TrackLocalInfo
|
|||
{
|
||||
/* Constant spec. data, read from <track>.xml */
|
||||
const char *station; /**<Station Weather */
|
||||
int timezone; /**< timezone for real timeday with not connection http */
|
||||
tdble anyrainlkhood; /**< Overall likelyhood of having rain (when random) [0, 1] */
|
||||
tdble littlerainlkhood; /**< Likelyhood of having little rain when it rains [0, 1] */
|
||||
tdble mediumrainlkhood; /**< Likelyhood of having medium rain when it rains [0, 1-little] */
|
||||
|
|
|
@ -65,13 +65,13 @@ public:
|
|||
GfRaceManager* getManager() const;
|
||||
|
||||
enum ETimeOfDaySpec { eTimeDawn, eTimeMorning, eTimeNoon, eTimeAfternoon,
|
||||
eTimeDusk, eTimeNight, eTimeNow, eTimeFromTrack, eTimeRandom,
|
||||
eTimeDusk, eTimeNight, eTimeNow, eTimeReal, eTimeFromTrack, eTimeRandom,
|
||||
eTime24hr,
|
||||
nTimeSpecNumber }; // Last = invalid value = nb of valid ones.
|
||||
enum ECloudsSpec { eCloudsNone, eCloudsFew, eCloudsScarce, eCloudsMany, eCloudsFull,
|
||||
eCloudsRandom, nCloudsSpecNumber}; // Last = invalid value = nb of valid ones.
|
||||
eCloudsRandom, eCloudsReal, nCloudsSpecNumber}; // Last = invalid value = nb of valid ones.
|
||||
enum ERainSpec { eRainNone, eRainLittle, eRainMedium, eRainHeavy, eRainRandom,
|
||||
nRainSpecNumber }; // Last = invalid value = nb of valid ones.
|
||||
eRainReal, nRainSpecNumber }; // Last = invalid value = nb of valid ones.
|
||||
class Parameters
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -146,7 +146,8 @@ GetTrackHeader(void *TrackHandle)
|
|||
/* Local infos */
|
||||
local = &theTrack->local;
|
||||
|
||||
local->station = GfParmGetStr(TrackHandle, TRK_SECT_LOCAL, TRK_ATT_STATION, "none");
|
||||
local->station = GfParmGetStr(TrackHandle, TRK_SECT_LOCAL, TRK_ATT_STATION, "LFPG");
|
||||
local->timezone = GfParmGetNum(TrackHandle, TRK_SECT_LOCAL, TRK_ATT_TIMEZONE, (char*)NULL, 0);
|
||||
local->anyrainlkhood = GfParmGetNum(TrackHandle, TRK_SECT_LOCAL, TRK_ATT_ANYRAINLKHD, (char*)NULL, 0);
|
||||
local->littlerainlkhood = GfParmGetNum(TrackHandle, TRK_SECT_LOCAL, TRK_ATT_LITTLERAINLKHD, (char*)NULL, 0);
|
||||
local->mediumrainlkhood = GfParmGetNum(TrackHandle, TRK_SECT_LOCAL, TRK_ATT_MEDIUMRAINLKHD, (char*)NULL, 0);
|
||||
|
|
|
@ -252,11 +252,17 @@ rmChangeRain(void *vp)
|
|||
cloudsComboEnabled = GFUI_DISABLE;
|
||||
rmrpClouds = GfRace::eCloudsRandom;
|
||||
}
|
||||
else if (rmrpRain == GfRace::eRainReal) // Real rain => Real clouds.
|
||||
{
|
||||
cloudsComboEnabled = GFUI_DISABLE;
|
||||
rmrpClouds = GfRace::eCloudsReal;
|
||||
}
|
||||
else if (rmrpRain != GfRace::eRainNone)
|
||||
{
|
||||
cloudsComboEnabled = GFUI_DISABLE;
|
||||
rmrpClouds = GfRace::eCloudsFull; // Rain => Heavy clouds.
|
||||
}
|
||||
|
||||
GfuiLabelSetText(ScrHandle, rmrpCloudsEditId, CloudsValues[rmrpClouds]);
|
||||
|
||||
// Show / hide clouds combo arrow buttons (any rain => no sky choice).
|
||||
|
|
Loading…
Reference in a new issue