1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

GCS/OPMap- Change one of the function names to proper camelcase

This commit is contained in:
PT_Dreamer 2012-08-20 16:21:12 +01:00
parent 56b094abab
commit 0c240cffa5
9 changed files with 54 additions and 54 deletions

View File

@ -2,7 +2,7 @@
****************************************************************************** ******************************************************************************
* *
* @file core.cpp * @file core.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @brief * @brief
* @see The GNU Public License (GPL) Version 3 * @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget * @defgroup OPMapWidget

View File

@ -2,7 +2,7 @@
****************************************************************************** ******************************************************************************
* *
* @file core.h * @file core.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @brief * @brief
* @see The GNU Public License (GPL) Version 3 * @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget * @defgroup OPMapWidget

View File

@ -2,7 +2,7 @@
****************************************************************************** ******************************************************************************
* *
* @file mapgraphicitem.cpp * @file mapgraphicitem.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @brief The main graphicsItem used on the widget, contains the map and map logic * @brief The main graphicsItem used on the widget, contains the map and map logic
* @see The GNU Public License (GPL) Version 3 * @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget * @defgroup OPMapWidget

View File

@ -2,7 +2,7 @@
****************************************************************************** ******************************************************************************
* *
* @file mapgraphicitem.h * @file mapgraphicitem.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @brief The main graphicsItem used on the widget, contains the map and map logic * @brief The main graphicsItem used on the widget, contains the map and map logic
* @see The GNU Public License (GPL) Version 3 * @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget * @defgroup OPMapWidget

View File

