From: <sv...@ww...> - 2004-06-29 10:21:13
|
Author: delta Date: 2004-06-29 03:21:05 -0700 (Tue, 29 Jun 2004) New Revision: 1100 Modified: trunk/CSP/CSPSim/Include/Systems/AircraftInputSystem.h trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h Log: Workaround for conflicts with min/macro macros under vs .net. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1100 Modified: trunk/CSP/CSPSim/Include/Systems/AircraftInputSystem.h =================================================================== --- trunk/CSP/CSPSim/Include/Systems/AircraftInputSystem.h 2004-06-29 09:07:05 UTC (rev 1099) +++ trunk/CSP/CSPSim/Include/Systems/AircraftInputSystem.h 2004-06-29 10:21:05 UTC (rev 1100) @@ -26,9 +26,11 @@ #ifndef __AIRCRAFTINPUTSYSTEM_H__ #define __AIRCRAFTINPUTSYSTEM_H__ -#include <System.h> +#include <SimData/Math.h> +#include "System.h" + class AircraftInputSystem: public System { class CombinedInput { @@ -55,7 +57,7 @@ m_DecayCount--; if (m_Increment == 0.0) v *= m_Decay; } - m_Channel->value() = std::min(1.0, std::max(-1.0, v)); + m_Channel->value() = simdata::clampTo(v,-1.0,1.0); } double getValue() { return m_Channel->value(); Modified: trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h =================================================================== --- trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h 2004-06-29 09:07:05 UTC (rev 1099) +++ trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h 2004-06-29 10:21:05 UTC (rev 1100) @@ -59,11 +59,11 @@ double input = 0.0; double output = b_Output->value(); if (b_Input.valid()) input = b_Input->value() * m_Limit; - double smooth = std::min(1.0, 10.0*fabs(output-input)); + double smooth = std::min<double>(1.0, 10.0*fabs(output-input)); if (output < input) { - output = std::min(output + smooth*m_Rate*dt, m_Limit); + output = std::min<double>(output + smooth*m_Rate*dt, m_Limit); } else { - output = std::max(output - smooth*m_Rate*dt, -m_Limit); + output = std::max<double>(output - smooth*m_Rate*dt, -m_Limit); } b_Output->value() = output; } |