You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should support tracking compile-time component configuration in FPP. For example, we should be able to define a watchdog component with a "expiration delay" setting, and then being able to configure that setting when instantiating the component in a topology.
We can currently use tricks like phase Fpp.ToCpp.Phases.configComponents, but they are verbose and are not type checked.
@bocchino suggested this syntax for defining the component (comments mine):
# To define the component
active component Watchdog(expirationDelayMs: U32)
# To instantiate the component
instance watchdog: Watchdog(5000)
I like the suggested syntax, but there are two things I want to consider:
Since there are some components that may have LOTS of compile-time configuration settings, I think it might be better to have the configured arguments named at the point of use.
Sometimes there are components that need configuration settings that are related to specific connected components, and this syntax doesn't allow for locality.
Consider the following more versatile syntax, for the sake of argument:
# To define the component
active component Dispatcher {
input setting cycle_duration_ms: U32
output port start_execution: [MAX_CLIENTS] Svc.Sched
input setting execution_time_ms: [MAX_CLIENTS] U32
}
# When wiring up the component in the topology
dispatcher.cycle_duration_ms = 1000
dispatcher.execution_time_ms[0] = 100
dispatcher.start_execution[0] -> activity1.start
dispatcher.execution_time_ms[1] = 400
dispatcher.start_execution[1] -> activity1.stop
dispatcher.execution_time_ms[2] = 300
dispatcher.start_execution[2] -> activity2.start
dispatcher.execution_time_ms[3] = 700
dispatcher.start_execution[3] -> activity2.stop
This example would be for a system that needs to run "activity1" from the 100th millisecond to the 400th millisecond of each second, and that needs to run "activity2" from the 300th millisecond to the 700th millisecond of each second.
The text was updated successfully, but these errors were encountered:
I agree that names are helpful at the point of instantiation, especially when there are many configuration parameters. One way to get the naming is to use an FPP struct type and value, e.g.,
We should support tracking compile-time component configuration in FPP. For example, we should be able to define a watchdog component with a "expiration delay" setting, and then being able to configure that setting when instantiating the component in a topology.
We can currently use tricks like
phase Fpp.ToCpp.Phases.configComponents
, but they are verbose and are not type checked.@bocchino suggested this syntax for defining the component (comments mine):
I like the suggested syntax, but there are two things I want to consider:
Consider the following more versatile syntax, for the sake of argument:
This example would be for a system that needs to run "activity1" from the 100th millisecond to the 400th millisecond of each second, and that needs to run "activity2" from the 300th millisecond to the 700th millisecond of each second.
The text was updated successfully, but these errors were encountered: