Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
iv::model::control::ValveManager Class Reference

#include <ValveManager.hpp>

Classes

struct  Constants
 
struct  Sections
 

Public Member Functions

 ValveManager ()=default
 
 ~ValveManager ()=default
 
void update (const ValveManager &other)
 
bool load (const iv::file::xml::node &nodeValves)
 
bool save (iv::file::xml::node &nodeValves) const
 
bool insertValve (const std::shared_ptr< iv::model::control::Valve > &valve)
 
bool createValve (valve::eValveSystem valveSystem, iv::types::control::valve::valveOrder valveOrder, iv::model::control::valve::eValveType valveType, iv::types::unitId lomId, const iv::model::control::valve::AllValveChannels &allValveChannels)
 
bool changeValveSystemAndOrder (const iv::types::control::valve::valveId &oldValveId, iv::model::control::valve::eValveSystem newValveSystem, iv::types::control::valve::valveOrder newValveOrder)
 
bool removeValve (const types::control::valve::valveId &valveId, bool resetWiredChannels, bool removeSoftwareChannels)
 
void getValveValidDefaultParameters (iv::model::control::valve::eValveSystem &defaultValveSystem, iv::types::control::valve::valveOrder &defaultValveOrder, valve::eValveType &defaultValveType, iv::types::unitId &defaultLomId)
 Gets a valid combination of default parameters for a valve.
 
std::map< iv::types::control::valve::valveId, std::shared_ptr< iv::model::control::Valve > > & valves ()
 

Static Public Member Functions

static std::set< iv::types::unitIdgetAvailableLomIds (iv::model::control::valve::eValveType valveType)
 Get the LOM IDs of the LOMs capable of managing a valve of a given type.
 
static std::optional< std::shared_ptr< iv::channels::AbstractChannel > > getTheNAvailableValveFeedbackChannel (iv::types::unitId lomId, uint16_t n)
 Get the Nth available valve feedback channel for a given LOM ID.
 
static std::optional< std::shared_ptr< iv::channels::AbstractChannel > > getTheNAvailableValveOrderChannel (iv::types::unitId lomId, uint16_t n)
 Get the Nth available valve order channel for a given LOM ID.
 
static iv::model::control::valve::eLomAvailability getLomAvailability (const std::shared_ptr< iv::units::Unit > &unit, iv::model::control::valve::eValveType valveType)
 Get the availability of LOMs for a given valve type.
 

Static Private Member Functions

static bool isDefaultChannel (const std::shared_ptr< iv::channels::AbstractChannel > &channel)
 Check if the channel is a default channel from the point of view of Valves.
 
static uint16_t getNumAvailableDigitalOutputChannels (const std::shared_ptr< iv::units::Unit > &unit)
 Get the number of available digital output channels for a given unit.
 
static std::list< iv::types::channelOrdergetNumAvailableCmdChannelOrders (const std::shared_ptr< iv::units::Unit > &unit)
 Get the available command channel orders for a given unit.
 
static std::list< iv::types::channelOrdergetNumAvailableTripChannelOrders (const std::shared_ptr< iv::units::Unit > &unit)
 Get the available trip channel orders for a given unit.
 
static bool linkAndConfigureValveChannels (const std::shared_ptr< iv::model::control::Valve > &valve)
 Link and configure the channels of a valve.
 
static void reconfigureValveChannels (const std::shared_ptr< iv::model::control::Valve > &valve)
 
static void resetValveWiredChannels (const std::shared_ptr< iv::model::control::Valve > &valve)
 Reset the wired channels of a valve.
 
static void removeValveSoftwareChannels (const std::shared_ptr< iv::model::control::Valve > &valve)
 Remove the software channels of a valve.
 
static bool configureChFeedbackOP (const std::shared_ptr< iv::channels::AbstractChannel > &channel, iv::types::control::valve::valveId valveId)
 
static bool configureChFeedbackCL (const std::shared_ptr< iv::channels::AbstractChannel > &channel, iv::types::control::valve::valveId valveId)
 
static bool configureChOutputOP (const std::shared_ptr< iv::channels::AbstractChannel > &channel, iv::types::control::valve::valveId valveId)
 
static bool configureChOutputCL (const std::shared_ptr< iv::channels::AbstractChannel > &channel, iv::types::control::valve::valveId valveId)
 
static bool configureChCmdOP (const std::shared_ptr< iv::channels::AbstractChannel > &channel, const iv::types::control::valve::valveId &valveId, iv::types::channelOrder channelOrder, iv::types::unitId unitId, bool isConfiguringFromController)
 
static bool configureChCmdCL (const std::shared_ptr< iv::channels::AbstractChannel > &channel, const iv::types::control::valve::valveId &valveId, iv::types::channelOrder channelOrder, iv::types::unitId unitId, bool isConfiguringFromController)
 
