From ffb37d104b2ca28e6986fc0576dfa1fc5d662322 Mon Sep 17 00:00:00 2001 From: gwm17 Date: Fri, 7 Oct 2022 10:12:22 -0400 Subject: [PATCH] Fix bug in digitizer panel for PHA params, do a better job of handling parameter changes. Some testing with pulser into single dgtz, yields some positive results --- src/Editor/EditorLayer.cpp | 21 +++++++++++++-------- src/Editor/ScopePanel.cpp | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Editor/EditorLayer.cpp b/src/Editor/EditorLayer.cpp index 9ad6c3f..6cf3df3 100644 --- a/src/Editor/EditorLayer.cpp +++ b/src/Editor/EditorLayer.cpp @@ -258,24 +258,29 @@ namespace Daqromancy { if (panel_status) { //Update project - m_project->SetDigitizerParameters(panel.GetDigitizerHandle(), panel.GetDigitizerParameters()); - if (panel.GetPanelType() == DigitizerPanel::Type::PHA) + int handle = panel.GetDigitizerHandle(); + DigitizerPanel::Type type = panel.GetPanelType(); + m_project->SetDigitizerParameters(handle, panel.GetDigitizerParameters()); + if (type == DigitizerPanel::Type::PHA) { - m_project->SetPHAParameters(panel.GetDigitizerHandle(), panel.GetPHAChannelParameters()); - m_project->SetPHAWaveParameters(panel.GetDigitizerHandle(), panel.GetPHAWaveParameters()); + m_project->SetPHAParameters(handle, panel.GetPHAChannelParameters()); + m_project->SetPHAWaveParameters(handle, panel.GetPHAWaveParameters()); } - else if (panel.GetPanelType() == DigitizerPanel::Type::PSD) + else if (type == DigitizerPanel::Type::PSD) { - m_project->SetPSDParameters(panel.GetDigitizerHandle(), panel.GetPSDChannelParameters()); - m_project->SetPSDWaveParameters(panel.GetDigitizerHandle(), panel.GetPSDWaveParameters()); + m_project->SetPSDParameters(handle, panel.GetPSDChannelParameters()); + m_project->SetPSDWaveParameters(handle, panel.GetPSDWaveParameters()); } else { DY_WARN("Unidentified digitizer type attempting to communicate with project"); } //Emit event to update aquisition side - AcqParametersEvent e(DigitizerAccessType::Single, panel.GetDigitizerHandle()); + AcqParametersEvent e(DigitizerAccessType::Single, handle); m_eventCallback(e); + + //Load back any changes CAEN made, sometimes specific numbers are invalid + UpdateDigitizerPanels(); } } diff --git a/src/Editor/ScopePanel.cpp b/src/Editor/ScopePanel.cpp index ea379c4..8571b92 100644 --- a/src/Editor/ScopePanel.cpp +++ b/src/Editor/ScopePanel.cpp @@ -56,7 +56,7 @@ namespace Daqromancy { { m_selectedBoard = boardArgs.handle; availChannels = boardArgs.channels; - selectedBoardString = fmt::format("{0}", m_selectedBoard); + selectedBoardString = boardArgs.name; if (boardArgs.firmware == CAEN_DGTZ_DPPFirmware_PHA) { const auto& phaParams = m_project->GetPHAWaveParameters(boardArgs.handle);