-
Notifications
You must be signed in to change notification settings - Fork 14
Description
What's needed?
We currently have two component state enums:
ComponentStatus: This enum depicts the state of our interaction with a component (e.g., whether we can read from or write to it).ComponentStateCode: This enum represents the actual state of the component as derived from the component directly.
The current naming can potentially lead to confusion between ComponentStatus and ComponentStateCode. They could be mistaken for referring to the same entity. Furthermore, ComponentStatus lacks specificity, as it seems to indicate the component's overall status rather than focusing on the aspect of interaction.
We need to address the naming issue to improve readability.
Proposed solution
Proposal 1
We can rename the `ComponentStatus` enum to something more appropriate.
One proposal is ComponentAccessLevel. This correctly depicts the purpose of this entity.
Proposal 2
We flip the concept, and do the following:
Active mode
As soon as a component moves to this mode, we try to start it up. Note that this cannot be guaranteed to succeed, since a component could refuse to start up, e.g., due to the component's internal configuration.
In this mode, clients are allowed to read data from the component, and send commands to it. Sending commands to a component in this mode can be prevented by setting its respective bounds to (0,0), which would make the component read-only.
Disabled mode
As soon as a component moves to this mode, we try to stop it. Again, this cannot be guaranteed to succeed due the same reasons mentioned above.
In this mode, clients do not receive any data from the component, and cannot send any control commands to it.
In this concept, RequestedComponentMode may be a better name.
Proposal 3
This extends Proposal 2, with an intermediate mode for switching the component off while still getting data from it.
Active mode
As soon as a component moves to this mode, we try to start it up. Note that this cannot be guaranteed to succeed, since a component could refuse to start up, e.g., due to the component's internal configuration.
In this mode, clients are allowed to read data from the component, and send commands to it. Sending commands to a component in this mode can be prevented by setting its respective bounds to (0,0), which would make the component read-only.
Off mode
As soon as a component moves to this mode, we try to stop it. Again, this cannot be guaranteed to succeed due the same reasons mentioned above.
In this mode, clients keep receiving data from the component, but cannot send any control commands to it. This mode allows users to receive a feedback that their action to move the component to mode Off has worked or not.
Inaccessible mode
As soon as a component moves to this mode, we assume that the component is not available on the network, and we do not attempt to read from it.
In this mode, clients do not receive any data from the component, and cannot send any control commands to it.
Proposal 4
Enabled mode
As soon as a component moves to this mode, we try to start it up. (Note that this cannot be guaranteed to succeed, since a component could refuse to start up, e.g., due to the component's internal configuration.)
In this mode, clients are allowed to read data from the component, and send commands to it. Sending commands to a component in this mode can be prevented by setting its respective bounds to (0,0), which would make the component read-only.
Disabled mode
As soon as a component moves to this mode, we try to stop it. (Again, this cannot be guaranteed to succeed due the same reasons mentioned above.)
In this mode,
- we will try to disconnect the component from the microgrid, by opening its relays.
- we will prevent applications from sending control commands to the component.
- we will keep getting data from this component.
Use cases
- switch a component on - e.g., closing its AC/DC relays
- switch a component off - e.g., opening its AC/DC relays. Note that depending upon the component model, it may still be able to stay online and allow us to read from it.
run maintenance activities on components - e.g., battery calibration, firmware updates.- add a placeholder component to the component graph, to indicate its existence in case we cannot reach it over the network due to hardware-installation-related challenges.
Alternatives and workarounds
No response
Additional context
No response