static bool configureChCmdReset (const std::shared_ptr< iv::channels::AbstractChannel > &channel, const iv::types::control::valve::valveId &valveId, iv::types::channelOrder channelOrder, iv::types::unitId unitId, bool isConfiguringFromController)
 
static bool configureChTrip (const std::shared_ptr< iv::channels::AbstractChannel > &channel, const iv::types::control::valve::valveId &valveId, iv::types::channelOrder channelOrder, iv::types::unitId unitId, bool isConfiguringFromController)
 

Private Attributes

std::map< iv::types::control::valve::valveId, std::shared_ptr< iv::model::control::Valve > > m_valves
 

Constructor & Destructor Documentation

◆ ValveManager()

iv::model::control::ValveManager::ValveManager ( )
default

◆ ~ValveManager()

iv::model::control::ValveManager::~ValveManager ( )
default

Member Function Documentation

◆ changeValveSystemAndOrder()

bool iv::model::control::ValveManager::changeValveSystemAndOrder ( const iv::types::control::valve::valveId & oldValveId,
iv::model::control::valve::eValveSystem newValveSystem,
iv::types::control::valve::valveOrder newValveOrder )

◆ configureChCmdCL()

bool iv::model::control::ValveManager::configureChCmdCL ( const std::shared_ptr< iv::channels::AbstractChannel > & channel,
const iv::types::control::valve::valveId & valveId,
iv::types::channelOrder channelOrder,
iv::types::unitId unitId,
bool isConfiguringFromController )
staticprivate

◆ configureChCmdOP()

bool iv::model::control::ValveManager::configureChCmdOP ( const std::shared_ptr< iv::channels::AbstractChannel > & channel,
const iv::types::control::valve::valveId & valveId,
iv::types::channelOrder channelOrder,
iv::types::unitId unitId,
bool isConfiguringFromController )
staticprivate

◆ configureChCmdReset()

bool iv::model::control::ValveManager::configureChCmdReset ( const std::shared_ptr< iv::channels::AbstractChannel > & channel,
const iv::types::control::valve::valveId & valveId,
iv::types::channelOrder channelOrder,
iv::types::unitId unitId,
bool isConfiguringFromController )
staticprivate

◆ configureChFeedbackCL()

bool iv::model::control::ValveManager::configureChFeedbackCL ( const std::shared_ptr< iv::channels::AbstractChannel > & channel,
iv::types::control::valve::valveId valveId )
staticprivate

◆ configureChFeedbackOP()

bool iv::model::control::ValveManager::configureChFeedbackOP ( const std::shared_ptr< iv::channels::AbstractChannel > & channel,
iv::types::control::valve::valveId valveId )
staticprivate

◆ configureChOutputCL()

bool iv::model::control::ValveManager::configureChOutputCL ( const std::shared_ptr< iv::channels::AbstractChannel > & channel,
iv::types::control::valve::valveId valveId )
staticprivate

◆ configureChOutputOP()

bool iv::model::control::ValveManager::configureChOutputOP ( const std::shared_ptr< iv::channels::AbstractChannel > & channel,
iv::types::control::valve::valveId valveId )
staticprivate

◆ configureChTrip()

bool iv::model::control::ValveManager::configureChTrip ( const std::shared_ptr< iv::channels::AbstractChannel > & channel,
const iv::types::control::valve::valveId & valveId,
iv::types::channelOrder channelOrder,
iv::types::unitId unitId,
bool isConfiguringFromController )
staticprivate

◆ createValve()

bool iv::model::control::ValveManager::createValve ( valve::eValveSystem valveSystem,
iv::types::control::valve::valveOrder valveOrder,
iv::model::control::valve::eValveType valveType,
iv::types::unitId lomId,
const iv::model::control::valve::AllValveChannels & allValveChannels )

◆ getAvailableLomIds()

std::set< iv::types::unitId > iv::model::control::ValveManager::getAvailableLomIds ( iv::model::control::valve::eValveType valveType)
staticnodiscard

Get the LOM IDs of the LOMs capable of managing a valve of a given type.

Parameters
valveTypeThe valve type to check.
Returns
A set of available LOM IDs.

◆ getLomAvailability()

iv::model::control::valve::eLomAvailability iv::model::control::ValveManager::getLomAvailability ( const std::shared_ptr< iv::units::Unit > & unit,
iv::model::control::valve::eValveType valveType )
staticnodiscard

Get the availability of LOMs for a given valve type.

Parameters
unitThe unit to check.
valveTypeThe valve type to check.
Returns
The availability of the LOM for the given valve type.

◆ getNumAvailableCmdChannelOrders()

std::list< iv::types::channelOrder > iv::model::control::ValveManager::getNumAvailableCmdChannelOrders ( const std::shared_ptr< iv::units::Unit > & unit)
staticprivate

Get the available command channel orders for a given unit.

Parameters
unitThe unit to check.
Returns
A list of available command channel orders.
Note
The list is ordered from the lowest to the highest channel order.

◆ getNumAvailableDigitalOutputChannels()

