CONTROLLER Class Reference

#include <Controller.h>

Inheritance diagram for CONTROLLER:

RoboCupCtrl ConsoleRoboCupCtrl List of all members.

Public Member Functions

 CONTROLLER ()
virtual ~CONTROLLER ()
virtual BOOLEAN SetActors (STRING &sMessage)
virtual void OnDestroy ()
virtual void OnMouseClick (const CLICKINFO &)
virtual void OnMouseDoubleClick (const CLICKINFO &)
virtual void OnBeginDrag (const CLICKINFO &)
virtual void OnDrag (const CLICKINFO &)
virtual void OnEndDrag (const CLICKINFO &)
virtual void OnKeyPressed (int)
SENSORPORT AddView (VIEW *pView)
ACTORPORT GetActorPort (const STRING &portname)
SENSORPORT GetSensorPort (const STRING &portname)
INTEGER GetSensorDim (SENSORPORT sp)
INTEGER GetSensorDimSize (SENSORPORT sp, INTEGER d)
void GetSensorValue (SENSORPORT sp, PSHORTREAL value)
void SetActorValue (ACTORPORT ap, REAL value)
PSHORTREAL NewSensorBuffer (SENSORPORT sp)
void DeleteSensorBuffer (SENSORPORT sp, PSHORTREAL buffer)
INTEGER SensorPortCount (SIM3DOBJECT obj)
INTEGER ActorPortCount (SIM3DOBJECT obj)
STRING SensorPortName (SIM3DOBJECT obj, INTEGER n)
STRING ActorPortName (SIM3DOBJECT obj, INTEGER n)
SIM3DOBJECT GetObject (const STRING &name)
STRING ObjectName (SIM3DOBJECT obj)
STRING ObjectRemark (SIM3DOBJECT obj)
STRING ObjectClass (SIM3DOBJECT obj)
INTEGER SubObjectCount (SIM3DOBJECT obj)
SIM3DOBJECT SubObject (SIM3DOBJECT obj, INTEGER n)
INTEGER MacroCount ()
SIM3DOBJECT GetMacro (INTEGER n)
SIM3DOBJECT GetMacro (const STRING &)
SIM3DOBJECT AddMacroAs (SIM3DOBJECT obj, const STRING &asname)
void RemoveObject (SIM3DOBJECT obj)
MOVEMATRIX GetLocation (SIM3DOBJECT obj)
void SetLocation (SIM3DOBJECT obj, const MOVEMATRIX &m)
virtual void activateSwitch (SensorData::sensors sensor, bool activate=true)=0
virtual bool isSwitchActivated (SensorData::sensors sensor) const =0

Private Member Functions

void Clean ()
void Check ()
INTEGER Check (INTEGER i)
STRING Check (const STRING &s)
SIM3DOBJECT Check (SIM3DOBJECT s)
PSHORTREAL Check (PSHORTREAL p)
MOVEMATRIX Check (const MOVEMATRIX &m)

Private Attributes

SIMULATIONm_pSim

Detailed Description

Definition at line 101 of file Controller.h.


Constructor & Destructor Documentation

CONTROLLER::CONTROLLER (  ) 

Definition at line 86 of file Controller.cpp.

References CRobotControlSimulatedRobots::getSimRobotDocument(), getSimulatedRobots(), CSimRobotDocument::GetSimulation(), and m_pSim.

virtual CONTROLLER::~CONTROLLER (  )  [inline, virtual]

Definition at line 105 of file Controller.h.


Member Function Documentation

virtual void CONTROLLER::activateSwitch ( SensorData::sensors  sensor,
bool  activate = true 
) [pure virtual]

Activates or diactivates a certain switch on the robot.

Parameters:
sensor The switch. Allowed values are: headBack, headFront, mouth, chin, and back.
activate Decides whether to activate or deactivate the switch.

Implemented in RoboCupCtrl.

Referenced by CSimRobotDocument::activateSwitch().

INTEGER CONTROLLER::ActorPortCount ( SIM3DOBJECT  obj  ) 

