Version: 8.3.0
YACS::HMI::ItemEditionBase Class Reference

#include <ItemEdition.hxx>

Inheritance diagram for YACS::HMI::ItemEditionBase:
Collaboration diagram for YACS::HMI::ItemEditionBase:

Public Member Functions

 ItemEditionBase (Subject *subject)
 
virtual ~ItemEditionBase ()
 
virtual void select (bool isSelected)
 
virtual void synchronize ()
 
virtual void update (GuiEvent event, int type, Subject *son)
 
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

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::GuiObserver
static std::string eventName (GuiEvent event)
 
static void setEventMap ()
 
- Static Protected Attributes inherited from YACS::HMI::GuiObserver
static std::map< int, std::string > _eventNameMap
 

Detailed Description

Definition at line 36 of file ItemEdition.hxx.

Constructor & Destructor Documentation

ItemEditionBase::ItemEditionBase ( Subject subject)

get name and strings for type of item and category

Definition at line 68 of file ItemEdition.cxx.

References _category, _name, _stackId, _subject, _type, YACS::ENGINE::Array, YACS::HMI::Subject::attach(), YACS::ENGINE::Bool, YACS::ENGINE::Double, YACS::HMI::GuiContext::getInvoc(), YACS::HMI::Subject::getName(), YACS::HMI::QtGuiContext::getQtCurrent(), YACS::HMI::ProcInvoc::getTypeName(), YACS::HMI::ProcInvoc::getTypeOfNode(), YACS::HMI::ProcInvoc::getTypeOfPort(), YACS::ENGINE::Int, YACS::ENGINE::Objref, YACS::ENGINE::Sequence, YACS::ENGINE::String, and YACS::ENGINE::Struct.

69  : GuiObserver(), _subject(subject)
70 {
71  _subject->attach(this);
72  _stackId = -1;
73  _name = _subject->getName();
74  _type = "Unknown";
75  _category = "Unknown";
77  if (SubjectNode * sub = dynamic_cast<SubjectNode*>(_subject))
78  {
79  _category = "Node";
80  _type = invoc->getTypeName(invoc->getTypeOfNode(sub->getNode()));
81  }
82  else if (SubjectDataPort * sub = dynamic_cast<SubjectDataPort*>(_subject))
83  {
84  _category = "Port";
85  _type = invoc->getTypeName(invoc->getTypeOfPort(sub->getPort()));
86  }
87  else if (SubjectLink * sub = dynamic_cast<SubjectLink*>(_subject))
88  {
89  _category = "Link";
90  _type = "Link";
91  }
92  else if (SubjectControlLink * sub = dynamic_cast<SubjectControlLink*>(_subject))
93  {
94  _category = "ControlLink";
95  _type = "Control Link";
96  }
97  else if (SubjectDataType * sub = dynamic_cast<SubjectDataType*>(_subject))
98  {
99  _category = "Data";
100  switch (sub->getTypeCode()->kind())
101  {
102  case YACS::ENGINE::Double: _type = "Double"; break;
103  case YACS::ENGINE::Int: _type = "Int"; break;
104  case YACS::ENGINE::String: _type = "String"; break;
105  case YACS::ENGINE::Bool: _type = "Bool"; break;
106  case YACS::ENGINE::Objref: _type = "Objref"; break;
107  case YACS::ENGINE::Sequence: _type = "Sequence"; break;
108  case YACS::ENGINE::Array: _type = "Array"; break;
109  case YACS::ENGINE::Struct: _type = "Struct"; break;
110  default: _type = "None or Unknown";
111  }
112  }
113  else if (SubjectComponent * sub = dynamic_cast<SubjectComponent*>(_subject))
114  {
115  _category = "Component";
116  _type = "Salome Component";
117  }
118  else if (SubjectContainerBase * sub = dynamic_cast<SubjectContainerBase*>(_subject))
119  {
120  _category = "Container";
121  _type = sub->getLabelForHuman();
122  }
123 }
ItemEditionBase::~ItemEditionBase ( )
virtual