@ -82,18 +82,18 @@ modelMapProxy::overlayType modelMapProxy::overlayTranslate(int type)
{ {
switch(type) switch(type)
{ {
case mapDataDelegate::MODE_FLYENDPOINT: case MapDataDelegate::MODE_FLYENDPOINT:
case mapDataDelegate::MODE_FLYVECTOR: case MapDataDelegate::MODE_FLYVECTOR:
case mapDataDelegate::MODE_DRIVEENDPOINT: case MapDataDelegate::MODE_DRIVEENDPOINT:
case mapDataDelegate::MODE_DRIVEVECTOR: case MapDataDelegate::MODE_DRIVEVECTOR:
return OVERLAY_LINE; return OVERLAY_LINE;
break; break;
case mapDataDelegate::MODE_FLYCIRCLERIGHT: case MapDataDelegate::MODE_FLYCIRCLERIGHT:
case mapDataDelegate::MODE_DRIVECIRCLERIGHT: case MapDataDelegate::MODE_DRIVECIRCLERIGHT:
return OVERLAY_CIRCLE_RIGHT; return OVERLAY_CIRCLE_RIGHT;
break; break;
case mapDataDelegate::MODE_FLYCIRCLELEFT: case MapDataDelegate::MODE_FLYCIRCLELEFT:
case mapDataDelegate::MODE_DRIVECIRCLELEFT: case MapDataDelegate::MODE_DRIVECIRCLELEFT:
return OVERLAY_CIRCLE_LEFT; return OVERLAY_CIRCLE_LEFT;
break; break;
default: default:
@ -167,23 +167,23 @@ void modelMapProxy::refreshOverlays()
createOverlay(wp_current,findWayPointNumber(wp_error),wp_error_overlay,Qt::red); createOverlay(wp_current,findWayPointNumber(wp_error),wp_error_overlay,Qt::red);
switch(model->data(model->index(x,flightDataModel::COMMAND)).toInt()) switch(model->data(model->index(x,flightDataModel::COMMAND)).toInt())
{ {
case mapDataDelegate::COMMAND_ONCONDITIONNEXTWAYPOINT: case MapDataDelegate::COMMAND_ONCONDITIONNEXTWAYPOINT:
wp_next=findWayPointNumber(x+1); wp_next=findWayPointNumber(x+1);
createOverlay(wp_current,wp_next,wp_next_overlay,Qt::green); createOverlay(wp_current,wp_next,wp_next_overlay,Qt::green);
break; break;
case mapDataDelegate::COMMAND_ONCONDITIONJUMPWAYPOINT: case MapDataDelegate::COMMAND_ONCONDITIONJUMPWAYPOINT:
wp_next=findWayPointNumber(wp_jump); wp_next=findWayPointNumber(wp_jump);
createOverlay(wp_current,wp_next,wp_jump_overlay,Qt::green); createOverlay(wp_current,wp_next,wp_jump_overlay,Qt::green);
break; break;
case mapDataDelegate::COMMAND_ONNOTCONDITIONJUMPWAYPOINT: case MapDataDelegate::COMMAND_ONNOTCONDITIONJUMPWAYPOINT:
wp_next=findWayPointNumber(wp_jump); wp_next=findWayPointNumber(wp_jump);
createOverlay(wp_current,wp_next,wp_jump_overlay,Qt::yellow); createOverlay(wp_current,wp_next,wp_jump_overlay,Qt::yellow);
break; break;
case mapDataDelegate::COMMAND_ONNOTCONDITIONNEXTWAYPOINT: case MapDataDelegate::COMMAND_ONNOTCONDITIONNEXTWAYPOINT:
wp_next=findWayPointNumber(x+1); wp_next=findWayPointNumber(x+1);
createOverlay(wp_current,wp_next,wp_next_overlay,Qt::yellow); createOverlay(wp_current,wp_next,wp_next_overlay,Qt::yellow);
break; break;
case mapDataDelegate::COMMAND_IFCONDITIONJUMPWAYPOINTELSENEXTWAYPOINT: case MapDataDelegate::COMMAND_IFCONDITIONJUMPWAYPOINTELSENEXTWAYPOINT:
wp_next=findWayPointNumber(wp_jump); wp_next=findWayPointNumber(wp_jump);
createOverlay(wp_current,wp_next,wp_jump_overlay,Qt::green); createOverlay(wp_current,wp_next,wp_jump_overlay,Qt::green);
wp_next=findWayPointNumber(x+1); wp_next=findWayPointNumber(x+1);

View File

@ -42,12 +42,12 @@ opmap_edit_waypoint_dialog::opmap_edit_waypoint_dialog(QWidget *parent,QAbstract
connect(ui->cbCondition,SIGNAL(currentIndexChanged(int)),this,SLOT(setupConditionWidgets())); connect(ui->cbCondition,SIGNAL(currentIndexChanged(int)),this,SLOT(setupConditionWidgets()));
connect(ui->pushButtonApply,SIGNAL(clicked()),this,SLOT(pushButtonApply_clicked())); connect(ui->pushButtonApply,SIGNAL(clicked()),this,SLOT(pushButtonApply_clicked()));
connect(ui->pushButtonCancel,SIGNAL(clicked()),this,SLOT(pushButtonCancel_clicked())); connect(ui->pushButtonCancel,SIGNAL(clicked()),this,SLOT(pushButtonCancel_clicked()));
mapDataDelegate::loadComboBox(ui->cbMode,flightDataModel::MODE); MapDataDelegate::loadComboBox(ui->cbMode,flightDataModel::MODE);
mapDataDelegate::loadComboBox(ui->cbCondition,flightDataModel::CONDITION); MapDataDelegate::loadComboBox(ui->cbCondition,flightDataModel::CONDITION);
mapDataDelegate::loadComboBox(ui->cbCommand,flightDataModel::COMMAND); MapDataDelegate::loadComboBox(ui->cbCommand,flightDataModel::COMMAND);
mapper = new QDataWidgetMapper(this); mapper = new QDataWidgetMapper(this);
mapper->setItemDelegate(new mapDataDelegate(this)); mapper->setItemDelegate(new MapDataDelegate(this));
connect(mapper,SIGNAL(currentIndexChanged(int)),this,SLOT(currentIndexChanged(int))); connect(mapper,SIGNAL(currentIndexChanged(int)),this,SLOT(currentIndexChanged(int)));
mapper->setModel(model); mapper->setModel(model);
mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit); mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
@ -101,18 +101,18 @@ void opmap_edit_waypoint_dialog::on_pushButtonOK_clicked()
void opmap_edit_waypoint_dialog::setupModeWidgets() void opmap_edit_waypoint_dialog::setupModeWidgets()
{ {
mapDataDelegate::ModeOptions mode=(mapDataDelegate::ModeOptions)ui->cbMode->itemData(ui->cbMode->currentIndex()).toInt(); MapDataDelegate::ModeOptions mode=(MapDataDelegate::ModeOptions)ui->cbMode->itemData(ui->cbMode->currentIndex()).toInt();
switch(mode) switch(mode)
{ {
case mapDataDelegate::MODE_FLYENDPOINT: case MapDataDelegate::MODE_FLYENDPOINT:
case mapDataDelegate::MODE_FLYVECTOR: case MapDataDelegate::MODE_FLYVECTOR:
case mapDataDelegate::MODE_FLYCIRCLERIGHT: case MapDataDelegate::MODE_FLYCIRCLERIGHT:
case mapDataDelegate::MODE_FLYCIRCLELEFT: case MapDataDelegate::MODE_FLYCIRCLELEFT:
case mapDataDelegate::MODE_DRIVEENDPOINT: case MapDataDelegate::MODE_DRIVEENDPOINT:
case mapDataDelegate::MODE_DRIVEVECTOR: case MapDataDelegate::MODE_DRIVEVECTOR:
case mapDataDelegate::MODE_DRIVECIRCLELEFT: case MapDataDelegate::MODE_DRIVECIRCLELEFT:
case mapDataDelegate::MODE_DRIVECIRCLERIGHT: case MapDataDelegate::MODE_DRIVECIRCLERIGHT:
case mapDataDelegate::MODE_DISARMALARM: case MapDataDelegate::MODE_DISARMALARM:
ui->modeParam1->setVisible(false); ui->modeParam1->setVisible(false);
ui->modeParam2->setVisible(false); ui->modeParam2->setVisible(false);
ui->modeParam3->setVisible(false); ui->modeParam3->setVisible(false);
@ -122,7 +122,7 @@ void opmap_edit_waypoint_dialog::setupModeWidgets()
ui->dsb_modeParam3->setVisible(false); ui->dsb_modeParam3->setVisible(false);
ui->dsb_modeParam4->setVisible(false); ui->dsb_modeParam4->setVisible(false);
break; break;
case mapDataDelegate::MODE_FIXEDATTITUDE: case MapDataDelegate::MODE_FIXEDATTITUDE:
ui->modeParam1->setText("pitch"); ui->modeParam1->setText("pitch");
ui->modeParam2->setText("roll"); ui->modeParam2->setText("roll");
ui->modeParam3->setText("yaw"); ui->modeParam3->setText("yaw");
@ -136,7 +136,7 @@ void opmap_edit_waypoint_dialog::setupModeWidgets()
ui->dsb_modeParam3->setVisible(true); ui->dsb_modeParam3->setVisible(true);
ui->dsb_modeParam4->setVisible(true); ui->dsb_modeParam4->setVisible(true);
break; break;
case mapDataDelegate::MODE_SETACCESSORY: case MapDataDelegate::MODE_SETACCESSORY:
ui->modeParam1->setText("Acc.channel"); ui->modeParam1->setText("Acc.channel");
ui->modeParam2->setText("Value"); ui->modeParam2->setText("Value");
ui->modeParam1->setVisible(true); ui->modeParam1->setVisible(true);
@ -152,12 +152,12 @@ void opmap_edit_waypoint_dialog::setupModeWidgets()
} }
void opmap_edit_waypoint_dialog::setupConditionWidgets() void opmap_edit_waypoint_dialog::setupConditionWidgets()
{ {
mapDataDelegate::EndConditionOptions mode=(mapDataDelegate::EndConditionOptions)ui->cbCondition->itemData(ui->cbCondition->currentIndex()).toInt(); MapDataDelegate::EndConditionOptions mode=(MapDataDelegate::EndConditionOptions)ui->cbCondition->itemData(ui->cbCondition->currentIndex()).toInt();
switch(mode) switch(mode)
{ {
case mapDataDelegate::ENDCONDITION_NONE: case MapDataDelegate::ENDCONDITION_NONE:
case mapDataDelegate::ENDCONDITION_IMMEDIATE: case MapDataDelegate::ENDCONDITION_IMMEDIATE:
case mapDataDelegate::ENDCONDITION_PYTHONSCRIPT: case MapDataDelegate::ENDCONDITION_PYTHONSCRIPT:
ui->condParam1->setVisible(false); ui->condParam1->setVisible(false);
ui->condParam2->setVisible(false); ui->condParam2->setVisible(false);
ui->condParam3->setVisible(false); ui->condParam3->setVisible(false);
@ -167,7 +167,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
ui->dsb_condParam3->setVisible(false); ui->dsb_condParam3->setVisible(false);
ui->dsb_condParam4->setVisible(false); ui->dsb_condParam4->setVisible(false);
break; break;
case mapDataDelegate::ENDCONDITION_TIMEOUT: case MapDataDelegate::ENDCONDITION_TIMEOUT:
ui->condParam1->setVisible(true); ui->condParam1->setVisible(true);
ui->condParam2->setVisible(false); ui->condParam2->setVisible(false);
ui->condParam3->setVisible(false); ui->condParam3->setVisible(false);
@ -178,7 +178,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
ui->dsb_condParam4->setVisible(false); ui->dsb_condParam4->setVisible(false);
ui->condParam1->setText("Timeout(ms)"); ui->condParam1->setText("Timeout(ms)");
break; break;
case mapDataDelegate::ENDCONDITION_DISTANCETOTARGET: case MapDataDelegate::ENDCONDITION_DISTANCETOTARGET:
ui->condParam1->setVisible(true); ui->condParam1->setVisible(true);
ui->condParam2->setVisible(true); ui->condParam2->setVisible(true);
ui->condParam3->setVisible(false); ui->condParam3->setVisible(false);
@ -190,7 +190,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
ui->condParam1->setText("Distance(m)"); ui->condParam1->setText("Distance(m)");
ui->condParam2->setText("Flag(0=2D,1=3D)");//FIXME ui->condParam2->setText("Flag(0=2D,1=3D)");//FIXME
break; break;
case mapDataDelegate::ENDCONDITION_LEGREMAINING: case MapDataDelegate::ENDCONDITION_LEGREMAINING:
ui->condParam1->setVisible(true); ui->condParam1->setVisible(true);
ui->condParam2->setVisible(false); ui->condParam2->setVisible(false);
ui->condParam3->setVisible(false); ui->condParam3->setVisible(false);
@ -201,7 +201,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
ui->dsb_condParam4->setVisible(false); ui->dsb_condParam4->setVisible(false);
ui->condParam1->setText("Relative Distance(0=complete,1=just starting)"); ui->condParam1->setText("Relative Distance(0=complete,1=just starting)");
break; break;
case mapDataDelegate::ENDCONDITION_ABOVEALTITUDE: case MapDataDelegate::ENDCONDITION_ABOVEALTITUDE:
ui->condParam1->setVisible(true); ui->condParam1->setVisible(true);
ui->condParam2->setVisible(false); ui->condParam2->setVisible(false);
ui->condParam3->setVisible(false); ui->condParam3->setVisible(false);
@ -212,7 +212,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
ui->dsb_condParam4->setVisible(false); ui->dsb_condParam4->setVisible(false);
ui->condParam1->setText("Altitude in meters (negative)"); ui->condParam1->setText("Altitude in meters (negative)");
break; break;
case mapDataDelegate::ENDCONDITION_POINTINGTOWARDSNEXT: case MapDataDelegate::ENDCONDITION_POINTINGTOWARDSNEXT:
ui->condParam1->setVisible(true); ui->condParam1->setVisible(true);
ui->condParam2->setVisible(false); ui->condParam2->setVisible(false);
ui->condParam3->setVisible(false); ui->condParam3->setVisible(false);

View File

@ -50,7 +50,7 @@ void pathPlanner::setModel(flightDataModel *model,QItemSelectionModel *selection
ui->tableView->setModel(model); ui->tableView->setModel(model);
ui->tableView->setSelectionModel(selection); ui->tableView->setSelectionModel(selection);
ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows); ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui->tableView->setItemDelegate(new mapDataDelegate(this)); ui->tableView->setItemDelegate(new MapDataDelegate(this));
connect(model,SIGNAL(rowsInserted(const QModelIndex&,int,int)),this,SLOT(rowsInserted(const QModelIndex&,int,int))); connect(model,SIGNAL(rowsInserted(const QModelIndex&,int,int)),this,SLOT(rowsInserted(const QModelIndex&,int,int)));
wid=new opmap_edit_waypoint_dialog(NULL,model,selection); wid=new opmap_edit_waypoint_dialog(NULL,model,selection);
ui->tableView->resizeColumnsToContents(); ui->tableView->resizeColumnsToContents();

View File

@ -28,7 +28,7 @@
#include <QComboBox> #include <QComboBox>
#include <QRadioButton> #include <QRadioButton>
#include <QDebug> #include <QDebug>
QWidget *mapDataDelegate::createEditor(QWidget *parent, QWidget *MapDataDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem & option, const QStyleOptionViewItem & option,
const QModelIndex & index) const const QModelIndex & index) const
{ {
@ -38,18 +38,18 @@ QWidget *mapDataDelegate::createEditor(QWidget *parent,
{ {
case flightDataModel::MODE: case flightDataModel::MODE:
box=new QComboBox(parent); box=new QComboBox(parent);
mapDataDelegate::loadComboBox(box,flightDataModel::MODE); MapDataDelegate::loadComboBox(box,flightDataModel::MODE);
return box; return box;
break; break;
case flightDataModel::CONDITION: case flightDataModel::CONDITION:
box=new QComboBox(parent); box=new QComboBox(parent);
mapDataDelegate::loadComboBox(box,flightDataModel::CONDITION); MapDataDelegate::loadComboBox(box,flightDataModel::CONDITION);
return box; return box;
break; break;
case flightDataModel::COMMAND: case flightDataModel::COMMAND:
box=new QComboBox(parent); box=new QComboBox(parent);
mapDataDelegate::loadComboBox(box,flightDataModel::COMMAND); MapDataDelegate::loadComboBox(box,flightDataModel::COMMAND);
return box; return box;
break; break;
default: default:
@ -61,7 +61,7 @@ QWidget *mapDataDelegate::createEditor(QWidget *parent,
return editor; return editor;
} }
void mapDataDelegate::setEditorData(QWidget *editor, void MapDataDelegate::setEditorData(QWidget *editor,
const QModelIndex &index) const const QModelIndex &index) const
{ {
if(!index.isValid()) if(!index.isValid())
@ -78,7 +78,7 @@ void mapDataDelegate::setEditorData(QWidget *editor,
QItemDelegate::setEditorData(editor, index); QItemDelegate::setEditorData(editor, index);
} }
void mapDataDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, void MapDataDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const const QModelIndex &index) const
{ {
QString className=editor->metaObject()->className(); QString className=editor->metaObject()->className();
@ -91,13 +91,13 @@ void mapDataDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
QItemDelegate::setModelData(editor,model,index); QItemDelegate::setModelData(editor,model,index);
} }
void mapDataDelegate::updateEditorGeometry(QWidget *editor, void MapDataDelegate::updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option, const QModelIndex &/* index */) const const QStyleOptionViewItem &option, const QModelIndex &/* index */) const
{ {
editor->setGeometry(option.rect); editor->setGeometry(option.rect);
} }
void mapDataDelegate::loadComboBox(QComboBox *combo, flightDataModel::pathPlanDataEnum type) void MapDataDelegate::loadComboBox(QComboBox *combo, flightDataModel::pathPlanDataEnum type)
{ {
switch(type) switch(type)
{ {
@ -138,6 +138,6 @@ void mapDataDelegate::loadComboBox(QComboBox *combo, flightDataModel::pathPlanDa
} }
} }
mapDataDelegate::mapDataDelegate(QObject *parent):QItemDelegate(parent) MapDataDelegate::MapDataDelegate(QObject *parent):QItemDelegate(parent)
{ {
} }

View File

@ -32,7 +32,7 @@
#include "flightdatamodel.h" #include "flightdatamodel.h"
class mapDataDelegate : public QItemDelegate class MapDataDelegate : public QItemDelegate
{ {
Q_OBJECT Q_OBJECT
@ -47,7 +47,7 @@ class mapDataDelegate : public QItemDelegate
COMMAND_ONCONDITIONJUMPWAYPOINT=2, COMMAND_ONNOTCONDITIONJUMPWAYPOINT=3, COMMAND_ONCONDITIONJUMPWAYPOINT=2, COMMAND_ONNOTCONDITIONJUMPWAYPOINT=3,
COMMAND_IFCONDITIONJUMPWAYPOINTELSENEXTWAYPOINT=4 } CommandOptions; COMMAND_IFCONDITIONJUMPWAYPOINTELSENEXTWAYPOINT=4 } CommandOptions;
mapDataDelegate(QObject *parent = 0); MapDataDelegate(QObject *parent = 0);
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const; const QModelIndex &index) const;