Browse Source

QGroundControl now compiles under Visual Studio 9 / 2008. Google Earth support for Windows close to work.

QGC4.4
pixhawk 15 years ago
parent
commit
c69c7b35e0
  1. 2
      src/comm/MAVLinkSimulationLink.cc
  2. 14
      src/comm/SerialLink.cc
  3. 2
      src/uas/UAS.cc
  4. 2
      src/ui/SlugsPIDControl.h
  5. 18
      src/ui/map3D/QGCGoogleEarthView.cc
  6. 26
      src/ui/map3D/QGCGoogleEarthView.h
  7. 16
      src/ui/map3D/QGCGoogleEarthViewWin.ui

2
src/comm/MAVLinkSimulationLink.cc

@ -837,7 +837,7 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
} }
unsigned char v=data[i]; //unsigned char v=data[i];
//fprintf(stderr,"%02x ", v); //fprintf(stderr,"%02x ", v);
} }
//fprintf(stderr,"\n"); //fprintf(stderr,"\n");

14
src/comm/SerialLink.cc

@ -184,18 +184,18 @@ void SerialLink::writeBytes(const char* data, qint64 size)
if(port->isOpen()) if(port->isOpen())
{ {
int b = port->write(data, size); int b = port->write(data, size);
qDebug() << "Transmitted " << b << "bytes:"; qDebug() << "Serial link " << this->getName() << "transmitted" << b << "bytes:";
// Increase write counter // Increase write counter
bitsSentTotal += size * 8; bitsSentTotal += size * 8;
int i; // int i;
for (i=0; i<size; i++) // for (i=0; i<size; i++)
{ // {
unsigned char v=data[i]; // unsigned char v=data[i];
//fprintf(stderr,"%02x ", v); // //fprintf(stderr,"%02x ", v);
} // }
} }
} }

2
src/uas/UAS.cc

@ -797,7 +797,7 @@ quint64 UAS::getUnixTime(quint64 time)
// 60 seconds // 60 seconds
// 1000 milliseconds // 1000 milliseconds
// 1000 microseconds // 1000 microseconds
#ifndef _MSVC_VER #ifndef _MSC_VER
else if (time < 1261440000000000LLU) else if (time < 1261440000000000LLU)
#else #else
else if (time < 1261440000000000) else if (time < 1261440000000000)

2
src/ui/SlugsPIDControl.h

@ -2,7 +2,7 @@
#define SLUGSPIDCONTROL_H #define SLUGSPIDCONTROL_H
#include <QWidget> #include <QWidget>
#include<QGroupBox> #include <QGroupBox>
#include "UASInterface.h" #include "UASInterface.h"
#include "QGCMAVLink.h" #include "QGCMAVLink.h"
#include "SlugsMAV.h" #include "SlugsMAV.h"

18
src/ui/map3D/QGCGoogleEarthView.cc

@ -6,9 +6,8 @@
#include "QGCGoogleEarthView.h" #include "QGCGoogleEarthView.h"
#include "QGCWebPage.h" #include "QGCWebPage.h"
#include "UASManager.h" #include "UASManager.h"
#include "ui_QGCGoogleEarthControls.h" #ifdef _MSC_VER
#if (defined Q_OS_WIN) && !(defined __MINGW32__) #include "ui_QGCGoogleEarthView.h"
#include "ui_QGCGoogleEarthViewWin.h"
#else #else
#include "ui_QGCGoogleEarthView.h" #include "ui_QGCGoogleEarthView.h"
#endif #endif
@ -24,13 +23,16 @@ QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) :
#if (defined Q_OS_MAC) #if (defined Q_OS_MAC)
webViewMac(new QWebView(this)), webViewMac(new QWebView(this)),
#endif #endif
#if (defined Q_OS_WIN) & !(defined __MINGW32__) #ifdef _MSC_VER
webViewWin(new QGCWebAxWidget(this)), webViewWin(new QGCWebAxWidget(this)),
#endif
#if (defined _MSC_VER)
ui(new Ui::QGCGoogleEarthView)
#else #else
ui(new Ui::QGCGoogleEarthView) ui(new Ui::QGCGoogleEarthView)
#endif #endif
{ {
#if (defined Q_OS_WIN) & !(defined __MINGW32__) #ifdef _MSC_VER
// Create layout and attach webViewWin // Create layout and attach webViewWin
#else #else
#endif #endif
@ -40,7 +42,7 @@ QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) :
ui->webViewLayout->addWidget(webViewMac); ui->webViewLayout->addWidget(webViewMac);
#endif #endif
#if ((defined Q_OS_MAC) | ((defined Q_OS_WIN) & !(defined __MINGW32__))) #if ((defined Q_OS_MAC) | (defined _MSC_VER))
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*))); connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*)));
connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateState())); connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateState()));
updateTimer->start(refreshRateMs); updateTimer->start(refreshRateMs);
@ -104,8 +106,8 @@ void QGCGoogleEarthView::show()
webViewMac->load(QUrl("earth.html")); webViewMac->load(QUrl("earth.html"));
#endif #endif
#if (defined Q_OS_WIN) & !(defined __MINGW32__) #ifdef _MSC_VER
webViewWin->load(QUrl("earth.html")); //webViewWin->load(QUrl("earth.html"));
#endif #endif
webViewInitialized = true; webViewInitialized = true;
} }

