+
+
+ SGPropertyNode * station_nodes = fgGetNode("/environment/weather");
+ if (station_nodes == 0) {
+ cerr << "No weatherstations (/environment/weather)!!";
+ return;
+ }
+
+ int index = 0;
+ for(vector<FGPhysicalProperties>::iterator it = database_data.begin(); it != database_data.end(); it++)
+ {
+ SGPropertyNode * station = station_nodes->getNode("station", index, true);
+
+ station -> tie("air-pressure-Pa",
+ SGRawValueMethods<FGAirPressureItem,WeatherPrecision>(
+ database_data[0].AirPressure,
+ &FGAirPressureItem::getValue,
+ &FGAirPressureItem::setValue)
+ ,false);
+
+ int i;
+ for( i = 0; i < database_data[index].Wind.size(); i++)
+ {
+ SGPropertyNode * wind = station->getNode("wind", i, true);
+ wind -> tie("north-mps",
+ SGRawValueMethodsIndexed<FGPhysicalProperties,WeatherPrecision>(
+ database_data[index], i,
+ &FGPhysicalProperties::getWind_x,
+ &FGPhysicalProperties::setWind_x)
+ ,false);
+ wind -> tie("east-mps",
+ SGRawValueMethodsIndexed<FGPhysicalProperties,WeatherPrecision>(
+ database_data[index], i,
+ &FGPhysicalProperties::getWind_y,
+ &FGPhysicalProperties::setWind_y)
+ ,false);
+ wind -> tie("up-mps",
+ SGRawValueMethodsIndexed<FGPhysicalProperties,WeatherPrecision>(
+ database_data[index], i,
+ &FGPhysicalProperties::getWind_z,
+ &FGPhysicalProperties::setWind_z)
+ ,false);
+ wind -> tie("altitude-m",
+ SGRawValueMethodsIndexed<FGPhysicalProperties,WeatherPrecision>(
+ database_data[index], i,
+ &FGPhysicalProperties::getWind_a,
+ &FGPhysicalProperties::setWind_a)
+ ,false);
+ }
+
+ for( i = 0; i < database_data[index].Temperature.size(); i++)
+ {
+ SGPropertyNode * temperature = station->getNode("temperature", i, true);
+ temperature -> tie("value-K",
+ SGRawValueMethodsIndexed<FGPhysicalProperties,WeatherPrecision>(
+ database_data[index], i,
+ &FGPhysicalProperties::getTemperature_x,
+ &FGPhysicalProperties::setTemperature_x)
+ ,false);
+ temperature -> tie("altitude-m",
+ SGRawValueMethodsIndexed<FGPhysicalProperties,WeatherPrecision>(
+ database_data[index], i,
+ &FGPhysicalProperties::getTemperature_a,
+ &FGPhysicalProperties::setTemperature_a)
+ ,false);
+ }
+
+ for( i = 0; i < database_data[index].VaporPressure.size(); i++)
+ {
+ SGPropertyNode * vaporpressure = station->getNode("vapor-pressure", i, true);
+ vaporpressure -> tie("value-Pa",
+ SGRawValueMethodsIndexed<FGPhysicalProperties,WeatherPrecision>(
+ database_data[index], i,
+ &FGPhysicalProperties::getVaporPressure_x,
+ &FGPhysicalProperties::setVaporPressure_x)
+ ,false);
+ vaporpressure -> tie("altitude-m",
+ SGRawValueMethodsIndexed<FGPhysicalProperties,WeatherPrecision>(
+ database_data[index], i,
+ &FGPhysicalProperties::getVaporPressure_a,
+ &FGPhysicalProperties::setVaporPressure_a)
+ ,false);
+ }
+
+ index++;
+ }
+}
+
+void FGLocalWeatherDatabase::unbind()
+{
+ fgUntie("/environment/weather/wind-north-mps");
+ fgUntie("/environment/weather/wind-east-mps");
+ fgUntie("/environment/weather/wind-up-mps");
+ fgUntie("/environment/weather/temperature-K");
+ fgUntie("/environment/weather/air-pressure-Pa");
+ fgUntie("/environment/weather/vapor-pressure-Pa");
+ fgUntie("/environment/weather/air-density");