Definition at line 216 of file Controller.cpp.

References SIMULATION::ActorPortCount(), Check(), Clean(), and m_pSim.

STRING CONTROLLER::ActorPortName ( SIM3DOBJECT  obj,
INTEGER  n 
)

Definition at line 228 of file Controller.cpp.

References SIMULATION::ActorPortName(), Check(), Clean(), and m_pSim.

SIM3DOBJECT CONTROLLER::AddMacroAs ( SIM3DOBJECT  obj,
const STRING asname 
)

Definition at line 288 of file Controller.cpp.

References SIMULATION::AddMacroAs(), Check(), Clean(), and m_pSim.

SENSORPORT CONTROLLER::AddView ( VIEW pView  ) 

Definition at line 92 of file Controller.cpp.

References GetObject(), GetSensorPort(), and ObjectName().

MOVEMATRIX CONTROLLER::Check ( const MOVEMATRIX m  )  [private]

Definition at line 143 of file Controller.cpp.

References XCONTROLLER::InvalidObject, m_pSim, and SIMULATION::WasOk().

PSHORTREAL CONTROLLER::Check ( PSHORTREAL  p  )  [private]

Definition at line 136 of file Controller.cpp.

References XCONTROLLER::InvalidObject, m_pSim, and SIMULATION::WasOk().

SIM3DOBJECT CONTROLLER::Check ( SIM3DOBJECT  s  )  [private]

Definition at line 129 of file Controller.cpp.

References XCONTROLLER::InvalidObject, m_pSim, and SIMULATION::WasOk().

STRING CONTROLLER::Check ( const STRING s  )  [private]

Definition at line 122 of file Controller.cpp.

References XCONTROLLER::InvalidObject, m_pSim, and SIMULATION::WasOk().

INTEGER CONTROLLER::Check ( INTEGER  i  )  [private]

Definition at line 115 of file Controller.cpp.

References XCONTROLLER::InvalidObject, m_pSim, and SIMULATION::WasOk().

void CONTROLLER::Check (  )  [private]

Definition at line 109 of file Controller.cpp.

References XCONTROLLER::InvalidObject, m_pSim, and SIMULATION::WasOk().

Referenced by ActorPortCount(), ActorPortName(), AddMacroAs(), DeleteSensorBuffer(), GetLocation(), GetMacro(), GetObject(), GetSensorDim(), GetSensorDimSize(), GetSensorValue(), MacroCount(), NewSensorBuffer(), ObjectClass(), ObjectName(), ObjectRemark(), RemoveObject(), SensorPortCount(), SensorPortName(), SetActorValue(), SetLocation(), SubObject(), and SubObjectCount().

void CONTROLLER::Clean (  )  [private]

Definition at line 101 of file Controller.cpp.

References sim3DTakeLastError().

Referenced by ActorPortCount(), ActorPortName(), AddMacroAs(), DeleteSensorBuffer(), GetActorPort(), GetLocation(), GetMacro(), GetObject(), GetSensorDim(), GetSensorDimSize(), GetSensorPort(), GetSensorValue(), MacroCount(), NewSensorBuffer(), ObjectClass(), ObjectName(), ObjectRemark(), RemoveObject(), SensorPortCount(), SensorPortName(), SetActorValue(), SetLocation(), SubObject(), and SubObjectCount().

void CONTROLLER::DeleteSensorBuffer ( SENSORPORT  sp,
PSHORTREAL  buffer 
)

Definition at line 203 of file Controller.cpp.

References Check(), Clean(), SIMULATION::DeleteSensorBuffer(), and m_pSim.

ACTORPORT CONTROLLER::GetActorPort ( const STRING portname  ) 

Definition at line 153 of file Controller.cpp.

References Clean(), SIMULATION::GetActorPort(), XCONTROLLER::InvalidActorPort, m_pSim, and SIMULATION::WasOk().

MOVEMATRIX CONTROLLER::GetLocation ( SIM3DOBJECT  obj  ) 

