mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Scanner update
Renamed scanner squelch to trigger Added squelch for audio output
This commit is contained in:
parent
ef0336ac4f
commit
4d839ea44e
@ -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);
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user