Skip to content

Commit

Permalink
jrk reconnect work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
poes-weather committed May 25, 2013
1 parent 70861d6 commit 90f3304
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions rig/jrk.cpp
Expand Up @@ -133,6 +133,7 @@ void TJRK::check_and_reinit(bool force)
}

if(reinit) {
qDebug("reinit jrk!");
az_jrk->setDevice(usb->get_device_by_sn(az_sn_));
el_jrk->setDevice(usb->get_device_by_sn(el_sn_));

Expand Down
13 changes: 9 additions & 4 deletions satellite/trackthread.cpp
Expand Up @@ -528,6 +528,15 @@ void TrackThread::initRotor(TRig *rig, TSat *sat)
qDebug("init rotor: %s", sat->name);

rig->rotor->flags &= ~(R_ROTOR_CCW | R_ROTOR_ZENITH_PASS);

// current satellite position
sat_az = sat->sat_azi;
sat_el = sat->sat_ele;

// TODO: rotor status should be checked here, is the connection still valid, USB disconnected, etc?
if(rig->rotor->rotor_type == RotorType_JRK)
rig->rotor->jrk->check_and_reinit();

int i = tw->trackIndex();

if(i == 1 || i == 2) { // tracking the sun or moon
Expand All @@ -546,11 +555,7 @@ void TrackThread::initRotor(TRig *rig, TSat *sat)
return;
}

// current satellite position
sat_az = sat->sat_azi;
sat_el = sat->sat_ele;

// TODO: rotor status should be checked here, is the connection still valid, USB disconnected, etc?
rig->rotor->readPosition();

// AOS satellite position
Expand Down

0 comments on commit 90f3304

Please sign in to comment.