Skip to content

Commit d83f232

Browse files
committed
Oscilloscope drivers: reset download state to DOWNLOAD_NONE after a download is complete
1 parent 5c34e24 commit d83f232

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

scopehal/DemoOscilloscope.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,10 @@ bool DemoOscilloscope::AcquireData()
575575

576576
SequenceSet s;
577577
for(int i=0; i<4; i++)
578+
{
578579
s[GetOscilloscopeChannel(i)] = waveforms[i];
580+
this->ChannelsDownloadStatusUpdate(i, InstrumentChannel::DownloadState::DOWNLOAD_NONE, 0.0);
581+
}
579582

580583
//Timestamp the waveform(s)
581584
double now = GetTime();

scopehal/RigolOscilloscope.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,10 @@ bool RigolOscilloscope::AcquireData()
10011001
//Clean up
10021002
delete[] temp_buf;
10031003

1004+
// Everything is done, and nothing else has anything in its buffer anymore.
1005+
for(size_t i = 0; i < m_analogChannelCount; i++)
1006+
ChannelsDownloadStatusUpdate(i, InstrumentChannel::DownloadState::DOWNLOAD_NONE, 1.0);
1007+
10041008
//TODO: support digital channels
10051009

10061010
//Re-arm the trigger if not in one-shot mode

scopehal/SiglentSCPIOscilloscope.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2060,6 +2060,9 @@ bool SiglentSCPIOscilloscope::AcquireData()
20602060
for(size_t j = 0; j < num_sequences; j++)
20612061
pending_waveforms[i].push_back(waveforms[i][j]);
20622062
}
2063+
2064+
for(unsigned int i = 0; i < m_analogChannelCount; i++)
2065+
ChannelsDownloadStatusUpdate(i, InstrumentChannel::DownloadState::DOWNLOAD_NONE, 1.0);
20632066
break;
20642067

20652068
// --------------------------------------------------
@@ -2101,7 +2104,7 @@ bool SiglentSCPIOscilloscope::AcquireData()
21012104
if(pdesc)
21022105
{ // Notify about download operation start
21032106
ChannelsDownloadStarted();
2104-
2107+
21052108
// Handle the case when only digital channel is activated
21062109
// Figure out when the first trigger happened.
21072110
//Read the timestamps if we're doing segmented capture
@@ -2264,6 +2267,11 @@ bool SiglentSCPIOscilloscope::AcquireData()
22642267
for(size_t j = 0; j < num_sequences; j++)
22652268
pending_waveforms[i+m_analogChannelCount].push_back(digitalWaveforms[i][j]);
22662269
}
2270+
2271+
for(unsigned int i = 0; i < m_analogChannelCount; i++)
2272+
ChannelsDownloadStatusUpdate(i, InstrumentChannel::DownloadState::DOWNLOAD_NONE, 1.0);
2273+
for(unsigned int i = 0; i < m_digitalChannelCount; i++)
2274+
ChannelsDownloadStatusUpdate(i+m_analogChannelCount, InstrumentChannel::DownloadState::DOWNLOAD_NONE, 1.0);
22672275
}
22682276

22692277
break;

0 commit comments

Comments
 (0)