Skip to content

Commit

Permalink
Added current probe degauss support
Browse files Browse the repository at this point in the history
  • Loading branch information
azonenberg committed Nov 8, 2023
1 parent eac6836 commit d254f46
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/ngscopeclient/ChannelPropertiesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ void ChannelPropertiesDialog::RefreshInputSettings(Oscilloscope* scope, size_t n
//Probe type
m_probe = scope->GetProbeName(nchan);
m_canAutoZero = scope->CanAutoZero(nchan);
m_canDegauss = scope->CanDegauss(nchan);
m_shouldDegauss = scope->ShouldDegauss(nchan);
}

ChannelPropertiesDialog::~ChannelPropertiesDialog()
Expand Down Expand Up @@ -421,6 +423,20 @@ bool ChannelPropertiesDialog::DoRender()
"Check probe documentation to see whether input signal must be removed before zeroing."
);
}

//If the probe supports degaussing, show a button for it
if(m_canDegauss)
{
string caption = "Degauss";
if(m_shouldDegauss)
caption += "*";
if(ImGui::Button(caption.c_str()))
m_channel->Degauss();
HelpMarker(
"Click to automatically degauss current probe.\n\n"
"Check probe documentation to see whether input signal must be removed before degaussing."
);
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/ngscopeclient/ChannelPropertiesDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class ChannelPropertiesDialog : public EmbeddableDialog

std::string m_probe;
bool m_canAutoZero;
bool m_canDegauss;
bool m_shouldDegauss;
};

#endif

0 comments on commit d254f46

Please sign in to comment.