Version: 8.3.0
YACS::HMI::EditionWhile Class Reference

#include <EditionWhile.hxx>

Inheritance diagram for YACS::HMI::EditionWhile:
Collaboration diagram for YACS::HMI::EditionWhile:

Public Slots

virtual void onConditionEdited ()
 

Public Member Functions

 EditionWhile (Subject *subject, QWidget *parent=0, const char *name=0)
 
virtual ~EditionWhile ()
 
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

FormLoop_formWhile
 
bool _condition
 
- 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 EditionWhile.hxx.

Constructor & Destructor Documentation

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

Definition at line 36 of file EditionWhile.cxx.

References _condition, _formWhile, FormEditItem::_wid, YACS::HMI::QtGuiContext::getQtCurrent(), and onConditionEdited().

39  : EditionNode(subject, parent, name)
40 {
41  _formWhile = new FormLoop(this);
42  _condition = 0;
43  _wid->gridLayout1->addWidget(_formWhile);
44  _formWhile->sb_nsteps->setMinimum(0);
45  _formWhile->sb_nsteps->setMaximum(1);
46  _formWhile->label->setText("Condition");
47  if (!QtGuiContext::getQtCurrent()->isEdition())
48  _formWhile->setEnabled (false);
49  connect(_formWhile->sb_nsteps, SIGNAL(editingFinished()),
50  this, SLOT(onConditionEdited()));
51 }
EditionWhile::~EditionWhile ( )
virtual

Definition at line 53 of file EditionWhile.cxx.

54 {
55 }

Member Function Documentation

void EditionWhile::onConditionEdited ( )
virtualslot

Definition at line 57 of file EditionWhile.cxx.

References _condition, _formWhile, YACS::HMI::ItemEditionBase::_subject, DEBTRACE, YACS::HMI::SubjectWhileLoop::setCondition(), and YASSERT.

Referenced by EditionWhile().

58 {
59  int newval = _formWhile->sb_nsteps->value();
60  DEBTRACE("EditionWhile::onConditionEdited " << _condition << " --> " << newval);
61  if (newval != _condition)
62  {
63  SubjectWhileLoop *swl = dynamic_cast<SubjectWhileLoop*>(_subject);
64  YASSERT(swl);
65  QString text = _formWhile->sb_nsteps->cleanText();
66  swl->setCondition(text.toStdString());
67  }
68 }
void EditionWhile::synchronize ( )
virtual

used in derived nodes for synchronisation with schema model.

Reimplemented from YACS::HMI::ItemEdition.

Definition at line 70 of file EditionWhile.cxx.

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

71 {
73 }
void EditionWhile::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 75 of file EditionWhile.cxx.

References _condition, _formWhile, YACS::HMI::ItemEditionBase::_subject, DEBTRACE, YACS::HMI::GuiObserver::eventName(), YACS::HMI::SubjectComposedNode::getValue(), CORBAEngineTest::i, YACS::HMI::SETVALUE, and YACS::HMI::EditionNode::update().

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

76 {
77  DEBTRACE("EditionWhile::update " << eventName(event) << " " << type);
78  EditionNode::update(event, type, son);
79  switch (event)
80  {
81  case SETVALUE:
82  SubjectComposedNode * scn = dynamic_cast<SubjectComposedNode*>(_subject);
83  string val = scn->getValue();
84  if (val == "True") val = "1";
85  else if (val == "False") val = "0";
86  DEBTRACE(val);
87  istringstream ss(val);
88  bool i = 0;
89  ss >> i;
90  DEBTRACE(i);
91  _formWhile->sb_nsteps->setValue(i);
92  _condition = i;
93  break;
94  }
95 }

Member Data Documentation

bool YACS::HMI::EditionWhile::_condition
protected

Definition at line 48 of file EditionWhile.hxx.

Referenced by EditionWhile(), onConditionEdited(), and update().

FormLoop* YACS::HMI::EditionWhile::_formWhile
protected

Definition at line 47 of file EditionWhile.hxx.

Referenced by EditionWhile(), onConditionEdited(), and update().


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