Definition at line 301 of file Controller.cpp.

References Check(), Clean(), SIMULATION::GetLocation(), and m_pSim.

SIM3DOBJECT CONTROLLER::GetMacro ( const STRING  ) 

Definition at line 282 of file Controller.cpp.

References Check(), Clean(), SIMULATION::GetMacro(), and m_pSim.

SIM3DOBJECT CONTROLLER::GetMacro ( INTEGER  n  ) 

Definition at line 276 of file Controller.cpp.

References Check(), Clean(), SIMULATION::GetMacro(), and m_pSim.

SIM3DOBJECT CONTROLLER::GetObject ( const STRING name  ) 

Definition at line 234 of file Controller.cpp.

References Check(), Clean(), SIMULATION::GetObject(), and m_pSim.

Referenced by RoboCupCtrl::adaptColors(), AddView(), Oracle::getBallModel(), Oracle::getPlayerPoseCollection(), RoboCupCtrl::OnBeginDrag(), OVirtualRobotComm::OVirtualRobotComm(), RoboCupCtrl::RoboCupCtrl(), and RoboCupCtrl::setPose2D().

INTEGER CONTROLLER::GetSensorDim ( SENSORPORT  sp  ) 

Definition at line 171 of file Controller.cpp.

References Check(), Clean(), SIMULATION::GetSensorDim(), and m_pSim.

INTEGER CONTROLLER::GetSensorDimSize ( SENSORPORT  sp,
INTEGER  d 
)

Definition at line 177 of file Controller.cpp.

References Check(), Clean(), SIMULATION::GetSensorDimSize(), and m_pSim.

SENSORPORT CONTROLLER::GetSensorPort ( const STRING portname  ) 

Definition at line 162 of file Controller.cpp.

References Clean(), SIMULATION::GetSensorPort(), XCONTROLLER::InvalidSensorPort, m_pSim, and SIMULATION::WasOk().

Referenced by AddView(), and OVirtualRobotComm::OVirtualRobotComm().

void CONTROLLER::GetSensorValue ( SENSORPORT  sp,
PSHORTREAL  value 
)

Definition at line 183 of file Controller.cpp.

References Check(), Clean(), SIMULATION::GetSensorValue(), and m_pSim.

Referenced by OVirtualRobotComm::update().

virtual bool CONTROLLER::isSwitchActivated ( SensorData::sensors  sensor  )  const [pure virtual]

The function checks whether a certain switch is activated.

Parameters:
sensor The switch to check.
Returns:
Activated or not?

Implemented in RoboCupCtrl.

Referenced by CSimRobotDocument::isSwitchActivated().

INTEGER CONTROLLER::MacroCount (  ) 

Definition at line 270 of file Controller.cpp.

References Check(), Clean(), m_pSim, and SIMULATION::MacroCount().

PSHORTREAL CONTROLLER::NewSensorBuffer ( SENSORPORT  sp  ) 

Definition at line 197 of file Controller.cpp.

References Check(), Clean(), m_pSim, and SIMULATION::NewSensorBuffer().

Referenced by OVirtualRobotComm::OVirtualRobotComm().

STRING CONTROLLER::ObjectClass ( SIM3DOBJECT  obj  ) 

Definition at line 252 of file Controller.cpp.

References Check(), Clean(), m_pSim, and SIMULATION::ObjectClass().

STRING CONTROLLER::ObjectName ( SIM3DOBJECT  obj  ) 

Definition at line 240 of file Controller.cpp.

References Check(), Clean(), m_pSim, and SIMULATION::ObjectName().

Referenced by AddView().

STRING CONTROLLER::ObjectRemark ( SIM3DOBJECT  obj  ) 

Definition at line 246 of file Controller.cpp.

References Check(), Clean(), m_pSim, and SIMULATION::ObjectRemark().

virtual void CONTROLLER::OnBeginDrag ( const CLICKINFO  )  [inline, virtual]

Reimplemented in RoboCupCtrl.

Definition at line 110 of file Controller.h.

