mirror of
https://github.com/gwm17/Specter.git
synced 2024-11-22 18:28:52 -05:00
Added Clear and ClearAll Buttons and functionality to histograms.
This commit is contained in:
parent
e8166cdbcd
commit
1aa7a41596
|
@ -52,6 +52,11 @@ namespace Navigator {
|
|||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if(ImGui::Button("Clear"))
|
||||
{
|
||||
HistogramMap::GetInstance().ClearHistogram(m_zoomedGram.name);
|
||||
}
|
||||
|
||||
if (ImPlot::BeginPlot(m_zoomedGram.name.c_str(), ImVec2(-1, -1)))
|
||||
{
|
||||
|
@ -129,6 +134,11 @@ namespace Navigator {
|
|||
else
|
||||
{
|
||||
ImGui::SliderInt2("Rows, Columns", m_tableSizes, 1, 3);
|
||||
ImGui::SameLine();
|
||||
if(ImGui::Button("Clear All"))
|
||||
{
|
||||
HistogramMap::GetInstance().ClearHistograms();
|
||||
}
|
||||
m_totalSlots = m_tableSizes[0] * m_tableSizes[1];
|
||||
m_selectedGrams.resize(m_totalSlots);
|
||||
if (ImGui::BeginTable("Select Histograms", m_tableSizes[1]))
|
||||
|
|
|
@ -74,6 +74,21 @@ namespace Navigator {
|
|||
pair.second->FillData();
|
||||
}
|
||||
|
||||
void HistogramMap::ClearHistograms()
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(m_histoMutex);
|
||||
for(auto& pair : m_map)
|
||||
pair.second->ClearData();
|
||||
}
|
||||
|
||||
void HistogramMap::ClearHistogram(const std::string& name)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(m_histoMutex);
|
||||
auto iter = m_map.find(name);
|
||||
if(iter != m_map.end())
|
||||
iter->second->ClearData();
|
||||
}
|
||||
|
||||
const HistogramParameters& HistogramMap::GetHistogramParams(const std::string& name)
|
||||
{
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ namespace Navigator {
|
|||
void RemoveCutFromHistograms(const std::string& cutname);
|
||||
|
||||
void UpdateHistograms();
|
||||
void ClearHistograms();
|
||||
void ClearHistogram(const std::string& name);
|
||||
|
||||
void DrawHistograms();
|
||||
void DrawHistogram(const std::string& name);
|
||||
|
|
Loading…
Reference in New Issue
Block a user