1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

GCS/OPMap-Fixes the jump and error destination number

This commit is contained in:
PT_Dreamer 2012-07-14 20:14:42 +01:00
parent 42d06ef7d9
commit 3879baf263
2 changed files with 10 additions and 6 deletions

View File

@ -159,8 +159,8 @@ void modelMapProxy::refreshOverlays()
for(int x=0;x<model->rowCount();++x)
{
wp_current=findWayPointNumber(x);
wp_jump=model->data(model->index(x,flightDataModel::JUMPDESTINATION)).toInt();
wp_error=model->data(model->index(x,flightDataModel::ERRORDESTINATION)).toInt();
wp_jump=model->data(model->index(x,flightDataModel::JUMPDESTINATION)).toInt()-1;
wp_error=model->data(model->index(x,flightDataModel::ERRORDESTINATION)).toInt()-1;
wp_next_overlay=overlayTranslate(model->data(model->index(x+1,flightDataModel::MODE)).toInt());
wp_jump_overlay=overlayTranslate(model->data(model->index(wp_jump,flightDataModel::MODE)).toInt());
wp_error_overlay=overlayTranslate(model->data(model->index(wp_error,flightDataModel::MODE)).toInt());
@ -331,6 +331,10 @@ void modelMapProxy::createWayPoint(internals::PointLatLng coord)
model->setData(index,coord.Lat(),Qt::EditRole);
index=model->index(model->rowCount()-1,flightDataModel::LNGPOSITION,QModelIndex());
model->setData(index,coord.Lng(),Qt::EditRole);
index=model->index(model->rowCount()-1,flightDataModel::JUMPDESTINATION,QModelIndex());
model->setData(index,1,Qt::EditRole);
index=model->index(model->rowCount()-1,flightDataModel::ERRORDESTINATION,QModelIndex());
model->setData(index,1,Qt::EditRole);
}
void modelMapProxy::deleteAll()
{

View File

@ -106,9 +106,9 @@ void modelUavoProxy::modelToObjects()
index=myModel->index(x,flightDataModel::COMMAND);
action.Command=myModel->data(index).toInt();
index=myModel->index(x,flightDataModel::JUMPDESTINATION);
action.JumpDestination=myModel->data(index).toInt();
action.JumpDestination=myModel->data(index).toInt()-1;
index=myModel->index(x,flightDataModel::ERRORDESTINATION);
action.ErrorDestination=myModel->data(index).toInt();
action.ErrorDestination=myModel->data(index).toInt()-1;
int actionNumber=addAction(act,action,lastaction);
if(actionNumber>lastaction)
@ -178,10 +178,10 @@ void modelUavoProxy::objectsToModel()
myModel->setData(index,actionfields.EndCondition);
index=myModel->index(x,flightDataModel::ERRORDESTINATION);
myModel->setData(index,actionfields.ErrorDestination);
myModel->setData(index,actionfields.ErrorDestination+1);
index=myModel->index(x,flightDataModel::JUMPDESTINATION);
myModel->setData(index,actionfields.JumpDestination);
myModel->setData(index,actionfields.JumpDestination+1);
index=myModel->index(x,flightDataModel::MODE);
myModel->setData(index,actionfields.Mode);