1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08: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
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget

View File

@ -2,7 +2,7 @@
******************************************************************************
*
* @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
* @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget

View File

@ -2,7 +2,7 @@
******************************************************************************
*
* @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
* @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget

View File

@ -2,7 +2,7 @@
******************************************************************************
*
* @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
* @see The GNU Public License (GPL) Version 3
* @defgroup OPMapWidget

View File

@ -82,18 +82,18 @@ modelMapProxy::overlayType modelMapProxy::overlayTranslate(int type)
{
switch(type)
{
case mapDataDelegate::MODE_FLYENDPOINT:
case mapDataDelegate::MODE_FLYVECTOR:
case mapDataDelegate::MODE_DRIVEENDPOINT:
case mapDataDelegate::MODE_DRIVEVECTOR:
case MapDataDelegate::MODE_FLYENDPOINT:
case MapDataDelegate::MODE_FLYVECTOR:
case MapDataDelegate::MODE_DRIVEENDPOINT:
case MapDataDelegate::MODE_DRIVEVECTOR:
return OVERLAY_LINE;
break;
case mapDataDelegate::MODE_FLYCIRCLERIGHT:
case mapDataDelegate::MODE_DRIVECIRCLERIGHT:
case MapDataDelegate::MODE_FLYCIRCLERIGHT:
case MapDataDelegate::MODE_DRIVECIRCLERIGHT:
return OVERLAY_CIRCLE_RIGHT;
break;
case mapDataDelegate::MODE_FLYCIRCLELEFT:
case mapDataDelegate::MODE_DRIVECIRCLELEFT:
case MapDataDelegate::MODE_FLYCIRCLELEFT:
case MapDataDelegate::MODE_DRIVECIRCLELEFT:
return OVERLAY_CIRCLE_LEFT;
break;
default:
@ -167,23 +167,23 @@ void modelMapProxy::refreshOverlays()
createOverlay(wp_current,findWayPointNumber(wp_error),wp_error_overlay,Qt::red);
switch(model->data(model->index(x,flightDataModel::COMMAND)).toInt())
{
case mapDataDelegate::COMMAND_ONCONDITIONNEXTWAYPOINT:
case MapDataDelegate::COMMAND_ONCONDITIONNEXTWAYPOINT:
wp_next=findWayPointNumber(x+1);
createOverlay(wp_current,wp_next,wp_next_overlay,Qt::green);
break;
case mapDataDelegate::COMMAND_ONCONDITIONJUMPWAYPOINT:
case MapDataDelegate::COMMAND_ONCONDITIONJUMPWAYPOINT:
wp_next=findWayPointNumber(wp_jump);
createOverlay(wp_current,wp_next,wp_jump_overlay,Qt::green);
break;
case mapDataDelegate::COMMAND_ONNOTCONDITIONJUMPWAYPOINT:
case MapDataDelegate::COMMAND_ONNOTCONDITIONJUMPWAYPOINT:
wp_next=findWayPointNumber(wp_jump);
createOverlay(wp_current,wp_next,wp_jump_overlay,Qt::yellow);
break;
case mapDataDelegate::COMMAND_ONNOTCONDITIONNEXTWAYPOINT:
case MapDataDelegate::COMMAND_ONNOTCONDITIONNEXTWAYPOINT:
wp_next=findWayPointNumber(x+1);
createOverlay(wp_current,wp_next,wp_next_overlay,Qt::yellow);
break;
case mapDataDelegate::COMMAND_IFCONDITIONJUMPWAYPOINTELSENEXTWAYPOINT:
case MapDataDelegate::COMMAND_IFCONDITIONJUMPWAYPOINTELSENEXTWAYPOINT:
wp_next=findWayPointNumber(wp_jump);
createOverlay(wp_current,wp_next,wp_jump_overlay,Qt::green);
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->pushButtonApply,SIGNAL(clicked()),this,SLOT(pushButtonApply_clicked()));
connect(ui->pushButtonCancel,SIGNAL(clicked()),this,SLOT(pushButtonCancel_clicked()));
mapDataDelegate::loadComboBox(ui->cbMode,flightDataModel::MODE);
mapDataDelegate::loadComboBox(ui->cbCondition,flightDataModel::CONDITION);
mapDataDelegate::loadComboBox(ui->cbCommand,flightDataModel::COMMAND);
MapDataDelegate::loadComboBox(ui->cbMode,flightDataModel::MODE);
MapDataDelegate::loadComboBox(ui->cbCondition,flightDataModel::CONDITION);
MapDataDelegate::loadComboBox(ui->cbCommand,flightDataModel::COMMAND);
mapper = new QDataWidgetMapper(this);
mapper->setItemDelegate(new mapDataDelegate(this));
mapper->setItemDelegate(new MapDataDelegate(this));
connect(mapper,SIGNAL(currentIndexChanged(int)),this,SLOT(currentIndexChanged(int)));
mapper->setModel(model);
mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
@ -101,18 +101,18 @@ void opmap_edit_waypoint_dialog::on_pushButtonOK_clicked()
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)
{
case mapDataDelegate::MODE_FLYENDPOINT:
case mapDataDelegate::MODE_FLYVECTOR:
case mapDataDelegate::MODE_FLYCIRCLERIGHT:
case mapDataDelegate::MODE_FLYCIRCLELEFT:
case mapDataDelegate::MODE_DRIVEENDPOINT:
case mapDataDelegate::MODE_DRIVEVECTOR:
case mapDataDelegate::MODE_DRIVECIRCLELEFT:
case mapDataDelegate::MODE_DRIVECIRCLERIGHT:
case mapDataDelegate::MODE_DISARMALARM:
case MapDataDelegate::MODE_FLYENDPOINT:
case MapDataDelegate::MODE_FLYVECTOR:
case MapDataDelegate::MODE_FLYCIRCLERIGHT:
case MapDataDelegate::MODE_FLYCIRCLELEFT:
case MapDataDelegate::MODE_DRIVEENDPOINT:
case MapDataDelegate::MODE_DRIVEVECTOR:
case MapDataDelegate::MODE_DRIVECIRCLELEFT:
case MapDataDelegate::MODE_DRIVECIRCLERIGHT:
case MapDataDelegate::MODE_DISARMALARM:
ui->modeParam1->setVisible(false);
ui->modeParam2->setVisible(false);
ui->modeParam3->setVisible(false);
@ -122,7 +122,7 @@ void opmap_edit_waypoint_dialog::setupModeWidgets()
ui->dsb_modeParam3->setVisible(false);
ui->dsb_modeParam4->setVisible(false);
break;
case mapDataDelegate::MODE_FIXEDATTITUDE:
case MapDataDelegate::MODE_FIXEDATTITUDE:
ui->modeParam1->setText("pitch");
ui->modeParam2->setText("roll");
ui->modeParam3->setText("yaw");
@ -136,7 +136,7 @@ void opmap_edit_waypoint_dialog::setupModeWidgets()
ui->dsb_modeParam3->setVisible(true);
ui->dsb_modeParam4->setVisible(true);
break;
case mapDataDelegate::MODE_SETACCESSORY:
case MapDataDelegate::MODE_SETACCESSORY:
ui->modeParam1->setText("Acc.channel");
ui->modeParam2->setText("Value");
ui->modeParam1->setVisible(true);
@ -152,12 +152,12 @@ void opmap_edit_waypoint_dialog::setupModeWidgets()
}
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)
{
case mapDataDelegate::ENDCONDITION_NONE:
case mapDataDelegate::ENDCONDITION_IMMEDIATE:
case mapDataDelegate::ENDCONDITION_PYTHONSCRIPT:
case MapDataDelegate::ENDCONDITION_NONE:
case MapDataDelegate::ENDCONDITION_IMMEDIATE:
case MapDataDelegate::ENDCONDITION_PYTHONSCRIPT:
ui->condParam1->setVisible(false);
ui->condParam2->setVisible(false);
ui->condParam3->setVisible(false);
@ -167,7 +167,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
ui->dsb_condParam3->setVisible(false);
ui->dsb_condParam4->setVisible(false);
break;
case mapDataDelegate::ENDCONDITION_TIMEOUT:
case MapDataDelegate::ENDCONDITION_TIMEOUT:
ui->condParam1->setVisible(true);
ui->condParam2->setVisible(false);
ui->condParam3->setVisible(false);
@ -178,7 +178,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
ui->dsb_condParam4->setVisible(false);
ui->condParam1->setText("Timeout(ms)");
break;
case mapDataDelegate::ENDCONDITION_DISTANCETOTARGET:
case MapDataDelegate::ENDCONDITION_DISTANCETOTARGET:
ui->condParam1->setVisible(true);
ui->condParam2->setVisible(true);
ui->condParam3->setVisible(false);
@ -190,7 +190,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
ui->condParam1->setText("Distance(m)");
ui->condParam2->setText("Flag(0=2D,1=3D)");//FIXME
break;
case mapDataDelegate::ENDCONDITION_LEGREMAINING:
case MapDataDelegate::ENDCONDITION_LEGREMAINING:
ui->condParam1->setVisible(true);
ui->condParam2->setVisible(false);
ui->condParam3->setVisible(false);
@ -201,7 +201,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
ui->dsb_condParam4->setVisible(false);
ui->condParam1->setText("Relative Distance(0=complete,1=just starting)");
break;
case mapDataDelegate::ENDCONDITION_ABOVEALTITUDE:
case MapDataDelegate::ENDCONDITION_ABOVEALTITUDE:
ui->condParam1->setVisible(true);
ui->condParam2->setVisible(false);
ui->condParam3->setVisible(false);
@ -212,7 +212,7 @@ void opmap_edit_waypoint_dialog::setupConditionWidgets()
ui->dsb_condParam4->setVisible(false);
ui->condParam1->setText("Altitude in meters (negative)");
break;
case mapDataDelegate::ENDCONDITION_POINTINGTOWARDSNEXT:
case MapDataDelegate::ENDCONDITION_POINTINGTOWARDSNEXT:
ui->condParam1->setVisible(true);
ui->condParam2->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->setSelectionModel(selection);
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)));
wid=new opmap_edit_waypoint_dialog(NULL,model,selection);
ui->tableView->resizeColumnsToContents();