uint16_t iv::model::control::ValveManager::getNumAvailableDigitalOutputChannels ( const std::shared_ptr< iv::units::Unit > & unit)
staticnodiscardprivate

Get the number of available digital output channels for a given unit.

Parameters
unitThe unit to check.
Returns
The number of available digital output channels.

◆ getNumAvailableTripChannelOrders()

std::list< iv::types::channelOrder > iv::model::control::ValveManager::getNumAvailableTripChannelOrders ( const std::shared_ptr< iv::units::Unit > & unit)
staticprivate

Get the available trip channel orders for a given unit.

Parameters
unitThe unit to check.
Returns
A list of available trip channel orders.
Note
The list is ordered from the lowest to the highest channel order.

◆ getTheNAvailableValveFeedbackChannel()

std::optional< std::shared_ptr< iv::channels::AbstractChannel > > iv::model::control::ValveManager::getTheNAvailableValveFeedbackChannel ( iv::types::unitId lomId,
uint16_t n )
staticnodiscard

Get the Nth available valve feedback channel for a given LOM ID.

Parameters
lomIdThe LOM ID to check.
nThe index of the channel to retrieve (1-based).
Returns
The Nth available valve feedback channel, or std::nullopt if not found.

◆ getTheNAvailableValveOrderChannel()

std::optional< std::shared_ptr< iv::channels::AbstractChannel > > iv::model::control::ValveManager::getTheNAvailableValveOrderChannel ( iv::types::unitId lomId,
uint16_t n )
staticnodiscard

Get the Nth available valve order channel for a given LOM ID.

Parameters
lomIdThe LOM ID to check.
nThe index of the channel to retrieve (1-based).
Returns
The Nth available valve order channel, or std::nullopt if not found.

◆ getValveValidDefaultParameters()

void iv::model::control::ValveManager::getValveValidDefaultParameters ( iv::model::control::valve::eValveSystem & defaultValveSystem,
iv::types::control::valve::valveOrder & defaultValveOrder,
valve::eValveType & defaultValveType,
iv::types::unitId & defaultLomId )

Gets a valid combination of default parameters for a valve.

Parameters
defaultValveSystemThe default valve system.
defaultValveOrderThe default valve order.
defaultValveTypeThe default valve type.
defaultLomIdThe default LOM ID.

◆ insertValve()

bool iv::model::control::ValveManager::insertValve ( const std::shared_ptr< iv::model::control::Valve > & valve)

◆ isDefaultChannel()

bool iv::model::control::ValveManager::isDefaultChannel ( const std::shared_ptr< iv::channels::AbstractChannel > & channel)
staticnodiscardprivate

Check if the channel is a default channel from the point of view of Valves.

Parameters
channelThe channel to check.
Returns
True if the channel is a default channel, false otherwise.

◆ linkAndConfigureValveChannels()

bool iv::model::control::ValveManager::linkAndConfigureValveChannels ( const std::shared_ptr< iv::model::control::Valve > & valve)
staticnodiscardprivate

Link and configure the channels of a valve.

Parameters
valveThe valve to link and configure.
Returns
True if the channels were successfully linked and configured, false otherwise.
Note
The wired channels are configured in this function.
The software channels are created, linked, and configured in this function.

◆ load()

bool iv::model::control::ValveManager::load ( const iv::file::xml::node & nodeValves)

◆ reconfigureValveChannels()

void iv::model::control::ValveManager::reconfigureValveChannels ( const std::shared_ptr< iv::model::control::Valve > & valve)
staticprivate

◆ removeValve()

bool iv::model::control::ValveManager::removeValve ( const types::control::valve::valveId & valveId,
bool resetWiredChannels,
bool removeSoftwareChannels )

◆ removeValveSoftwareChannels()

void iv::model::control::ValveManager::removeValveSoftwareChannels ( const std::shared_ptr< iv::model::control::Valve > & valve)
staticprivate

Remove the software channels of a valve.

Parameters
valveThe valve to remove the software channels from.
Note
The channel may not be wired. In this case, the channel won't be removed.

◆ resetValveWiredChannels()

void iv::model::control::ValveManager::resetValveWiredChannels ( const std::shared_ptr< iv::model::control::Valve > & valve)
staticprivate

Reset the wired channels of a valve.

Parameters
valveThe valve to reset.
Note
The channel may not be wired. Will be reset anyway.

◆ save()

bool iv::model::control::ValveManager::save ( iv::file::xml::node & nodeValves) const

◆ update()

void iv::model::control::ValveManager::update ( const ValveManager & other)

◆ valves()

std::map< iv::types::control::valve::valveId, std::shared_ptr< iv::model::control::Valve > > & iv::model::control::ValveManager::valves ( )
nodiscard

Member Data Documentation

◆ m_valves

std::map<iv::types::control::valve::valveId, std::shared_ptr<iv::model::control::Valve> > iv::model::control::ValveManager::m_valves
private

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