#36 NBFM squelch control. Updates NBFM decoder to incorporate squelch control. Squelch is a configuration item and also available to adjust at runtime with new 'Channel' tab in Now Playing window. All decoders were updated to produce continuous channel power (dB) measurements that are displayed in the Channel tab's new Power Meter. (#1100)

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
Denny Sheirer
2021-11-14 06:59:58 -05:00
committed by GitHub
parent 7303e06943
commit 4b806ecfde
40 changed files with 2348 additions and 98 deletions

View File

@@ -152,6 +152,7 @@ public class TalkgroupFormatPreference extends Preference
case APCO25:
case DMR:
case MDC1200:
case NBFM:
case PASSPORT:
case UNKNOWN:
default:
@@ -171,6 +172,7 @@ public class TalkgroupFormatPreference extends Preference
case APCO25:
case DMR:
case MDC1200:
case NBFM:
case PASSPORT:
case UNKNOWN:
default:
@@ -191,6 +193,7 @@ public class TalkgroupFormatPreference extends Preference
case LTR:
case LTR_NET:
case MPT1327:
case NBFM:
case UNKNOWN:
default:
return true;

View File

@@ -0,0 +1,78 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2019 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
*/
package io.github.dsheirer.preference.identifier.talkgroup;
import io.github.dsheirer.identifier.talkgroup.TalkgroupIdentifier;
import io.github.dsheirer.preference.identifier.IntegerFormat;
public class NBFMTalkgroupFormatter extends AbstractIntegerFormatter
{
public static final int DECIMAL_WIDTH = 5;
public static final int HEXADECIMAL_WIDTH = 4;
/**
* Formats the individual or group identifier to the specified format and width.
*/
public static String format(TalkgroupIdentifier identifier, IntegerFormat format, boolean fixedWidth)
{
if(fixedWidth)
{
switch(format)
{
case DECIMAL:
case FORMATTED:
return toDecimal(identifier.getValue(), DECIMAL_WIDTH);
case HEXADECIMAL:
return toHex(identifier.getValue(), HEXADECIMAL_WIDTH);
default:
throw new IllegalArgumentException("Unrecognized integer format: " + format);
}
}
else
{
switch(format)
{
case DECIMAL:
case FORMATTED:
return identifier.getValue().toString();
case HEXADECIMAL:
return toHex(identifier.getValue());
default:
throw new IllegalArgumentException("Unrecognized integer format: " + format);
}
}
}
@Override
public String format(int value, IntegerFormat integerFormat)
{
switch(integerFormat)
{
case DECIMAL:
case FORMATTED:
return format(value);
case HEXADECIMAL:
return toHex(value);
default:
throw new IllegalArgumentException("Unrecognized integer format: " + integerFormat);
}
}
}