more work on the rigctl client update

new_rigctl_client
AlexandreRouma 2024-12-19 04:18:19 +01:00
rodzic a8e6f24b29
commit 711ed7711f
1 zmienionych plików z 26 dodań i 15 usunięć

Wyświetl plik

@ -334,6 +334,10 @@ private:
} }
// Save frequencies
lastRigctlFreq = rigctlFreq;
lastCenterFreq = centerFreq;
// Wait for the time interval // Wait for the time interval
std::this_thread::sleep_for(std::chrono::milliseconds(interval)); std::this_thread::sleep_for(std::chrono::milliseconds(interval));
} }
@ -341,11 +345,9 @@ private:
void mirrorWorker() { void mirrorWorker() {
int64_t lastRigctlFreq = -1; int64_t lastRigctlFreq = -1;
int64_t lastCenterFreq = -1; int64_t lastFreq = -1;
int64_t lastVFOFreq = -1;
int64_t rigctlFreq; int64_t rigctlFreq;
int64_t centerFreq; int64_t freq;
int64_t vfoFreq;
int lastRigctlMode = -1; int lastRigctlMode = -1;
int lastVFOMode = -1; int lastVFOMode = -1;
int rigctlMode; int rigctlMode;
@ -357,14 +359,13 @@ private:
// Get the current rigctl frequency // Get the current rigctl frequency
rigctlFreq = (int64_t)client->getFreq(); rigctlFreq = (int64_t)client->getFreq();
// Get the current center frequency // Get the rigctl and VFO modes
centerFreq = (int64_t)gui::waterfall.getCenterFrequency(); if (selectedVFO.empty()) {
// Get the VFO frequency
// Get the current VFO frequency if there is a VFO
// TODO // TODO
// Get the rigctl and VFO modes // Get the mode if needed
if (!selectedVFO.empty() && syncMode && vfoIsRadio) { if (syncMode && vfoIsRadio) {
// Get the current rigctl mode // Get the current rigctl mode
// rigctlMode = client->getMode(); // rigctlMode = client->getMode();
@ -372,6 +373,10 @@ private:
core::modComManager.callInterface(selectedVFO, RADIO_IFACE_CMD_GET_MODE, NULL, &vfoMode); core::modComManager.callInterface(selectedVFO, RADIO_IFACE_CMD_GET_MODE, NULL, &vfoMode);
} }
} }
else {
freq = (int64_t)gui::waterfall.getCenterFrequency();
}
}
catch (const std::exception& e) { catch (const std::exception& e) {
flog::error("Error while getting frequencies: {}", e.what()); flog::error("Error while getting frequencies: {}", e.what());
} }
@ -384,6 +389,12 @@ private:
} }
// Save modes and frequencies
lastRigctlFreq = rigctlFreq;
lastFreq = freq;
lastRigctlMode = rigctlMode;
lastVFOMode = vfoMode;
// Wait for the time interval // Wait for the time interval
std::this_thread::sleep_for(std::chrono::milliseconds(interval)); std::this_thread::sleep_for(std::chrono::milliseconds(interval));
} }