Version: 8.3.0
YACS::HMI::CommandSetLinkProperties Class Reference

#include <commandsProc.hxx>

Inheritance diagram for YACS::HMI::CommandSetLinkProperties:
Collaboration diagram for YACS::HMI::CommandSetLinkProperties:

Public Member Functions

 CommandSetLinkProperties (std::string startnode, std::string startport, std::string endnode, std::string endport, std::map< std::string, std::string > properties)
 
- Public Member Functions inherited from YACS::HMI::Command
 Command ()
 
virtual bool execute ()
 the command is executed a first time after its registration for undo redo, then on redo More...
 
virtual bool reverse (bool isNormal=true)
 Reverse action: undo. More...
 
virtual bool executeSubOnly ()
 execute only sub commands in a reverse action More...
 
std::string recursiveDump (int level=0)
 
void addSubCommand (Command *command)
 
bool isNormalReverse ()
 

Protected Member Functions

virtual bool localExecute ()
 
virtual bool localReverse ()
 
virtual std::string dump ()
 

Protected Attributes

std::string _startNodeName
 
std::string _startPortName
 
std::string _endNodeName
 
std::string _endPortName
 
std::map< std::string,
std::string > 
_properties
 
std::map< std::string,
std::string > 
_oldProp
 
- Protected Attributes inherited from YACS::HMI::Command
std::vector< Command * > _subCommands
 
bool _normalReverse
 

Detailed Description

Definition at line 622 of file commandsProc.hxx.

Constructor & Destructor Documentation

CommandSetLinkProperties::CommandSetLinkProperties ( std::string  startnode,
std::string  startport,
std::string  endnode,
std::string  endport,
std::map< std::string, std::string >  properties 
)

Definition at line 3500 of file commandsProc.cxx.

References _oldProp, and DEBTRACE.

3503  : Command(), _startNodeName(startnode), _startPortName(startport),
3504  _endNodeName(endnode), _endPortName(endport),
3505  _properties(properties)
3506 {
3507  DEBTRACE("CommandSetLinkProperties::CommandSetLinkProperties " );
3508  _oldProp.clear();
3509 }

Member Function Documentation

std::string CommandSetLinkProperties::dump ( )
protectedvirtual

Reimplemented from YACS::HMI::Command.

Definition at line 3511 of file commandsProc.cxx.

References _endNodeName, _endPortName, _startNodeName, _startPortName, and PMMLBasicsTestLauncher::ret.

3512 {
3513  string ret ="CommandSetLinkProperties " + _startNodeName + " " + _startPortName + " " + _endNodeName + " " + _endPortName;
3514  return ret;
3515 }
bool CommandSetLinkProperties::localExecute ( )
protectedvirtual

Implements YACS::HMI::Command.

Definition at line 3517 of file commandsProc.cxx.

References _endNodeName, _endPortName, YACS::HMI::GuiContext::_mapOfSubjectLink, _oldProp, _properties, _startNodeName, _startPortName, DEBTRACE, YACS::ENGINE::ComposedNode::getChildByName(), YACS::HMI::GuiContext::getCurrent(), YACS::ENGINE::Node::getInputDataStreamPort(), YACS::ENGINE::Node::getOutputDataStreamPort(), YACS::HMI::GuiContext::getProc(), YACS::ENGINE::DataStreamPort::getProperties(), setErrorMsg(), YACS::ENGINE::DataStreamPort::setProperties(), YACS::HMI::SETVALUE, and YACS::Exception::what().

