@@ -60,24 +60,23 @@ void GetMatrixSlice::execute()
6060 setAlgoIntFromState (Parameters::SliceIndex);
6161 auto output = algo ().run (withInputData ((InputMatrix, input)));
6262 sendOutputFromAlgorithm (OutputMatrix, output);
63- get_state ()->setValue (Parameters::MaxIndex, output.additionalAlgoOutput ()->toInt ());
63+ auto maxIndex = output.additionalAlgoOutput ()->toInt ();
64+ get_state ()->setValue (Parameters::MaxIndex, maxIndex);
6465
65- /*
66- auto playMode = get_state()->getValue (Parameters::PlayMode).toBool( );
67- if (playMode)
66+ std::cout << " checking play mode " << std::endl;
67+ auto playMode = optional_any_cast_or_default< int >( get_state ()->getTransientValue (Parameters::PlayMode));
68+ if (playMode == 1 )
6869 {
70+ std::cout << " checking play mode: " << playMode << std::endl;
6971 auto nextIndex = algo ().get (Parameters::SliceIndex).toInt () + 1 ;
70- auto maxIndex = algo().get(Parameters::IsSliceColumn).toBool() && input ? input->ncols() : input->nrows();
71- if (nextIndex >= maxIndex)
72- {
73- get_state()->setValue(Parameters::PlayMode, false);
74- }
75- else
76- {
77- get_state()->setValue(Parameters::SliceIndex, nextIndex);
78- enqueueExecuteAgain();
79- }
72+ std::cout << " setting index to " << nextIndex % (maxIndex + 1 ) << std::endl;
73+ get_state ()->setValue (Parameters::SliceIndex, nextIndex % (maxIndex + 1 ));
74+ enqueueExecuteAgain ();
75+ std::cout << " execute enqueued " << std::endl;
76+ }
77+ else if (playMode == 2 )
78+ {
79+ std::cout << " execute paused" << std::endl;
8080 }
81- */
8281 }
8382}
0 commit comments