Commit 2f6b17b4 authored by Joshua Santana's avatar Joshua Santana
Browse files

Merge branch 'sprint_5' of gitlab.rlp.net:top/21s/sivert-vis/sivert-vis-project into sprint_5

parents 22a8a9a9 6daf0971
......@@ -42,8 +42,6 @@ void WEventIDLimitationPropertyHandler::createProperties()
m_maxCap = eventIDGroup->addProperty( "Maximum event id", "Filters out every event id which is higher than the set value.", 2000 );
m_applySelection = eventIDGroup->addProperty( "Set selection", "Apply", WPVBaseTypes::PV_TRIGGER_READY, eventIDNotifier );
determineMinMaxEventID();
updateProperty();
}
......@@ -54,6 +52,8 @@ void WEventIDLimitationPropertyHandler::updateProperty()
m_minCap->setHidden( false );
m_maxCap->setHidden( false );
m_applySelection->setHidden( false );
determineMinMaxEventID();
}
else
{
......@@ -65,7 +65,6 @@ void WEventIDLimitationPropertyHandler::updateProperty()
void WEventIDLimitationPropertyHandler::updateMesh()
{
determineMinMaxEventID();
m_dataUpdate( );
if( m_applySelection->get( true ) == WPVBaseTypes::PV_TRIGGER_TRIGGERED )
......@@ -84,21 +83,34 @@ void WEventIDLimitationPropertyHandler::determineMinMaxEventID()
}
int minCap = std::stoi( m_protonData->getCSVData()->front().at( eventIDIndex ) );
int maxCap = std::stoi( m_protonData->getCSVData()->back().at( eventIDIndex ) );
int maxCap = maxCap;
for( auto iter = m_protonData->getCSVData()->begin(); iter != m_protonData->getCSVData()->end(); iter++ )
{
int calc = std::stoi( ( *iter ).at( eventIDIndex ) );
if( calc < minCap )
{
minCap = calc;
}
if(calc > maxCap )
{
maxCap = calc;
}
}
m_minCap->setMin( minCap );
m_minCap->setMax( maxCap );
m_maxCap->setMin( minCap );
m_maxCap->setMax( maxCap );
int currentMinCap = m_minCap->get();
int currentMaxCap = m_maxCap->get();
if( currentMaxCap < currentMinCap )
m_maxCap->set( currentMinCap );
if( m_maxCap->get() > maxCap )
{
m_maxCap->set( maxCap );
}
if( currentMinCap < 0 )
m_minCap->set( 0 );
if( m_minCap->get() < minCap )
{
m_minCap->set( minCap );
}
}
WPropInt WEventIDLimitationPropertyHandler::getMinCap()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment