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

#include <PmsManager.hpp>

Collaboration diagram for iv::model::pms::PmsManager:
[legend]

Classes

struct  DefaultValues
 
struct  Keys
 
struct  RunningModeTransition
 
struct  Sections
 

Public Member Functions

 PmsManager ()=default
 
 ~PmsManager ()=default
 
void update (const PmsManager &other)
 
bool load (std::string_view pathPms)
 
bool save (std::string_view pathPms, const std::optional< std::shared_ptr< std::vector< std::shared_ptr< iv::file::xml::File > > > > &savingFilesOut=std::nullopt) const
 
bool insertMainBar (const std::shared_ptr< MainBar > &mainBar)
 
bool insertBusTie (const std::shared_ptr< BusTie > &busTie)
 
bool insertGenerator (const std::shared_ptr< Generator > &generator)
 
bool insertMode (const std::shared_ptr< Mode > &mode)
 
bool insertTransition (const std::shared_ptr< Transition > &transition)
 
bool insertAction (const iv::types::pms::modeId &sourceModeId, const iv::types::pms::modeId &modeToReachId, const std::shared_ptr< AbstractPmsAction > &action)
 
std::optional< iv::types::pms::elementIdcreateMainBar (const std::string &name)
 
std::optional< iv::types::pms::elementIdcreateBusTie (const std::string &name, iv::types::unitId lomId, iv::types::pms::elementId leftMainBarId, iv::types::pms::elementId rightMainBarId)
 
std::optional< iv::types::pms::elementIdcreateGenerator (const std::string &name, iv::types::unitId lomId, iv::model::pms::eGeneratorType type, iv::types::pms::elementId mainBarId, uint32_t ratedPower)
 
std::optional< iv::types::pms::modeIdcreateMode (const std::string &modeId, iv::types::milliseconds feedbackTimeout)
 
bool createTransition (const iv::model::pms::Transition &newTransition)
 
bool createAction (const iv::types::pms::modeId &sourceModeId, const iv::types::pms::modeId &modeToReachId, const std::shared_ptr< iv::model::pms::AbstractPmsAction > &newAction)
 
bool changeMainBarId (iv::types::pms::elementId oldMainBarId, iv::types::pms::elementId newMainBarId)
 
bool changeBusTieId (iv::types::pms::elementId oldBusTieId, iv::types::pms::elementId newBusTieId)
 
bool changeGeneratorId (iv::types::pms::elementId oldGeneratorId, iv::types::pms::elementId newGeneratorId)
 
bool changeModeId (const iv::types::pms::modeId &oldModeId, const iv::types::pms::modeId &newModeId)
 
bool changeTransitionModeToReachId (const iv::types::pms::modeId &sourceModeId, const iv::types::pms::modeId &oldModeToReachId, const iv::types::pms::modeId &newModeToReachId)
 
bool replaceAction (const iv::types::pms::modeId &sourceModeId, const iv::types::pms::modeId &modeToReachId, uint64_t actionIndex, const std::shared_ptr< iv::model::pms::AbstractPmsAction > &newAction)
 Replaces an action in a transition.
 
bool updateBusTieLeftMainBar (iv::types::pms::elementId busTieId, iv::types::pms::elementId newLeftMainBarId)
 
bool updateBusTieRightMainBar (iv::types::pms::elementId busTieId, iv::types::pms::elementId newRightMainBarId)
 
bool updateGeneratorMainBar (iv::types::pms::elementId generatorId, iv::types::pms::elementId newMainBarId)
 
bool updateGeneratorLomId (iv::types::pms::elementId generatorId, iv::types::unitId newLomId)
 
bool eraseMainBar (iv::types::pms::elementId mainBarId)
 Deletes a main bar, propagating its elimination to the bus ties and generators.
 
bool eraseBusTie (iv::types::pms::elementId busTieId)
 
bool eraseGenerator (iv::types::pms::elementId generatorId)
 
bool eraseMode (const iv::types::pms::modeId &modeId)
 
bool eraseTransition (const iv::types::pms::modeId &sourceModeId, const iv::types::pms::modeId &modeToReachId)
 
bool eraseAction (const iv::types::pms::modeId &sourceModeId, const iv::types::pms::modeId &modeToReachId, uint64_t actionIndex)
 
const std::map< iv::types::pms::elementId, std::shared_ptr< iv::model::pms::MainBar > > & mainBars ()
 
const std::map< iv::types::pms::elementId, std::shared_ptr< iv::model::pms::BusTie > > & busTies ()
 
const std::map< iv::types::pms::elementId, std::shared_ptr< iv::model::pms::Generator > > & generators ()
 
const std::map< iv::types::pms::modeId, std::shared_ptr< iv::model::pms::Mode > > & modes ()
 
std::set< iv::types::pms::elementIdgetBarsIds () const
 
bool moveUpAction (const iv::types::pms::modeId &sourceModeId, const iv::types::pms::modeId &modeToReachId, uint64_t actionIndex)
 
bool moveDownAction (const iv::types::pms::modeId &sourceModeId, const iv::types::pms::modeId &modeToReachId, uint64_t actionIndex)
 
void manageErasedUnit (const iv::types::unitId &unitId)
 
std::weak_ptr< iv::model::pms::ModegetActivePmsMode () const
 Obtiene el modo de PMS activo en este momento.
 
void setAndSendChannelTransitionFailureToAlarmValue () const
 Set the channel transition failure to alarm value and sends expeditiously the channel by redundancy.
 
void setAndSendChannelTransitionFailureToNormalValue () const
 Set the channel transition failure to normal value and sends expeditiously the channel by redundancy.
 
void sendModeTransitionInfo (bool isRunning, const iv::types::pms::modeId &modeToReachId, const iv::mimics::elements::eOperationModeState &newModeState)
 Send the mode transition information through redundancy.
 

Static Public Member Functions

static void setOperationModesMimicElementsState (const iv::types::pms::modeId &modeToReachId, const iv::mimics::elements::eOperationModeState &newModeState)
 Runs through all Operation Modes Mimic Elements matching the given modeId and sets their state.
 

Public Attributes

RunningModeTransition m_runningModeTransition
 
std::weak_ptr< iv::channels::AbstractChannelm_channelTransitionFailureAlarm
 

Static Private Member Functions

static void unlinkGeneratorChannels (const std::shared_ptr< iv::model::pms::Generator > &generator)
 
static bool channelsPmsToGenerator (const std::shared_ptr< iv::model::pms::Generator > &generator)
 

Private Attributes

std::map< iv::types::pms::elementId, std::shared_ptr< iv::model::pms::MainBar > > m_mainBars
 
std::map< iv::types::pms::elementId, std::shared_ptr< iv::model::pms::BusTie > > m_busTies
 
std::map< iv::types::pms::elementId, std::shared_ptr< iv::model::pms::Generator > > m_generators
 
std::map< iv::types::pms::modeId, std::shared_ptr< iv::model::pms::Mode > > m_modes
 

Constructor & Destructor Documentation

◆ PmsManager()

iv::model::pms::PmsManager::PmsManager ( )
default

◆ ~PmsManager()

iv::model::pms::PmsManager::~PmsManager ( )
default

Member Function Documentation

◆ busTies()

const std::map< iv::types::pms::elementId, std::shared_ptr< iv::model::pms::BusTie > > & iv::model::pms::PmsManager::busTies ( )

◆ changeBusTieId()

bool iv::model::pms::PmsManager::changeBusTieId ( iv::types::pms::elementId oldBusTieId,
iv::types::pms::elementId newBusTieId )

◆ changeGeneratorId()

bool iv::model::pms::PmsManager::changeGeneratorId ( iv::types::pms::elementId oldGeneratorId,
iv::types::pms::elementId newGeneratorId )

◆ changeMainBarId()

bool iv::model::pms::PmsManager::changeMainBarId ( iv::types::pms::elementId oldMainBarId,
iv::types::pms::elementId newMainBarId )

◆ changeModeId()

bool iv::model::pms::PmsManager::changeModeId ( const iv::types::pms::modeId & oldModeId,
const iv::types::pms::modeId & newModeId )

◆ changeTransitionModeToReachId()

bool iv::model::pms::PmsManager::changeTransitionModeToReachId ( const iv::types::pms::modeId & sourceModeId,
const iv::types::pms::modeId & oldModeToReachId,
const iv::types::pms::modeId & newModeToReachId )

◆ channelsPmsToGenerator()

bool iv::model::pms::PmsManager::channelsPmsToGenerator ( const std::shared_ptr< iv::model::pms::Generator > & generator)
staticprivate

◆ createAction()

bool iv::model::pms::PmsManager::createAction ( const iv::types::pms::modeId & sourceModeId,
const iv::types::pms::modeId & modeToReachId,
const std::shared_ptr< iv::model::pms::AbstractPmsAction > & newAction )

◆ createBusTie()

std::optional< iv::types::pms::elementId > iv::model::pms::PmsManager::createBusTie ( const std::string & name,
iv::types::unitId lomId,
iv::types::pms::elementId leftMainBarId,
iv::types::pms::elementId rightMainBarId )

◆ createGenerator()

std::optional< iv::types::pms::elementId > iv::model::pms::PmsManager::createGenerator ( const std::string & name,
iv::types::unitId lomId,
iv::model::pms::eGeneratorType type,
iv::types::pms::elementId mainBarId,
uint32_t ratedPower )

◆ createMainBar()

std::optional< iv::types::pms::elementId > iv::model::pms::PmsManager::createMainBar ( const std::string & name)

◆ createMode()

std::optional< iv::types::pms::modeId > iv::model::pms::PmsManager::createMode ( const std::string & modeId,
iv::types::milliseconds feedbackTimeout )

◆ createTransition()

bool iv::model::pms::PmsManager::createTransition ( const iv::model::pms::Transition & newTransition)

◆ eraseAction()

bool iv::model::pms::PmsManager::eraseAction ( const iv::types::pms::modeId & sourceModeId,
const iv::types::pms::modeId & modeToReachId,
uint64_t actionIndex )

◆ eraseBusTie()

bool iv::model::pms::PmsManager::eraseBusTie ( iv::types::pms::elementId busTieId)

◆ eraseGenerator()

bool iv::model::pms::PmsManager::eraseGenerator ( iv::types::pms::elementId generatorId)

◆ eraseMainBar()

bool iv::model::pms::PmsManager::eraseMainBar ( iv::types::pms::elementId mainBarId)

Deletes a main bar, propagating its elimination to the bus ties and generators.

Parameters
mainBarIdMain bar id to be deleted
Returns
True if the main bar was deleted, false otherwise

◆ eraseMode()

bool iv::model::pms::PmsManager::eraseMode ( const iv::types::pms::modeId & modeId)

◆ eraseTransition()

bool iv::model::pms::PmsManager::eraseTransition ( const iv::types::pms::modeId & sourceModeId,
const iv::types::pms::modeId & modeToReachId )

◆ generators()

const std::map< iv::types::pms::elementId, std::shared_ptr< iv::model::pms::Generator > > & iv::model::pms::PmsManager::generators ( )

◆ getActivePmsMode()

std::weak_ptr< iv::model::pms::Mode > iv::model::pms::PmsManager::getActivePmsMode ( ) const
nodiscard

Obtiene el modo de PMS activo en este momento.

Returns
Modo activo si lo hay, weak pointer vacío si no.
Note
Si más de un modo está activo, devuelve el primero encontrado.

◆ getBarsIds()

std::set< iv::types::pms::elementId > iv::model::pms::PmsManager::getBarsIds ( ) const
nodiscard

◆ insertAction()

bool iv::model::pms::PmsManager::insertAction ( const iv::types::pms::modeId & sourceModeId,
const iv::types::pms::modeId & modeToReachId,
const std::shared_ptr< AbstractPmsAction > & action )

◆ insertBusTie()

bool iv::model::pms::PmsManager::insertBusTie ( const std::shared_ptr< BusTie > & busTie)

◆ insertGenerator()

bool iv::model::pms::PmsManager::insertGenerator ( const std::shared_ptr< Generator > & generator)

◆ insertMainBar()

bool iv::model::pms::PmsManager::insertMainBar ( const std::shared_ptr< MainBar > & mainBar)

◆ insertMode()

bool iv::model::pms::PmsManager::insertMode ( const std::shared_ptr< Mode > & mode)

◆ insertTransition()

bool iv::model::pms::PmsManager::insertTransition ( const std::shared_ptr< Transition > & transition)

◆ load()

bool iv::model::pms::PmsManager::load ( std::string_view pathPms)

◆ mainBars()

const std::map< iv::types::pms::elementId, std::shared_ptr< iv::model::pms::MainBar > > & iv::model::pms::PmsManager::mainBars ( )

◆ manageErasedUnit()

void iv::model::pms::PmsManager::manageErasedUnit ( const iv::types::unitId & unitId)

◆ modes()

const std::map< iv::types::pms::modeId, std::shared_ptr< iv::model::pms::Mode > > & iv::model::pms::PmsManager::modes ( )

◆ moveDownAction()

bool iv::model::pms::PmsManager::moveDownAction ( const iv::types::pms::modeId & sourceModeId,
const iv::types::pms::modeId & modeToReachId,
uint64_t actionIndex )

◆ moveUpAction()

bool iv::model::pms::PmsManager::moveUpAction ( const iv::types::pms::modeId & sourceModeId,
const iv::types::pms::modeId & modeToReachId,
uint64_t actionIndex )

