Version: 8.3.0
YACS::HMI::CommandSetAlgo Class Reference

#include <commandsProc.hxx>

Inheritance diagram for YACS::HMI::CommandSetAlgo:
Collaboration diagram for YACS::HMI::CommandSetAlgo:

Public Member Functions

 CommandSetAlgo (std::string optimizer, std::string alglib, std::string symbol)
 
- 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 _optimizer
 
std::string _alglib
 
std::string _symbol
 
std::string _oldAlglib
 
std::string _oldSymbol
 
- Protected Attributes inherited from YACS::HMI::Command
std::vector< Command * > _subCommands
 
bool _normalReverse
 

Detailed Description

Definition at line 484 of file commandsProc.hxx.

Constructor & Destructor Documentation

CommandSetAlgo::CommandSetAlgo ( std::string  optimizer,
std::string  alglib,
std::string  symbol 
)

Definition at line 2778 of file commandsProc.cxx.

References _alglib, _oldAlglib, _oldSymbol, _optimizer, _symbol, and DEBTRACE.

2779  : Command(), _optimizer(optimizer), _alglib(alglib), _symbol(symbol)
2780 {
2781  DEBTRACE("CommandSetAlgo::CommandSetAlgo" << _optimizer << " " << _alglib << " " << _symbol);
2782  _oldAlglib = "";
2783  _oldSymbol = "";
2784 }

Member Function Documentation

std::string CommandSetAlgo::dump ( )
protectedvirtual

Reimplemented from YACS::HMI::Command.

Definition at line 2786 of file commandsProc.cxx.

References _alglib, _optimizer, _symbol, and PMMLBasicsTestLauncher::ret.

2787 {
2788  string ret ="CommandSetAlgo " + _optimizer + " " + _alglib + " " + _symbol;
2789  return ret;
2790 }
bool CommandSetAlgo::localExecute ( )
protectedvirtual

Implements YACS::HMI::Command.

Definition at line 2792 of file commandsProc.cxx.

References _alglib, YACS::HMI::GuiContext::_mapOfSubjectDataPort, YACS::HMI::GuiContext::_mapOfSubjectNode, _oldAlglib, _oldSymbol, _optimizer, _symbol, DEBTRACE, YACS::ENGINE::OptimizerLoop::edGetPortForOutPool(), YACS::ENGINE::DynParaLoop::edGetSamplePort(), YACS::ENGINE::ComposedNode::getChildByName(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getProc(), YACS::ENGINE::OptimizerLoop::setAlgorithm(), setErrorMsg(), YACS::HMI::SETVALUE, YACS::HMI::UPDATE, YACS::Exception::what(), and YASSERT.

2793 {
2794  DEBTRACE("CommandSetAlgo::localExecute");
2795  try
2796  {
2797  Proc* proc = GuiContext::getCurrent()->getProc();
2798  OptimizerLoop* loop = dynamic_cast<OptimizerLoop*>(proc->getChildByName(_optimizer));
2799  loop->setAlgorithm(_alglib,_symbol);
2800  _oldAlglib = _alglib;
2801  _oldSymbol = _symbol;
2802  InputPort *port = loop->edGetPortForOutPool();
2803  YASSERT(GuiContext::getCurrent()->_mapOfSubjectDataPort.count(static_cast<DataPort*>(port)));
2805  spo->update(UPDATE, 0, spo);
2806  OutputPort *oport = loop->edGetSamplePort();
2807  YASSERT(GuiContext::getCurrent()->_mapOfSubjectDataPort.count(static_cast<DataPort*>(oport)));
2808  spo = GuiContext::getCurrent()->_mapOfSubjectDataPort[static_cast<DataPort*>(oport)];
2809  spo->update(UPDATE, 0, spo);
2810  YASSERT(GuiContext::getCurrent()->_mapOfSubjectNode.count(loop));
2812  snode->update(SETVALUE, 0, snode);
2813  return true;
2814  }
2815  catch (Exception& ex)
2816  {
2817  DEBTRACE("CommandSetAlgo::localExecute() : " << ex.what());
2818  setErrorMsg(ex);
2819  return false;
2820  }
2821 }
bool CommandSetAlgo::localReverse ( )
protectedvirtual

Implements YACS::HMI::Command.

Definition at line 2823 of file commandsProc.cxx.

References YACS::HMI::GuiContext::_mapOfSubjectDataPort, YACS::HMI::GuiContext::_mapOfSubjectNode, _oldAlglib, _oldSymbol, _optimizer, DEBTRACE, YACS::ENGINE::OptimizerLoop::edGetPortForOutPool(), YACS::ENGINE::DynParaLoop::edGetSamplePort(), YACS::ENGINE::ComposedNode::getChildByName(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getProc(), YACS::ENGINE::OptimizerLoop::setAlgorithm(), setErrorMsg(), YACS::HMI::SETVALUE, YACS::HMI::UPDATE, YACS::Exception::what(), and YASSERT.

2824 {
2825  DEBTRACE("CommandSetAlgo::localReverse");
2826  try
2827  {
2828  Proc* proc = GuiContext::getCurrent()->getProc();
2829  OptimizerLoop* loop = dynamic_cast<OptimizerLoop*>(proc->getChildByName(_optimizer));
2831  InputPort *port = loop->edGetPortForOutPool();
2832  YASSERT(GuiContext::getCurrent()->_mapOfSubjectDataPort.count(static_cast<DataPort*>(port)));
2834  spo->update(UPDATE, 0, spo);
2835  OutputPort *oport = loop->edGetSamplePort();
2836  YASSERT(GuiContext::getCurrent()->_mapOfSubjectDataPort.count(static_cast<DataPort*>(oport)));
2837  spo = GuiContext::getCurrent()->_mapOfSubjectDataPort[static_cast<DataPort*>(oport)];
2838  spo->update(UPDATE, 0, spo);
2839  YASSERT(GuiContext::getCurrent()->_mapOfSubjectNode.count(loop));
2841  snode->update(SETVALUE, 0, snode);
2842  return true;
2843  }
2844  catch (Exception& ex)
2845  {
2846  DEBTRACE("CommandSetAlgo::localReverse() : " << ex.what());
2847  setErrorMsg(ex);
2848  return false;
2849  }
2850  return true;
2851 }

Member Data Documentation

std::string YACS::HMI::CommandSetAlgo::_alglib
protected

Definition at line 493 of file commandsProc.hxx.

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

std::string YACS::HMI::CommandSetAlgo::_oldAlglib
protected

Definition at line 495 of file commandsProc.hxx.

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

std::string YACS::HMI::CommandSetAlgo::_oldSymbol
protected

Definition at line 496 of file commandsProc.hxx.

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

std::string YACS::HMI::CommandSetAlgo::_optimizer
protected

Definition at line 492 of file commandsProc.hxx.

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

std::string YACS::HMI::CommandSetAlgo::_symbol
protected

Definition at line 494 of file commandsProc.hxx.

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


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