Definition at line 125 of file ItemEdition.cxx.

126 {
127 }

Member Function Documentation

Subject * ItemEditionBase::getSubject ( )
virtual

Definition at line 142 of file ItemEdition.cxx.

References _subject.

143 {
144  return _subject;
145 }
void ItemEditionBase::select ( bool  isSelected)
virtual

Reimplemented from YACS::HMI::GuiObserver.

Reimplemented in YACS::HMI::ItemEdition, YACS::HMI::EditionInputPort, and YACS::HMI::EditionOutputPort.

Definition at line 129 of file ItemEdition.cxx.

References DEBTRACE.

130 {
131  DEBTRACE("ItemEditionBase::select " << isSelected);
132 }

Member Data Documentation

std::string YACS::HMI::ItemEditionBase::_category
protected

Definition at line 50 of file ItemEdition.hxx.

Referenced by ItemEditionBase().

int YACS::HMI::ItemEditionBase::_stackId
protected

Definition at line 47 of file ItemEdition.hxx.

Referenced by YACS::HMI::ItemEdition::ItemEdition(), and ItemEditionBase().

Subject* YACS::HMI::ItemEditionBase::_subject
protected

Definition at line 46 of file ItemEdition.hxx.

Referenced by YACS::HMI::EditionComponent::changeContainer(), YACS::HMI::EditionSalomeNode::changeContainer(), YACS::HMI::EditionSalomeNode::changeInstance(), YACS::HMI::EditionBloc::EditionBloc(), YACS::HMI::EditionComponent::EditionComponent(), YACS::HMI::EditionDataLink::EditionDataLink(), YACS::HMI::EditionElementaryNode::EditionElementaryNode(), YACS::HMI::EditionInputPort::EditionInputPort(), YACS::HMI::EditionNode::EditionNode(), YACS::HMI::EditionOutputPort::EditionOutputPort(), YACS::HMI::EditionPyFunc::EditionPyFunc(), YACS::HMI::EditionSalomeNode::EditionSalomeNode(), YACS::HMI::EditionScript::EditionScript(), YACS::HMI::EditionComponent::fillContainerPanel(), YACS::HMI::EditionContainer::getContainer(), getSubject(), YACS::HMI::ItemEdition::ItemEdition(), ItemEditionBase(), YACS::HMI::ItemEdition::onApply(), YACS::HMI::EditionWhile::onConditionEdited(), YACS::HMI::EditionSwitch::onModifySelect(), YACS::HMI::EditionForEachLoop::onNbBranchesEdited(), YACS::HMI::EditionOptimizerLoop::onNbBranchesEdited(), YACS::HMI::EditionLoop::onNbStepsEdited(), YACS::HMI::EditionOutputPort::select(), YACS::HMI::EditionInputPort::select(), YACS::HMI::ItemEdition::setEdited(), YACS::HMI::EditionWhile::synchronize(), YACS::HMI::EditionLoop::synchronize(), YACS::HMI::EditionForEachLoop::synchronize(), YACS::HMI::EditionOptimizerLoop::synchronize(), YACS::HMI::EditionSwitch::synchronize(), YACS::HMI::EditionElementaryNode::synchronize(), YACS::HMI::EditionWhile::update(), YACS::HMI::EditionLoop::update(), YACS::HMI::EditionForEachLoop::update(), YACS::HMI::EditionOptimizerLoop::update(), YACS::HMI::EditionSwitch::update(), YACS::HMI::ItemEdition::update(), and YACS::HMI::ItemEdition::~ItemEdition().

std::string YACS::HMI::ItemEditionBase::_type
protected

Definition at line 49 of file ItemEdition.hxx.

Referenced by YACS::HMI::ItemEdition::ItemEdition(), and ItemEditionBase().


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