- 3.0.2 core module.
ct::core::PhaseSequence< Phase, Time > Class Template Reference

Describes a Phase sequence with timing. More...

#include <Switching.h>

Public Types

typedef std::vector< Phase > PhaseSchedule_t
 
typedef std::vector< TimeTimeSchedule_t
 

Public Member Functions

 PhaseSequence (const Time &start_time=0)
 Construct empty sequence (with default start time) More...
 
 ~PhaseSequence ()
 Destructor. More...
 
void addPhase (Phase phase, Time duration)
 add a phase with duration More...
 
std::size_t getNumPhases () const
 get number of phases More...
 
std::size_t getNumSwitches () const
 get number of switches More...
 
Time getTotalDuration () const
 get sequence total duration More...
 
Time getStartTimeFromIdx (std::size_t idx) const
 get start time from sequence index More...
 
Time getEndTimeFromIdx (std::size_t idx) const
 get end time from sequence index More...
 
Phase getPhaseFromIdx (std::size_t idx) const
 get phase pointer from sequence index More...
 
Phase getPhaseFromTime (Time time) const
 get phase pointer from time More...
 
Phase getFirstPhase () const
 get First phase pointer More...
 
Phase getFinalPhase () const
 get Final phase pointer More...
 
SwitchEvent< Phase, TimegetSwitchEventFromIdx (std::size_t idx) const
 get next switch event from sequence index More...
 
SwitchEvent< Phase, TimegetSwitchEventFromTime (Time time) const
 get next switch event from time More...
 
std::size_t getIdxFromTime (Time time) const
 get sequence index from time More...
 

Detailed Description

template<class Phase, typename Time>
class ct::core::PhaseSequence< Phase, Time >

Describes a Phase sequence with timing.

Each phase of the sequence has a start time, and end time Each event has a pre & post phase + switching time

Example: The following illustrates a sequence of 3 phases

  • ----— + ----— + ----— + t0 p0 t1 p1 t2 p2 t3

It contains 4 times to define the sequence. Two of those are switching times: t1 and t2 There are two switching events: {p0, p1, t1} and {p1, p2, t2};

Member Typedef Documentation

◆ PhaseSchedule_t

template<class Phase, typename Time>
typedef std::vector<Phase> ct::core::PhaseSequence< Phase, Time >::PhaseSchedule_t

◆ TimeSchedule_t

template<class Phase, typename Time>
typedef std::vector<Time> ct::core::PhaseSequence< Phase, Time >::TimeSchedule_t

Constructor & Destructor Documentation

◆ PhaseSequence()

template<class Phase, typename Time>
ct::core::PhaseSequence< Phase, Time >::PhaseSequence ( const Time start_time = 0)
inline

Construct empty sequence (with default start time)

◆ ~PhaseSequence()

template<class Phase, typename Time>
ct::core::PhaseSequence< Phase, Time >::~PhaseSequence ( )
inline

Destructor.

Member Function Documentation

◆ addPhase()

template<class Phase, typename Time>
void ct::core::PhaseSequence< Phase, Time >::addPhase ( Phase  phase,
Time  duration 
)
inline

add a phase with duration

Referenced by TEST().

◆ getNumPhases()

template<class Phase, typename Time>
std::size_t ct::core::PhaseSequence< Phase, Time >::getNumPhases ( ) const
inline

get number of phases

Referenced by TEST().

◆ getNumSwitches()

template<class Phase, typename Time>
std::size_t ct::core::PhaseSequence< Phase, Time >::getNumSwitches ( ) const
inline

get number of switches

Referenced by TEST().

◆ getTotalDuration()

template<class Phase, typename Time>
Time ct::core::PhaseSequence< Phase, Time >::getTotalDuration ( ) const
inline

get sequence total duration

Referenced by TEST().

◆ getStartTimeFromIdx()

template<class Phase, typename Time>
Time ct::core::PhaseSequence< Phase, Time >::getStartTimeFromIdx ( std::size_t  idx) const
inline

get start time from sequence index

Referenced by TEST().

◆ getEndTimeFromIdx()

template<class Phase, typename Time>
Time ct::core::PhaseSequence< Phase, Time >::getEndTimeFromIdx ( std::size_t  idx) const
inline

get end time from sequence index

Referenced by TEST().

◆ getPhaseFromIdx()

template<class Phase, typename Time>
Phase ct::core::PhaseSequence< Phase, Time >::getPhaseFromIdx ( std::size_t  idx) const
inline

get phase pointer from sequence index

Referenced by TEST().

◆ getPhaseFromTime()

◆ getFirstPhase()

template<class Phase, typename Time>
Phase ct::core::PhaseSequence< Phase, Time >::getFirstPhase ( ) const
inline

get First phase pointer

◆ getFinalPhase()

template<class Phase, typename Time>
Phase ct::core::PhaseSequence< Phase, Time >::getFinalPhase ( ) const
inline

get Final phase pointer

◆ getSwitchEventFromIdx()

template<class Phase, typename Time>
SwitchEvent<Phase, Time> ct::core::PhaseSequence< Phase, Time >::getSwitchEventFromIdx ( std::size_t  idx) const
inline

get next switch event from sequence index

Referenced by TEST().

◆ getSwitchEventFromTime()

template<class Phase, typename Time>
SwitchEvent<Phase, Time> ct::core::PhaseSequence< Phase, Time >::getSwitchEventFromTime ( Time  time) const
inline

get next switch event from time

◆ getIdxFromTime()

template<class Phase, typename Time>
std::size_t ct::core::PhaseSequence< Phase, Time >::getIdxFromTime ( Time  time) const
inline

get sequence index from time

Referenced by TEST().


The documentation for this class was generated from the following file: