Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
iv::units::Units Class Reference

#include <Units.hpp>

Inheritance diagram for iv::units::Units:
[legend]
Collaboration diagram for iv::units::Units:
[legend]

Classes

struct  DefaultValues
 
struct  Keys
 
struct  Sections
 

Public Member Functions

bool load (const iv::file::xml::node &nodeDataProject, std::string_view unitsFolderPath)
 
bool save (iv::file::xml::node &nodeDataProject, std::string_view unitsFolderPath, const std::optional< std::shared_ptr< std::vector< std::shared_ptr< iv::file::xml::File > > > > &savingFilesOut=std::nullopt) const
 
void update (Units &other)
 
bool hasChannels () const
 
bool hasRmsUnit () const
 
bool hasHeartbeatUnit () const
 
bool hasCommFailUnit () const
 
std::weak_ptr< UnitrmsUnit ()
 
std::weak_ptr< UnitheartbeatUnit () const
 
std::weak_ptr< UnitcommFailureUnit () const
 
std::weak_ptr< UnitgetUnit (iv::types::unitId unitId) const
 
std::weak_ptr< UnitgetUnitAt (uint32_t index)
 
std::optional< uint32_t > getUnitIndex (iv::types::unitId unitId) const
 
std::vector< std::shared_ptr< iv::units::Unit > > getUnitsFromIds (const std::set< iv::types::unitId > &unitIds) const
 
std::set< iv::types::unitIdunitsReadyForSetSpare () const
 
std::vector< std::weak_ptr< iv::channels::AbstractChannel > > getAllChannelsOrdered ()
 
std::map< iv::types::channelId, std::shared_ptr< iv::channels::AbstractChannel > > getAllChannels ()
 
void initializeChannels (const std::shared_ptr< AbstractProgress > &progress)
 
std::weak_ptr< iv::channels::AbstractChannelgetChannel (const iv::types::channelId &channelId)
 
std::weak_ptr< iv::channels::AbstractChannelgetChannelByShipyardTag (const std::string &channelTag)
 
bool existsChannel (const iv::types::channelId &channelId)
 
bool addUnit (const std::shared_ptr< iv::units::Unit > &unit, bool createHeartbeatAndFailChannels=true)
 
bool deleteUnit (iv::types::unitId unitId)
 
bool changeUnitId (const iv::types::unitId &unitId, const iv::types::unitId &newUnitId)
 
bool swapUnitsId (const iv::types::unitId &firstUnitId, const iv::types::unitId &secondUnitId)
 
std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > getActiveChannelsByGroupId (const iv::types::groupId &groupId, bool refreshCache=false)
 Get all channels that belong to a group.
 
void disableGroups (const std::unordered_set< iv::types::groupId > &groups)
 
std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > getAllChannelsInverted () const
 
std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > getAllChannelsOffScan () const
 
std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > getAllChannelsInhibited () const
 
iv::types::unitId getFirstFreeUnitId (std::optional< iv::units::eUnitType > unitType=std::nullopt) const
 
std::set< iv::types::unitIdgetLOMsOnline (bool isNotInProjectUnit=false) const
 
std::set< iv::types::unitIdgetLOMsOffline (bool isNotInProjectUnit=false) const
 
std::vector< iv::units::UnitIdAndNamegetAllUnitsIdAndNameOnline () const
 
std::set< iv::types::unitIdgetIdsAllOnUnits () const
 
uint32_t getNumberOfChannels ()
 
void rearrangeCommHeartbeatAndFailureChannel () const
 
void rearrangeStationHeartbeatAndFailureChannel () const
 
void rearrangeWatchcallNodeHeartbeatAndFailureChannel () const
 
void createCommHeartbeatAndFailureChannel (const iv::types::networkId &commId) const
 Creates the Network's Heartbeat and Failure channels in their corresponding units.
 
void createAllSystemChannels ()
 
void createStationHeartbeatAndFailureChannel (const iv::types::stationId &stationId) const
 
void createWatchcallNodeHearbeatAndFailureChannel (const iv::types::repeaterId &repeaterId) const
 

Static Public Member Functions

static std::shared_ptr< iv::channels::AbstractChannelgenerateLomHeartBeatChannel (iv::types::unitId unitId, iv::types::channelOrder channelOrder)
 
static std::shared_ptr< iv::channels::AbstractChannelgenerateCanAFailChannel (iv::types::unitId unitId, iv::types::channelOrder channelOrder)
 
static std::shared_ptr< iv::channels::AbstractChannelgenerateCanBFailChannel (iv::types::unitId unitId, iv::types::channelOrder channelOrder)
 
static std::shared_ptr< iv::channels::AbstractChannelgenerateCanCFailChannel (iv::types::unitId unitId, iv::types::channelOrder channelOrder)
 
static std::shared_ptr< iv::channels::AbstractChannelgenerateLomOfflineChannel (iv::types::unitId unitId, iv::types::channelOrder channelOrder)
 
static std::shared_ptr< iv::channels::AbstractChannelgenerateNetworkHeartbeatChannel (iv::types::networkId networkId, iv::types::channelOrder channelOrder)
 
static std::shared_ptr< iv::channels::AbstractChannelgenerateNetworkFailChannel (iv::types::networkId networkId, iv::types::channelOrder channelOrder)
 
static std::shared_ptr< iv::channels::AbstractChannelgenerateStationHeartbeatChannel (const iv::types::stationId &stationId, iv::types::channelOrder channelOrder)
 
static std::shared_ptr< iv::channels::AbstractChannelgenerateStationFailChannel (const iv::types::stationId &stationId, iv::types::channelOrder channelOrder)
 
static std::shared_ptr< iv::channels::AbstractChannelgenerateWatchcallNodeHeartbeatChannel (const iv::types::repeaterId &repeaterId, iv::types::channelOrder channelOrder)
 
static std::shared_ptr< iv::channels::AbstractChannelgenerateWatchcallNodeFailChannel (const iv::types::repeaterId &repeaterId, iv::types::channelOrder channelOrder)
 

Private Member Functions

bool loadUnit (iv::types::unitId unitId, std::string_view unitsFolderPath)
 
void createUnitHeartbeatAndFailureChannels (iv::types::unitId newUnitId) const
 
std::vector< std::shared_ptr< iv::channels::AbstractChannel > > extractUnitHeartbeatAndFailureChannels (iv::types::unitId unitId) const
 

Member Function Documentation

◆ addUnit()

bool iv::units::Units::addUnit ( const std::shared_ptr< iv::units::Unit > & unit,
bool createHeartbeatAndFailChannels = true )

◆ changeUnitId()

bool iv::units::Units::changeUnitId ( const iv::types::unitId & unitId,
const iv::types::unitId & newUnitId )

◆ commFailureUnit()

std::weak_ptr< Unit > iv::units::Units::commFailureUnit ( ) const
nodiscard

◆ createAllSystemChannels()

void iv::units::Units::createAllSystemChannels ( )

◆ createCommHeartbeatAndFailureChannel()

void iv::units::Units::createCommHeartbeatAndFailureChannel ( const iv::types::networkId & commId) const

Creates the Network's Heartbeat and Failure channels in their corresponding units.

Note
This must be called after creating and inserting the NetworkData in the Stations.
Parameters
commIdNetwork ID to which create the channels

◆ createStationHeartbeatAndFailureChannel()

void iv::units::Units::createStationHeartbeatAndFailureChannel ( const iv::types::stationId & stationId) const

◆ createUnitHeartbeatAndFailureChannels()

void iv::units::Units::createUnitHeartbeatAndFailureChannels ( iv::types::unitId newUnitId) const
private

◆ createWatchcallNodeHearbeatAndFailureChannel()

void iv::units::Units::createWatchcallNodeHearbeatAndFailureChannel ( const iv::types::repeaterId & repeaterId) const

◆ deleteUnit()

bool iv::units::Units::deleteUnit ( iv::types::unitId unitId)

◆ disableGroups()

void iv::units::Units::disableGroups ( const std::unordered_set< iv::types::groupId > & groups)

◆ existsChannel()

bool iv::units::Units::existsChannel ( const iv::types::channelId & channelId)
nodiscard

