Fawkes API
Fawkes Development Version
|
Aquisition-dependant threads. More...
#include "aqt_vision_threads.h"
Public Member Functions | |
FvAqtVisionThreads (fawkes::Clock *clock) | |
Constructor. More... | |
~FvAqtVisionThreads () | |
Destructor. More... | |
void | add_waiting_thread (fawkes::Thread *thread) |
Add a thread in waiting state. More... | |
void | remove_thread (fawkes::Thread *thread) |
Remove a thread. More... | |
void | remove_waiting_thread (fawkes::Thread *thread) |
Remove waiting thread. More... | |
void | set_thread_running (fawkes::Thread *thread) |
Mark the thread as running. More... | |
bool | empty () |
Check if there is no thread at all. More... | |
float | empty_time () |
Get the empty time. More... | |
bool | has_cyclic_thread () |
Check if there is at least one cyclic thread. More... | |
bool | has_cont_thread () |
Check if there is at least one continuous thread. More... | |
void | wakeup_and_wait_cyclic_threads () |
Wakeup and wait for all cyclic threads. More... | |
void | set_prepfin_hold (bool hold) |
Set prepfin hold fo cyclic threads. More... | |
bool | has_waiting_thread (fawkes::Thread *t) |
Check if the given waiting thread is registered. More... | |
Aquisition-dependant threads.
This class is used for managing the vision threads that depend on a given aquisition thread. Used internally in base vision.
Definition at line 39 of file aqt_vision_threads.h.
FvAqtVisionThreads::FvAqtVisionThreads | ( | fawkes::Clock * | clock | ) |
Constructor.
clock | Clock for timeout handling, system time is used only. |
Definition at line 43 of file aqt_vision_threads.cpp.
References fawkes::Clock::get_systime().
FvAqtVisionThreads::~FvAqtVisionThreads | ( | ) |
Destructor.
Definition at line 50 of file aqt_vision_threads.cpp.
void FvAqtVisionThreads::add_waiting_thread | ( | fawkes::Thread * | thread | ) |
Add a thread in waiting state.
The thread is marked as dependant but it is otherwise ignored.
thread | thread to add for access to the YUV422_PLANAR image. |
Definition at line 60 of file aqt_vision_threads.cpp.
References fawkes::ThreadList::push_back_locked().
Referenced by FvBaseThread::register_for_camera().
bool FvAqtVisionThreads::empty | ( | ) |
Check if there is no thread at all.
Definition at line 148 of file aqt_vision_threads.cpp.
Referenced by remove_thread(), and remove_waiting_thread().
float FvAqtVisionThreads::empty_time | ( | ) |
Get the empty time.
Definition at line 158 of file aqt_vision_threads.cpp.
References fawkes::Clock::elapsed().
bool FvAqtVisionThreads::has_cont_thread | ( | ) |
Check if there is at least one continuous thread.
Definition at line 128 of file aqt_vision_threads.cpp.
bool FvAqtVisionThreads::has_cyclic_thread | ( | ) |
Check if there is at least one cyclic thread.
Definition at line 119 of file aqt_vision_threads.cpp.
Referenced by wakeup_and_wait_cyclic_threads().
bool FvAqtVisionThreads::has_waiting_thread | ( | fawkes::Thread * | t | ) |
Check if the given waiting thread is registered.
t | thread to check for |
Definition at line 138 of file aqt_vision_threads.cpp.
void FvAqtVisionThreads::remove_thread | ( | fawkes::Thread * | thread | ) |
Remove a thread.
The thread is removed from all internal structures.
thread | thread to remove |
Definition at line 88 of file aqt_vision_threads.cpp.
References empty(), fawkes::Clock::get_systime(), and fawkes::ThreadList::remove_locked().
void FvAqtVisionThreads::remove_waiting_thread | ( | fawkes::Thread * | thread | ) |
Remove waiting thread.
thread | thread to remove from waiting structures. |
Definition at line 107 of file aqt_vision_threads.cpp.
References empty(), fawkes::Clock::get_systime(), and fawkes::ThreadList::remove_locked().
void FvAqtVisionThreads::set_prepfin_hold | ( | bool | hold | ) |
Set prepfin hold fo cyclic threads.
Sets prepfin hold for cyclice threads and rolls back if it cannot be set for any of the threads.
hold | prepfin hold value |
Exception | thrown if setting fails |
Definition at line 182 of file aqt_vision_threads.cpp.
References fawkes::ThreadList::set_prepfin_hold().
Referenced by FvAcquisitionThread::set_vt_prepfin_hold().
void FvAqtVisionThreads::set_thread_running | ( | fawkes::Thread * | thread | ) |
Mark the thread as running.
thread | thread to mark as running |
Definition at line 69 of file aqt_vision_threads.cpp.
References fawkes::ThreadList::push_back_locked(), fawkes::ThreadList::remove_locked(), and fawkes::VisionAspect::vision_thread_mode().
void FvAqtVisionThreads::wakeup_and_wait_cyclic_threads | ( | ) |
Wakeup and wait for all cyclic threads.
Definition at line 165 of file aqt_vision_threads.cpp.
References has_cyclic_thread(), and fawkes::ThreadList::wakeup().
Referenced by FvAcquisitionThread::loop().