pub struct Site {
pub id: SiteId,
pub label: String,
pub location: GeoPoint,
pub grid: GridConnection,
pub circuits: Circuits,
pub assets: Vec<Asset>,
}Expand description
One installation.
Fields§
§id: SiteIdFleet-unique identity.
label: StringA human label.
location: GeoPointWhere it is.
grid: GridConnectionThe grid connection.
circuits: CircuitsThe electrical tree.
assets: Vec<Asset>Everything behind the connection.
Implementations§
Source§impl Site
impl Site
Sourcepub fn new(
id: SiteId,
location: GeoPoint,
grid: GridConnection,
circuits: Circuits,
assets: Vec<Asset>,
) -> Result<Self, SiteError>
pub fn new( id: SiteId, location: GeoPoint, grid: GridConnection, circuits: Circuits, assets: Vec<Asset>, ) -> Result<Self, SiteError>
Sourcepub fn grid_meters(&self) -> impl Iterator<Item = &Asset>
pub fn grid_meters(&self) -> impl Iterator<Item = &Asset>
The assets that are meters of the grid connection point.
Sourcepub fn balance_residual(
grid: Power,
assets: impl IntoIterator<Item = Power>,
) -> Power
pub fn balance_residual( grid: Power, assets: impl IntoIterator<Item = Power>, ) -> Power
How far the measured grid power is from the sum of the measured assets.
With the load convention of crate::units, the site balance is
grid == Σ assetsso a residual that is not near zero means a meter is missing, mis-signed
or stale. hems-realtime watches it, and a large residual makes the
arbiter fall back to conservative assumptions rather than optimise
against a fiction.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Site
impl<'de> Deserialize<'de> for Site
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Site
Auto Trait Implementations§
impl Freeze for Site
impl RefUnwindSafe for Site
impl Send for Site
impl Sync for Site
impl Unpin for Site
impl UnsafeUnpin for Site
impl UnwindSafe for Site
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more