Skip to content

Commit

Permalink
Update PhaseDetector to use TtlLineParameter
Browse files Browse the repository at this point in the history
  • Loading branch information
anjaldoshi committed Apr 2, 2024
1 parent db7a6d8 commit 9f22e9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions Plugins/PhaseDetector/PhaseDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ PhaseDetector::PhaseDetector() : GenericProcessor ("Phase Detector")
{

addSelectedChannelsParameter(Parameter::STREAM_SCOPE, "channel", "Channel", "The continuous channel to analyze", 1);
addIntParameter(Parameter::STREAM_SCOPE, "ttl_out", "TTL out", "The output TTL line", 1, 1, 16);
addTtlLineParameter(Parameter::STREAM_SCOPE, "ttl_out", "TTL out", "The output TTL line", 16);
addIntParameter(Parameter::STREAM_SCOPE,"gate_line", "Gate line", "The input TTL line for gating the signal (0 = off)", 0, 0, 16);
addCategoricalParameter(Parameter::STREAM_SCOPE,
"phase",
Expand Down Expand Up @@ -122,7 +122,7 @@ void PhaseDetector::parameterValueChanged(Parameter* param)
else if (param->getName().equalsIgnoreCase("ttl_out"))
{
settings[param->getStreamId()]->lastOutputLine = settings[param->getStreamId()]->outputLine;
settings[param->getStreamId()]->outputLine = (int)param->getValue() - 1;
settings[param->getStreamId()]->outputLine = (int)param->getValue();
settings[param->getStreamId()]->outputLineChanged = true;
}
else if (param->getName().equalsIgnoreCase("gate_line"))
Expand All @@ -138,11 +138,6 @@ void PhaseDetector::updateSettings()

for (auto stream : getDataStreams())
{
// update "settings" objects
parameterValueChanged(stream->getParameter("phase"));
parameterValueChanged(stream->getParameter("channel"));
parameterValueChanged(stream->getParameter("ttl_out"));
parameterValueChanged(stream->getParameter("gate_line"));

EventChannel::Settings s{
EventChannel::Type::TTL,
Expand Down
2 changes: 1 addition & 1 deletion Plugins/PhaseDetector/PhaseDetectorEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ PhaseDetectorEditor::PhaseDetectorEditor(GenericProcessor* parentNode)
chanEditor->setLayout(ParameterEditor::Layout::nameOnTop);
chanEditor->setSize(80, 34);

addComboBoxParameterEditor(Parameter::STREAM_SCOPE, "TTL_out", 110, 57);
addTtlLineParameterEditor(Parameter::STREAM_SCOPE, "TTL_out", 110, 57);
ParameterEditor* ttlEditor = getParameterEditor("TTL_out");
ttlEditor->setLayout(ParameterEditor::Layout::nameOnTop);
ttlEditor->setSize(80, 34);
Expand Down

0 comments on commit 9f22e9a

Please sign in to comment.