Version: 8.3.0
YACS::HMI::CommandSetDSPortProperties Class Reference

#include <commandsProc.hxx>

Inheritance diagram for YACS::HMI::CommandSetDSPortProperties:
Collaboration diagram for YACS::HMI::CommandSetDSPortProperties:

Public Member Functions

 CommandSetDSPortProperties (std::string node, std::string port, bool isInport, 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 _nodeName
 
std::string _portName
 
bool _isInport
 
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 606 of file commandsProc.hxx.

Constructor & Destructor Documentation

CommandSetDSPortProperties::CommandSetDSPortProperties ( std::string  node,
std::string  port,
bool  isInport,
std::map< std::string, std::string >  properties 
)

Definition at line 3435 of file commandsProc.cxx.

References _oldProp, and DEBTRACE.

3437  : Command(), _nodeName(node), _portName(port), _isInport(isInport), _properties(properties)
3438 {
3439  DEBTRACE("CommandSetDSPortProperties::CommandSetDSPortProperties " << node << "." << port << " " << isInport);
3440  _oldProp.clear();
3441 }

Member Function Documentation

std::string CommandSetDSPortProperties::dump ( )
protectedvirtual

Reimplemented from YACS::HMI::Command.

Definition at line 3443 of file commandsProc.cxx.

References _isInport, _nodeName, _portName, and PMMLBasicsTestLauncher::ret.

3444 {
3445  string s = "false";
3446  if (_isInport) s = "true";
3447  string ret ="CommandSetDSPortProperties " + _nodeName + " " + _portName + " " + s;
3448  return ret;
3449 }
bool CommandSetDSPortProperties::localExecute ( )
protectedvirtual

Implements YACS::HMI::Command.

Definition at line 3451 of file commandsProc.cxx.

References _isInport, _nodeName, _oldProp, _portName, _properties, 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(), and YACS::Exception::what().

3452 {
3453  DEBTRACE("CommandSetDSPortProperties::localExecute");
3454  try
3455  {
3456  Proc* proc = GuiContext::getCurrent()->getProc();
3457  Node* node = proc->getChildByName(_nodeName);
3458  DataStreamPort* DSPort = 0;
3459  if (_isInport)
3460  DSPort = node->getInputDataStreamPort(_portName);
3461  else
3462  DSPort = node->getOutputDataStreamPort(_portName);
3463  _oldProp = DSPort->getProperties();
3464  DSPort->setProperties(_properties);
3465  return true;
3466  }
3467  catch (Exception& ex)
3468  {
3469  DEBTRACE("CommandSetDSPortProperties::localExecute() : " << ex.what());
3470  setErrorMsg(ex);
3471  return false;
3472  }
3473 }
bool CommandSetDSPortProperties::localReverse ( )
protectedvirtual

Implements YACS::HMI::Command.

Definition at line 3475 of file commandsProc.cxx.

References _isInport, _nodeName, _oldProp, _portName, 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(), and YACS::Exception::what().

3476 {
3477  DEBTRACE("CommandSetDSPortProperties::localReverse");
3478  try
3479  {
3480  Proc* proc = GuiContext::getCurrent()->getProc();
3481  Node* node = proc->getChildByName(_nodeName);
3482  DataStreamPort* DSPort = 0;
3483  if (_isInport)
3484  DSPort = node->getInputDataStreamPort(_portName);
3485  else
3486  DSPort = node->getOutputDataStreamPort(_portName);
3487  DSPort->setProperties(_oldProp);
3488  return true;
3489  }
3490  catch (Exception& ex)
3491  {
3492  DEBTRACE("CommandSetDSPortProperties::localReverse() : " << ex.what());
3493  setErrorMsg(ex);
3494  return false;
3495  }
3496 }

Member Data Documentation

bool YACS::HMI::CommandSetDSPortProperties::_isInport
protected

Definition at line 617 of file commandsProc.hxx.

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

std::string YACS::HMI::CommandSetDSPortProperties::_nodeName
protected

Definition at line 615 of file commandsProc.hxx.

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

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

Definition at line 619 of file commandsProc.hxx.

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

std::string YACS::HMI::CommandSetDSPortProperties::_portName
protected

Definition at line 616 of file commandsProc.hxx.

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

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

Definition at line 618 of file commandsProc.hxx.

Referenced by localExecute().


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