在UOS上编译完成,顺便修改了几处在win下导致的不严谨

This commit is contained in:
2020-09-09 18:06:00 +08:00
parent 3bba1e3000
commit d2df2efaeb
16 changed files with 114 additions and 48 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
include(./CharInputter/CharInputter.pri) include(./CharInputter/CharInputter.pri)
include(./Inputter/Inputter.pri) include(./Inputter/Inputter.pri)
include(./Multiselector/Multiselector.pri) include(./MultiSelector/Multiselector.pri)
include(./Selector/Selector.pri) include(./Selector/Selector.pri)
include(./Confirm/Confirm.pri) include(./Confirm/Confirm.pri)
include(./Scope/Scope.pri) include(./Scope/Scope.pri)
View File
@@ -1,5 +1,5 @@
#include "Multiselector.h" #include "multiselector.h"
#include "ui_multiselector.h" #include "ui_Multiselector.h"
MultiSelector::MultiSelector(QWidget *parent) : MultiSelector::MultiSelector(QWidget *parent) :
QWidget(parent), QWidget(parent),
@@ -348,11 +348,19 @@ QVariant ParameterInspector::param_value(mavlink_param_value_t param)
}break; }break;
case MAV_PARAM_TYPE_UINT64: case MAV_PARAM_TYPE_UINT64:
{ {
#ifdef unix
//value = ((ulong *)&param.param_value)[0];
#else
value = ((uint64_t *)&param.param_value)[0]; value = ((uint64_t *)&param.param_value)[0];
#endif
}break; }break;
case MAV_PARAM_TYPE_INT64: case MAV_PARAM_TYPE_INT64:
{ {
#ifdef unix
//value = ((long *)&param.param_value)[0];
#else
value = ((int64_t *)&param.param_value)[0]; value = ((int64_t *)&param.param_value)[0];
#endif
}break; }break;
case MAV_PARAM_TYPE_REAL32: case MAV_PARAM_TYPE_REAL32:
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Tools_Index0.h" #include "tools_Index0.h"
#include "ui_tools_Index0.h" #include "ui_tools_Index0.h"
Tools_Index0::Tools_Index0(QWidget *parent) : Tools_Index0::Tools_Index0(QWidget *parent) :
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Tools_Index1.h" #include "tools_Index1.h"
#include "ui_tools_Index1.h" #include "ui_tools_Index1.h"
Tools_Index1::Tools_Index1(QWidget *parent) : Tools_Index1::Tools_Index1(QWidget *parent) :
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Tools_Index2.h" #include "tools_Index2.h"
#include "ui_tools_Index2.h" #include "ui_tools_Index2.h"
Tools_Index2::Tools_Index2(QWidget *parent) : Tools_Index2::Tools_Index2(QWidget *parent) :
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Tools_Index3.h" #include "tools_Index3.h"
#include "ui_tools_Index3.h" #include "ui_tools_Index3.h"
Tools_Index3::Tools_Index3(QWidget *parent) : Tools_Index3::Tools_Index3(QWidget *parent) :
+25 -3
View File
@@ -222,6 +222,9 @@ void Cockpit::wheelEvent(QWheelEvent *e)
void Cockpit::setPitch(double Pitch) void Cockpit::setPitch(double Pitch)
{ {
#ifdef unix
#else
#ifdef __MINGW32__ #ifdef __MINGW32__
#else #else
@@ -229,6 +232,7 @@ void Cockpit::setPitch(double Pitch)
{ {
return; return;
} }
#endif
#endif #endif
//if(Pitch > 360) Pitch = 360; //if(Pitch > 360) Pitch = 360;
@@ -250,6 +254,9 @@ void Cockpit::setPitch(double Pitch)
void Cockpit::setPitchTarget(double Pitch) void Cockpit::setPitchTarget(double Pitch)
{ {
#ifdef unix
#else
#ifdef __MINGW32__ #ifdef __MINGW32__
#else #else
@@ -257,6 +264,7 @@ void Cockpit::setPitchTarget(double Pitch)
{ {
return; return;
} }
#endif
#endif #endif
//if(Pitch > 360) Pitch = 360; //if(Pitch > 360) Pitch = 360;
@@ -279,14 +287,17 @@ void Cockpit::setPitchTarget(double Pitch)
void Cockpit::setRoll(double Roll) void Cockpit::setRoll(double Roll)
{ {
#ifdef __MINGW32__ #ifdef unix
#else
#ifdef __MINGW32__
#else #else
if(isnan(Roll)) if(isnan(Roll))
{ {
return; return;
} }
#endif
#endif #endif
//if(Roll > 360) Roll = 360; //if(Roll > 360) Roll = 360;
//else if(Roll < -360) Roll = -360; //else if(Roll < -360) Roll = -360;
@@ -307,14 +318,17 @@ void Cockpit::setRoll(double Roll)
void Cockpit::setRollTarget(double Roll) void Cockpit::setRollTarget(double Roll)
{ {
#ifdef __MINGW32__ #ifdef unix
#else
#ifdef __MINGW32__
#else #else
if(isnan(Roll)) if(isnan(Roll))
{ {
return; return;
} }
#endif
#endif #endif
//if(Roll > 360) Roll = 360; //if(Roll > 360) Roll = 360;
//else if(Roll < -360) Roll = -360; //else if(Roll < -360) Roll = -360;
@@ -336,8 +350,11 @@ void Cockpit::setRollTarget(double Roll)
void Cockpit::setYaw(double Yaw) void Cockpit::setYaw(double Yaw)
{ {
#ifdef __MINGW32__
#ifdef unix
#else
#ifdef __MINGW32__
#else #else
if(isnan(Yaw)) if(isnan(Yaw))
@@ -345,6 +362,7 @@ void Cockpit::setYaw(double Yaw)
return; return;
} }
#endif #endif
#endif
if(Yaw < 0) Yaw += 360; if(Yaw < 0) Yaw += 360;
else if(Yaw > 360) Yaw -= 360; else if(Yaw > 360) Yaw -= 360;
@@ -359,6 +377,9 @@ void Cockpit::setYaw(double Yaw)
void Cockpit::setYawTarget(double Yaw) void Cockpit::setYawTarget(double Yaw)
{ {
#ifdef unix
#else
#ifdef __MINGW32__ #ifdef __MINGW32__
@@ -368,6 +389,7 @@ void Cockpit::setYawTarget(double Yaw)
return; return;
} }
#endif #endif
#endif
if(Yaw < 0) Yaw += 360; if(Yaw < 0) Yaw += 360;
else if(Yaw > 360) Yaw -= 360; else if(Yaw > 360) Yaw -= 360;
-2
View File
@@ -4,11 +4,9 @@ TEMPLATE = subdirs
CONFIG += ordered CONFIG += ordered
#SUBDIRS += Skin
SUBDIRS += opmap SUBDIRS += opmap
SUBDIRS += Cockpit SUBDIRS += Cockpit
SUBDIRS += MavLinkNode SUBDIRS += MavLinkNode
SUBDIRS += dlink SUBDIRS += dlink
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Replay.h" #include "replay.h"
Replay::Replay(QObject *parent) : QObject(parent) Replay::Replay(QObject *parent) : QObject(parent)
+8 -1
View File
@@ -90,7 +90,14 @@ win32|win64 {
system(xcopy $$src_dir $$dst_dir /y /e) system(xcopy $$src_dir $$dst_dir /y /e)
} }
unix {
src_dir = $$PWD/*.h
dst_dir = $$PWD/../thirdpart/include/
!exists($$dst_dir): system(mkdir -p $$dst_dir)
system(cp $$src_dir $$dst_dir -arf )
}
+7
View File
@@ -96,5 +96,12 @@ win32|win64 {
system(xcopy $$src_dir $$dst_dir /y /e) system(xcopy $$src_dir $$dst_dir /y /e)
} }
unix {
src_dir = $$PWD/*.h
dst_dir = $$PWD/../../thirdpart/include/
!exists($$dst_dir): system(mkdir -p $$dst_dir)
system(cp $$src_dir $$dst_dir -arf )
}
+16
View File
@@ -88,5 +88,21 @@ win32|win64 {
system(xcopy $$src_dir $$dst_dir /y /e) system(xcopy $$src_dir $$dst_dir /y /e)
} }
unix {
src_dir = $$PWD/*.h
dst_dir = $$PWD/../../thirdpart/include/
!exists($$dst_dir): system(mkdir -p $$dst_dir)
system(cp $$src_dir $$dst_dir -arf )
src_prodir = $$PWD/projections/*.h
dst_prodir = $$PWD/../../thirdpart/include/projections/
!exists($$dst_prodir): system(mkdir -p $$dst_prodir)
system(cp $$src_prodir $$dst_prodir -arf )
}
+4
View File
@@ -6,6 +6,9 @@
#ifdef _USE_MATH_DEFINES #ifdef _USE_MATH_DEFINES
#ifdef unix
#else
#ifdef __MINGW32__ #ifdef __MINGW32__
#else #else
@@ -24,6 +27,7 @@
#define M_SQRT2 1.41421356237309504880 #define M_SQRT2 1.41421356237309504880
#define M_SQRT1_2 0.707106781186547524401 #define M_SQRT1_2 0.707106781186547524401
#endif /* __MINGW32__ */ #endif /* __MINGW32__ */
#endif
+8 -4
View File
@@ -119,10 +119,14 @@ win32|win64 {
} }
#DISTFILES += \ unix {
# Triangle.qml \ src_dir = $$PWD/*.h
# test.qml \ dst_dir = $$PWD/../../thirdpart/include/
# waypointui.qml
!exists($$dst_dir): system(mkdir -p $$dst_dir)
system(cp $$src_dir $$dst_dir -arf )
}