View File

@ -28,7 +28,7 @@
#include <QComboBox>
#include <QRadioButton>
#include <QDebug>
QWidget *mapDataDelegate::createEditor(QWidget *parent,
QWidget *MapDataDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem & option,
const QModelIndex & index) const
{
@ -38,18 +38,18 @@ QWidget *mapDataDelegate::createEditor(QWidget *parent,
{
case flightDataModel::MODE:
box=new QComboBox(parent);
mapDataDelegate::loadComboBox(box,flightDataModel::MODE);
MapDataDelegate::loadComboBox(box,flightDataModel::MODE);
return box;
break;
case flightDataModel::CONDITION:
box=new QComboBox(parent);
mapDataDelegate::loadComboBox(box,flightDataModel::CONDITION);
MapDataDelegate::loadComboBox(box,flightDataModel::CONDITION);
return box;
break;
case flightDataModel::COMMAND:
box=new QComboBox(parent);
mapDataDelegate::loadComboBox(box,flightDataModel::COMMAND);
MapDataDelegate::loadComboBox(box,flightDataModel::COMMAND);
return box;
break;
default:
@ -61,7 +61,7 @@ QWidget *mapDataDelegate::createEditor(QWidget *parent,
return editor;
}
void mapDataDelegate::setEditorData(QWidget *editor,
void MapDataDelegate::setEditorData(QWidget *editor,
const QModelIndex &index) const
{
if(!index.isValid())
@ -78,7 +78,7 @@ void mapDataDelegate::setEditorData(QWidget *editor,
QItemDelegate::setEditorData(editor, index);
}
void mapDataDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
void MapDataDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const
{
QString className=editor->metaObject()->className();
@ -91,13 +91,13 @@ void mapDataDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
QItemDelegate::setModelData(editor,model,index);
}
void mapDataDelegate::updateEditorGeometry(QWidget *editor,
void MapDataDelegate::updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option, const QModelIndex &/* index */) const
{
editor->setGeometry(option.rect);
}
void mapDataDelegate::loadComboBox(QComboBox *combo, flightDataModel::pathPlanDataEnum type)
void MapDataDelegate::loadComboBox(QComboBox *combo, flightDataModel::pathPlanDataEnum 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"
class mapDataDelegate : public QItemDelegate
class MapDataDelegate : public QItemDelegate
{
Q_OBJECT
@ -47,7 +47,7 @@ class mapDataDelegate : public QItemDelegate
COMMAND_ONCONDITIONJUMPWAYPOINT=2, COMMAND_ONNOTCONDITIONJUMPWAYPOINT=3,
COMMAND_IFCONDITIONJUMPWAYPOINTELSENEXTWAYPOINT=4 } CommandOptions;
mapDataDelegate(QObject *parent = 0);
MapDataDelegate(QObject *parent = 0);
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const;