Commit d6ecb566 authored by Laurent Claustre's avatar Laurent Claustre

Merge branch...

Merge branch '43-with-roicounter-processing-without-rois-ctcontrol-get-stuck-in-acqrunning-status' into 'master'

Resolve "With RoiCounter processing without Rois, CtControl get stuck in AcqRunning status"

Closes #43

See merge request !61
parents bf2a9489 bd21de85
Pipeline #3185 passed with stages
in 1 minute and 38 seconds
......@@ -50,6 +50,11 @@ namespace lima
virtual bool addTo(TaskMgr&,int stage) = 0;
virtual void prepare() = 0;
public:
// By default the task is active. Some Op may be in the pipeline but not actually active, e.g.
// RoiCounters, Roi2Spectrum without Rois defined.
virtual bool isActive() const { return true; }
};
enum SoftOpId
......@@ -87,6 +92,9 @@ namespace lima
const std::string &anAlias) :
m_key(akey),
m_alias(anAlias),m_linkable(false),m_opt(NULL) {}
bool isActive() const { return m_opt->isActive(); }
SoftOpKey m_key;
std::string m_alias;
bool m_linkable;
......@@ -239,6 +247,11 @@ namespace lima
return m_manager_tasks.size();
}
bool empty() const
{
return m_manager_tasks.empty();
}
NameMapIterator begin()
{
return m_manager_tasks.begin();
......@@ -407,6 +420,8 @@ namespace lima
void setBufferSize(int size);
void getBufferSize(int &size) const;
/*override*/ bool isActive() const { return !m_task_manager.empty(); }
protected:
virtual bool addTo(TaskMgr&,int stage);
......@@ -599,6 +614,8 @@ namespace lima
void setBufferSize(int size);
void getBufferSize(int &size) const;
/*override*/ bool isActive() const { return !m_task_manager.empty(); }
protected:
virtual bool addTo(TaskMgr&,int stage);
......
......@@ -321,20 +321,23 @@ void SoftOpExternalMgr::isTaskActive(bool &linkTaskFlag,bool &sinkTaskFlag) cons
{
DEB_MEMBER_FUNCT();
AutoMutex aLock(m_cond.mutex());
linkTaskFlag = sinkTaskFlag = false;
for(Stage2Instance::const_iterator i = m_stage2instance.begin();
i != m_stage2instance.end() && (!linkTaskFlag || !sinkTaskFlag);++i)
{
for(std::list<SoftOpInstance>::const_iterator k = i->second.begin();
k != i->second.end() && (!linkTaskFlag || !sinkTaskFlag);++k)
AutoMutex aLock(m_cond.mutex());
linkTaskFlag = sinkTaskFlag = false;
for (Stage2Instance::const_iterator i = m_stage2instance.begin();
i != m_stage2instance.end() && (!linkTaskFlag || !sinkTaskFlag); ++i)
{
if(k->m_linkable)
linkTaskFlag = true;
else
sinkTaskFlag = true;
for (std::list<SoftOpInstance>::const_iterator k = i->second.begin();
k != i->second.end() && (!linkTaskFlag || !sinkTaskFlag); ++k)
{
if (k->isActive())
{
if (k->m_linkable)
linkTaskFlag = true;
else
sinkTaskFlag = true;
}
}
}
}
DEB_RETURN() << DEB_VAR2(linkTaskFlag,sinkTaskFlag);
}
......
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