Fix pointNum in SA result for DFT mode with narrow spans
This commit is contained in:
parent
72f2a72445
commit
71b095cf2e
@ -300,6 +300,10 @@ void SA::Work() {
|
|||||||
if(!s.SignalID || signalIDstep >= signalIDsteps - 1) {
|
if(!s.SignalID || signalIDstep >= signalIDsteps - 1) {
|
||||||
// this measurement point is done, handle result according to detector
|
// this measurement point is done, handle result according to detector
|
||||||
for(uint16_t i=0;i<DFTpoints;i++) {
|
for(uint16_t i=0;i<DFTpoints;i++) {
|
||||||
|
if(pointCnt + i >= points) {
|
||||||
|
// DFT covered more points than are required for the remaining sweep, can abort here
|
||||||
|
break;
|
||||||
|
}
|
||||||
uint16_t binIndex = (pointCnt + i) / binSize;
|
uint16_t binIndex = (pointCnt + i) / binSize;
|
||||||
uint32_t pointInBin = (pointCnt + i) % binSize;
|
uint32_t pointInBin = (pointCnt + i) % binSize;
|
||||||
bool lastPointInBin = pointInBin >= binSize - 1;
|
bool lastPointInBin = pointInBin >= binSize - 1;
|
||||||
@ -386,7 +390,7 @@ void SA::Work() {
|
|||||||
Communication::Send(packet);
|
Communication::Send(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pointCnt < points - DFTpoints) {
|
if(pointCnt + DFTpoints < points) {
|
||||||
pointCnt += DFTpoints;
|
pointCnt += DFTpoints;
|
||||||
} else {
|
} else {
|
||||||
pointCnt = 0;
|
pointCnt = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user