Browse Source

Solved bugs for large angles

QGC4.4
pixhawk 14 years ago
parent
commit
dee19d0c4e
  1. 12
      src/GAudioOutput.cc
  2. 2
      src/GAudioOutput.h
  3. 30
      src/QGC.cc
  4. 8
      src/ui/HUD.cc

12
src/GAudioOutput.cc

@ -137,12 +137,12 @@ GAudioOutput::GAudioOutput(QObject* parent) : QObject(parent), @@ -137,12 +137,12 @@ GAudioOutput::GAudioOutput(QObject* parent) : QObject(parent),
}
}
GAudioOutput::~GAudioOutput()
{
#ifdef _MSC_VER2
::CoUninitialize();
#endif
}
//GAudioOutput::~GAudioOutput()
//{
//#ifdef _MSC_VER2
// ::CoUninitialize();
//#endif
//}
void GAudioOutput::mute(bool mute)
{

2
src/GAudioOutput.h

@ -124,7 +124,7 @@ protected: @@ -124,7 +124,7 @@ protected:
bool muted;
private:
GAudioOutput(QObject* parent=NULL);
~GAudioOutput();
// ~GAudioOutput();
};
#endif // AUDIOOUTPUT_H

30
src/QGC.cc

@ -49,28 +49,28 @@ quint64 groundTimeMilliseconds() @@ -49,28 +49,28 @@ quint64 groundTimeMilliseconds()
float limitAngleToPMPIf(float angle)
{
while (angle > ((float)M_PI+FLT_EPSILON)) {
angle -= 2.0f * (float)M_PI;
}
// while (angle > ((float)M_PI+FLT_EPSILON)) {
// angle -= 2.0f * (float)M_PI;
// }
while (angle <= -((float)M_PI+FLT_EPSILON)) {
angle += 2.0f * (float)M_PI;
}
// while (angle <= -((float)M_PI+FLT_EPSILON)) {
// angle += 2.0f * (float)M_PI;
// }
return angle;
}
double limitAngleToPMPId(double angle)
{
if (angle < -M_PI) {
while (angle < -M_PI) {
angle += M_PI;
}
} else if (angle > M_PI) {
while (angle > M_PI) {
angle -= M_PI;
}
}
// if (angle < -M_PI) {
// while (angle < -M_PI) {
// angle += M_PI;
// }
// } else if (angle > M_PI) {
// while (angle > M_PI) {
// angle -= M_PI;
// }
// }
return angle;
}

8
src/ui/HUD.cc

@ -1047,10 +1047,10 @@ void HUD::paintPitchLines(float pitch, QPainter* painter) @@ -1047,10 +1047,10 @@ void HUD::paintPitchLines(float pitch, QPainter* painter)
float offset = pitch;
if (offset < 0) offset = -offset;
int offsetCount = 0;
while (offset > lineDistance) {
offset -= lineDistance;
offsetCount++;
}
// while (offset > lineDistance) {
// offset -= lineDistance;
// offsetCount++;
// }
int iPos = (int)(0.5f + lineDistance); ///< The first line
int iNeg = (int)(-0.5f - lineDistance); ///< The first line

Loading…
Cancel
Save