mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
GCS-disabled the reload board data button while it is doing its work.
minimized uavo transactions when button is pressed.
This commit is contained in:
parent
4530a13f93
commit
14b7666c1b
@ -784,6 +784,9 @@ void ConfigTaskWidget::defaultButtonClicked()
|
||||
*/
|
||||
void ConfigTaskWidget::reloadButtonClicked()
|
||||
{
|
||||
QPushButton * button=qobject_cast<QPushButton*>(sender());
|
||||
if(button)
|
||||
button->setEnabled(false);
|
||||
int group=sender()->property("group").toInt();
|
||||
QList<objectToWidget*> * list=defaultReloadGroups.value(group,NULL);
|
||||
if(!list)
|
||||
@ -793,10 +796,19 @@ void ConfigTaskWidget::reloadButtonClicked()
|
||||
QEventLoop * eventLoop=new QEventLoop(this);
|
||||
connect(timeOut, SIGNAL(timeout()),eventLoop,SLOT(quit()));
|
||||
connect(objper, SIGNAL(objectUpdated(UAVObject*)), eventLoop, SLOT(quit()));
|
||||
|
||||
QList<temphelper> temp;
|
||||
foreach(objectToWidget * oTw,*list)
|
||||
{
|
||||
if (oTw->object != NULL)
|
||||
{
|
||||
temphelper value;
|
||||
value.objid=oTw->object->getObjID();
|
||||
value.objinstid=oTw->object->getInstID();
|
||||
if(temp.contains(value))
|
||||
continue;
|
||||
else
|
||||
temp.append(value);
|
||||
ObjectPersistence::DataFields data;
|
||||
data.Operation = ObjectPersistence::OPERATION_LOAD;
|
||||
data.Selection = ObjectPersistence::SELECTION_SINGLEOBJECT;
|
||||
@ -824,6 +836,8 @@ void ConfigTaskWidget::reloadButtonClicked()
|
||||
delete timeOut;
|
||||
timeOut=NULL;
|
||||
}
|
||||
if(button)
|
||||
button->setEnabled(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -70,6 +70,16 @@ public:
|
||||
QList<shadow *> shadowsList;
|
||||
};
|
||||
|
||||
struct temphelper
|
||||
{
|
||||
quint32 objid;
|
||||
quint32 objinstid;
|
||||
bool operator==(const temphelper& lhs)
|
||||
{
|
||||
return (lhs.objid==this->objid && lhs.objinstid==this->objinstid);
|
||||
}
|
||||
};
|
||||
|
||||
enum buttonTypeEnum {none,save_button,apply_button,reload_button,default_button,help_button};
|
||||
struct uiRelationAutomation
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user