Commit 9acd7ff0 authored by pixhawk's avatar pixhawk

Fixed a small bug in the HSI widget leading to wrong compass drawing

parent ce2219ac
...@@ -155,12 +155,12 @@ void HSIDisplay::paintDisplay() ...@@ -155,12 +155,12 @@ void HSIDisplay::paintDisplay()
// Draw orientation labels // Draw orientation labels
// Translate and rotate coordinate frame // Translate and rotate coordinate frame
painter.translate((xCenterPos)*scalingFactor, (yCenterPos)*scalingFactor); painter.translate((xCenterPos)*scalingFactor, (yCenterPos)*scalingFactor);
painter.rotate((-yaw/(M_PI))*180.0f); painter.rotate((yaw/(M_PI))*180.0f);
paintText(tr("N"), ringColor, 3.5f, - 1.0f, - baseRadius - 5.5f, &painter); paintText(tr("N"), ringColor, 3.5f, - 1.0f, - baseRadius - 5.5f, &painter);
paintText(tr("S"), ringColor, 3.5f, - 1.0f, + baseRadius + 1.5f, &painter); paintText(tr("S"), ringColor, 3.5f, - 1.0f, + baseRadius + 1.5f, &painter);
paintText(tr("E"), ringColor, 3.5f, + baseRadius + 2.0f, - 1.75f, &painter); paintText(tr("E"), ringColor, 3.5f, + baseRadius + 2.0f, - 1.75f, &painter);
paintText(tr("W"), ringColor, 3.5f, - baseRadius - 5.5f, - 1.75f, &painter); paintText(tr("W"), ringColor, 3.5f, - baseRadius - 5.5f, - 1.75f, &painter);
painter.rotate((yaw/(M_PI))*180.0f); painter.rotate((-yaw/(M_PI))*180.0f);
painter.translate(-(xCenterPos)*scalingFactor, -(yCenterPos)*scalingFactor); painter.translate(-(xCenterPos)*scalingFactor, -(yCenterPos)*scalingFactor);
// Draw center indicator // Draw center indicator
...@@ -677,7 +677,7 @@ void HSIDisplay::drawWaypoints(QPainter& painter) ...@@ -677,7 +677,7 @@ void HSIDisplay::drawWaypoints(QPainter& painter)
pen.setColor(color); pen.setColor(color);
painter.setPen(pen); painter.setPen(pen);
float radius = (waypointSize/2.0f) * 0.8 * (1/sqrt(2.0f)); float radius = (waypointSize/2.0f) * 0.8 * (1/sqrt(2.0f));
drawLine(p.x(), p.y(), p.x()+sin(yaw) * radius, p.y()-cos(yaw) * radius, refLineWidthToPen(0.4f), color, &painter); drawLine(p.x(), p.y(), p.x()+sin(list.at(i)->getYaw()+yaw) * radius, p.y()-cos(list.at(i)->getYaw()+yaw) * radius, refLineWidthToPen(0.4f), color, &painter);
drawPolygon(poly, &painter); drawPolygon(poly, &painter);
// DRAW CONNECTING LINE // DRAW CONNECTING LINE
......
#include "WatchdogControl.h" #include "WatchdogControl.h"
#include "WatchdogView.h"
#include "WatchdogProcessView.h"
#include "ui_WatchdogControl.h" #include "ui_WatchdogControl.h"
#include "PxQuadMAV.h" #include "PxQuadMAV.h"
...@@ -52,7 +54,8 @@ void WatchdogControl::updateWatchdog(int systemId, int watchdogId, unsigned int ...@@ -52,7 +54,8 @@ void WatchdogControl::updateWatchdog(int systemId, int watchdogId, unsigned int
{ {
watchdog.processes_ = std::vector<ProcessInfo>(processCount); watchdog.processes_ = std::vector<ProcessInfo>(processCount);
// Create new UI widget // Create new UI widget
//WatchdogView* view = new Watch //WatchdogView* view = new WatchdogView(this);
} }
// start the timeout timer // start the timeout timer
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include <string> #include <string>
#include <sstream> #include <sstream>
#include "WatchdogView.h"
#include "UASInterface.h" #include "UASInterface.h"
namespace Ui { namespace Ui {
...@@ -128,6 +130,7 @@ private: ...@@ -128,6 +130,7 @@ private:
WatchdogInfo& getWatchdog(uint8_t system_id, uint16_t watchdog_id); WatchdogInfo& getWatchdog(uint8_t system_id, uint16_t watchdog_id);
std::map<WatchdogID, WatchdogInfo> watchdogs_; ///< A map containing all watchdogs which are currently active std::map<WatchdogID, WatchdogInfo> watchdogs_; ///< A map containing all watchdogs which are currently active
std::map<WatchdogID, WatchdogView> views;
QTimer updateTimer_; QTimer updateTimer_;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment