76 mResetProcessTimer(true)
78 setCycleTime(cycleTime);
79 setCycleTimeTolerance(cycleTime);
91 mResetProcessTimer(true)
93 setCycleTime(cycleTime);
94 setCycleTimeTolerance(cycleTimeTolerance);
100 template<
typename Reflector>
104 r.property(
"CycleTime",
107 "The cycle time of our process", mCycleTime,
111 r.property(
"CycleTimeTolerance",
114 "The maximum time about that we can exceed the cycle time " 115 "before issuing a warning", mCycleTimeTolerance,
122 virtual void checkin(
const std::string& ns,
const std::string& name);
140 void setCycleTimeTolerance(
Duration tolerance);
146 Duration getCycleTimeTolerance()
const;
154 virtual void start();
173 virtual void process(
const Timer& timer);
176 virtual void needRecovery(
const std::string& reason =
"");
179 virtual void operational();
183 void processIntern(
const Timer& timer);
189 bool mResetProcessTimer;
class MIRA_FRAMEWORK_EXPORT Unit
forward declaration
Definition: MicroUnit.h:60
tick_type milliseconds() const
Returns normalized number of milliseconds (0..999)
Definition: Time.h:285
DispatcherThread::TimerPtr TimerPtr
Definition: DispatcherThread.h:525
Class representing timers and tasks that can be registered and executed by the dispatcher thread...
Definition: DispatcherThread.h:147
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
virtual ~Unit()
Definition: Unit.h:97
#define MIRA_REFLECT_BASE(reflector, BaseClass)
Macro that can be used to reflect the base class easily.
Definition: ReflectorInterface.h:912
Duration getCycleTimeTolerance() const
Returns the cycle period tolerance for exceeding the period while calling the process(const Timer& ti...
Flags
Flags for creating an authority.
Definition: Authority.h:101
A more complex unit that adds a default timer to the thread dispatcher of the authority that acts as ...
Definition: Unit.h:63
Base class for all units.
#define MIRA_FRAMEWORK_EXPORT
Definition: FrameworkExports.h:61
Use this class to represent time durations.
Definition: Time.h:106
hour_type hours() const
Returns number of hours in the duration.
Definition: Time.h:270
Unit(Duration cycleTime, Flags flags=NORMAL)
Constructs a unit with given cycle time.
Definition: Unit.h:74
#define MIRA_OBJECT(classIdentifier)
Use this MACRO if you like the factory to automatically extract the class name from the given identif...
Definition: FactoryMacros.h:179
void setCycleTimeTolerance(Duration tolerance)
Set the cycle period tolerance for exceeding the period while calling the process(const Timer& timer)...
#define MIRA_NO_PUBLIC_DEFAULT_CONSTRUCTOR(CLASS)
Use this macro if your class does not have a public default constructor and should be managed by the ...
Definition: FactoryMacros.h:270
Duration getCycleTime() const
Returns the cycle period the process(const Timer& timer) method gets called.
void setCycleTime(Duration period)
Set the cycle period the process(const Timer& timer) method gets called.
Unit(Duration cycleTime, Duration cycleTimeTolerance, Flags flags=NORMAL)
Constructs a unit with given cycle time and a tolerance for the cycle time.
Definition: Unit.h:89
void reflect(Reflector &r)
Definition: Unit.h:101
Units are basic modules of a complex application.
Definition: MicroUnit.h:69