mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-15 07:29:15 +01:00
GCS - MapLib - added home item editor
This commit is contained in:
parent
b8b46e90a3
commit
09a67af3e1
35
ground/openpilotgcs/src/plugins/opmap/homeeditor.cpp
Normal file
35
ground/openpilotgcs/src/plugins/opmap/homeeditor.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
#include "homeeditor.h"
|
||||
#include "ui_homeeditor.h"
|
||||
|
||||
homeEditor::homeEditor(HomeItem *home, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::homeEditor),
|
||||
myhome(home)
|
||||
{
|
||||
if(!home)
|
||||
{
|
||||
deleteLater();
|
||||
return;
|
||||
}
|
||||
ui->setupUi(this);
|
||||
this->setAttribute(Qt::WA_DeleteOnClose,true);
|
||||
ui->altitude->setValue(home->Altitude());
|
||||
ui->latitude->setValue(home->Coord().Lat());
|
||||
ui->longitude->setValue(home->Coord().Lng());
|
||||
}
|
||||
|
||||
homeEditor::~homeEditor()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void homeEditor::on_buttonBox_accepted()
|
||||
{
|
||||
myhome->SetCoord(internals::PointLatLng(ui->latitude->value(),ui->longitude->value()));
|
||||
myhome->SetAltitude(ui->altitude->value());
|
||||
}
|
||||
|
||||
void homeEditor::on_buttonBox_rejected()
|
||||
{
|
||||
this->close();
|
||||
}
|
31
ground/openpilotgcs/src/plugins/opmap/homeeditor.h
Normal file
31
ground/openpilotgcs/src/plugins/opmap/homeeditor.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef HOMEEDITOR_H
|
||||
#define HOMEEDITOR_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "opmapcontrol/opmapcontrol.h"
|
||||
|
||||
using namespace mapcontrol;
|
||||
|
||||
namespace Ui {
|
||||
class homeEditor;
|
||||
}
|
||||
|
||||
class homeEditor : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit homeEditor(HomeItem * home,QWidget *parent = 0);
|
||||
~homeEditor();
|
||||
|
||||
private slots:
|
||||
void on_buttonBox_accepted();
|
||||
|
||||
void on_buttonBox_rejected();
|
||||
|
||||
private:
|
||||
Ui::homeEditor *ui;
|
||||
HomeItem * myhome;
|
||||
};
|
||||
|
||||
#endif // HOMEEDITOR_H
|
136
ground/openpilotgcs/src/plugins/opmap/homeeditor.ui
Normal file
136
ground/openpilotgcs/src/plugins/opmap/homeeditor.ui
Normal file
@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>homeEditor</class>
|
||||
<widget class="QDialog" name="homeEditor">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>295</width>
|
||||
<height>159</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Latitude:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Longitude:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Altitude:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="altitude">
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="longitude">
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QDoubleSpinBox" name="latitude">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>homeEditor</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>homeEditor</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
Loading…
x
Reference in New Issue
Block a user