Skip to content

Commit

Permalink
more work on the rigctl client update
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreRouma committed Dec 19, 2024
1 parent a8e6f24 commit 711ed77
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions misc_modules/rigctl_client/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,18 +334,20 @@ class RigctlClientModule : public ModuleManager::Instance {

}

// Save frequencies
lastRigctlFreq = rigctlFreq;
lastCenterFreq = centerFreq;

// Wait for the time interval
std::this_thread::sleep_for(std::chrono::milliseconds(interval));
}
}

void mirrorWorker() {
int64_t lastRigctlFreq = -1;
int64_t lastCenterFreq = -1;
int64_t lastVFOFreq = -1;
int64_t lastFreq = -1;
int64_t rigctlFreq;
int64_t centerFreq;
int64_t vfoFreq;
int64_t freq;
int lastRigctlMode = -1;
int lastVFOMode = -1;
int rigctlMode;
Expand All @@ -357,19 +359,22 @@ class RigctlClientModule : public ModuleManager::Instance {
// Get the current rigctl frequency
rigctlFreq = (int64_t)client->getFreq();

// Get the current center frequency
centerFreq = (int64_t)gui::waterfall.getCenterFrequency();

// Get the current VFO frequency if there is a VFO
// TODO

// Get the rigctl and VFO modes
if (!selectedVFO.empty() && syncMode && vfoIsRadio) {
// Get the current rigctl mode
// rigctlMode = client->getMode();

// Get the current VFO mode
core::modComManager.callInterface(selectedVFO, RADIO_IFACE_CMD_GET_MODE, NULL, &vfoMode);
if (selectedVFO.empty()) {
// Get the VFO frequency
// TODO

// Get the mode if needed
if (syncMode && vfoIsRadio) {
// Get the current rigctl mode
// rigctlMode = client->getMode();

// Get the current VFO mode
core::modComManager.callInterface(selectedVFO, RADIO_IFACE_CMD_GET_MODE, NULL, &vfoMode);
}
}
else {
freq = (int64_t)gui::waterfall.getCenterFrequency();
}
}
catch (const std::exception& e) {
Expand All @@ -384,6 +389,12 @@ class RigctlClientModule : public ModuleManager::Instance {

}

// Save modes and frequencies
lastRigctlFreq = rigctlFreq;
lastFreq = freq;
lastRigctlMode = rigctlMode;
lastVFOMode = vfoMode;

// Wait for the time interval
std::this_thread::sleep_for(std::chrono::milliseconds(interval));
}
Expand Down

0 comments on commit 711ed77

Please sign in to comment.