Scanner update

Renamed scanner squelch to trigger
Added squelch for audio output
This commit is contained in:
Jonathan Elder 2020-06-06 11:45:19 -07:00
parent 38b6f334b2
commit 7fa92868d7
2 changed files with 23 additions and 6 deletions

View File

@ -104,6 +104,7 @@ ScannerView::ScannerView(
&field_rf_amp,
&field_volume,
&field_bw,
&field_trigger,
&field_squelch,
&field_wait,
//&record_view,
@ -143,10 +144,17 @@ ScannerView::ScannerView(
};
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) {
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.on_change = [this](int32_t v) {
@ -175,7 +183,7 @@ void ScannerView::on_statistics_update(const ChannelStatistics& statistics) {
if (timer <= wait)
timer++;
if (max_db < -squelch) {
if (max_db < -trigger) {
if (timer == wait) {
//audio::output::stop();
scan_thread->set_scanning(true);

View File

@ -66,6 +66,7 @@ private:
void handle_retune(uint32_t i);
std::vector<rf::Frequency> frequency_list { };
int32_t trigger { 0 };
int32_t squelch { 0 };
uint32_t timer { 0 };
uint32_t wait { 0 };
@ -73,8 +74,8 @@ private:
Labels labels {
{ { 0 * 8, 0 * 16 }, "LNA: VGA: AMP: VOL:", Color::light_grey() },
{ { 0 * 8, 1 * 16 }, "BW: SQUELCH: /99 WAIT:", Color::light_grey() },
{ { 0 * 8, 3 * 16 }, "Work in progress...", Color::light_grey() }
{ { 0 * 8, 1 * 16 }, "BW: TR: /99 SQ: /99 WT:", Color::light_grey() },
{ { 0 * 8, 3 * 16 }, "Work in progress!", Color::light_grey() }
};
LNAGainField field_lna {
@ -107,8 +108,16 @@ private:
}
};
NumberField field_trigger {
{ 10 * 8, 1 * 16 },
2,
{ 0, 99 },
1,
' ',
};
NumberField field_squelch {
{ 15 * 8, 1 * 16 },
{ 19 * 8, 1 * 16 },
2,
{ 0, 99 },
1,
@ -116,7 +125,7 @@ private:
};
NumberField field_wait {
{ 26 * 8, 1 * 16 },
{ 28 * 8, 1 * 16 },
2,
{ 0, 99 },
1,