Version: 8.3.0
YACS::HMI::GuiObserver_i Class Reference

#include <GuiObserver_i.hxx>

Inheritance diagram for YACS::HMI::GuiObserver_i:
Collaboration diagram for YACS::HMI::GuiObserver_i:

Public Member Functions

 GuiObserver_i (YACS::ENGINE::Proc *guiProc)
 
virtual ~GuiObserver_i ()
 
void notifyObserver (CORBA::Long numid, const char *event)
 
void setConversion ()
 
void SetImpl (GuiExecutor *impl)
 
void SetRemoteProc (YACS_ORB::ProcExec_ptr engineProc)
 
int getEngineId (int guiId)
 

Protected Attributes

YACS::ENGINE::Proc_guiProc
 
YACS_ORB::ProcExec_var _engineProc
 
GuiExecutor_impl
 
std::map< int, int > _guiToEngineMap
 
std::map< int, int > _engineToGuiMap
 

Friends

class GuiExecutor
 

Detailed Description

Definition at line 51 of file GuiObserver_i.hxx.

Constructor & Destructor Documentation

GuiObserver_i::GuiObserver_i ( YACS::ENGINE::Proc guiProc)

Definition at line 41 of file GuiObserver_i.cxx.

References _engineProc, _engineToGuiMap, _guiProc, _guiToEngineMap, _impl, and DEBTRACE.

42 {
43  DEBTRACE("GuiObserver_i::GuiObserver_i");
44  _guiProc = guiProc;
45  _engineProc = YACS_ORB::ProcExec::_nil();
46  _impl = 0;
47  _guiToEngineMap.clear();
48  _engineToGuiMap.clear();
49 }
GuiObserver_i::~GuiObserver_i ( )
virtual

Definition at line 51 of file GuiObserver_i.cxx.

References DEBTRACE.

52 {
53  DEBTRACE("GuiObserver_i::~GuiObserver_i");
54 }

Member Function Documentation

int YACS::HMI::GuiObserver_i::getEngineId ( int  guiId)
inline

Definition at line 62 of file GuiObserver_i.hxx.

References _guiToEngineMap.

62 { return _guiToEngineMap[guiId]; };
void GuiObserver_i::notifyObserver ( CORBA::Long  numid,
const char *  event 
)

Definition at line 56 of file GuiObserver_i.cxx.

References _impl, and DEBTRACE.

57 {
58  DEBTRACE("GuiObserver_i::notifyObserver " << numid << " " << event);
59  pair<int,string> myEvent(numid, event);
60  YACSEvent* evt = new YACSEvent(myEvent);
61  QApplication::postEvent(_impl, evt); // Qt will delete it when done
62 }
void GuiObserver_i::setConversion ( )

Definition at line 64 of file GuiObserver_i.cxx.

References _engineProc, _engineToGuiMap, _guiProc, _guiToEngineMap, DEBTRACE, YACS::ENGINE::ComposedNode::getChildByName(), YACS::ENGINE::Node::getNumId(), CORBAEngineTest::i, and YASSERT.

65 {
66  DEBTRACE("GuiObserver_i::setConversion");
67  YASSERT(!CORBA::is_nil(_engineProc));
68  YACS_ORB::stringArray_var engineNames;
69  YACS_ORB::longArray_var engineIds;
70  //DEBTRACE("---");
71  _engineProc->getIds(engineIds.out(), engineNames.out());
72  int iLength = engineIds->length();
73  int nLength = engineNames->length();
74  if (nLength < iLength) iLength = nLength;
75  for(int i=0; i<iLength; i++)
76  {
77  string aName = "";
78  aName = engineNames[i];
79  int iEng = engineIds[i];
80  DEBTRACE("--- " << aName << " " << iEng);
81  if (aName != "_root_")
82  {
83  int iGui = _guiProc->getChildByName(aName)->getNumId();
84  //DEBTRACE("---");
85  _guiToEngineMap[iGui] = iEng;
86  _engineToGuiMap[iEng] = iGui;
87  }
88  else
89  {
90  int iGui = _guiProc->getNumId();
91  _guiToEngineMap[iGui] = iEng;
92  _engineToGuiMap[iEng] = iGui;
93  }
94  }
95 }
void GuiObserver_i::SetImpl ( GuiExecutor impl)

Definition at line 97 of file GuiObserver_i.cxx.

References _impl, and DEBTRACE.

98 {
99  DEBTRACE("GuiObserver_i::SetImpl");
100  _impl = impl;
101 }
void GuiObserver_i::SetRemoteProc ( YACS_ORB::ProcExec_ptr  engineProc)

Definition at line 103 of file GuiObserver_i.cxx.

References _engineProc, and DEBTRACE.

104 {
105  DEBTRACE("GuiObserver_i::SetRemoteProc");
106  _engineProc = YACS_ORB::ProcExec::_duplicate(engineProc);
107 }

Friends And Related Function Documentation

friend class GuiExecutor
friend

Definition at line 54 of file GuiObserver_i.hxx.

Member Data Documentation

YACS_ORB::ProcExec_var YACS::HMI::GuiObserver_i::_engineProc
protected

Definition at line 66 of file GuiObserver_i.hxx.

Referenced by GuiObserver_i(), setConversion(), and SetRemoteProc().

std::map<int, int> YACS::HMI::GuiObserver_i::_engineToGuiMap
protected

Definition at line 69 of file GuiObserver_i.hxx.

Referenced by GuiObserver_i(), and setConversion().

YACS::ENGINE::Proc* YACS::HMI::GuiObserver_i::_guiProc
protected

Definition at line 62 of file GuiObserver_i.hxx.

Referenced by GuiObserver_i(), and setConversion().

std::map<int, int> YACS::HMI::GuiObserver_i::_guiToEngineMap
protected

Definition at line 68 of file GuiObserver_i.hxx.

Referenced by getEngineId(), GuiObserver_i(), and setConversion().

GuiExecutor* YACS::HMI::GuiObserver_i::_impl
protected

Definition at line 67 of file GuiObserver_i.hxx.

Referenced by GuiObserver_i(), notifyObserver(), and SetImpl().


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