Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source/Systems
In directory sc8-pr-cvs1:/tmp/cvs-serv26115/Source/Systems
Modified Files:
AircraftFlightSensors.cpp AircraftSimpleFCS.cpp
Log Message:
Index: AircraftFlightSensors.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Systems/AircraftFlightSensors.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AircraftFlightSensors.cpp 20 Oct 2003 00:23:23 -0000 1.2
--- AircraftFlightSensors.cpp 20 Oct 2003 01:27:10 -0000 1.3
***************
*** 29,32 ****
--- 29,35 ----
#include <CSPSim.h>
+ #include <sstream>
+ #include <iomanip>
+
using bus::Kinetics;
***************
*** 37,47 ****
--- 40,55 ----
double AircraftFlightSensors::onUpdate(double dt) {
simdata::Vector3 pos = b_Position->value();
+ double speed = b_Velocity->value().length();
Atmosphere const *atmosphere = CSPSim::theSim->getAtmosphere();
if (atmosphere) {
b_Density->value() = atmosphere->getDensity(pos.z());
+ b_Temperature->value() = atmosphere->getTemperature(pos.z());
b_Pressure->value() = atmosphere->getPressure(pos.z());
simdata::Vector3 wind = atmosphere->getWind(pos);
wind += atmosphere->getTurbulence(pos, m_Distance);
b_WindVelocity->value() = wind;
+ double mach = atmosphere->getMach(speed, pos.z());
+ b_Mach->value() = mach;
+ b_CAS->value() = atmosphere->getCAS(mach, pos.z());
m_Distance += (wind - b_Velocity->value()).length() * dt;
} else {
***************
*** 64,68 ****
--- 72,88 ----
b_Density = bus->registerLocalDataChannel<double>("Conditions.Density", 1.25);
b_Temperature = bus->registerLocalDataChannel<double>("Conditions.Temperature", 300);
+ b_Mach = bus->registerLocalDataChannel<double>("Conditions.Mach", 0.0);
+ b_CAS = bus->registerLocalDataChannel<double>("Conditions.CAS", 0.0);
}
+ void AircraftFlightSensors::getInfo(InfoList &info) const {
+ std::stringstream line;
+ line.setf(std::ios::fixed | std::ios::showpos);
+ line.precision(0);
+ line << "P: " << std::setw(3) << b_Pressure->value()
+ << ", T: " << std::setw(3) << b_Temperature->value()
+ << ", Mach: " << std::setw(3) << b_Mach->value()
+ << ", CAS: " << std::setw(3) << b_CAS->value();
+ info.push_back(line.str());
+ }
Index: AircraftSimpleFCS.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Systems/AircraftSimpleFCS.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AircraftSimpleFCS.cpp 20 Oct 2003 00:23:23 -0000 1.2
--- AircraftSimpleFCS.cpp 20 Oct 2003 01:27:10 -0000 1.3
***************
*** 110,114 ****
}
! void AircraftSimpleFCS::getInfo(InfoList &info) {
std::stringstream line;
line.setf(std::ios::fixed | std::ios::showpos);
--- 110,114 ----
}
! void AircraftSimpleFCS::getInfo(InfoList &info) const {
std::stringstream line;
line.setf(std::ios::fixed | std::ios::showpos);
|