Merge branch 'scanner-update'

This commit is contained in:
eried 2020-06-07 04:34:21 +02:00
commit cb0a4da7e1
2 changed files with 28 additions and 11 deletions

View File

@ -104,6 +104,7 @@ ScannerView::ScannerView(
&field_rf_amp, &field_rf_amp,
&field_volume, &field_volume,
&field_bw, &field_bw,
&field_trigger,
&field_squelch, &field_squelch,
&field_wait, &field_wait,
//&record_view, //&record_view,
@ -143,10 +144,17 @@ ScannerView::ScannerView(
}; };
field_wait.set_value(5); field_wait.set_value(5);
field_trigger.on_change = [this](int32_t v) {
trigger = v;
};
field_trigger.set_value(30);
field_squelch.set_value(receiver_model.squelch_level());
field_squelch.on_change = [this](int32_t v) { field_squelch.on_change = [this](int32_t v) {
squelch = v; squelch = v;
receiver_model.set_squelch_level(v);
}; };
field_squelch.set_value(30);
field_volume.set_value((receiver_model.headphone_volume() - audio::headphone::volume_range().max).decibel() + 99); field_volume.set_value((receiver_model.headphone_volume() - audio::headphone::volume_range().max).decibel() + 99);
field_volume.on_change = [this](int32_t v) { field_volume.on_change = [this](int32_t v) {
@ -175,7 +183,7 @@ void ScannerView::on_statistics_update(const ChannelStatistics& statistics) {
if (timer <= wait) if (timer <= wait)
timer++; timer++;
if (max_db < -squelch) { if (max_db < -trigger) {
if (timer == wait) { if (timer == wait) {
//audio::output::stop(); //audio::output::stop();
scan_thread->set_scanning(true); scan_thread->set_scanning(true);

View File

@ -66,15 +66,16 @@ private:
void handle_retune(uint32_t i); void handle_retune(uint32_t i);
std::vector<rf::Frequency> frequency_list { }; std::vector<rf::Frequency> frequency_list { };
int32_t trigger { 0 };
int32_t squelch { 0 }; int32_t squelch { 0 };
uint32_t timer { 0 }; uint32_t timer { 0 };
uint32_t wait { 0 }; uint32_t wait { 0 };
freqman_db database { }; freqman_db database { };
Labels labels { Labels labels {
{ { 0 * 8, 0 * 16 }, "LNA: VGA: AMP: VOL:", Color::light_grey() }, { { 0 * 8, 0 * 16 }, "LNA: TRIGGER: /99 VOL:", Color::light_grey() },
{ { 0 * 8, 1 * 16 }, "BW: SQUELCH: /99 WAIT:", Color::light_grey() }, { { 0 * 8, 1 * 16 }, "VGA: SQUELCH: /99 AMP:", Color::light_grey() },
{ { 0 * 8, 3 * 16 }, "Work in progress...", Color::light_grey() } { { 0 * 8, 2 * 16 }, " BW: WAIT:", Color::light_grey() },
}; };
LNAGainField field_lna { LNAGainField field_lna {
@ -82,15 +83,15 @@ private:
}; };
VGAGainField field_vga { VGAGainField field_vga {
{ 11 * 8, 0 * 16 } { 4 * 8, 1 * 16 }
}; };
RFAmpField field_rf_amp { RFAmpField field_rf_amp {
{ 18 * 8, 0 * 16 } { 28 * 8, 1 * 16 }
}; };
NumberField field_volume { NumberField field_volume {
{ 24 * 8, 0 * 16 }, { 28 * 8, 0 * 16 },
2, 2,
{ 0, 99 }, { 0, 99 },
1, 1,
@ -98,7 +99,7 @@ private:
}; };
OptionsField field_bw { OptionsField field_bw {
{ 3 * 8, 1 * 16 }, { 4 * 8, 2 * 16 },
3, 3,
{ {
{ "8k5", 0 }, { "8k5", 0 },
@ -107,8 +108,16 @@ private:
} }
}; };
NumberField field_trigger {
{ 16 * 8, 0 * 16 },
2,
{ 0, 99 },
1,
' ',
};
NumberField field_squelch { NumberField field_squelch {
{ 15 * 8, 1 * 16 }, { 16 * 8, 1 * 16 },
2, 2,
{ 0, 99 }, { 0, 99 },
1, 1,
@ -116,7 +125,7 @@ private:
}; };
NumberField field_wait { NumberField field_wait {
{ 26 * 8, 1 * 16 }, { 16 * 8, 2 * 16 },
2, 2,
{ 0, 99 }, { 0, 99 },
1, 1,