Skip to content

Commit

Permalink
LogicAnalyzerAPI: add checks to make sure we load the correct index
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Guramulta <[email protected]>
  • Loading branch information
DanielGuramulta authored and adisuciu committed Sep 11, 2019
1 parent 37b5064 commit 6fa2c03
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/logic_analyzer_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ int LogicAnalyzer_API::externalTriggerSource() const

void LogicAnalyzer_API::setExternalTriggerSource(int en)
{
lga->trigger_settings_ui->cmb_extern_src->setCurrentIndex(en);
if (en >= 0 && en < lga->trigger_settings_ui->cmb_extern_src->count()) {
lga->trigger_settings_ui->cmb_extern_src->setCurrentIndex(en);
} else {
lga->trigger_settings_ui->cmb_extern_src->setCurrentIndex(0);
}
}


Expand All @@ -121,7 +125,11 @@ int LogicAnalyzer_API::externalTriggerCnd() const

void LogicAnalyzer_API::setExternalTriggerCnd(int en)
{
lga->trigger_settings_ui->cmb_trigg_extern_cond_1->setCurrentIndex(en);
if (en >= 0 && en < lga->trigger_settings_ui->cmb_trigg_extern_cond_1->count()) {
lga->trigger_settings_ui->cmb_trigg_extern_cond_1->setCurrentIndex(en);
} else {
lga->trigger_settings_ui->cmb_trigg_extern_cond_1->setCurrentIndex(0);
}
}

bool LogicAnalyzer_API::cursorsActive() const
Expand Down

0 comments on commit 6fa2c03

Please sign in to comment.