Version: 8.3.0
YACS::HMI::EditionForEachLoop Class Reference

#include <EditionForEachLoop.hxx>

Inheritance diagram for YACS::HMI::EditionForEachLoop:
Collaboration diagram for YACS::HMI::EditionForEachLoop:

Public Slots

virtual void onModifyCollection ()
 
virtual void onNbBranchesEdited ()
 

Public Member Functions

 EditionForEachLoop (Subject *subject, QWidget *parent=0, const char *name=0)
 
virtual ~EditionForEachLoop ()
 
virtual void synchronize ()
 
virtual void update (GuiEvent event, int type, Subject *son)
 
- Public Member Functions inherited from YACS::HMI::EditionNode
 EditionNode (Subject *subject, QWidget *parent=0, const char *name=0)
 
virtual ~EditionNode ()
 
- Public Member Functions inherited from YACS::HMI::ItemEdition
 ItemEdition (Subject *subject, QWidget *parent=0, const char *name=0)
 
virtual ~ItemEdition ()
 
virtual void select (bool isSelected)
 
virtual void setName (std::string name)
 
virtual void setEdited (bool isEdited)
 
- Public Member Functions inherited from FormEditItem
 FormEditItem (QWidget *parent=0)
 
virtual ~FormEditItem ()
 
- Public Member Functions inherited from YACS::HMI::ItemEditionBase
 ItemEditionBase (Subject *subject)
 
virtual ~ItemEditionBase ()
 
virtual SubjectgetSubject ()
 
- Public Member Functions inherited from YACS::HMI::GuiObserver
 GuiObserver ()
 
virtual ~GuiObserver ()
 
virtual void incrementSubjects (Subject *subject)
 
virtual void decrementSubjects (Subject *subject)
 
int getNbSubjects ()
 
bool isDestructible ()
 

Protected Attributes

FormEachLoop_formEachLoop
 
int _nbBranches
 
- Protected Attributes inherited from YACS::HMI::EditionNode
QLineEdit_le_fullName
 
SubjectNode_subjectNode
 
- Protected Attributes inherited from YACS::HMI::ItemEdition
bool _isEdited
 
bool _haveScript
 
- Protected Attributes inherited from FormEditItem
WidEditItem_wid
 
- Protected Attributes inherited from YACS::HMI::ItemEditionBase
Subject_subject
 
int _stackId
 
std::string _name
 
std::string _type
 
std::string _category
 
- Protected Attributes inherited from YACS::HMI::GuiObserver
std::set< Subject * > _subjectSet
 
bool _destructible
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::HMI::ItemEdition
static std::string filterName (const std::string &name)
 
- Static Protected Attributes inherited from YACS::HMI::GuiObserver
static std::map< int, std::string > _eventNameMap
 

Detailed Description

Definition at line 31 of file EditionForEachLoop.hxx.

Constructor & Destructor Documentation

EditionForEachLoop::EditionForEachLoop ( Subject subject,
QWidget parent = 0,
const char *  name = 0 
)

Definition at line 39 of file EditionForEachLoop.cxx.

References _formEachLoop, _nbBranches, YACS::HMI::EditionNode::_subjectNode, FormEditItem::_wid, YACS::ENGINE::DynParaLoop::edGetSamplePort(), YACS::ENGINE::DataPort::edGetType(), YACS::HMI::SubjectNode::getNode(), YACS::HMI::QtGuiContext::getQtCurrent(), YACS::ENGINE::TypeCode::name(), onModifyCollection(), and onNbBranchesEdited().

42  : EditionNode(subject, parent, name)
43 {
44  _formEachLoop = new FormEachLoop(this);
45  _nbBranches = 1;
46  _wid->gridLayout1->addWidget(_formEachLoop);
47  _formEachLoop->sb_nbranch->setMinimum(1);
48  _formEachLoop->sb_nbranch->setMaximum(INT_MAX);
49  if (!QtGuiContext::getQtCurrent()->isEdition())
50  _formEachLoop->setEnabled (false);
51  Node* node=_subjectNode->getNode();
52  ForEachLoop *fe = dynamic_cast<ForEachLoop*>(node);
53  if(fe)
54  _formEachLoop->lineEdit->setText(fe->edGetSamplePort()->edGetType()->name());
55  connect(_formEachLoop->sb_nbranch, SIGNAL(editingFinished()),
56  this, SLOT(onNbBranchesEdited()));
57 
58  connect(_formEachLoop->lineEdit_2, SIGNAL(editingFinished()),this,SLOT(onModifyCollection()));
59 
60 }
EditionForEachLoop::~EditionForEachLoop ( )
virtual

