1
0
Fork 0

Use "coverage" instead of "type".

Rename "mostly-cloudy" to "broken" and "mostly-sunny" to "scattered",
to follow standard weather terminology.

Add "few".
This commit is contained in:
david 2003-04-05 03:33:01 +00:00
parent 807bcfb8e0
commit 27d5965703
2 changed files with 31 additions and 26 deletions

View file

@ -120,10 +120,10 @@ FGEnvironmentMgr::bind ()
&FGEnvironmentMgr::get_cloud_layer_transition_ft, &FGEnvironmentMgr::get_cloud_layer_transition_ft,
&FGEnvironmentMgr::set_cloud_layer_transition_ft); &FGEnvironmentMgr::set_cloud_layer_transition_ft);
fgSetArchivable(buf); fgSetArchivable(buf);
sprintf(buf, "/environment/clouds/layer[%d]/type", i); sprintf(buf, "/environment/clouds/layer[%d]/coverage", i);
fgTie(buf, this, i, fgTie(buf, this, i,
&FGEnvironmentMgr::get_cloud_layer_type, &FGEnvironmentMgr::get_cloud_layer_coverage,
&FGEnvironmentMgr::set_cloud_layer_type); &FGEnvironmentMgr::set_cloud_layer_coverage);
fgSetArchivable(buf); fgSetArchivable(buf);
} }
} }
@ -262,15 +262,17 @@ FGEnvironmentMgr::set_cloud_layer_transition_ft (int index,
} }
const char * const char *
FGEnvironmentMgr::get_cloud_layer_type (int index) const FGEnvironmentMgr::get_cloud_layer_coverage (int index) const
{ {
switch (thesky->get_cloud_layer(index)->getType()) { switch (thesky->get_cloud_layer(index)->getCoverage()) {
case SGCloudLayer::SG_CLOUD_OVERCAST: case SGCloudLayer::SG_CLOUD_OVERCAST:
return "overcast"; return "overcast";
case SGCloudLayer::SG_CLOUD_MOSTLY_CLOUDY: case SGCloudLayer::SG_CLOUD_BROKEN:
return "mostly-cloudy"; return "broken";
case SGCloudLayer::SG_CLOUD_MOSTLY_SUNNY: case SGCloudLayer::SG_CLOUD_SCATTERED:
return "mostly-sunny"; return "scattered";
case SGCloudLayer::SG_CLOUD_FEW:
return "few";
case SGCloudLayer::SG_CLOUD_CIRRUS: case SGCloudLayer::SG_CLOUD_CIRRUS:
return "cirrus"; return "cirrus";
case SGCloudLayer::SG_CLOUD_CLEAR: case SGCloudLayer::SG_CLOUD_CLEAR:
@ -281,24 +283,27 @@ FGEnvironmentMgr::get_cloud_layer_type (int index) const
} }
void void
FGEnvironmentMgr::set_cloud_layer_type (int index, const char * type_name) FGEnvironmentMgr::set_cloud_layer_coverage (int index,
const char * coverage_name)
{ {
SGCloudLayer::Type type; SGCloudLayer::Coverage coverage;
if (!strcmp(type_name, "overcast")) if (!strcmp(coverage_name, "overcast"))
type = SGCloudLayer::SG_CLOUD_OVERCAST; coverage = SGCloudLayer::SG_CLOUD_OVERCAST;
else if (!strcmp(type_name, "mostly-cloudy")) else if (!strcmp(coverage_name, "broken"))
type = SGCloudLayer::SG_CLOUD_MOSTLY_CLOUDY; coverage = SGCloudLayer::SG_CLOUD_BROKEN;
else if (!strcmp(type_name, "mostly-sunny")) else if (!strcmp(coverage_name, "scattered"))
type = SGCloudLayer::SG_CLOUD_MOSTLY_SUNNY; coverage = SGCloudLayer::SG_CLOUD_SCATTERED;
else if (!strcmp(type_name, "cirrus")) else if (!strcmp(coverage_name, "few"))
type = SGCloudLayer::SG_CLOUD_CIRRUS; coverage = SGCloudLayer::SG_CLOUD_FEW;
else if (!strcmp(type_name, "clear")) else if (!strcmp(coverage_name, "cirrus"))
type = SGCloudLayer::SG_CLOUD_CLEAR; coverage = SGCloudLayer::SG_CLOUD_CIRRUS;
else if (!strcmp(coverage_name, "clear"))
coverage = SGCloudLayer::SG_CLOUD_CLEAR;
else { else {
SG_LOG(SG_INPUT, SG_WARN, "Unknown cloud type " << type_name); SG_LOG(SG_INPUT, SG_WARN, "Unknown cloud type " << coverage_name);
type = SGCloudLayer::SG_CLOUD_CLEAR; coverage = SGCloudLayer::SG_CLOUD_CLEAR;
} }
thesky->get_cloud_layer(index)->setType(type); thesky->get_cloud_layer(index)->setCoverage(coverage);
} }

View file

@ -81,8 +81,8 @@ private:
void set_cloud_layer_thickness_ft (int index, double thickness_ft); void set_cloud_layer_thickness_ft (int index, double thickness_ft);
double get_cloud_layer_transition_ft (int index) const; double get_cloud_layer_transition_ft (int index) const;
void set_cloud_layer_transition_ft (int index, double transition_ft); void set_cloud_layer_transition_ft (int index, double transition_ft);
const char * get_cloud_layer_type (int index) const; const char * get_cloud_layer_coverage (int index) const;
void set_cloud_layer_type (int index, const char * type); void set_cloud_layer_coverage (int index, const char * coverage);
FGEnvironment * _environment; // always the same, for now FGEnvironment * _environment; // always the same, for now
FGEnvironmentCtrl * _controller; // always the same, for now FGEnvironmentCtrl * _controller; // always the same, for now