3518 {
3519  DEBTRACE("CommandSetLinkProperties::localExecute");
3520  try
3521  {
3522  Proc* proc = GuiContext::getCurrent()->getProc();
3523  Node* node;
3524  InputDataStreamPort* inDSPort = 0;
3525  OutputDataStreamPort* outDSPort = 0;
3526 
3527  node = proc->getChildByName(_startNodeName);
3528  outDSPort = node->getOutputDataStreamPort(_startPortName);
3529  outDSPort->setProperties(_properties);
3530 
3531  node = proc->getChildByName(_endNodeName);
3532  inDSPort = node->getInputDataStreamPort(_endPortName);
3533  _oldProp = inDSPort->getProperties();
3534  inDSPort->setProperties(_properties);
3535 
3536  std::pair<OutPort*,InPort*> keymap = std::pair<OutPort*,InPort*>(outDSPort,inDSPort);
3538  subject->update(SETVALUE, 0, subject);
3539  return true;
3540  }
3541  catch (Exception& ex)
3542  {
3543  DEBTRACE("CommandSetDSPortProperties::localExecute() : " << ex.what());
3544  setErrorMsg(ex);
3545  return false;
3546  }
3547 }
bool CommandSetLinkProperties::localReverse ( )
protectedvirtual

Implements YACS::HMI::Command.

Definition at line 3549 of file commandsProc.cxx.

References _endNodeName, _endPortName, YACS::HMI::GuiContext::_mapOfSubjectLink, _oldProp, _properties, _startNodeName, _startPortName, DEBTRACE, YACS::ENGINE::ComposedNode::getChildByName(), YACS::HMI::GuiContext::getCurrent(), YACS::ENGINE::Node::getInputDataStreamPort(), YACS::ENGINE::Node::getOutputDataStreamPort(), YACS::HMI::GuiContext::getProc(), setErrorMsg(), YACS::ENGINE::DataStreamPort::setProperties(), YACS::HMI::SETVALUE, and YACS::Exception::what().

3550 {
3551  DEBTRACE("CommandSetLinkProperties::localReverse");
3552  try
3553  {
3554  Proc* proc = GuiContext::getCurrent()->getProc();
3555  Node* node;
3556  InputDataStreamPort* inDSPort = 0;
3557  OutputDataStreamPort* outDSPort = 0;
3558 
3559  node = proc->getChildByName(_startNodeName);
3560  outDSPort = node->getOutputDataStreamPort(_startPortName);
3561  outDSPort->setProperties(_properties);
3562 
3563  node = proc->getChildByName(_endNodeName);
3564  inDSPort = node->getInputDataStreamPort(_endPortName);
3565  inDSPort->setProperties(_oldProp);
3566 
3567  std::pair<OutPort*,InPort*> keymap = std::pair<OutPort*,InPort*>(outDSPort,inDSPort);
3569  subject->update(SETVALUE, 0, subject);
3570  return true;
3571  }
3572  catch (Exception& ex)
3573  {
3574  DEBTRACE("CommandSetDSPortProperties::localReverse() : " << ex.what());
3575  setErrorMsg(ex);
3576  return false;
3577  }
3578 }

Member Data Documentation

std::string YACS::HMI::CommandSetLinkProperties::_endNodeName
protected

Definition at line 634 of file commandsProc.hxx.

Referenced by dump(), localExecute(), and localReverse().

std::string YACS::HMI::CommandSetLinkProperties::_endPortName
protected

Definition at line 635 of file commandsProc.hxx.

Referenced by dump(), localExecute(), and localReverse().

std::map<std::string,std::string> YACS::HMI::CommandSetLinkProperties::_oldProp
protected

Definition at line 637 of file commandsProc.hxx.

Referenced by CommandSetLinkProperties(), localExecute(), and localReverse().

std::map<std::string,std::string> YACS::HMI::CommandSetLinkProperties::_properties
protected

Definition at line 636 of file commandsProc.hxx.

Referenced by localExecute(), and localReverse().

std::string YACS::HMI::CommandSetLinkProperties::_startNodeName
protected

Definition at line 632 of file commandsProc.hxx.

Referenced by dump(), localExecute(), and localReverse().

std::string YACS::HMI::CommandSetLinkProperties::_startPortName
protected

Definition at line 633 of file commandsProc.hxx.

Referenced by dump(), localExecute(), and localReverse().


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