Definition at line 62 of file EditionForEachLoop.cxx.

63 {
64 }

Member Function Documentation

void EditionForEachLoop::onModifyCollection ( )
virtualslot
void EditionForEachLoop::onNbBranchesEdited ( )
virtualslot

Definition at line 77 of file EditionForEachLoop.cxx.

References _formEachLoop, _nbBranches, YACS::HMI::ItemEditionBase::_subject, DEBTRACE, YACS::HMI::SubjectDynParaLoop::setNbBranches(), and YASSERT.

Referenced by EditionForEachLoop().

78 {
79  int newval = _formEachLoop->sb_nbranch->value();
80  DEBTRACE("EditionForEachLoop::onNbBranchesEdited " << _nbBranches << " --> " << newval);
81  if (newval != _nbBranches)
82  {
83  SubjectForEachLoop *sfe = dynamic_cast<SubjectForEachLoop*>(_subject);
84  YASSERT(sfe);
85  QString text = _formEachLoop->sb_nbranch->cleanText();
86  sfe->setNbBranches(text.toStdString());
87  }
88 }
void EditionForEachLoop::synchronize ( )
virtual

used in derived nodes for synchronisation with schema model.

Reimplemented from YACS::HMI::ItemEdition.

Definition at line 90 of file EditionForEachLoop.cxx.

References YACS::HMI::ItemEditionBase::_subject, YACS::HMI::SETVALUE, and YACS::HMI::Subject::update().

91 {
93 }
void EditionForEachLoop::update ( GuiEvent  event,
int  type,
Subject son 
)
virtual

when loading a schema, creation of all edition widgets is time and memory consuming, so, widget edition creation is differed until user select an item in tree or 2D vue.

Reimplemented from YACS::HMI::EditionNode.

Definition at line 95 of file EditionForEachLoop.cxx.

References _formEachLoop, _nbBranches, YACS::HMI::ItemEditionBase::_subject, YACS::HMI::EditionNode::_subjectNode, DEBTRACE, YACS::HMI::GuiObserver::eventName(), YACS::ENGINE::DataPort::getAsString(), YACS::ENGINE::Node::getInputPort(), YACS::HMI::SubjectNode::getNode(), YACS::HMI::SubjectComposedNode::getValue(), CORBAEngineTest::i, YACS::HMI::SETVALUE, and YACS::HMI::EditionNode::update().

Referenced by gui.graph.MyCanvas::customEvent().

96 {
97  DEBTRACE("EditionForEachLoop::update " << eventName(event) << " " << type);
98  EditionNode::update(event, type, son);
99  switch (event)
100  {
101  case SETVALUE:
102  SubjectComposedNode * scn = dynamic_cast<SubjectComposedNode*>(_subject);
103  string val = scn->getValue();
104  istringstream ss(val);
105  DEBTRACE( val);
106  int i = 0;
107  ss >> i;
108  DEBTRACE(i);
109  _formEachLoop->sb_nbranch->setValue(i);
110  _nbBranches = i;
111 
112  //smplscollection
113  InputPort* dp=_subjectNode->getNode()->getInputPort("SmplsCollection");
114  _formEachLoop->lineEdit_2->setText(dp->getAsString().c_str());
115  break;
116  }
117 }

Member Data Documentation

FormEachLoop* YACS::HMI::EditionForEachLoop::_formEachLoop
protected
int YACS::HMI::EditionForEachLoop::_nbBranches
protected

Definition at line 49 of file EditionForEachLoop.hxx.

Referenced by EditionForEachLoop(), onNbBranchesEdited(), and update().


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