Commit e89983da authored by pixhawk's avatar pixhawk

Fixed some display bugs in editable waypoints

parent faac2ca5
...@@ -234,6 +234,7 @@ void WaypointEditableView::updateActionView(int action) ...@@ -234,6 +234,7 @@ void WaypointEditableView::updateActionView(int action)
*/ */
void WaypointEditableView::changedAction(int index) void WaypointEditableView::changedAction(int index)
{ {
MAV_FRAME cur_frame = (MAV_FRAME) m_ui->comboBox_frame->itemData(m_ui->comboBox_frame->currentIndex()).toUInt();
// set waypoint action // set waypoint action
int actionIndex = m_ui->comboBox_action->itemData(index).toUInt(); int actionIndex = m_ui->comboBox_action->itemData(index).toUInt();
if (actionIndex < MAV_CMD_ENUM_END && actionIndex >= 0) { if (actionIndex < MAV_CMD_ENUM_END && actionIndex >= 0) {
...@@ -255,7 +256,7 @@ void WaypointEditableView::changedAction(int index) ...@@ -255,7 +256,7 @@ void WaypointEditableView::changedAction(int index)
case MAV_CMD_NAV_LOITER_TIME: case MAV_CMD_NAV_LOITER_TIME:
changeViewMode(QGC_WAYPOINTEDITABLEVIEW_MODE_NAV); changeViewMode(QGC_WAYPOINTEDITABLEVIEW_MODE_NAV);
// Update frame view // Update frame view
updateFrameView(m_ui->comboBox_frame->currentIndex()); updateFrameView(cur_frame);
// Update view // Update view
updateActionView(actionIndex); updateActionView(actionIndex);
break; break;
...@@ -310,9 +311,13 @@ void WaypointEditableView::changeViewMode(QGC_WAYPOINTEDITABLEVIEW_MODE mode) ...@@ -310,9 +311,13 @@ void WaypointEditableView::changeViewMode(QGC_WAYPOINTEDITABLEVIEW_MODE mode)
void WaypointEditableView::updateFrameView(int frame) void WaypointEditableView::updateFrameView(int frame)
{ {
std::cerr << "update frame view: "<< frame << std::endl;
//int custom_index = m_ui->comboBox_action->findData(MAV_CMD_ENUM_END);
switch(frame) { switch(frame) {
case MAV_FRAME_GLOBAL: case MAV_FRAME_GLOBAL:
case MAV_FRAME_GLOBAL_RELATIVE_ALT: case MAV_FRAME_GLOBAL_RELATIVE_ALT:
if (viewMode != QGC_WAYPOINTEDITABLEVIEW_MODE_DIRECT_EDITING)
{
m_ui->posNSpinBox->hide(); m_ui->posNSpinBox->hide();
m_ui->posESpinBox->hide(); m_ui->posESpinBox->hide();
m_ui->posDSpinBox->hide(); m_ui->posDSpinBox->hide();
...@@ -322,8 +327,15 @@ void WaypointEditableView::updateFrameView(int frame) ...@@ -322,8 +327,15 @@ void WaypointEditableView::updateFrameView(int frame)
// Coordinate frame // Coordinate frame
m_ui->comboBox_frame->show(); m_ui->comboBox_frame->show();
m_ui->customActionWidget->hide(); m_ui->customActionWidget->hide();
}
else // do not hide customActionWidget if Command is set to "Other"
{
m_ui->customActionWidget->show();
}
break; break;
case MAV_FRAME_LOCAL_NED: case MAV_FRAME_LOCAL_NED:
if (viewMode != QGC_WAYPOINTEDITABLEVIEW_MODE_DIRECT_EDITING)
{
m_ui->lonSpinBox->hide(); m_ui->lonSpinBox->hide();
m_ui->latSpinBox->hide(); m_ui->latSpinBox->hide();
m_ui->altSpinBox->hide(); m_ui->altSpinBox->hide();
...@@ -333,6 +345,11 @@ void WaypointEditableView::updateFrameView(int frame) ...@@ -333,6 +345,11 @@ void WaypointEditableView::updateFrameView(int frame)
// Coordinate frame // Coordinate frame
m_ui->comboBox_frame->show(); m_ui->comboBox_frame->show();
m_ui->customActionWidget->hide(); m_ui->customActionWidget->hide();
}
else // do not hide customActionWidget if Command is set to "Other"
{
m_ui->customActionWidget->show();
}
break; break;
default: default:
std::cerr << "unknown frame" << std::endl; std::cerr << "unknown frame" << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment