Skip to content

Commit

Permalink
Added BER scan reporting UI. Fixes #709.
Browse files Browse the repository at this point in the history
  • Loading branch information
azonenberg committed Apr 18, 2024
1 parent 9f59140 commit 82a24ac
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/ngscopeclient/BERTInputChannelDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,16 @@ bool BERTInputChannelDialog::DoRender()
auto state = m_parent->GetSession().GetBERTState(m_channel->GetBERT());
state->m_horzBathtubScanPending[m_channel->GetIndex()] = true;
}

Unit fs(Unit::UNIT_FS);
ImGui::SameLine();

//Scan progress or estimated run time
if(m_channel->IsHBathtubScanInProgress())
ImGui::ProgressBar(m_channel->GetScanProgress(), ImVec2(2*width, 0));
else
ImGui::Text("Estimated %s", fs.PrettyPrint(m_channel->GetExpectedBathtubCaptureTime(), 5).c_str());

HelpMarker("Acquire a single horizontal bathtub measurement");

if(ImGui::Button("Eye"))
Expand All @@ -319,6 +329,13 @@ bool BERTInputChannelDialog::DoRender()
auto state = m_parent->GetSession().GetBERTState(m_channel->GetBERT());
state->m_eyeScanPending[m_channel->GetIndex()] = true;
}
ImGui::SameLine();

//Scan progress or estimated run time
if(m_channel->IsEyeScanInProgress())
ImGui::ProgressBar(m_channel->GetScanProgress(), ImVec2(2*width, 0));
else
ImGui::Text("Estimated %s", fs.PrettyPrint(m_channel->GetExpectedEyeCaptureTime(), 5).c_str());
HelpMarker("Acquire a single eye pattern measurement");

//Input path
Expand Down
20 changes: 20 additions & 0 deletions src/ngscopeclient/BERTThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,30 @@ void BERTThread(BERTThreadArgs args)
for(size_t i=0; i<bert->GetChannelCount(); i++)
{
if(state->m_horzBathtubScanPending[i].exchange(false))
{
Unit fs(Unit::UNIT_FS);
auto expected = bert->GetExpectedBathtubCaptureTime(i);
LogTrace("Starting bathtub scan, expecting to take %s\n", fs.PrettyPrint(expected).c_str());

double start = GetTime();
bert->MeasureHBathtub(i);
double dt = (GetTime() - start) * FS_PER_SECOND;

LogTrace("Scan actually took %s\n", fs.PrettyPrint(dt).c_str());
}

if(state->m_eyeScanPending[i].exchange(false))
{
Unit fs(Unit::UNIT_FS);
auto expected = bert->GetExpectedEyeCaptureTime(i);
LogTrace("Starting eye scan, expecting to take %s\n", fs.PrettyPrint(expected).c_str());

double start = GetTime();
bert->MeasureEye(i);
double dt = (GetTime() - start) * FS_PER_SECOND;

LogTrace("Scan actually took %s\n", fs.PrettyPrint(dt).c_str());
}

args.session->MarkChannelDirty(bert->GetChannel(i));
}
Expand Down

0 comments on commit 82a24ac

Please sign in to comment.