Skip to main content

DynamicSetpoint

Struct DynamicSetpoint 

Source
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

Source

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.

Source

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.

Source

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

V2xError::BadDuration.

Source

pub const fn operation(&self) -> &Operation

The operation currently in force.

Source

pub const fn id(&self) -> i32

The profile id updates are addressed to.

Source

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

As V2xPlan::to_request.

Source

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.

Source

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.

Source

pub fn pull_response(&self) -> PullDynamicScheduleUpdateResponse

The answer to the station’s PullDynamicScheduleUpdateRequest (K28.FR.07): the operation currently in force.

Trait Implementations§

Source§

impl Clone for DynamicSetpoint

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DynamicSetpoint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for DynamicSetpoint

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DynamicSetpoint

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.