◆ extractUnitHeartbeatAndFailureChannels()

std::vector< std::shared_ptr< iv::channels::AbstractChannel > > iv::units::Units::extractUnitHeartbeatAndFailureChannels ( iv::types::unitId unitId) const
nodiscardprivate

◆ generateCanAFailChannel()

std::shared_ptr< iv::channels::AbstractChannel > iv::units::Units::generateCanAFailChannel ( iv::types::unitId unitId,
iv::types::channelOrder channelOrder )
static

◆ generateCanBFailChannel()

std::shared_ptr< iv::channels::AbstractChannel > iv::units::Units::generateCanBFailChannel ( iv::types::unitId unitId,
iv::types::channelOrder channelOrder )
static

◆ generateCanCFailChannel()

std::shared_ptr< iv::channels::AbstractChannel > iv::units::Units::generateCanCFailChannel ( iv::types::unitId unitId,
iv::types::channelOrder channelOrder )
static

◆ generateLomHeartBeatChannel()

std::shared_ptr< iv::channels::AbstractChannel > iv::units::Units::generateLomHeartBeatChannel ( iv::types::unitId unitId,
iv::types::channelOrder channelOrder )
static

◆ generateLomOfflineChannel()

std::shared_ptr< iv::channels::AbstractChannel > iv::units::Units::generateLomOfflineChannel ( iv::types::unitId unitId,
iv::types::channelOrder channelOrder )
static

◆ generateNetworkFailChannel()

std::shared_ptr< iv::channels::AbstractChannel > iv::units::Units::generateNetworkFailChannel ( iv::types::networkId networkId,
iv::types::channelOrder channelOrder )
static

◆ generateNetworkHeartbeatChannel()

std::shared_ptr< iv::channels::AbstractChannel > iv::units::Units::generateNetworkHeartbeatChannel ( iv::types::networkId networkId,
iv::types::channelOrder channelOrder )
static

◆ generateStationFailChannel()

std::shared_ptr< iv::channels::AbstractChannel > iv::units::Units::generateStationFailChannel ( const iv::types::stationId & stationId,
iv::types::channelOrder channelOrder )
static

◆ generateStationHeartbeatChannel()

std::shared_ptr< iv::channels::AbstractChannel > iv::units::Units::generateStationHeartbeatChannel ( const iv::types::stationId & stationId,
iv::types::channelOrder channelOrder )
static

◆ generateWatchcallNodeFailChannel()

std::shared_ptr< iv::channels::AbstractChannel > iv::units::Units::generateWatchcallNodeFailChannel ( const iv::types::repeaterId & repeaterId,
iv::types::channelOrder channelOrder )
static

◆ generateWatchcallNodeHeartbeatChannel()

std::shared_ptr< iv::channels::AbstractChannel > iv::units::Units::generateWatchcallNodeHeartbeatChannel ( const iv::types::repeaterId & repeaterId,
iv::types::channelOrder channelOrder )
static

◆ getActiveChannelsByGroupId()

std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > iv::units::Units::getActiveChannelsByGroupId ( const iv::types::groupId & groupId,
bool refreshCache = false )

Get all channels that belong to a group.

Parameters
groupIdID of the group
refreshCacheIf true, the channels are collected again even if they are already cached.
Returns
vector of weak pointers to the channels, ordered by channel description

◆ getAllChannels()

std::map< iv::types::channelId, std::shared_ptr< iv::channels::AbstractChannel > > iv::units::Units::getAllChannels ( )

◆ getAllChannelsInhibited()

std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > iv::units::Units::getAllChannelsInhibited ( ) const
nodiscard

◆ getAllChannelsInverted()

std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > iv::units::Units::getAllChannelsInverted ( ) const
nodiscard

◆ getAllChannelsOffScan()

std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > iv::units::Units::getAllChannelsOffScan ( ) const
nodiscard

◆ getAllChannelsOrdered()

std::vector< std::weak_ptr< iv::channels::AbstractChannel > > iv::units::Units::getAllChannelsOrdered ( )

◆ getAllUnitsIdAndNameOnline()

std::vector< iv::units::UnitIdAndName > iv::units::Units::getAllUnitsIdAndNameOnline ( ) const
nodiscard

