Commit dcfbc8f1 authored by Mariano Lizarraga's avatar Mariano Lizarraga

Merge branch 'mergeRemote' into experimental

parents 5f1bb21b 79fd9437
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="org.eclipse.cdt.core.default.config.989472769">
<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.989472769" moduleId="org.eclipse.cdt.core.settings" name="Configuration">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="Qt Release Build" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments/>
<buildTarget>release</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="Qt Debug Build" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
<buildCommand>mingw32-make</buildCommand>
<buildArguments/>
<buildTarget>debug</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.pathentry">
<pathentry base-path="C:/Qt/2010.04/qt/include" include="" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="ActiveQt" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="phonon" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="phonon_compat" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="Qt" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="Qt3Support" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtAssistant" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtCore" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtDBus" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtDeclarative" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtDesigner" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtGui" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtHelp" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtMultimedia" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtNetwork" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtOpenGL" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtOpenVG" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtScript" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtScriptTools" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtSql" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtSvg" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtTest" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtUiTools" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtWebKit" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtXml" kind="inc" path="" system="true"/>
<pathentry base-path="C:/Qt/2010.04/qt/include" include="QtXmlPatterns" kind="inc" path="" system="true"/>
</storageModule>
</cconfiguration>
</storageModule>
</cproject>
......@@ -30,4 +30,13 @@ user_config.pri
*.ncb
*.vcproj
*.sln
\ No newline at end of file
*.sln
*.sln
*.vcproj
*.user
*.ncb
*.idb
*.project
*.cproject
*.sln
*.suo
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>qgroundcontrol</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.trolltech.qtcppproject.QtMakefileGenerator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.make.core.makeBuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>org.eclipse.cdt.core.errorOutputParser</key>
<value>org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.MakeErrorParser;</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.arguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.command</key>
<value>mingw32-make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.target.auto</key>
<value>debug</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.target.clean</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.build.target.inc</key>
<value>debug</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.environment</key>
<value>QMAKESPEC=win32-g++|PATH=C:\\Qt\\2010.04\\qt\\bin;${env_var:PATH}|</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>false</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.make.core.makeNature</nature>
<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
<nature>com.trolltech.qtcppproject.QtNature</nature>
</natures>
</projectDescription>
......@@ -27,7 +27,7 @@ R13=0.005927
R21=-0.000563
R22=0.999999
R23=0.001235
R33=-0.005926
R31=-0.005926
R32=-0.001239
R33=0.999982
Tx=-0.024287
......
......@@ -12,6 +12,7 @@ cp -r ../bin/mac/qgroundcontrol.app mac/.
cp -r ../audio mac/qgroundcontrol.app/Contents/MacOs/.
mkdir -p mac/qgroundcontrol.app/Contents/Frameworks/
# SDL is not copied by Qt - for whatever reason
cp -r SDL.framework mac/qgroundcontrol.app/Contents/Frameworks/.
echo -e '\n\nStarting to create disk image. This may take a while..\n'
macdeployqt mac/qgroundcontrol.app -dmg
......
......@@ -16,20 +16,20 @@ LicenseData ..\license.txt
Section ""
SetOutPath $INSTDIR
File qgroundcontrol\*.*
WriteUninstaller $INSTDIR\QGroundcontrol_uninstall.exe
File ..\release\*.*
WriteUninstaller $INSTDIR\QGroundControl_uninstall.exe
SectionEnd
Section "Uninstall"
Delete $INSTDIR\QGroundcontrol_uninstall.exe
Delete $INSTDIR\QGroundControl_uninstall.exe
Delete $INSTDIR\*.*
RMDir $INSTDIR
Delete "$SMPROGRAMS\QGroundcontrol\*.*"
RMDir "$SMPROGRAMS\QGroundcontrol\"
Delete "$SMPROGRAMS\QGroundControl\*.*"
RMDir "$SMPROGRAMS\QGroundControl\"
SectionEnd
Section "create Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\QGroundcontrol"
CreateShortCut "$SMPROGRAMS\QGroundcontrol\uninstall.lnk" "$INSTDIR\QGroundcontrol_uninstall.exe" "" "$INSTDIR\QGroundcontrol_uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\QGroundcontrol\QGroundcontrol.lnk" "$INSTDIR\qgroundcontrol.exe" "" "$INSTDIR\qgroundcontrol.exe" 0
CreateDirectory "$SMPROGRAMS\QGroundControl"
CreateShortCut "$SMPROGRAMS\QGroundControl\uninstall.lnk" "$INSTDIR\QGroundControl_uninstall.exe" "" "$INSTDIR\QGroundControl_uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\QGroundControl\QGroundControl.lnk" "$INSTDIR\qgroundcontrol.exe" "" "$INSTDIR\qgroundcontrol.exe" 0
SectionEnd
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
......@@ -7,18 +7,22 @@
<!-- QGroundControl -->
<title>QGroundControl Google Earth View</title>
<!-- *** Replace the key below below with your own API key, available at http://code.google.com/apis/maps/signup.html *** -->
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw"></script>
<script type="text/javascript">
<script type="text/javascript" src="https://getfirebug.com/firebug-lite-beta.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw"></script>
<script type="text/javascript">
google.load("earth", "1", { 'language': 'en'});
var ge = null;
var initialized = false;
var aircraft = new Array();
var currAircraft = 220;
var followAircraft = false;
var followEnabled = false;
var lastLat = 0;
var lastLon = 0;
var currLat = 47.3769;
var currLon = 8.549444;
var currAlt = 470;
var currFollowHeading = 0.0;
var homeLat = 0;
var homeLon = 0;
......@@ -27,18 +31,30 @@ var homeViewRange = 500;
var homeLocation = null;
var homeGroundLevel = 0;
var currViewRange = 3.0; ///<< The current viewing range from this position (in meters)
var currViewRange = 50.0; ///<< The current viewing range from this position (in meters)
var currTilt = 40.0; ///<< The tilt angle (in degrees)
var currFollowTilt = 40.0;
var currView = null;
var M_PI = 3.14159265;
var planeOrient;
var planeLoc;
var aircraft = [];
var attitudes = [];
var locations = [];
var trails = [];
var trailPlacemarks = [];
var trailsVisible = [];
var trailColors = [];
//var trailPlacemarks[id];
var lineStyle;
// Aircraft class
var planeColor = '6600ffff';
function isInitialized()
......@@ -47,13 +63,17 @@ function isInitialized()
}
function init() {
function init()
{
google.earth.createInstance("map3d", initCallback, failureCallback);
}
function setCurrAircraft(id)
{
currAircraft = id;
}
function setGCSHome(lat, lon, alt)
{
......@@ -86,36 +106,11 @@ function setGCSHome(lat, lon, alt)
{
homeGroundLevel = alt;
}
goHome();
}
function initCallback(object)
function createAircraft(id, type, color)
{
ge = object;
ge.getWindow().setVisibility(true);
ge.getOptions().setStatusBarVisibility(true);
ge.getOptions().setScaleLegendVisibility(true);
ge.getOptions().setFlyToSpeed(ge.SPEED_TELEPORT);
ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_TREES, true);
// Now after the Google Earth initialization, initialize the GCS view
setGCSHome(currLat, currLon, currAlt);
// Create the first aircraft model
// Load 3D model
var planePlacemark = ge.createPlacemark('');
planePlacemark = ge.createPlacemark('');
planePlacemark.setName('aircraft');
planeModel = ge.createModel('');
ge.getFeatures().appendChild(planePlacemark);
......@@ -135,9 +130,95 @@ function initCallback(object)
planePlacemark.setGeometry(planeModel);
setAircraftPositionAttitude(220, 47.3772, currLon, currAlt+50, 20, 15, 50);
enableFollowing(true);
updateFollowAircraft();
// Write into global structure
aircraft[id] = planePlacemark;
attitudes[id] = planeOrient;
locations[id] = planeLoc;
//planeColor = color;
createTrail(id, color);
console.log(color);
}
function createTrail(id, color)
{
trailPlacemarks[id] = ge.createPlacemark('');
// Create the placemark
// Create the LineString; set it to extend down to the ground
// and set the altitude mode
trails[id] = ge.createLineString('');
trailPlacemarks[id].setGeometry(trails[id]);
trails[id].setExtrude(false);
trails[id].setAltitudeMode(ge.ALTITUDE_ABSOLUTE);
// Add LineString points
//lineString.getCoordinates().pushLatLngAlt(48.754, -121.835, 700);
// Create a style and set width and color of line
trailPlacemarks[id].setStyleSelector(ge.createStyle(''));
lineStyle = trailPlacemarks[id].getStyleSelector().getLineStyle();
lineStyle.setWidth(5);
trailColors[id] = color;
lineStyle.getColor().set('00000000');  // aabbggrr format
trailsVisible[id] = false;
// Add the feature to Earth
//ge.getFeatures().appendChild(trailPlacemarks[id]);
}
function hideTrail(id)
{
trailsVisible[id] = false;
ge.getFeatures().removeChild(trailPlacemarks[id]);
}
function showTrail(id)
{
ge.getFeatures().appendChild(trailPlacemarks[id]);
trailsVisible[id] = true;
}
function setViewRange(dist)
{
currViewRange = dist;
}
function addTrailPosition(id, lat, lon, alt)
{
trails[id].setExtrude(false);
trails[id].setAltitudeMode(ge.ALTITUDE_ABSOLUTE);
// Add LineString points
trails[id].getCoordinates().pushLatLngAlt(lat, lon, alt);
// Create a style and set width and color of line
trailPlacemarks[id].setStyleSelector(ge.createStyle(''));
lineStyle = trailPlacemarks[id].getStyleSelector().getLineStyle();
lineStyle.setWidth(5);
lineStyle.getColor().set(trailColors[id]);  // aabbggrr format
//lineStyle.getColor().set(color);  // aabbggrr format
// Add the feature to Earth
if (trailsVisible[id] == true) ge.getFeatures().replaceChild(trailPlacemarks[id], trailPlacemarks[id]);
}
function initCallback(object)
{
ge = object;
ge.getWindow().setVisibility(true);
ge.getOptions().setStatusBarVisibility(true);
ge.getOptions().setScaleLegendVisibility(true);
ge.getOptions().setFlyToSpeed(5.0);
//ge.getOptions().setFlyToSpeed(ge.SPEED_TELEPORT);
ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_TREES, true);
initialized = true;
......@@ -147,23 +228,39 @@ function setAircraftPositionAttitude(id, lat, lon, alt, roll, pitch, yaw)
{
if (id == currAircraft)
{
lastLat = currLat;
lastLon = lastLon;
currLat = lat;
currLon = lon;
currAlt = alt;
//currFollowHeading = ((yaw/M_PI)+1.0)*360.0;
}
planeOrient.setRoll(roll);
planeOrient.setTilt(pitch);
planeOrient.setHeading(yaw);
// FIXME Currently invalid conversion from right-handed z-down to z-up frame
planeOrient.setRoll(((roll/M_PI)+1.0)*360.0);
planeOrient.setTilt(((pitch/M_PI)+1.0)*360.0);
planeOrient.setHeading(((yaw/M_PI)+1.0)*360.0);
planeLoc.setLatitude(lat);
planeLoc.setLongitude(lon);
planeLoc.setAltitude(alt);
planeLoc.setLatitude(lat);
planeLoc.setLongitude(lon);
planeLoc.setAltitude(alt);
}
function enableDaylight(enabled)
{
if(enabled)
{
ge.getSun().setVisibility(true);
}
else
{
ge.getSun().setVisibility(false);
}
}
function goHome()
{
var currView = ge.getView().copyAsLookAt(ge.ALTITUDE_ABSOLUTE);
......@@ -180,24 +277,17 @@ function setCurrentAircraft(id)
currAircraft = id;
}
function enableFollowing(follow)
{
followEnabled = follow;
}
function updateFollowAircraft()
{
if (followEnabled)
{
currView = ge.getView().copyAsLookAt(ge.ALTITUDE_ABSOLUTE);
currView.setLatitude(currLat);
currView.setLongitude(currLon);
currView.setAltitude(currAlt);
currView.setRange(currViewRange);
currView.setTilt(currFollowTilt);
currFollowHeading = 0.9*currFollowHeading+0.1*((Math.atan2(lastLat-currLat, lastLon-currLon)/M_PI)+1.0)*360.0;
currView.setHeading(currFollowHeading-0.0);
ge.getView().setAbstractView(currView);
}
}
function failureCallback(object)
......
......@@ -99,9 +99,10 @@ namespace qmapcontrol
Geometry* Layer::get_Geometry(int index)
{
Geometry* geo = NULL;
if(geometrySelected)
{
return geometrySelected;
geo = geometrySelected;
}
else
{
......@@ -110,7 +111,7 @@ namespace qmapcontrol
Geometry *geometry = geometries[i];
if(geometry->name() == QString::number(index))
{
return geometry;
geo = geometry;
}
}
......@@ -124,7 +125,7 @@ namespace qmapcontrol
// }
}
return geo;
}
bool Layer::isVisible() const
......
......@@ -112,7 +112,14 @@ namespace qmapcontrol
void LayerManager::setView(const QPointF& coordinate)
{
QPoint oldMapPx = mapmiddle_px;
mapmiddle_px = layer()->mapadapter()->coordinateToDisplay(coordinate);
scroll += mapmiddle_px - oldMapPx;
zoomImageScroll+= mapmiddle_px - oldMapPx;
mapmiddle = coordinate;
//TODO: muss wegen moveTo() raus
......@@ -125,7 +132,8 @@ namespace qmapcontrol
//TODO:
// verschiebung ausrechnen
// oder immer neues offscreenimage
newOffscreenImage();
//newOffscreenImage();
moveWidgets();
}
}
......
# -------------------------------------------------
# QGroundControl - Micro Air Vehicle Groundstation
# Please see our website at <http://qgroundcontrol.org>
# Author:
# Lorenz Meier <mavteam@student.ethz.ch>
# (c) 2009-2010 PIXHAWK Team
# This file is part of the mav groundstation project
# QGroundControl is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# QGroundControl is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
# -------------------------------------------------
# Include QMapControl map library
# prefer version from external directory /
# from http://github.com/pixhawk/qmapcontrol/
# over bundled version in lib directory
# Version from GIT repository is preferred
# include ( "../qmapcontrol/QMapControl/QMapControl.pri" ) #{
# Include bundled version if necessary
CONFIG += designer plugin
TARGET = $$qtLibraryTarget($$TARGET)
TEMPLATE = lib
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/designer
FORMS = src/ui/designer/QGCParamSlider.ui
HEADERS = src/ui/designer/QGCParamSlider.h \
src/ui/designer/QGCParamSliderPlugin.h
SOURCES = src/ui/designer/QGCParamSlider.cc \
src/ui/designer/QGCParamSliderPlugin.cc
# install
target.path = $$[QT_INSTALL_PLUGINS]/designer
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockplugin
INSTALLS += target
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
......@@ -23,11 +23,13 @@
#
#-------------------------------------------------
#$$BASEDIR/lib/qextserialport/include
# $$BASEDIR/lib/openjaus/libjaus/include \
# $$BASEDIR/lib/openjaus/libopenJaus/include
message(Qt version $$[QT_VERSION])
message(Using Qt from $QTDIR)
release {
# DEFINES += QT_NO_DEBUG_OUTPUT
......@@ -40,15 +42,16 @@ QMAKE_POST_LINK += echo "Copying files"
#QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/.
# MAC OS X
macx {
macx {
COMPILER_VERSION = system(gcc -v)
COMPILER_VERSION = $$system(gcc -v)
message(Using compiler $$COMPILER_VERSION)
HARDWARE_PLATFORM = $$system(uname -a)
contains( HARDWARE_PLATFORM, 9.6.0 ) || contains( HARDWARE_PLATFORM, 9.7.0 ) || contains( HARDWARE_PLATFORM, 9.8.0 ) || contains( HARDWARE_PLATFORM, 9.9.0 ) {
# x86 Mac OS X Leopard 10.5 and earlier
CONFIG += x86 cocoa phonon
CONFIG -= x86_64
message(Building for Mac OS X 32bit/Leopard 10.5 and earlier)
# Enable function-profiling with the OS X saturn tool
......@@ -73,7 +76,7 @@ macx {
-framework CoreFoundation \
-framework ApplicationServices \
-lm
ICON = $$BASEDIR/images/icons/macx.icns
# Copy audio files if needed
......@@ -153,12 +156,13 @@ linux-g++ {
release {
DESTDIR = $$TARGETDIR/release
DEFINES += QT_NO_DEBUG
}
QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
INCLUDEPATH += /usr/include \
/usr/local/include \
/usr/local/include \
/usr/include/qt4/phonon
# $$BASEDIR/lib/flite/include \
# $$BASEDIR/lib/flite/lang
......@@ -222,6 +226,7 @@ linux-g++-64 {
release {
DESTDIR = $$TARGETDIR/release
DEFINES += QT_NO_DEBUG
}
QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
......@@ -289,8 +294,17 @@ win32-msvc2008 {
CONFIG += qaxcontainer
# Special settings for debug
#CONFIG += CONSOLE
# QWebkit is not needed on MS-Windows compilation environment
CONFIG -= webkit
release {
CONFIG -= console
DEFINES += QT_NO_DEBUG
}
debug {
CONFIG += console
}
INCLUDEPATH += $$BASEDIR/lib/sdl/msvc/include \
$$BASEDIR/lib/opal/include \
......@@ -310,9 +324,9 @@ INCLUDEPATH += $$BASEDIR/lib/osgEarth/win32/include \
LIBS += -L$$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/lib \
-losg \
-losgViewer \
-losgGA \
-losgDB \
-losgText \
-losgGA \
-losgDB \
-losgText \
-lOpenThreads
DEFINES += QGC_OSG_ENABLED
exists($$BASEDIR/lib/osgEarth123) {
......@@ -331,18 +345,18 @@ exists($$BASEDIR/lib/osgEarth123) {
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
debug {
exists($$TARGETDIR/debug) {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\debug\\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\debug\audio\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\debug\models\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\debug\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\audio\" \"$$TARGETDIR_WIN\\debug\\audio\\\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\debug\\models\\\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\debug\\earth.html\"
}
release {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\release\audio\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\release\models\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\release\"
exists($$TARGETDIR/release) {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\release\\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\audio\" \"$$TARGETDIR_WIN\\release\\audio\\\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\release\\models\\\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\release\\earth.html\"
}
}
......@@ -351,7 +365,7 @@ exists($$BASEDIR/lib/osgEarth123) {
win32-g++ {
message(Building for Windows Platform (32bit))
# Special settings for debug
#CONFIG += CONSOLE
......@@ -362,20 +376,28 @@ win32-g++ {
LIBS += -L$$BASEDIR/lib/sdl/win32 \
-lmingw32 -lSDLmain -lSDL -mwindows
CONFIG += windows
debug {
#DESTDIR = $$BUILDDIR/debug
CONFIG += console
}
release {
CONFIG -= console
DEFINES += QT_NO_DEBUG
#DESTDIR = $$BUILDDIR/release
}
RC_FILE = $$BASEDIR/qgroundcontrol.rc
# Copy dependencies
system(cp): {
# CP command is available, use it instead of copy / xcopy
message("Using cp to copy image and audio files to executable")
debug {
QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/debug/SDL.dll
QMAKE_POST_LINK += && cp -r $$BASEDIR/audio $$TARGETDIR/debug/audio
......@@ -388,6 +410,28 @@ win32-g++ {
QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/release/models
}
} else {
# No cp command available, go for copy / xcopy
# Copy dependencies
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
exists($$TARGETDIR/debug) {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\debug\\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\audio\" \"$$TARGETDIR_WIN\\debug\\audio\\\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\debug\\models\\\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\debug\\earth.html\"
}
exists($$TARGETDIR/release) {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\release\\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\audio\" \"$$TARGETDIR_WIN\\release\\audio\\\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\release\\models\\\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\release\\earth.html\"
}
}
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
QMAKE_CXXFLAGS += -Wl,-E
......
......@@ -145,12 +145,15 @@ FORMS += src/ui/MainWindow.ui \
src/ui/QGCWebView.ui \
src/ui/map3D/QGCGoogleEarthView.ui \
src/ui/map3D/QGCGoogleEarthViewWin.ui \
src/ui/map3D/QGCGoogleEarthControls.ui \
src/ui/SlugsDataSensorView.ui \
src/ui/SlugsHilSim.ui \
src/ui/SlugsPIDControl.ui \
src/ui/SlugsVideoCamControl.ui \
src/ui/SlugsPadCameraControl.ui
src/ui/SlugsPadCameraControl.ui \
src/ui/uas/QGCUnconnectedInfoWidget.ui \
src/ui/designer/QGCToolWidget.ui \
src/ui/designer/QGCParamSlider.ui \
src/ui/designer/QGCActionButton.ui
INCLUDEPATH += src \
src/ui \
......@@ -165,7 +168,8 @@ INCLUDEPATH += src \
src/ui/mavlink \
src/ui/param \
src/ui/watchdog \
src/ui/map3D
src/ui/map3D \
src/ui/designer
HEADERS += src/MG.h \
src/Core.h \
......@@ -244,12 +248,23 @@ HEADERS += src/MG.h \
src/comm/QGCMAVLink.h \
src/ui/QGCWebView.h \
src/ui/map3D/QGCWebPage.h \
src/ui/map3D/QGCGoogleEarthView.h\
src/ui/SlugsDataSensorView.h \
src/ui/SlugsHilSim.h \
src/ui/SlugsPIDControl.h \
src/ui/SlugsVideoCamControl.h \
src/ui/SlugsPadCameraControl.h
src/ui/SlugsPadCameraControl.h \
src/ui/QGCMainWindowAPConfigurator.h \
src/comm/MAVLinkSwarmSimulationLink.h \
src/ui/uas/QGCUnconnectedInfoWidget.h \
src/ui/designer/QGCToolWidget.h \
src/ui/designer/QGCParamSlider.h \
src/ui/designer/QGCActionButton.h \
src/ui/designer/QGCToolWidgetItem.h
# Google Earth is only supported on Mac OS and Windows with Visual Studio Compiler
macx|win32-msvc2008: {
HEADERS += src/ui/map3D/QGCGoogleEarthView.h
}
contains(DEPENDENCIES_PRESENT, osg) {
message("Including headers for OpenSceneGraph")
......@@ -353,13 +368,24 @@ SOURCES += src/main.cc \
src/ui/RadioCalibration/AbstractCalibrator.cc \
src/ui/RadioCalibration/RadioCalibrationData.cc \
src/ui/QGCWebView.cc \
src/ui/map3D/QGCGoogleEarthView.cc \
src/ui/map3D/QGCWebPage.cc \
src/ui/SlugsDataSensorView.cc \
src/ui/SlugsHilSim.cc \
src/ui/SlugsPIDControl.cpp \
src/ui/SlugsVideoCamControl.cpp \
src/ui/SlugsPadCameraControl.cpp
src/ui/SlugsPadCameraControl.cpp \
src/ui/QGCMainWindowAPConfigurator.cc \
src/comm/MAVLinkSwarmSimulationLink.cc \
src/ui/uas/QGCUnconnectedInfoWidget.cc \
src/ui/designer/QGCToolWidget.cc \
src/ui/designer/QGCParamSlider.cc \
src/ui/designer/QGCActionButton.cc \
src/ui/designer/QGCToolWidgetItem.cc
macx|win32-msvc2008: {
SOURCES += src/ui/map3D/QGCGoogleEarthView.cc
}
contains(DEPENDENCIES_PRESENT, osg) {
message("Including sources for OpenSceneGraph")
......
......@@ -66,7 +66,7 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
{
this->setApplicationName(QGC_APPLICATION_NAME);
this->setApplicationVersion(QGC_APPLICATION_VERSION);
this->setOrganizationName(QLatin1String("PIXHAWK Association Zurich"));
this->setOrganizationName(QLatin1String("OPENMAV"));
this->setOrganizationDomain("http://qgroundcontrol.org");
// Show splash screen
......@@ -105,10 +105,6 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
// Start the user interface
splashScreen->showMessage(tr("Starting User Interface"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
// Start UI
mainWindow = new MainWindow();
// Remove splash screen
splashScreen->finish(mainWindow);
// Connect links
// to make sure that all components are initialized when the
......@@ -117,7 +113,22 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
// Listen on Multicast-Address 239.255.77.77, Port 14550
//QHostAddress * multicast_udp = new QHostAddress("239.255.77.77");
//UDPLink* udpLink = new UDPLink(*multicast_udp, 14550);
mainWindow->addLink(udpLink);
//mainWindow->addLink(udpLink);
#ifdef OPAL_RT
// Add OpalRT Link, but do not connect
OpalLink* opalLink = new OpalLink();
//mainWindow->addLink(opalLink);
#endif
// MAVLinkSimulationLink* simulationLink = new MAVLinkSimulationLink(MG::DIR::getSupportFilesDirectory() + "/demo-log.txt");
MAVLinkSimulationLink* simulationLink = new MAVLinkSimulationLink(":/demo-log.txt");
simulationLink->disconnect();
//mainWindow->addLink(simulationLink);
mainWindow = MainWindow::instance();
// Remove splash screen
splashScreen->finish(mainWindow);
// Check if link could be connected
if (!udpLink->connect())
......@@ -140,15 +151,6 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
QTimer::singleShot(200, mainWindow, SLOT(close()));
}
}
#ifdef OPAL_RT
// Add OpalRT Link, but do not connect
OpalLink* opalLink = new OpalLink();
mainWindow->addLink(opalLink);
#endif
// MAVLinkSimulationLink* simulationLink = new MAVLinkSimulationLink(MG::DIR::getSupportFilesDirectory() + "/demo-log.txt");
MAVLinkSimulationLink* simulationLink = new MAVLinkSimulationLink(":/demo-log.txt");
mainWindow->addLink(simulationLink);
}
/**
......@@ -157,6 +159,9 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
**/
Core::~Core()
{
//mainWindow->storeSettings();
mainWindow->hide();
mainWindow->deleteLater();
// Delete singletons
delete LinkManager::instance();
delete UASManager::instance();
......
......@@ -30,6 +30,7 @@ This file is part of the QGROUNDCONTROL project
*/
#include <QApplication>
#include <QSettings>
#include <QTemporaryFile>
#include "GAudioOutput.h"
#include "MG.h"
......@@ -85,10 +86,19 @@ GAudioOutput* GAudioOutput::instance()
return _instance;
}
#define QGC_GAUDIOOUTPUT_KEY QString("QGC_AUDIOOUTPUT_")
GAudioOutput::GAudioOutput(QObject* parent) : QObject(parent),
voiceIndex(0),
emergency(false)
emergency(false),
muted(false)
{
// Load settings
QSettings settings;
settings.sync();
muted = settings.value(QGC_GAUDIOOUTPUT_KEY+"muted", muted).toBool();
#ifdef Q_OS_LINUX
flite_init();
#endif
......@@ -134,13 +144,28 @@ emergency(false)
GAudioOutput::~GAudioOutput()
{
QSettings settings;
settings.setValue(QGC_GAUDIOOUTPUT_KEY+"muted", muted);
settings.sync();
#ifdef _MSC_VER2
::CoUninitialize();
#endif
}
void GAudioOutput::mute(bool mute)
{
this->muted = mute;
}
bool GAudioOutput::isMuted()
{
return this->muted;
}
bool GAudioOutput::say(QString text, int severity)
{
if (!muted)
{
// TODO Add severity filter
Q_UNUSED(severity);
bool res = false;
......@@ -183,13 +208,18 @@ bool GAudioOutput::say(QString text, int severity)
}
return res;
}
else
{
return false;
}
}
/**
* @param text This message will be played after the alert beep
*/
bool GAudioOutput::alert(QString text)
{
if (!emergency)
if (!emergency || !muted)
{
// Play alert sound
beep();
......@@ -205,19 +235,25 @@ bool GAudioOutput::alert(QString text)
void GAudioOutput::notifyPositive()
{
if (!muted)
{
// Use QFile to transform path for all OS
QFile f(QCoreApplication::applicationDirPath()+QString("/audio/double_notify.wav"));
m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
m_media->play();
}
}
void GAudioOutput::notifyNegative()
{
if (!muted)
{
// Use QFile to transform path for all OS
QFile f(QCoreApplication::applicationDirPath()+QString("/audio/flat_notify.wav"));
m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
m_media->play();
}
}
/**
* The emergency sound will be played continously during the emergency.
......@@ -232,7 +268,7 @@ bool GAudioOutput::startEmergency()
{
emergency = true;
// Beep immediately and then start timer
beep();
if (!muted) beep();
emergencyTimer->start(1500);
QTimer::singleShot(5000, this, SLOT(stopEmergency()));
}
......@@ -257,11 +293,14 @@ bool GAudioOutput::stopEmergency()
void GAudioOutput::beep()
{
if (!muted)
{
// Use QFile to transform path for all OS
QFile f(QCoreApplication::applicationDirPath()+QString("/audio/alert.wav"));
m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
m_media->play();
}
}
void GAudioOutput::selectFemaleVoice()
{
......
......@@ -99,6 +99,10 @@ public slots:
void notifyPositive();
/** @brief Notify about negative event */
void notifyNegative();
/** @brief Mute/unmute sound */
void mute(bool mute);
/** @brief Get the mute state */
bool isMuted();
protected:
#ifdef Q_OS_MAC
......@@ -112,6 +116,7 @@ protected:
Phonon::AudioOutput* m_audioOutput;
bool emergency; ///< Emergency status flag
QTimer* emergencyTimer;
bool muted;
private:
GAudioOutput(QObject* parent=NULL);
~GAudioOutput();
......
......@@ -125,7 +125,9 @@ void LogCompressor::run()
file.reset();
QTextStream data(&file);
int linecounter = 0;
while (!data.atEnd()) {
quint64 lastTimeIndex = 0;
while (!data.atEnd())
{
linecounter++;
currentDataLine = linecounter;
QString line = data.readLine();
......@@ -140,7 +142,33 @@ void LogCompressor::run()
value = "NaN";
}
// Get matching output line
quint64 index = times->indexOf(time);
// Constraining the search area might result in not finding a key,
// but it significantly reduces the time needed for the search
// setting a window of 1000 entries means that a 1 Hz data point
// can still be located
int offsetLimit = 200;
quint64 offset;
quint64 index = -1;
while (index == -1)
{
if (lastTimeIndex > offsetLimit)
{
offset = lastTimeIndex - offsetLimit;
}
else
{
offset = 0;
}
quint64 index = times->indexOf(time, offset);
if (index == -1)
{
qDebug() << "INDEX NOT FOUND DURING LOGFILE PROCESSING, RESTARTING SEARCH";
// FIXME Reset and start without offset heuristic again
offsetLimit+=1000;
}
}
lastTimeIndex = index;
QString outLine = outLines->at(index);
QStringList outParts = outLine.split(separator);
// Replace measurement placeholder with current value
......
......@@ -11,9 +11,15 @@ namespace QGC
const QColor colorGreen(20, 200, 20);
const QColor colorYellow(255, 255, 0);
const QColor colorDarkYellow(180, 180, 0);
const QColor colorBackground("#050508");
/** @brief Get the current ground time in microseconds */
quint64 groundTimeUsecs();
const QString APPNAME = "QGROUNDCONTROL";
const QString COMPANYNAME = "OPENMAV";
}
#define QGC_EVENTLOOP_DEBUG 0
#endif // QGC_H
......@@ -42,6 +42,7 @@ along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
class LinkInterface : public QThread {
Q_OBJECT
public:
LinkInterface(QObject* parent = 0) : QThread(parent) {}
//virtual ~LinkInterface() = 0;
/* Connection management */
......
......@@ -32,6 +32,7 @@ This file is part of the QGROUNDCONTROL project
#include <QList>
#include <QApplication>
#include "LinkManager.h"
#include <iostream>
#include <QDebug>
......@@ -65,6 +66,8 @@ LinkManager::~LinkManager()
void LinkManager::add(LinkInterface* link)
{
if(!link) return;
connect(link, SIGNAL(destroyed(QObject*)), this, SLOT(removeLink(QObject*)));
links.append(link);
emit newLink(link);
}
......@@ -73,6 +76,7 @@ void LinkManager::addProtocol(LinkInterface* link, ProtocolInterface* protocol)
{
// Connect link to protocol
// the protocol will receive new bytes from the link
if(!link || !protocol) return;
connect(link, SIGNAL(bytesReceived(LinkInterface*, QByteArray)), protocol, SLOT(receiveBytes(LinkInterface*, QByteArray)));
// Store the connection information in the protocol links map
protocolLinks.insertMulti(protocol, link);
......@@ -91,7 +95,8 @@ bool LinkManager::connectAll()
foreach (LinkInterface* link, links)
{
if(! link->connect()) allConnected = false;
if(!link) {}
else if(!link->connect()) allConnected = false;
}
return allConnected;
......@@ -103,7 +108,9 @@ bool LinkManager::disconnectAll()
foreach (LinkInterface* link, links)
{
if(! link->disconnect()) allDisconnected = false;
//static int i=0;
if(!link){}
else if(!link->disconnect()) allDisconnected = false;
}
return allDisconnected;
......@@ -111,14 +118,43 @@ bool LinkManager::disconnectAll()
bool LinkManager::connectLink(LinkInterface* link)
{
if(!link) return false;
return link->connect();
}
bool LinkManager::disconnectLink(LinkInterface* link)
{
if(!link) return false;
return link->disconnect();
}
void LinkManager::removeLink(QObject* link)
{
LinkInterface* linkInterface = dynamic_cast<LinkInterface*>(link);
// Add link to link list
if (links.contains(linkInterface))
{
int linkIndex = links.indexOf(linkInterface);
links.removeAt(linkIndex);
}
}
bool LinkManager::removeLink(LinkInterface* link)
{
if(link)
{
for (int i=0; i < QList<LinkInterface*>(links).size(); i++)
{
if(link==links.at(i))
{
links.removeAt(i); //remove from link list
}
}
return true;
}
return false;
}
/**
* The access time is linear in the number of links.
*
......
......@@ -67,6 +67,9 @@ public slots:
void add(LinkInterface* link);
void addProtocol(LinkInterface* link, ProtocolInterface* protocol);
void removeLink(QObject* link);
bool removeLink(LinkInterface* link);
bool connectAll();
bool connectLink(LinkInterface* link);
......
......@@ -33,6 +33,7 @@ This file is part of the QGROUNDCONTROL project
#include <QDebug>
#include <QTime>
#include <QApplication>
#include <QMessageBox>
#include "MG.h"
#include "MAVLinkProtocol.h"
......@@ -45,6 +46,7 @@ This file is part of the QGROUNDCONTROL project
#include "ArduPilotMegaMAV.h"
#include "configuration.h"
#include "LinkManager.h"
#include "MainWindow.h"
#include <QGCMAVLink.h>
#include "QGC.h"
......@@ -141,8 +143,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
// of its existence, as it only then can send and receive
// it's first messages.
// FIXME Current debugging
// check if the UAS has the same id like this system
// Check if the UAS has the same id like this system
if (message.sysid == getSystemId())
{
qDebug() << "WARNING\nWARNING\nWARNING\nWARNING\nWARNING\nWARNING\nWARNING\n\n RECEIVED MESSAGE FROM THIS SYSTEM WITH ID" << message.msgid << "FROM COMPONENT" << message.compid;
......@@ -155,7 +156,22 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
// First create new UAS object
// Decode heartbeat message
mavlink_heartbeat_t heartbeat;
// Reset version field to 0
heartbeat.mavlink_version = 0;
mavlink_msg_heartbeat_decode(&message, &heartbeat);
// Check if the UAS has a different protocol version
if (heartbeat.mavlink_version != MAVLINK_VERSION)
{
// Bring up dialog to inform user
MainWindow::instance()->showCriticalMessage(tr("The MAVLink protocol version on the MAV and QGroundControl mismatch!"),
tr("It is unsafe to use different MAVLink versions. QGroundControl therefore refuses to connect to system %1, which sends MAVLink version %2 (QGroundControl uses version %3).").arg(message.sysid).arg(heartbeat.mavlink_version).arg(MAVLINK_VERSION));
// Ignore this message and continue gracefully
continue;
}
switch (heartbeat.autopilot)
{
case MAV_AUTOPILOT_GENERIC:
......@@ -229,6 +245,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
}
else
{
// TODO: This if-else block can (should) be greatly simplified
if (lastIndex[message.sysid][message.compid] == 255)
{
lastIndex[message.sysid][message.compid] = 0;
......
This diff is collapsed.
......@@ -47,7 +47,7 @@ class MAVLinkSimulationLink : public LinkInterface
{
Q_OBJECT
public:
MAVLinkSimulationLink(QString readFile="", QString writeFile="", int rate=5);
MAVLinkSimulationLink(QString readFile="", QString writeFile="", int rate=5, QObject* parent = 0);
~MAVLinkSimulationLink();
bool isConnected();
qint64 bytesAvailable();
......@@ -85,16 +85,18 @@ public:
public slots:
void writeBytes(const char* data, qint64 size);
void readBytes();
void mainloop();
/** @brief Mainloop simulating the mainloop of the MAV */
virtual void mainloop();
bool connectLink(bool connect);
void connectLink();
protected:
// UAS properties
float roll, pitch, yaw;
float x, y, z;
float spX, spY, spZ, spYaw;
double x, y, z;
double spX, spY, spZ, spYaw;
int battery;
QTimer* timer;
......@@ -126,7 +128,7 @@ protected:
void enqueue(uint8_t* stream, uint8_t* index, mavlink_message_t* msg);
static const uint8_t systemId = 220;
static const uint8_t componentId = 0;
static const uint8_t componentId = 200;
static const uint16_t version = 1000;
signals:
......
#include "MAVLinkSwarmSimulationLink.h"
MAVLinkSwarmSimulationLink::MAVLinkSwarmSimulationLink(QString readFile, QString writeFile, int rate, QObject *parent) :
MAVLinkSimulationLink(readFile, writeFile, rate, parent)
{
}
void MAVLinkSwarmSimulationLink::mainloop()
{
}
#ifndef MAVLINKSWARMSIMULATIONLINK_H
#define MAVLINKSWARMSIMULATIONLINK_H
#include "MAVLinkSimulationLink.h"
class MAVLinkSwarmSimulationLink : public MAVLinkSimulationLink
{
Q_OBJECT
public:
MAVLinkSwarmSimulationLink(QString readFile="", QString writeFile="", int rate=5, QObject *parent = 0);
signals:
public slots:
void mainloop();
};
#endif // MAVLINKSWARMSIMULATIONLINK_H
This diff is collapsed.
This diff is collapsed.
......@@ -91,6 +91,9 @@ public:
qint64 getBitsSent();
qint64 getBitsReceived();
void loadSettings();
void writeSettings();
void run();
int getLinkQuality();
......
......@@ -57,6 +57,8 @@ public slots:
virtual bool setParityType(int parity) = 0;
virtual bool setDataBitsType(int dataBits) = 0;
virtual bool setStopBitsType(int stopBits) = 0;
virtual void loadSettings() = 0;
virtual void writeSettings() = 0;
};
......
......@@ -7,7 +7,7 @@
#ifdef MAVLINK_ENABLED_SLUGS
#define SERIAL_POLL_INTERVAL 7
#else
#define SERIAL_POLL_INTERVAL 2
#define SERIAL_POLL_INTERVAL 7
#endif
/** @brief Heartbeat emission rate, in Hertz (times per second) */
......@@ -16,6 +16,6 @@
#define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "QGroundControl"
#define QGC_APPLICATION_VERSION "v. 0.7.7 (Beta)"
#define QGC_APPLICATION_VERSION "v. 0.8.0 (Beta)"
#endif // CONFIGURATION_H
......@@ -341,7 +341,7 @@ Freenect::readConfigFile(void)
settings.value("transform/R33").toDouble(),
settings.value("transform/Tz").toDouble(),
0.0, 0.0, 0.0, 1.0);
transformMatrix = transformMatrix.transposed();
transformMatrix = transformMatrix.inverted();
baseline = settings.value("transform/baseline").toDouble();
disparityOffset = settings.value("transform/disparity_offset").toDouble();
......
......@@ -92,8 +92,11 @@ enum BaudRateType
BAUD57600,
BAUD76800, //POSIX ONLY
BAUD115200,
BAUD128000, //WINDOWS ONLY
BAUD256000 //WINDOWS ONLY
BAUD128000, // WINDOWS ONLY
BAUD230400, // WINDOWS ONLY
BAUD256000, // WINDOWS ONLY
BAUD460800, // WINDOWS ONLY
BAUD921600 // WINDOWS ONLY
};
enum DataBitsType
......
......@@ -5,6 +5,16 @@
#include <windows.h>
#include <QThread>
/* These baudrates work on windows, but are not part of the windows headers */
#ifndef CBR_230400
#define CBR_230400 230400
#endif
#ifndef CBR_460800
#define CBR_460800 460800
#endif
#ifndef CBR_921600
#define CBR_921600 921600
#endif
/*if all warning messages are turned off, flag portability warnings to be turned off as well*/
#ifdef _TTY_NOWARN_
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
......@@ -10,15 +9,15 @@ This file is part of the QGROUNDCONTROL project
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
......@@ -47,17 +46,20 @@ void ArduPilotMegaMAV::receiveMessage(LinkInterface* link, mavlink_message_t mes
{
// Let UAS handle the default message set
UAS::receiveMessage(link, message);
// Handle your special messages
switch (message.msgid)
if (message.sysid == uasId)
{
case MAVLINK_MSG_ID_HEARTBEAT:
// Handle your special messages
switch (message.msgid)
{
qDebug() << "ARDUPILOT RECEIVED HEARTBEAT";
case MAVLINK_MSG_ID_HEARTBEAT:
{
//qDebug() << "ARDUPILOT RECEIVED HEARTBEAT";
break;
}
default:
//qDebug() << "\nARDUPILOT RECEIVED MESSAGE WITH ID" << message.msgid;
break;
}
default:
qDebug() << "\nARDUPILOT RECEIVED MESSAGE WITH ID" << message.msgid;
break;
}
}
......@@ -41,12 +41,12 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
{
// Let UAS handle the default message set
UAS::receiveMessage(link, message);
// mavlink_message_t* msg = &message;
//qDebug() << "PX RECEIVED" << msg->sysid << msg->compid << msg->msgid;
// Only compile this portion if matching MAVLink packets have been compiled
#ifdef MAVLINK_ENABLED_PIXHAWK
mavlink_message_t* msg = &message;
if (message.sysid == uasId)
{
......
......@@ -62,7 +62,8 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
// Let UAS handle the default message set
UAS::receiveMessage(link, message);
if (message.sysid == uasId)
{
// Handle your special messages mavlink_message_t* msg = &message;
switch (message.msgid)
{
......@@ -136,7 +137,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
case MAVLINK_MSG_ID_CTRL_SRFC_PT: //181
break;
break;
case MAVLINK_MSG_ID_PID: //182
memset(&mlSinglePid,0,sizeof(mavlink_pid_t));
......@@ -153,9 +154,10 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
#endif
default:
// qDebug() << "\nSLUGS RECEIVED MESSAGE WITH ID" << message.msgid;
// qDebug() << "\nSLUGS RECEIVED MESSAGE WITH ID" << message.msgid;
break;
}
}
}
......@@ -176,9 +178,9 @@ void SlugsMAV::emitSignals (void){
case 3:
emit remoteControlChannelScaledChanged(0,(mlPilotConsoleData.de- 1000.0f)/1000.0f);
emit remoteControlChannelScaledChanged(1,(mlPilotConsoleData.dla- 1000.0f)/1000.0f);
emit remoteControlChannelScaledChanged(2,(mlPilotConsoleData.dr- 1000.0f)/1000.0f);
emit remoteControlChannelScaledChanged(3,(mlPilotConsoleData.dra- 1000.0f)/1000.0f);
emit remoteControlChannelScaledChanged(1,(mlPilotConsoleData.dla- 1000.0f)/1000.0f);
emit remoteControlChannelScaledChanged(2,(mlPilotConsoleData.dr- 1000.0f)/1000.0f);
emit remoteControlChannelScaledChanged(3,(mlPilotConsoleData.dra- 1000.0f)/1000.0f);
emit slugsPWM(uasId, mlPwmCommands);
break;
......
This diff is collapsed.
......@@ -146,10 +146,15 @@ protected:
double latitude;
double longitude;
double altitude;
double speedX; ///< True speed in X axis
double speedY; ///< True speed in Y axis
double speedZ; ///< True speed in Z axis
double roll;
double pitch;
double yaw;
QTimer* statusTimeout; ///< Timer for various status timeouts
QMap<int, QMap<QString, float>* > parameters; ///< All parameters
bool paramsOnceRequested; ///< If the parameter list has been read at least once
/** @brief Set the current battery type */
void setBattery(BatteryType type, int cells);
......@@ -196,7 +201,7 @@ public slots:
//void requestWaypoints(); FIXME tbd
//void clearWaypointList(); FIXME tbd
void requestParameters();
/** @brief Enable the motors */
void enable_motors();
/** @brief Disable the motors */
......@@ -211,19 +216,25 @@ public slots:
void addLink(LinkInterface* link);
/** @brief Receive a message from one of the communication links. */
void receiveMessage(LinkInterface* link, mavlink_message_t message);
virtual void receiveMessage(LinkInterface* link, mavlink_message_t message);
/** @brief Send a message over this link (to this or to all UAS on this link) */
void sendMessage(LinkInterface* link, mavlink_message_t message);
/** @brief Send a message over all links this UAS can be reached with (!= all links) */
void sendMessage(mavlink_message_t message);
/** @brief Temporary Hack for sending packets to patch Antenna. Send a message over all serial links except for this UAS's */
void forwardMessage(mavlink_message_t message);
/** @brief Set this UAS as the system currently in focus, e.g. in the main display widgets */
void setSelected();
/** @brief Set current mode of operation, e.g. auto or manual */
void setMode(int mode);
/** @brief Request all parameters */
void requestParameters();
/** @brief Set a system parameter */
void setParameter(int component, QString id, float value);
......@@ -232,6 +243,12 @@ public slots:
/** @brief Read parameters from permanent storage */
void readParametersFromStorage();
/** @brief Get the names of all parameters */
QList<QString> getParameterNames(int component);
/** @brief Get the ids of all components */
QList<int> getComponentIds();
void enableAllDataTransmission(int rate);
void enableRawSensorDataTransmission(int rate);
void enableExtendedSystemStatusTransmission(int rate);
......
......@@ -126,6 +126,7 @@ public:
///> Map will start from beginning when the first 20 colors are exceeded
colors.append(QColor(231,72,28));
colors.append(QColor(104,64,240));
colors.append(QColor(203,254,121));
colors.append(QColor(161,252,116));
colors.append(QColor(232,33,47));
......@@ -140,11 +141,10 @@ public:
colors.append(QColor(87,231,246));
colors.append(QColor(151,59,239));
colors.append(QColor(81,183,244));
colors.append(QColor(104,64,240));
colors.append(QColor(75,133,243));
colors.append(QColor(242,255,128));
colors.append(QColor(230,126,23));
nextColor++;
nextColor = 0;
}
return colors[nextColor++];
}
......
......@@ -71,6 +71,18 @@ void UASManager::run()
void UASManager::addUAS(UASInterface* uas)
{
// WARNING: The active uas is set here
// and then announced below. This is necessary
// to make sure the getActiveUAS() function
// returns the UAS once the UASCreated() signal
// is emitted. The code is thus NOT redundant.
bool firstUAS = false;
if (activeUAS == NULL)
{
firstUAS = true;
activeUAS = uas;
}
// Only execute if there is no UAS at this index
if (!systems.contains(uas->getUASID()))
{
......@@ -79,20 +91,25 @@ void UASManager::addUAS(UASInterface* uas)
}
// If there is no active UAS yet, set the first one as the active UAS
if (activeUAS == NULL)
if (firstUAS)
{
setActiveUAS(uas);
}
}
QList<UASInterface*> UASManager::getUASList()
{
return systems.values();
}
UASInterface* UASManager::getActiveUAS()
{
if(!activeUAS)
{
QMessageBox msgBox;
msgBox.setText(tr("No Micro Air Vehicle connected. Please connect one first."));
msgBox.exec();
}
// if(!activeUAS)
// {
// QMessageBox msgBox;
// msgBox.setText(tr("No Micro Air Vehicle connected. Please connect one first."));
// msgBox.exec();
// }
return activeUAS; ///< Return zero pointer if no UAS has been loaded
}
......
......@@ -69,6 +69,8 @@ public:
**/
UASInterface* getUASForId(int id);
QList<UASInterface*> getUASList();
public slots:
......
......@@ -395,11 +395,14 @@ void UASWaypointManager::loadWaypoints(const QString &loadFile)
void UASWaypointManager::globalAddWaypoint(Waypoint *wp)
{
// FIXME Will be removed
Q_UNUSED(wp);
}
int UASWaypointManager::globalRemoveWaypoint(quint16 seq)
{
// FIXME Will be removed
Q_UNUSED(seq);
return 0;
}
......
......@@ -47,6 +47,7 @@ This file is part of the QGROUNDCONTROL project
#endif
#include "MAVLinkProtocol.h"
#include "MAVLinkSettingsWidget.h"
#include "LinkManager.h"
CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolInterface* protocol, QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags)
{
......@@ -58,6 +59,10 @@ CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolIn
// add link types
ui.linkType->addItem("Serial",QGC_LINK_SERIAL);
ui.linkType->addItem("UDP",QGC_LINK_UDP);
ui.linkType->addItem("Simulation",QGC_LINK_SIMULATION);
ui.linkType->addItem("Serial Forwarding",QGC_LINK_FORWARDING);
ui.connectionType->addItem("MAVLink", QGC_PROTOCOL_MAVLINK);
// Create action to open this menu
// Create configuration action for this link
......@@ -195,11 +200,20 @@ void CommConfigurationWindow::setLinkName(QString name)
void CommConfigurationWindow::remove()
{
link->disconnect();
//delete link;
//delete action;
if(action) delete action; //delete action first since it has a pointer to link
action=NULL;
if(link)
{
LinkManager::instance()->removeLink(link); //remove link from LinkManager list
link->disconnect(); //disconnect port, and also calls terminate() to stop the thread
if (link->isRunning()) link->terminate(); // terminate() the serial thread just in case it is still running
link->wait(); // wait() until thread is stoped before deleting
delete link;
}
link=NULL;
this->window()->close();
qDebug() << "TODO: Link cannot be deleted: CommConfigurationWindow::remove() NOT IMPLEMENTED!";
}
void CommConfigurationWindow::connectionState(bool connect)
......
......@@ -42,7 +42,14 @@ This file is part of the QGROUNDCONTROL project
enum qgc_link_t
{
QGC_LINK_SERIAL,
QGC_LINK_UDP
QGC_LINK_UDP,
QGC_LINK_SIMULATION,
QGC_LINK_FORWARDING
};
enum qgc_protocol_t
{
QGC_PROTOCOL_MAVLINK
};
#ifdef OPAL_RT
......
......@@ -43,23 +43,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="linkType">
<item>
<property name="text">
<string>Serial Link</string>
</property>
</item>
<item>
<property name="text">
<string>UDP</string>
</property>
</item>
<item>
<property name="text">
<string>Simulation</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="linkType"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
......@@ -71,13 +55,8 @@
<item row="1" column="1">
<widget class="QComboBox" name="connectionType">
<property name="currentIndex">
<number>0</number>
<number>-1</number>
</property>
<item>
<property name="text">
<string>MAVLink</string>
</property>
</item>
</widget>
</item>
</layout>
......
......@@ -125,12 +125,28 @@ void DebugConsole::addLink(LinkInterface* link)
// Register for name changes
connect(link, SIGNAL(nameChanged(QString)), this, SLOT(updateLinkName(QString)));
connect(link, SIGNAL(destroyed(QObject*)), this, SLOT(removeLink(QObject*)));
}
void DebugConsole::removeLink(QObject* link)
{
LinkInterface* linkInterface = dynamic_cast<LinkInterface*>(link);
// Add link to link list
if (links.contains(linkInterface))
{
int linkIndex = links.indexOf(linkInterface);
links.removeAt(linkIndex);
m_ui->linkComboBox->removeItem(linkIndex);
}
if (link == currLink) currLink = NULL;
}
void DebugConsole::linkSelected(int linkId)
{
// Disconnect
if (currLink != NULL)
if (currLink)
{
disconnect(currLink, SIGNAL(bytesReceived(LinkInterface*,QByteArray)), this, SLOT(receiveBytes(LinkInterface*, QByteArray)));
}
......@@ -205,30 +221,30 @@ void DebugConsole::paintEvent(QPaintEvent *event)
{
Q_UNUSED(event);
// Update bandwidth
if (holdOn)
{
//qDebug() << "Data rate:" << dataRate/1000.0f << "kB/s";
QString rate("data rate: %1");
rate.arg(dataRate);
QPainter painter(this);
painter.setRenderHint(QPainter::HighQualityAntialiasing);
painter.translate(width()/5.0f, height()/5.0f);
//QFont font("Bitstream Vera Sans");
QFont font = painter.font();
font.setPixelSize((int)(60.0f));
QFontMetrics metrics = QFontMetrics(font);
int border = qMax(4, metrics.leading());
QRect rect = metrics.boundingRect(0, 0, width() - 2*border, int(height()*0.125),
Qt::AlignLeft | Qt::TextWordWrap, rate);
painter.setPen(QColor(255, 50, 50));
painter.setRenderHint(QPainter::TextAntialiasing);
painter.drawText(QRect(QPoint(static_cast<int>(width()/5.0f), static_cast<int>(height()/5.0f)), QPoint(static_cast<int>(width() - width()/5.0f), static_cast<int>(height() - height()/5.0f))), rate);
//Qt::AlignRight | Qt::TextWordWrap
}
// if (holdOn)
// {
// //qDebug() << "Data rate:" << dataRate/1000.0f << "kB/s";
// QString rate("data rate: %1");
// rate.arg(dataRate);
// QPainter painter(this);
// painter.setRenderHint(QPainter::HighQualityAntialiasing);
// painter.translate(width()/5.0f, height()/5.0f);
// //QFont font("Bitstream Vera Sans");
// QFont font = painter.font();
// font.setPixelSize((int)(60.0f));
// QFontMetrics metrics = QFontMetrics(font);
// int border = qMax(4, metrics.leading());
// QRect rect = metrics.boundingRect(0, 0, width() - 2*border, int(height()*0.125),
// Qt::AlignLeft | Qt::TextWordWrap, rate);
// painter.setPen(QColor(255, 50, 50));
// painter.setRenderHint(QPainter::TextAntialiasing);
// painter.drawText(QRect(QPoint(static_cast<int>(width()/5.0f), static_cast<int>(height()/5.0f)), QPoint(static_cast<int>(width() - width()/5.0f), static_cast<int>(height() - height()/5.0f))), rate);
// //Qt::AlignRight | Qt::TextWordWrap
// }
}
void DebugConsole::receiveBytes(LinkInterface* link, QByteArray bytes)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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