mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-30 22:38:44 +08:00
Merge remote-tracking branch 'origin/feature/light_weight_fsm' into development
This commit is contained in:
commit
6637757ad4
@ -311,7 +311,7 @@
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>7</Optim>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
@ -320,7 +320,7 @@
|
||||
<PlainCh>1</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>3</wLevel>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>1</uC99>
|
||||
|
||||
@ -335,15 +335,6 @@ namespace etl
|
||||
base_t::clear();
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Increases the size of the vector by one, but does not initialise the new element.
|
||||
/// If asserts or exceptions are enabled, throws a vector_full if the vector is already full.
|
||||
//*************************************************************************
|
||||
void push_back()
|
||||
{
|
||||
base_t::push_back();
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
/// Inserts a value at the end of the vector.
|
||||
/// If asserts or exceptions are enabled, emits vector_full if the vector is already full.
|
||||
@ -737,15 +728,6 @@ namespace etl
|
||||
base_t::clear();
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Increases the size of the vector by one, but does not initialise the new element.
|
||||
/// If asserts or exceptions are enabled, throws a vector_full if the vector is already full.
|
||||
//*************************************************************************
|
||||
void push_back()
|
||||
{
|
||||
base_t::push_back();
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
/// Inserts a value at the end of the vector.
|
||||
/// If asserts or exceptions are enabled, emits vector_full if the vector is already full.
|
||||
|
||||
@ -127,31 +127,65 @@ namespace etl
|
||||
|
||||
//*************************************************************************
|
||||
/// Constructor.
|
||||
/// \tparam TRANSITION_TABLE_SIZE The transition table size.
|
||||
/// \param object_ A reference to the implementation object.
|
||||
/// \param transition_table_ The table of transitions.
|
||||
/// \param state_id_ The initial state id.
|
||||
/// \param object_ A reference to the implementation object.
|
||||
/// \param transition_table_begin_ The start of the table of transitions.
|
||||
/// \param transition_table_end_ The end of the table of transitions.
|
||||
/// \param state_id_ The initial state id.
|
||||
//*************************************************************************
|
||||
template <const uint32_t TRANSITION_TABLE_SIZE>
|
||||
state_chart(TObject& object_,
|
||||
const etl::array<transition, TRANSITION_TABLE_SIZE>& transition_table_,
|
||||
const transition* transition_table_begin_,
|
||||
const transition* transition_table_end_,
|
||||
const state_id_t state_id_)
|
||||
: istate_chart(state_id_),
|
||||
object(object_),
|
||||
transition_table(transition_table_.begin(), transition_table_.end()),
|
||||
transition_table(transition_table_begin_, transition_table_end_),
|
||||
started(false)
|
||||
{
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Sets the state table.
|
||||
/// \tparam STATE_TABLE_SIZE The state table size.
|
||||
/// \param state_table_ A reference to the state table.
|
||||
/// Constructor.
|
||||
/// \param object_ A reference to the implementation object.
|
||||
/// \param transition_table_begin_ The start of the table of transitions.
|
||||
/// \param transition_table_end_ The end of the table of transitions.
|
||||
/// \param state_table_begin_ The start of the state table.
|
||||
/// \param state_table_end_ The end of the state table.
|
||||
/// \param state_id_ The initial state id.
|
||||
//*************************************************************************
|
||||
template <const uint32_t STATE_TABLE_SIZE>
|
||||
void set_state_table(const etl::array<state, STATE_TABLE_SIZE>& state_table_)
|
||||
state_chart(TObject& object_,
|
||||
const transition* transition_table_begin_,
|
||||
const transition* transition_table_end_,
|
||||
const state* state_table_begin_,
|
||||
const state* state_table_end_,
|
||||
const state_id_t state_id_)
|
||||
: istate_chart(state_id_),
|
||||
object(object_),
|
||||
transition_table(transition_table_begin_, transition_table_end_),
|
||||
state_table(state_table_begin_, state_table_end_),
|
||||
started(false)
|
||||
{
|
||||
state_table.assign(state_table_.begin(), state_table_.end());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Sets the transition table.
|
||||
/// \param state_table_begin_ The start of the state table.
|
||||
/// \param state_table_end_ The end of the state table.
|
||||
//*************************************************************************
|
||||
void set_transition_table(const transition* transition_table_begin_,
|
||||
const transition* transition_table_end_)
|
||||
{
|
||||
transition_table.assign(transition_table_begin_, transition_table_end_);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
/// Sets the state table.
|
||||
/// \param state_table_begin_ The start of the state table.
|
||||
/// \param state_table_end_ The end of the state table.
|
||||
//*************************************************************************
|
||||
void set_state_table(const state* state_table_begin_,
|
||||
const state* state_table_end_)
|
||||
{
|
||||
state_table.assign(state_table_begin_, state_table_end_);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -37,12 +37,12 @@ SOFTWARE.
|
||||
/// Definitions of the ETL version
|
||||
///\ingroup utilities
|
||||
|
||||
#define ETL_VERSION "11.19.0"
|
||||
#define ETL_VERSION_W L"11.19.0"
|
||||
#define ETL_VERSION_U16 u"11.19.0"
|
||||
#define ETL_VERSION_U32 U"11.19.0"
|
||||
#define ETL_VERSION_MAJOR 11
|
||||
#define ETL_VERSION_MINOR 19
|
||||
#define ETL_VERSION "12.0.0"
|
||||
#define ETL_VERSION_W L"12.0.0"
|
||||
#define ETL_VERSION_U16 u"12.0.0"
|
||||
#define ETL_VERSION_U32 U"12.0.0"
|
||||
#define ETL_VERSION_MAJOR 12
|
||||
#define ETL_VERSION_MINOR 0
|
||||
#define ETL_VERSION_PATCH 0
|
||||
#define ETL_VERSION_VALUE ((ETL_VERSION_MAJOR * 10000) + (ETL_VERSION_MINOR * 100) + ETL_VERSION_PATCH)
|
||||
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
===============================================================================
|
||||
12.0.0
|
||||
Modified the API of etl::state_chart constructors.
|
||||
|
||||
===============================================================================
|
||||
11.19.0
|
||||
Removed push(void) push_back(void) and push_front(void) function for containers.
|
||||
|
||||
@ -323,6 +323,7 @@
|
||||
<Unit filename="../../src/crc16.cpp" />
|
||||
<Unit filename="../../src/crc16_ccitt.cpp" />
|
||||
<Unit filename="../../src/crc16_kermit.cpp" />
|
||||
<Unit filename="../../src/crc16_modbus.cpp" />
|
||||
<Unit filename="../../src/crc32.cpp" />
|
||||
<Unit filename="../../src/crc32_c.cpp" />
|
||||
<Unit filename="../../src/crc64_ecma.cpp" />
|
||||
|
||||
@ -86,9 +86,9 @@ namespace
|
||||
public:
|
||||
|
||||
MotorControl()
|
||||
: state_chart<MotorControl>(*this, transitionTable, StateId::IDLE)
|
||||
: state_chart<MotorControl>(*this, transitionTable.begin(), transitionTable.end(), StateId::IDLE)
|
||||
{
|
||||
this->set_state_table(stateTable);
|
||||
this->set_state_table(stateTable.begin(), stateTable.end());
|
||||
ClearStatistics();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user