pub struct DynamicSetpoint { /* private fields */ }Expand description
A Dynamic profile whose one period a controller moves with updates (Q04, K28).
Built with a fallback: when no update arrives within it, the station drops the profile and falls back to the next valid one (K28.FR.13). There is no way to build one without.
Implementations§
Source§impl DynamicSetpoint
impl DynamicSetpoint
Sourcepub fn new(
id: i32,
target: Target,
unit: RateUnit,
operation: Operation,
fallback_after: Duration,
) -> Result<Self, V2xError>
pub fn new( id: i32, target: Target, unit: RateUnit, operation: Operation, fallback_after: Duration, ) -> Result<Self, V2xError>
A dynamic profile id for target, starting with operation, falling back when not
updated for fallback_after. Stack level 0; see stack_level.
§Errors
V2xError::BadDuration for a fallback under a second or above i32::MAX seconds.
Sourcepub const fn stack_level(self, stack_level: i32) -> Self
pub const fn stack_level(self, stack_level: i32) -> Self
Sets the stack level — above a plan’s, so the dynamic profile leads while it lives.
Sourcepub fn pull_every(self, interval: Duration) -> Result<Self, V2xError>
pub fn pull_every(self, interval: Duration) -> Result<Self, V2xError>
Lets the station pull updates (PullDynamicScheduleUpdateRequest) every interval
(dynUpdateInterval, K28.FR.10); answer with pull_response.
§Errors
Sourcepub fn to_request(
&self,
station: &V2xStation,
) -> Result<SetChargingProfileRequest, V2xError>
pub fn to_request( &self, station: &V2xStation, ) -> Result<SetChargingProfileRequest, V2xError>
The SetChargingProfileRequest installing it: Dynamic, one schedule, one period at 0
(K28.FR.01/02), duration = the fallback.
§Errors
Sourcepub fn update(
&mut self,
next: Operation,
) -> Result<UpdateDynamicScheduleRequest, V2xError>
pub fn update( &mut self, next: Operation, ) -> Result<UpdateDynamicScheduleRequest, V2xError>
Replaces the operation, keeping its mode, and returns the update to send (K28.FR.06).
§Errors
V2xError::ModeChanged: an update carries no operationMode, so changing the mode
needs a new profile.
Sourcepub fn update_setpoint(
&mut self,
setpoint: Setpoint,
) -> Result<UpdateDynamicScheduleRequest, V2xError>
pub fn update_setpoint( &mut self, setpoint: Setpoint, ) -> Result<UpdateDynamicScheduleRequest, V2xError>
Moves the setpoint within the current limits and returns the update to send.
§Errors
V2xError::SetpointOutsideLimits, or V2xError::NotInMode unless CentralSetpoint.
Sourcepub fn pull_response(&self) -> PullDynamicScheduleUpdateResponse
pub fn pull_response(&self) -> PullDynamicScheduleUpdateResponse
The answer to the station’s PullDynamicScheduleUpdateRequest (K28.FR.07): the operation
currently in force.