![]() |
GM6000 Digital Heater Controller Build: 20 (Branch = develop)
SDX-1330
|
This concrete class implements MApp the polls a model point for a temperature value and periodically writes the value to the trace output. More...
This concrete class implements MApp the polls a model point for a temperature value and periodically writes the value to the trace output.
The MApp also collects some metrics and has the option to display temperature in degrees Fahrenheit or Celsius.
NOTE: Multiple of instance of the class can be created - as long as each instance has a unique 'name'.
The class is intended to be example/template for an MApp - not that it does anything particular noteworthy.
#include <Api.h>
Public Member Functions | |
| Api (Cpl::Container::SList< MAppApi > &mappList, Cpl::Dm::MailboxServer &myMbox, Cpl::Dm::Mp::Float &srcTemperatureMp, const char *name=DEFAULT_NAME) | |
| Constructor. Note: The myMbox argument is only needed because the class uses a SW timer. | |
Public Member Functions inherited from Cpl::MApp::MApp_ | |
| const char * | getName () const noexcept |
| See Cpl::MApp::Api. | |
| const char * | getDescription () const noexcept |
| See Cpl::MApp::Api. | |
| const char * | getUsage () const noexcept |
| See Cpl::MApp::Api. | |
Public Member Functions inherited from Cpl::MApp::MAppApi | |
| virtual | ~MAppApi () |
| Virtual destructor. | |
Public Member Functions inherited from Cpl::Container::Item | |
| bool | insert_ (void *newContainerPtr) |
| Helper method to trap when inserting an item in multiple containers. | |
| bool | isInContainer_ (const void *containerPtr) const noexcept |
| Returns 'true' if the instance is in the specified container. | |
Public Member Functions inherited from Cpl::System::Timer | |
| Timer (TimerManager &timingSource) | |
| Constructor | |
| Timer () | |
| Constructor. Alternate constructor - that defers the assignment of the timing source | |
| virtual void | start (unsigned long timerDurationInMilliseconds) noexcept |
| Starts the timer with an initial count down count duration of 'timerDurationInMilliseconds'. | |
| virtual void | stop () noexcept |
| Stops the timer. | |
| unsigned long | count () const noexcept |
| Returns the current count (in milliseconds) | |
| virtual void | setTimingSource (TimerManager &timingSource) noexcept |
| Sets the timing source. | |
Public Member Functions inherited from Cpl::System::CounterCallback_ | |
| virtual | ~CounterCallback_ () |
| Virtual Destructor. | |
Static Public Attributes | |
| static constexpr const char * | DEFAULT_NAME = "temperature" |
| The default MApp Name. | |
| static constexpr const char * | USAGE |
| Usage string (recommended that lines do not exceed 80 chars) 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890. | |
| static constexpr const char * | DESCRIPTION = "Periodically Samples temperature and displays sample/metric values." |
| Description string (recommended that lines do not exceed 80 chars) 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890. | |
Protected Member Functions | |
| void | intialize_ () noexcept |
| See Cpl::MApp::Api. | |
| bool | start_ (char *args) noexcept |
| See Cpl::MApp::Api. | |
| void | stop_ () noexcept |
| See Cpl::MApp::Api. | |
| void | shutdown_ () noexcept |
| See Cpl::MApp::Api. | |
| bool | parse (char *args) noexcept |
| Helper method to parse the 'command line' options. | |
| void | expired (void) noexcept |
| Timer expired callback. | |
Protected Member Functions inherited from Cpl::MApp::MApp_ | |
| MApp_ (Cpl::Container::SList< MAppApi > &mappList, const char *mappName, const char *description, const char *usage) | |
| Constructor. | |
Protected Member Functions inherited from Cpl::Container::Item | |
| Item () | |
| Constructor. | |
| Item (const char *) | |
| Constructor used ONLY with the child class MapItem: -->special constructor to allow a Map to be statically allocated. | |
Protected Member Functions inherited from Cpl::System::Timer | |
| void | decrement (unsigned long milliseconds=1) noexcept |
| See Cpl::System::CounterCallback_. | |
| void | increment (unsigned long milliseconds) noexcept |
| See Cpl::System::CounterCallback_. | |
Protected Member Functions inherited from Cpl::Container::ExtendedItem | |
| ExtendedItem () | |
| Constructor. | |
| ExtendedItem (const char *ignoreThisParameter_usedToCreateAUniqueConstructor) | |
| Constructor used ONLY with the child class MapItem: -->special constructor to allow a Map to be statically allocated. | |
Protected Attributes | |
| Cpl::Dm::Mp::Float & | m_temperature |
| Temperature Input. Assumed units is Celsius. | |
| float | m_maxTemp |
| Maximum Temp. sampled. | |
| float | m_minTemp |
| Minimum Temp. sampled. | |
| float | m_sumTemp |
| Cumulative sum Temp. | |
| uint32_t | m_numSamples |
| Number of samples. | |
| uint32_t | m_sampleMs |
| Sample time in msecs. | |
| uint32_t | m_displayMs |
| Display time in msecs. | |
| uint32_t | m_timeMarkerMs |
| Time marker of last display action. | |
| bool | m_fahrenheit |
| When true the values are displayed in Fahrenheit. | |
| bool | m_invalidData |
| Flag that tracks when I have invalid data. | |
Protected Attributes inherited from Cpl::MApp::MApp_ | |
| const char * | m_name |
| Command name. | |
| const char * | m_description |
| Description. | |
| const char * | m_usage |
| Usage. | |
| bool | m_started |
| Started state. | |
Protected Attributes inherited from Cpl::System::Timer | |
| TimerManager * | m_timingSource |
| The timer's tick source. | |
| unsigned long | m_count |
| Current count. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Cpl::Container::Item | |
| static void | remove_ (Item *itemPtr) noexcept |
| Helper method to do the proper 'clean-up' for the multiple-containers-error-trap when removing an item from a container. | |
Public Attributes inherited from Cpl::Container::Item | |
| void * | m_nextPtr_ |
| The link field. | |
| void * | m_inListPtr_ |
| Debug field. | |
Public Attributes inherited from Cpl::Container::ExtendedItem | |
| void * | m_prevPtr_ |
| The previous link field. | |
| Cpl::MApp::Temperature::Api::Api | ( | Cpl::Container::SList< MAppApi > & | mappList, |
| Cpl::Dm::MailboxServer & | myMbox, | ||
| Cpl::Dm::Mp::Float & | srcTemperatureMp, | ||
| const char * | name = DEFAULT_NAME ) |
Constructor. Note: The myMbox argument is only needed because the class uses a SW timer.
|
protectedvirtualnoexcept |
Timer expired callback.
Implements Cpl::System::CounterCallback_.
|
protectedvirtualnoexcept |
See Cpl::MApp::Api.
Implements Cpl::MApp::MAppApi.
|
protectednoexcept |
Helper method to parse the 'command line' options.
|
protectedvirtualnoexcept |
See Cpl::MApp::Api.
Implements Cpl::MApp::MAppApi.
|
protectedvirtualnoexcept |
See Cpl::MApp::Api.
Implements Cpl::MApp::MAppApi.
|
protectedvirtualnoexcept |
See Cpl::MApp::Api.
Implements Cpl::MApp::MAppApi.
|
staticconstexpr |
The default MApp Name.
|
staticconstexpr |
Description string (recommended that lines do not exceed 80 chars) 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890.
|
protected |
Display time in msecs.
|
protected |
When true the values are displayed in Fahrenheit.
|
protected |
Flag that tracks when I have invalid data.
|
protected |
Maximum Temp. sampled.
|
protected |
Minimum Temp. sampled.
|
protected |
Number of samples.
|
protected |
Sample time in msecs.
|
protected |
Cumulative sum Temp.
|
protected |
Temperature Input. Assumed units is Celsius.
|
protected |
Time marker of last display action.
|
staticconstexpr |
Usage string (recommended that lines do not exceed 80 chars) 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890.