mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
LP-572 Update context menu from configuration settings, max update rate user-configurable
This commit is contained in:
parent
16cca00f21
commit
411512fa62
@ -59,6 +59,7 @@ void OPMapGadget::loadConfiguration(IUAVGadgetConfiguration *config)
|
||||
{
|
||||
m_config = qobject_cast<OPMapGadgetConfiguration *>(config);
|
||||
m_widget->setMapProvider(m_config->mapProvider());
|
||||
m_widget->setMaxUpdateRate(m_config->maxUpdateRate());
|
||||
m_widget->setUseOpenGL(m_config->useOpenGL());
|
||||
m_widget->setShowTileGridLines(m_config->showTileGridLines());
|
||||
m_widget->setAccessMode(m_config->accessMode());
|
||||
|
@ -1100,6 +1100,15 @@ void OPMapGadgetWidget::setMaxUpdateRate(int update_rate)
|
||||
m_updateTimer->setInterval(m_maxUpdateRate);
|
||||
}
|
||||
|
||||
// Update context menu selection
|
||||
int max_rate_list_size = sizeof(max_update_rate_list) / sizeof(max_update_rate_list[0]);
|
||||
for (int i = 0; i < max_rate_list_size; i++) {
|
||||
int maxUpdateRate = max_update_rate_list[i];
|
||||
if (maxUpdateRate == update_rate) {
|
||||
maxUpdateRateAct.at(i)->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
// if (m_statusUpdateTimer)
|
||||
// m_statusUpdateTimer->setInterval(m_maxUpdateRate);
|
||||
}
|
||||
@ -1112,6 +1121,15 @@ void OPMapGadgetWidget::setSafeAreaRadius(int safe_area_radius)
|
||||
|
||||
m_map->Home->SetSafeArea(safe_area_radius);
|
||||
m_map->Home->SetToggleRefresh(true);
|
||||
|
||||
// Update context menu selection
|
||||
int safe_area_list_size = sizeof(safe_area_radius_list) / sizeof(safe_area_radius_list[0]);
|
||||
for (int i = 0; i < safe_area_list_size; i++) {
|
||||
int safeArea = safe_area_radius_list[i];
|
||||
if (safeArea == safe_area_radius) {
|
||||
safeAreaAct.at(i)->setChecked(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::setShowSafeArea(bool showSafeArea)
|
||||
@ -1122,6 +1140,8 @@ void OPMapGadgetWidget::setShowSafeArea(bool showSafeArea)
|
||||
|
||||
m_map->Home->SetShowSafeArea(showSafeArea);
|
||||
m_map->Home->SetToggleRefresh(true);
|
||||
|
||||
showSafeAreaAct->setChecked(showSafeArea);
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::setZoom(int zoom)
|
||||
|
Loading…
x
Reference in New Issue
Block a user