◆ replaceAction()

bool iv::model::pms::PmsManager::replaceAction ( const iv::types::pms::modeId & sourceModeId,
const iv::types::pms::modeId & modeToReachId,
uint64_t actionIndex,
const std::shared_ptr< iv::model::pms::AbstractPmsAction > & newAction )

Replaces an action in a transition.

Parameters
sourceModeIdSource mode id
modeToReachIdMode to reach id
actionIndexIndex of the action to be replaced
newActionNew action to replace the old one
Returns
True if the action was replaced, false otherwise
Note
En esta operación, tener en cuenta que a diferencia del resto de operaciones de actualización de datos que se realizan en el manager, en este caso no se está manteniendo el puntero del objeto a cambiar, sino que se extrae y entra otro en su posición.

◆ save()

bool iv::model::pms::PmsManager::save ( std::string_view pathPms,
const std::optional< std::shared_ptr< std::vector< std::shared_ptr< iv::file::xml::File > > > > & savingFilesOut = std::nullopt ) const

◆ sendModeTransitionInfo()

void iv::model::pms::PmsManager::sendModeTransitionInfo ( bool isRunning,
const iv::types::pms::modeId & modeToReachId,
const iv::mimics::elements::eOperationModeState & newModeState )

Send the mode transition information through redundancy.

Note
The information is sent when the transition starts, ends or is cancelled

◆ setAndSendChannelTransitionFailureToAlarmValue()

void iv::model::pms::PmsManager::setAndSendChannelTransitionFailureToAlarmValue ( ) const

Set the channel transition failure to alarm value and sends expeditiously the channel by redundancy.

Note
Works only if the station is the one setting the mode

◆ setAndSendChannelTransitionFailureToNormalValue()

void iv::model::pms::PmsManager::setAndSendChannelTransitionFailureToNormalValue ( ) const

Set the channel transition failure to normal value and sends expeditiously the channel by redundancy.

Note
Works only if the station is the one setting the mode

◆ setOperationModesMimicElementsState()

void iv::model::pms::PmsManager::setOperationModesMimicElementsState ( const iv::types::pms::modeId & modeToReachId,
const iv::mimics::elements::eOperationModeState & newModeState )
static

Runs through all Operation Modes Mimic Elements matching the given modeId and sets their state.

Parameters
modeToReachIdMode Id which state will be set
newModeStateMode state to set

◆ unlinkGeneratorChannels()

void iv::model::pms::PmsManager::unlinkGeneratorChannels ( const std::shared_ptr< iv::model::pms::Generator > & generator)
staticprivate

◆ update()

void iv::model::pms::PmsManager::update ( const PmsManager & other)

◆ updateBusTieLeftMainBar()

bool iv::model::pms::PmsManager::updateBusTieLeftMainBar ( iv::types::pms::elementId busTieId,
iv::types::pms::elementId newLeftMainBarId )

◆ updateBusTieRightMainBar()

bool iv::model::pms::PmsManager::updateBusTieRightMainBar ( iv::types::pms::elementId busTieId,
iv::types::pms::elementId newRightMainBarId )

◆ updateGeneratorLomId()

bool iv::model::pms::PmsManager::updateGeneratorLomId ( iv::types::pms::elementId generatorId,
iv::types::unitId newLomId )

◆ updateGeneratorMainBar()

bool iv::model::pms::PmsManager::updateGeneratorMainBar ( iv::types::pms::elementId generatorId,
iv::types::pms::elementId newMainBarId )

Member Data Documentation

◆ m_busTies

std::map<iv::types::pms::elementId, std::shared_ptr<iv::model::pms::BusTie> > iv::model::pms::PmsManager::m_busTies
private

◆ m_channelTransitionFailureAlarm

std::weak_ptr<iv::channels::AbstractChannel> iv::model::pms::PmsManager::m_channelTransitionFailureAlarm

◆ m_generators

std::map<iv::types::pms::elementId, std::shared_ptr<iv::model::pms::Generator> > iv::model::pms::PmsManager::m_generators
private

◆ m_mainBars

std::map<iv::types::pms::elementId, std::shared_ptr<iv::model::pms::MainBar> > iv::model::pms::PmsManager::m_mainBars
private

◆ m_modes

std::map<iv::types::pms::modeId, std::shared_ptr<iv::model::pms::Mode> > iv::model::pms::PmsManager::m_modes
private

◆ m_runningModeTransition

RunningModeTransition iv::model::pms::PmsManager::m_runningModeTransition

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