Referenced by CSimRobotDocument::OnBeginDrag().

virtual void CONTROLLER::OnDestroy (  )  [inline, virtual]

Definition at line 107 of file Controller.h.

Referenced by CSimRobotDocument::OnSimReset(), and CSimRobotDocument::~CSimRobotDocument().

virtual void CONTROLLER::OnDrag ( const CLICKINFO  )  [inline, virtual]

Reimplemented in RoboCupCtrl.

Definition at line 111 of file Controller.h.

Referenced by CSimRobotDocument::OnDrag().

virtual void CONTROLLER::OnEndDrag ( const CLICKINFO  )  [inline, virtual]

Reimplemented in RoboCupCtrl.

Definition at line 112 of file Controller.h.

Referenced by CSimRobotDocument::OnEndDrag().

virtual void CONTROLLER::OnKeyPressed ( int   )  [inline, virtual]

Definition at line 113 of file Controller.h.

virtual void CONTROLLER::OnMouseClick ( const CLICKINFO  )  [inline, virtual]

Definition at line 108 of file Controller.h.

Referenced by CSimRobotDocument::OnMouseClick().

virtual void CONTROLLER::OnMouseDoubleClick ( const CLICKINFO  )  [inline, virtual]

Definition at line 109 of file Controller.h.

Referenced by CSimRobotDocument::OnMouseDoubleClick().

void CONTROLLER::RemoveObject ( SIM3DOBJECT  obj  ) 

Definition at line 294 of file Controller.cpp.

References Check(), Clean(), m_pSim, and SIMULATION::RemoveObject().

INTEGER CONTROLLER::SensorPortCount ( SIM3DOBJECT  obj  ) 

Definition at line 210 of file Controller.cpp.

References Check(), Clean(), m_pSim, and SIMULATION::SensorPortCount().

STRING CONTROLLER::SensorPortName ( SIM3DOBJECT  obj,
INTEGER  n 
)

Definition at line 222 of file Controller.cpp.

References Check(), Clean(), m_pSim, and SIMULATION::SensorPortName().

virtual BOOLEAN CONTROLLER::SetActors ( STRING sMessage  )  [inline, virtual]

Reimplemented in RoboCupCtrl.

Definition at line 106 of file Controller.h.

References TRUE.

Referenced by CSimRobotDocument::OnIdle().

void CONTROLLER::SetActorValue ( ACTORPORT  ap,
REAL  value 
)

Definition at line 190 of file Controller.cpp.

References Check(), Clean(), m_pSim, and SIMULATION::SetActorValue().

void CONTROLLER::SetLocation ( SIM3DOBJECT  obj,
const MOVEMATRIX m 
)

Definition at line 307 of file Controller.cpp.

References Check(), Clean(), m_pSim, and SIMULATION::SetLocation().

SIM3DOBJECT CONTROLLER::SubObject ( SIM3DOBJECT  obj,
INTEGER  n 
)

Definition at line 264 of file Controller.cpp.

References Check(), Clean(), m_pSim, and SIMULATION::SubObject().

INTEGER CONTROLLER::SubObjectCount ( SIM3DOBJECT  obj  ) 

Definition at line 258 of file Controller.cpp.

References Check(), Clean(), m_pSim, and SIMULATION::SubObjectCount().


Member Data Documentation

SIMULATION* CONTROLLER::m_pSim [private]

Definition at line 157 of file Controller.h.

Referenced by ActorPortCount(), ActorPortName(), AddMacroAs(), Check(), CONTROLLER(), DeleteSensorBuffer(), GetActorPort(), GetLocation(), GetMacro(), GetObject(), GetSensorDim(), GetSensorDimSize(), GetSensorPort(), GetSensorValue(), MacroCount(), NewSensorBuffer(), ObjectClass(), ObjectName(), ObjectRemark(), RemoveObject(), SensorPortCount(), SensorPortName(), SetActorValue(), SetLocation(), SubObject(), and SubObjectCount().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:23:36 2006 for DT2005.panorama by  doxygen 1.4.7