mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-01 21:54:39 -04:00
Add delta lock -- lock modem relative to center frequency
This commit is contained in:
@@ -183,6 +183,7 @@ void ModeSelectorCanvas::setSelection(int value) {
|
||||
for (int i = 0; i < numChoices; i++) {
|
||||
if (selections[i].value == value) {
|
||||
currentSelection = i;
|
||||
Refresh();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,6 +148,10 @@ void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, l
|
||||
demodLabel = std::string("[S] ") + demodLabel;
|
||||
}
|
||||
|
||||
if (demod->isDeltaLock()) {
|
||||
demodLabel.append(" [V]");
|
||||
}
|
||||
|
||||
if (demod->getDemodulatorType() == "USB") {
|
||||
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demodLabel, uxPos, hPos, 16, GLFont::GLFONT_ALIGN_LEFT, GLFont::GLFONT_ALIGN_CENTER);
|
||||
} else if (demod->getDemodulatorType() == "LSB") {
|
||||
|
||||
@@ -186,6 +186,9 @@ void TuningCanvas::StepTuner(ActiveState state, int exponent, bool up) {
|
||||
activeDemod->setTracking(true);
|
||||
activeDemod->setFollow(true);
|
||||
activeDemod->setFrequency(freq);
|
||||
if (activeDemod->isDeltaLock()) {
|
||||
activeDemod->setDeltaLockOfs(activeDemod->getFrequency() - wxGetApp().getFrequency());
|
||||
}
|
||||
activeDemod->updateLabel(freq);
|
||||
}
|
||||
|
||||
|
||||
@@ -612,6 +612,9 @@ void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||
|
||||
if (bwDiff) {
|
||||
demod->setFrequency(currentFreq + bwDiff);
|
||||
if (demod->isDeltaLock()) {
|
||||
demod->setDeltaLockOfs(demod->getFrequency() - wxGetApp().getFrequency());
|
||||
}
|
||||
currentFreq = demod->getFrequency();
|
||||
demod->updateLabel(currentFreq);
|
||||
}
|
||||
@@ -699,6 +702,12 @@ void WaterfallCanvas::OnMouseReleased(wxMouseEvent& event) {
|
||||
demod->setSquelchEnabled(mgr->isLastSquelchEnabled());
|
||||
demod->setGain(mgr->getLastGain());
|
||||
demod->setMuted(mgr->isLastMuted());
|
||||
if (mgr->getLastDeltaLock()) {
|
||||
demod->setDeltaLock(true);
|
||||
demod->setDeltaLockOfs(wxGetApp().getFrequency()-freq);
|
||||
} else {
|
||||
demod->setDeltaLock(false);
|
||||
}
|
||||
demod->writeModemSettings(mgr->getLastModemSettings(mgr->getLastDemodulatorType()));
|
||||
demod->run();
|
||||
|
||||
@@ -712,6 +721,9 @@ void WaterfallCanvas::OnMouseReleased(wxMouseEvent& event) {
|
||||
|
||||
demod->updateLabel(freq);
|
||||
demod->setFrequency(freq);
|
||||
if (demod->isDeltaLock()) {
|
||||
demod->setDeltaLockOfs(demod->getFrequency() - wxGetApp().getFrequency());
|
||||
}
|
||||
|
||||
if (isNew) {
|
||||
setStatusText("New demodulator at frequency: %s", freq);
|
||||
@@ -788,6 +800,12 @@ void WaterfallCanvas::OnMouseReleased(wxMouseEvent& event) {
|
||||
demod->setSquelchEnabled(mgr->isLastSquelchEnabled());
|
||||
demod->setGain(mgr->getLastGain());
|
||||
demod->setMuted(mgr->isLastMuted());
|
||||
if (mgr->getLastDeltaLock()) {
|
||||
demod->setDeltaLock(true);
|
||||
demod->setDeltaLockOfs(wxGetApp().getFrequency()-freq);
|
||||
} else {
|
||||
demod->setDeltaLock(false);
|
||||
}
|
||||
demod->writeModemSettings(mgr->getLastModemSettings(mgr->getLastDemodulatorType()));
|
||||
|
||||
demod->run();
|
||||
|
||||
Reference in New Issue
Block a user