mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-22 19:58:39 -05:00
Update RigThread
This commit is contained in:
parent
52de909cfb
commit
a8c4b09655
@ -3,7 +3,6 @@
|
|||||||
std::vector<const struct rig_caps *> RigThread::rigCaps;
|
std::vector<const struct rig_caps *> RigThread::rigCaps;
|
||||||
|
|
||||||
RigThread::RigThread() {
|
RigThread::RigThread() {
|
||||||
terminated.store(true);
|
|
||||||
freq = wxGetApp().getFrequency();
|
freq = wxGetApp().getFrequency();
|
||||||
newFreq = freq;
|
newFreq = freq;
|
||||||
freqChanged.store(true);
|
freqChanged.store(true);
|
||||||
@ -46,7 +45,6 @@ void RigThread::run() {
|
|||||||
int retcode, status;
|
int retcode, status;
|
||||||
|
|
||||||
termStatus = 0;
|
termStatus = 0;
|
||||||
terminated.store(false);
|
|
||||||
|
|
||||||
std::cout << "Rig thread starting." << std::endl;
|
std::cout << "Rig thread starting." << std::endl;
|
||||||
|
|
||||||
@ -57,7 +55,7 @@ void RigThread::run() {
|
|||||||
|
|
||||||
if (retcode != 0) {
|
if (retcode != 0) {
|
||||||
std::cout << "Rig failed to init. " << std::endl;
|
std::cout << "Rig failed to init. " << std::endl;
|
||||||
terminated.store(true);
|
IOThread::terminate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +67,7 @@ void RigThread::run() {
|
|||||||
std::cout << "Rig info was NULL." << std::endl;
|
std::cout << "Rig info was NULL." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!terminated.load()) {
|
while (!stopping) {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(150));
|
std::this_thread::sleep_for(std::chrono::milliseconds(150));
|
||||||
|
|
||||||
DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getActiveDemodulator();
|
DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getActiveDemodulator();
|
||||||
@ -77,7 +75,7 @@ void RigThread::run() {
|
|||||||
|
|
||||||
if (freqChanged.load() && (controlMode.load() || setOneShot.load())) {
|
if (freqChanged.load() && (controlMode.load() || setOneShot.load())) {
|
||||||
status = rig_get_freq(rig, RIG_VFO_CURR, &freq);
|
status = rig_get_freq(rig, RIG_VFO_CURR, &freq);
|
||||||
if (status == 0 && !terminated.load()) {
|
if (status == 0 && !stopping) {
|
||||||
|
|
||||||
if (freq != newFreq && setOneShot.load()) {
|
if (freq != newFreq && setOneShot.load()) {
|
||||||
freq = newFreq;
|
freq = newFreq;
|
||||||
@ -96,7 +94,7 @@ void RigThread::run() {
|
|||||||
|
|
||||||
status = rig_get_freq(rig, RIG_VFO_CURR, &checkFreq);
|
status = rig_get_freq(rig, RIG_VFO_CURR, &checkFreq);
|
||||||
|
|
||||||
if (status == 0 && !terminated.load()) {
|
if (status == 0 && !stopping) {
|
||||||
if (checkFreq != freq && followMode.load()) {
|
if (checkFreq != freq && followMode.load()) {
|
||||||
freq = checkFreq;
|
freq = checkFreq;
|
||||||
if (followModem.load()) {
|
if (followModem.load()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user