Skip to content

Commit

Permalink
FrequencyStepView field in TransmitterView class
Browse files Browse the repository at this point in the history
  • Loading branch information
F33RNI committed May 14, 2021
1 parent bf0b9b9 commit 97f3f77
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions firmware/application/ui/ui_transmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ void TransmitterView::set_transmitting(const bool transmitting) {

void TransmitterView::on_show() {
field_frequency.set_value(transmitter_model.tuning_frequency());
field_frequency_step.set_by_value(receiver_model.frequency_step());

field_gain.set_value(transmitter_model.tx_gain());
field_amp.set_value(transmitter_model.rf_amp() ? 14 : 0);
Expand All @@ -122,6 +123,7 @@ TransmitterView::TransmitterView(

add_children({
&field_frequency,
&field_frequency_step,
&text_gain,
&field_gain,
&button_start,
Expand Down Expand Up @@ -157,6 +159,10 @@ TransmitterView::TransmitterView(
if (on_edit_frequency)
on_edit_frequency();
};

field_frequency_step.on_change = [this](size_t, OptionsField::value_t v) {
this->field_frequency.set_step(v);
};

field_gain.on_change = [this](uint32_t tx_gain) {
on_tx_gain_changed(tx_gain);
Expand Down

0 comments on commit 97f3f77

Please sign in to comment.