Emergency 20 Dokumentation  4.2.0
WaitForRobotAction.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
17 
18 
19 //[-------------------------------------------------------]
20 //[ Namespace ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24 
25 
26  //[-------------------------------------------------------]
27  //[ Classes ]
28  //[-------------------------------------------------------]
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Public definitions ]
39  //[-------------------------------------------------------]
40  public:
42 
43 
44  //[-------------------------------------------------------]
45  //[ Public methods ]
46  //[-------------------------------------------------------]
47  public:
53 
58  virtual ~WaitForRobotAction();
59 
60  void init(uint64 entityId);
61 
62 
63  //[-------------------------------------------------------]
64  //[ Public virtual qsf::Actions methods ]
65  //[-------------------------------------------------------]
66  public:
67  virtual void serialize(qsf::BinarySerializer& serializer) override;
68 
69 
70  //[-------------------------------------------------------]
71  //[ Protected virtual qsf::Action methods ]
72  //[-------------------------------------------------------]
73  protected:
74  virtual bool onStartup() override;
75  virtual void onShutdown() override;
76  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
77 
78 
79  //[-------------------------------------------------------]
80  //[ Private methods ]
81  //[-------------------------------------------------------]
82  private:
83  void onRobotDestroyed(const qsf::MessageParameters& parameters);
84  bool checkTargetActionPlan();
85 
86 
87  //[-------------------------------------------------------]
88  //[ Private definitions ]
89  //[-------------------------------------------------------]
90  private:
91  enum State
92  {
93  STATE_INIT,
94  STATE_WAITING,
95  STATE_DONE
96  };
97 
98 
99  //[-------------------------------------------------------]
100  //[ Private data ]
101  //[-------------------------------------------------------]
102  private:
103  // Configuration
104  bool mIsRobotAlive;
105  State mCurrentState;
106  uint64 mTargetEntityId;
107  qsf::MessageProxy mMessageProxyVehicleDestroyed;
108 
109 
110  //[-------------------------------------------------------]
111  //[ CAMP reflection system ]
112  //[-------------------------------------------------------]
113  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
114 
115 
116  };
117 
118 
119 //[-------------------------------------------------------]
120 //[ Namespace ]
121 //[-------------------------------------------------------]
122 } // em5
123 
124 
125 //[-------------------------------------------------------]
126 //[ CAMP reflection system ]
127 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Message parameters class.
Definition: MessageParameters.h:34
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
Message listener proxy class.
Definition: MessageProxy.h:47
uint64_t uint64
Definition: PlatformTypes.h:184
static const qsf::NamedIdentifier ACTION_ID
"em5::WaitForRobotAction" unique action identifier
Definition: WaitForRobotAction.h:41
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
State
Definition: ProcessState.h:20
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
Abstract action base class.
Definition: Action.h:59
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
Binary serializer class.
Definition: BinarySerializer.h:35
Result
Definition: ActionResult.h:20
EMERGENCY 5 wait for SEK robot to return to the transporter.
Definition: WaitForRobotAction.h:33