Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AM Demod: Add additional modes to specify channel center frequency #1876

Merged
merged 7 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/sdrangel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
files: ${{ github.workspace }}/build/sdrangel-${{ steps.get_version.outputs.version }}-win64.exe

build_mac:
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -109,7 +109,15 @@ jobs:
- name: Update brew
run: brew update
- name: Install brew packages
run: brew install nasm boost hidapi libusb fftw ffmpeg faad2 zlib airspy airspyhf hackrf rtl-sdr libbladerf soapysdr qt uhd
run: brew install nasm boost hidapi libusb fftw ffmpeg faad2 zlib airspy airspyhf hackrf rtl-sdr libbladerf soapysdr qt
- name: Install brew uhd package
run: |
rm -f /usr/local/bin/2to3*
rm -f /usr/local/bin/idle3
rm -f /usr/local/bin/pydoc3
rm -f /usr/local/bin/python3
rm -f /usr/local/bin/python3-config
brew install uhd
- name: Install brew opencv package
run: |
rm -f /usr/local/bin/2to3
Expand Down
37 changes: 37 additions & 0 deletions plugins/channelrx/demodam/amdemod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ void AMDemod::applySettings(const AMDemodSettings& settings, bool force)
<< " m_audioDeviceName: " << settings.m_audioDeviceName
<< " m_pll: " << settings.m_pll
<< " m_syncAMOperation: " << (int) settings.m_syncAMOperation
<< " m_frequencyMode: " << settings.m_frequencyMode
<< " m_frequency: " << settings.m_frequency
<< " m_snap: " << settings.m_snap
<< " m_streamIndex: " << settings.m_streamIndex
<< " m_useReverseAPI: " << settings.m_useReverseAPI
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
Expand Down Expand Up @@ -276,6 +279,16 @@ void AMDemod::applySettings(const AMDemodSettings& settings, bool force)
reverseAPIKeys.append("volume");
}

if ((m_settings.m_frequencyMode != settings.m_frequencyMode) || force) {
reverseAPIKeys.append("frequencyMode");
}
if ((m_settings.m_frequency != settings.m_frequency) || force) {
reverseAPIKeys.append("frequency");
}
if ((m_settings.m_snap != settings.m_snap) || force) {
reverseAPIKeys.append("snap");
}

if (m_settings.m_streamIndex != settings.m_streamIndex)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
Expand Down Expand Up @@ -448,6 +461,18 @@ void AMDemod::webapiUpdateChannelSettings(
AMDemodSettings::SyncAMLSB : (AMDemodSettings::SyncAMOperation) syncAMOperationCode;
}

if (channelSettingsKeys.contains("frequencyMode")) {
settings.m_frequencyMode = (AMDemodSettings::FrequencyMode) response.getAmDemodSettings()->getFrequencyMode();
}

if (channelSettingsKeys.contains("frequency")) {
settings.m_frequency = response.getAmDemodSettings()->getFrequency();
}

if (channelSettingsKeys.contains("snap")) {
settings.m_snap = (bool) response.getAmDemodSettings()->getSnap();
}

if (channelSettingsKeys.contains("streamIndex")) {
settings.m_streamIndex = response.getAmDemodSettings()->getStreamIndex();
}
Expand Down Expand Up @@ -510,6 +535,9 @@ void AMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respo

response.getAmDemodSettings()->setPll(settings.m_pll ? 1 : 0);
response.getAmDemodSettings()->setSyncAmOperation((int) settings.m_syncAMOperation);
response.getAmDemodSettings()->setFrequencyMode((int) settings.m_frequencyMode);
response.getAmDemodSettings()->setFrequency(settings.m_frequency);
response.getAmDemodSettings()->setSnap((int) settings.m_snap);
response.getAmDemodSettings()->setStreamIndex(settings.m_streamIndex);
response.getAmDemodSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);

Expand Down Expand Up @@ -669,6 +697,15 @@ void AMDemod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("syncAMOperation") || force) {
swgAMDemodSettings->setSyncAmOperation((int) settings.m_syncAMOperation);
}
if (channelSettingsKeys.contains("frequencyMode") || force) {
swgAMDemodSettings->setFrequencyMode((int) settings.m_frequencyMode);
}
if (channelSettingsKeys.contains("frequency") || force) {
swgAMDemodSettings->setFrequency(settings.m_frequency);
}
if (channelSettingsKeys.contains("snap") || force) {
swgAMDemodSettings->setSnap(settings.m_snap);
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgAMDemodSettings->setStreamIndex(settings.m_streamIndex);
}
Expand Down
Loading