|
Lydia - Printhead
|
The Component class represents a generic component. More...
#include <Component.h>
Public Member Functions | |
| void | clearFlag (byte flag) |
| Clears a specific flag for the component. | |
| Component () | |
| Default constructor for the Component class. | |
| Component (String _name) | |
| Constructor for the Component class with a specified name. | |
| Component (String _name, short _id) | |
| Constructor for the Component class with a specified name and ID. | |
| Component (String _name, short _id, int _flags) | |
| Constructor for the Component class with a specified name, ID, and flags. | |
| Component (String _name, short _id, int _flags, Component *_owner) | |
| Constructor for the Component class with a specified name, ID, flags, and owner. | |
| virtual short | debug () |
| Virtual function to debug the component. | |
| virtual short | debug (short val0, short val1) |
| Virtual function to debug the component. | |
| virtual short | destroy () |
| Virtual function to destroy the component. | |
| void | disable () |
| Disables the component. | |
| void | enable () |
| Enables the component. | |
| bool | enabled () |
| Checks if the component is enabled. | |
| bool | hasFlag (byte flag) |
| Checks if the component has a specific flag. | |
| virtual short | info () |
| Virtual function to display information about the component. | |
| virtual short | info (short val0, short val1) |
| Virtual function to display information about the component. | |
| virtual short | loop () |
| Virtual function to run the component in a loop. | |
| virtual short | onError (short id, short error) |
| virtual short | onMessage (int id, E_CALLS verb, E_MessageFlags flags, const void *user, Component *src) |
| Handles incoming messages. | |
| virtual short | onRawResponse (short size, uint8_t rxBuffer[]) |
| virtual short | onRegisterMethods (Bridge *bridge) |
| virtual short | onResponse (short error) |
| void | setFlag (byte flag) |
| Sets a specific flag for the component. | |
| virtual short | setup () |
| Virtual function to set up the component. | |
| ~Component () | |
| Destructor for the Component class. | |
Public Member Functions inherited from ModbusGateway | |
| short | getAddress () |
| MB_FC | getFunctionCode () |
| short | getNumberAddresses () |
| virtual String | getRegisterDescription (short flags=0) |
| const char * | getRegisterMode () |
| ModbusGateway () | |
| ModbusGateway (short _addr) | |
| ModbusGateway (short _addr, short _fc) | |
| void | setAddress (short _addr) |
| void | setFunctionCode (MB_FC fc) |
| void | setGateway (Mudbus *mudbus) |
| void | setNumberAddresses (short _nbAddr) |
| void | setRegisterMode (MB_REGISTER_MODE mode) |
Public Attributes | |
| int | flags |
| The run flags for the component. | |
| const short | id |
| The ID of the component. | |
| millis_t | last |
| The last tick time in milliseconds. | |
| String | name |
| The name of the component. | |
| int | nFlags |
| The network capabilities of the component. | |
| millis_t | now |
| The current time in milliseconds. | |
| Component * | owner |
| The owner of the component. | |
Public Attributes inherited from ModbusGateway | |
| short | addr |
| MB_FC | fn |
| uchar | lastMQSlot |
| Mudbus * | mudbus |
| short | nbAddr |
| short | registerMode |
Static Public Attributes | |
| static const int | COMPONENT_DEFAULT = 1 << OBJECT_RUN_FLAGS::E_OF_LOOP | 1 << OBJECT_RUN_FLAGS::E_OF_SETUP |
| The default run flags for a component. | |
| static const int | COMPONENT_NO_ID = 0 |
| The default ID for a component. | |
The Component class represents a generic component.
Definition at line 20 of file Component.h.
|
inline |
Default constructor for the Component class.
Definition at line 36 of file Component.h.
|
inline |
Constructor for the Component class with a specified name.
| _name | The name of the component. |
Definition at line 44 of file Component.h.
Constructor for the Component class with a specified name, ID, and flags.
| _name | The name of the component. |
| _id | The ID of the component. |
| _flags | The run flags for the component. |
Definition at line 64 of file Component.h.
Constructor for the Component class with a specified name, ID, flags, and owner.
| _name | The name of the component. |
| _id | The ID of the component. |
| _flags | The run flags for the component. |
| _owner | The owner of the component. |
Definition at line 78 of file Component.h.
|
inline |
Clears a specific flag for the component.
| flag | The flag to clear. |
Definition at line 158 of file Component.h.
Virtual function to debug the component.
| stream | The stream to output the debug information to. |
Reimplemented in Pos3Analog, MotorLoad, POT, Relay, StatusLight, StepperController, ModbusBridge, OmronPID, OmronVFD, H7TC, PID, App, Bridge, and SerialMessage.
Definition at line 100 of file Component.h.
Virtual function to debug the component.
| stream | The stream to output the debug information to. |
Definition at line 107 of file Component.h.
Virtual function to destroy the component.
Definition at line 93 of file Component.h.
|
inline |
Disables the component.
Definition at line 174 of file Component.h.
|
inline |
Enables the component.
Definition at line 166 of file Component.h.
|
inline |
Checks if the component is enabled.
Definition at line 183 of file Component.h.
Checks if the component has a specific flag.
| flag | The flag to check. |
Definition at line 140 of file Component.h.
Virtual function to display information about the component.
| stream | The stream to output the information to. |
Reimplemented in MotorLoad, StatusLight, StepperController, ModbusBridge, OmronPID, OmronVFD, H7TC, and App.
Definition at line 114 of file Component.h.
Virtual function to display information about the component.
| stream | The stream to output the information to. |
Reimplemented in Pos3Analog, POT, and Relay.
Definition at line 121 of file Component.h.
Virtual function to run the component in a loop.
Reimplemented in Pos3Analog, MotorLoad, POT, Relay, StatusLight, StepperController, ModbusBridge, OmronPID, OmronVFD, PHApp, H7TC, TC, App, and SerialMessage.
Definition at line 133 of file Component.h.
|
inlinevirtual |
Handles incoming messages.
This function is called when a message is received by the component. It processes the message and returns a short value indicating the status of the operation.
| id | The ID of the message. |
| verb | The type of operation to be performed. |
| flags | The flags associated with the message. |
| user | A pointer to user-defined data. |
| src | The source component that sent the message. |
Reimplemented in Bridge.
Definition at line 241 of file Component.h.
Registers methods for the component with the specified bridge. This method should be overridden by derived classes to provide custom method registration logic.
| bridge | The bridge to register methods with. |
Reimplemented in Pos3Analog, POT, Relay, StatusLight, StepperController, OmronPID, OmronVFD, and PHApp.
Definition at line 4 of file Component.cpp.
Sets a specific flag for the component.
| flag | The flag to set. |
Definition at line 149 of file Component.h.
Virtual function to set up the component.
Reimplemented in Pos3Analog, MotorLoad, POT, Relay, StatusLight, StepperController, ModbusBridge, OmronPID, OmronVFD, PHApp, H7TC, TC, App, Bridge, and SerialMessage.
Definition at line 127 of file Component.h.
|
static |
The default run flags for a component.
Definition at line 26 of file Component.h.
The default ID for a component.
Definition at line 31 of file Component.h.
| int Component::flags |
The run flags for the component.
Definition at line 201 of file Component.h.
The ID of the component.
Definition at line 196 of file Component.h.
| millis_t Component::last |
The last tick time in milliseconds.
Definition at line 221 of file Component.h.
| String Component::name |
The name of the component.
Definition at line 191 of file Component.h.
| int Component::nFlags |
The network capabilities of the component.
Definition at line 206 of file Component.h.
| millis_t Component::now |
The current time in milliseconds.
Definition at line 216 of file Component.h.
| Component* Component::owner |
The owner of the component.
Definition at line 211 of file Component.h.