26
src/ui/map3D/QGCGoogleEarthView.h

@ -9,16 +9,15 @@
#include <QWebView> #include <QWebView>
#endif #endif
#if (defined Q_OS_WIN) & (defined _MSVC_VER) #ifdef _MSC_VER
QGCWebAxWidget* webViewWin;
#include <ActiveQt/QAxWidget> #include <ActiveQt/QAxWidget>
#include "windows.h" #include "windows.h"
class WebAxWidget : public QAxWidget class QGCWebAxWidget : public QAxWidget
{ {
public: public:
WebAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0) QGCWebAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0)
: QAxWidget(parent, f) : QAxWidget(parent, f)
{ {
} }
@ -32,16 +31,15 @@ protected:
} }
}; };
#else #endif
namespace Ui { namespace Ui {
class QGCGoogleEarthControls; #ifdef _MSC_VER
#if (defined Q_OS_WIN) & (defined _MSVC_VER) class QGCGoogleEarthView;
class QGCGoogleEarthViewWin;
#else #else
class QGCGoogleEarthView; class QGCGoogleEarthView;
#endif #endif
} }
#endif
class QGCGoogleEarthView : public QWidget class QGCGoogleEarthView : public QWidget
{ {
@ -75,18 +73,16 @@ protected:
bool followCamera; bool followCamera;
bool trailEnabled; bool trailEnabled;
bool webViewInitialized; bool webViewInitialized;
#if (defined Q_OS_WIN) & (defined _MSVC_VER) #ifdef _MSC_VER
#if (defined Q_OS_WIN) && !(defined __MINGW32__) QGCWebAxWidget* webViewWin;
WebAxWidget* webViewWin;
#endif #endif
#if (defined Q_OS_MAC) #if (defined Q_OS_MAC)
QWebView* webViewMac; QWebView* webViewMac;
#endif #endif
private: private:
Ui::QGCGoogleEarthControls* controls; #ifdef _MSC_VER
#if (defined Q_OS_WIN) && !(defined __MINGW32__) Ui::QGCGoogleEarthView* ui;
Ui::QGCGoogleEarthViewWin* ui;
#else #else
Ui::QGCGoogleEarthView* ui; Ui::QGCGoogleEarthView* ui;
#endif #endif

16
src/ui/map3D/QGCGoogleEarthViewWin.ui

@ -1,10 +1,8 @@
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<author></author> <ui version="4.0">
<comment></comment> <class>QGCGoogleEarthViewWin</class>
<exportmacro></exportmacro> <widget class="QWidget" name="QGCGoogleEarthViewWin">
<class>Form</class> <property name="geometry">
<widget class="QWidget" name="Form" >
<property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -12,10 +10,10 @@
<height>300</height> <height>300</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
</widget> </widget>
<pixmapfunction></pixmapfunction> <resources/>
<connections/> <connections/>
</ui> </ui>

Loading…
Cancel
Save