◆ getChannel()

std::weak_ptr< iv::channels::AbstractChannel > iv::units::Units::getChannel ( const iv::types::channelId & channelId)

◆ getChannelByShipyardTag()

std::weak_ptr< iv::channels::AbstractChannel > iv::units::Units::getChannelByShipyardTag ( const std::string & channelTag)

◆ getFirstFreeUnitId()

iv::types::unitId iv::units::Units::getFirstFreeUnitId ( std::optional< iv::units::eUnitType > unitType = std::nullopt) const
nodiscard

◆ getIdsAllOnUnits()

std::set< iv::types::unitId > iv::units::Units::getIdsAllOnUnits ( ) const
nodiscard

◆ getLOMsOffline()

std::set< iv::types::unitId > iv::units::Units::getLOMsOffline ( bool isNotInProjectUnit = false) const
nodiscard

◆ getLOMsOnline()

std::set< iv::types::unitId > iv::units::Units::getLOMsOnline ( bool isNotInProjectUnit = false) const
nodiscard

◆ getNumberOfChannels()

uint32_t iv::units::Units::getNumberOfChannels ( )

◆ getUnit()

std::weak_ptr< Unit > iv::units::Units::getUnit ( iv::types::unitId unitId) const
nodiscard

◆ getUnitAt()

std::weak_ptr< Unit > iv::units::Units::getUnitAt ( uint32_t index)
nodiscard

◆ getUnitIndex()

std::optional< uint32_t > iv::units::Units::getUnitIndex ( iv::types::unitId unitId) const
nodiscard

◆ getUnitsFromIds()

std::vector< std::shared_ptr< iv::units::Unit > > iv::units::Units::getUnitsFromIds ( const std::set< iv::types::unitId > & unitIds) const
nodiscard

◆ hasChannels()

bool iv::units::Units::hasChannels ( ) const
nodiscard

◆ hasCommFailUnit()

bool iv::units::Units::hasCommFailUnit ( ) const
nodiscard

◆ hasHeartbeatUnit()

bool iv::units::Units::hasHeartbeatUnit ( ) const
nodiscard

◆ hasRmsUnit()

bool iv::units::Units::hasRmsUnit ( ) const
nodiscard

◆ heartbeatUnit()

std::weak_ptr< Unit > iv::units::Units::heartbeatUnit ( ) const
nodiscard

◆ initializeChannels()

void iv::units::Units::initializeChannels ( const std::shared_ptr< AbstractProgress > & progress)

◆ load()

bool iv::units::Units::load ( const iv::file::xml::node & nodeDataProject,
std::string_view unitsFolderPath )

◆ loadUnit()

bool iv::units::Units::loadUnit ( iv::types::unitId unitId,
std::string_view unitsFolderPath )
private

◆ rearrangeCommHeartbeatAndFailureChannel()

void iv::units::Units::rearrangeCommHeartbeatAndFailureChannel ( ) const

◆ rearrangeStationHeartbeatAndFailureChannel()

void iv::units::Units::rearrangeStationHeartbeatAndFailureChannel ( ) const

◆ rearrangeWatchcallNodeHeartbeatAndFailureChannel()

void iv::units::Units::rearrangeWatchcallNodeHeartbeatAndFailureChannel ( ) const

◆ rmsUnit()

std::weak_ptr< Unit > iv::units::Units::rmsUnit ( )
nodiscard

◆ save()

bool iv::units::Units::save ( iv::file::xml::node & nodeDataProject,
std::string_view unitsFolderPath,
const std::optional< std::shared_ptr< std::vector< std::shared_ptr< iv::file::xml::File > > > > & savingFilesOut = std::nullopt ) const

◆ swapUnitsId()

bool iv::units::Units::swapUnitsId ( const iv::types::unitId & firstUnitId,
const iv::types::unitId & secondUnitId )

◆ unitsReadyForSetSpare()

std::set< iv::types::unitId > iv::units::Units::unitsReadyForSetSpare ( ) const
nodiscard

◆ update()

void iv::units::Units::update ( Units & other)

The documentation for this class was generated from the following files: