1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

GCS/OPMap-Increase several value limits and added

missing label on the wp editor.
This commit is contained in:
PT_Dreamer 2012-07-06 23:02:56 +01:00
parent 66ed4552be
commit 61dea64a76
4 changed files with 30 additions and 6 deletions

View File

@ -273,9 +273,10 @@ WayPointItem::WayPointItem(MapGraphicItem *map, bool magicwaypoint):reached(fals
void WayPointItem::setRelativeCoord(distBearingAltitude value)
{
if(value.altitudeRelative-relativeCoord.altitudeRelative<0.0001
&& value.bearing-relativeCoord.bearing<0.0001 && value.distance==relativeCoord.distance)
if(qAbs(value.altitudeRelative-relativeCoord.altitudeRelative<0.0001)
&& qAbs(value.bearing-relativeCoord.bearing<0.0001) && value.distance==relativeCoord.distance)
return;
qDebug()<<"setRelative";
relativeCoord=value;
if(myHome)
{
@ -290,8 +291,9 @@ WayPointItem::WayPointItem(MapGraphicItem *map, bool magicwaypoint):reached(fals
void WayPointItem::SetCoord(const internals::PointLatLng &value)
{
if(Coord()==value)
if(qAbs(Coord().Lat()-value.Lat()<0.0001 && qAbs(Coord().Lng()-value.Lng()<0.0001)))
return;
qDebug()<<"setCoord";
bool abs_coord=false;
bool rel_coord=false;
if(coord!=value)

View File

@ -389,6 +389,8 @@ bool flightDataModel::insertRows(int row, int count, const QModelIndex &/*parent
bool flightDataModel::removeRows(int row, int count, const QModelIndex &/*parent*/)
{
if(row<0)
return false;
beginRemoveRows(QModelIndex(),row,row+count-1);
for(int x=0; x<count;++x)
{

View File

@ -259,7 +259,11 @@
</widget>
</item>
<item row="10" column="2">
<widget class="QDoubleSpinBox" name="doubleSpinBoxVelocity"/>
<widget class="QDoubleSpinBox" name="doubleSpinBoxVelocity">
<property name="maximum">
<double>999999999.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
@ -295,7 +299,14 @@
</widget>
</item>
<item row="8" column="2">
<widget class="QDoubleSpinBox" name="doubleSpinBoxRelativeAltitude"/>
<widget class="QDoubleSpinBox" name="doubleSpinBoxRelativeAltitude">
<property name="minimum">
<double>-999999999.000000000000000</double>
</property>
<property name="maximum">
<double>999999999.000000000000000</double>
</property>
</widget>
</item>
<item row="8" column="3">
<widget class="QLabel" name="label_9">
@ -307,7 +318,7 @@
<item row="6" column="2">
<widget class="QDoubleSpinBox" name="doubleSpinBoxDistance">
<property name="decimals">
<number>0</number>
<number>2</number>
</property>
<property name="maximum">
<double>999999999.000000000000000</double>
@ -324,6 +335,13 @@
</property>
</widget>
</item>
<item row="10" column="3">
<widget class="QLabel" name="label_10">
<property name="text">
<string>m/s</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>

View File

@ -64,6 +64,8 @@ QWidget *mapDataDelegate::createEditor(QWidget *parent,
void mapDataDelegate::setEditorData(QWidget *editor,
const QModelIndex &index) const
{
if(!index.isValid())
return;
QString className=editor->metaObject()->className();
if (className.contains("QComboBox")) {
int value = index.model()->data(index, Qt::EditRole).toInt();