VSM C++ SDK
Vehicle Specific Modules SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
poi_action.h
Go to the documentation of this file.
1 // Copyright (c) 2018, Smart Projects Holdings Ltd
2 // All rights reserved.
3 // See LICENSE file for license details.
4 
8 #ifndef _UGCS_VSM_POI_ACTION_H_
9 #define _UGCS_VSM_POI_ACTION_H_
10 
11 #include <ugcs/vsm/action.h>
12 
13 namespace ugcs {
14 namespace vsm {
15 
17 class Poi_action:public Action {
19 
20 public:
23  Action(Type::POI),
24  position(position), active(active) {}
25 
30  Action(Type::POI),
31  position(Geodetic_tuple(0, 0, 0))
32  {
33  double lat = 0, lon = 0, alt = 0;
34  auto pi = p.find("latitude");
35  if (pi != p.end()) {
36  pi->second->Get_value(lat);
37  }
38  pi = p.find("longitude");
39  if (pi != p.end()) {
40  pi->second->Get_value(lon);
41  }
42  pi = p.find("altitude_amsl");
43  if (pi != p.end()) {
44  pi->second->Get_value(alt);
45  }
46  position = Geodetic_tuple(lat, lon, alt);
47  p.at("active")->Get_value(active);
48  }
49 
52 
55  bool active;
56 };
57 
59 template<>
60 struct Action::Mapper<Action::Type::POI> {
62  typedef Poi_action type;
63 };
64 
65 } /* namespace vsm */
66 } /* namespace ugcs */
67 
68 #endif /* _UGCS_VSM_POI_ACTION_H_ */
Definition: property.h:249
Coordinates tuple for geodetic CS.
Definition: coordinates.h:36
Point of interest (POI) for a vehicle.
Definition: poi_action.h:17
Type
Types of vehicle actions as part of task (mission).
Definition: action.h:30
bool active
true - POI is active and should be monitored, false - POI is not active and should not be anymore mon...
Definition: poi_action.h:55
Generic action.
Definition: action.h:22
Poi_action(const Property_list &p)
Construct action from protobuf command.
Definition: poi_action.h:29
Generic action.
Map Action type enum value to specific Action type class.
Definition: action.h:120
Wgs84_position position
Position of a a POI.
Definition: poi_action.h:51
#define DEFINE_COMMON_CLASS(__class_name,...)
Use this macro to define some common attributes for a class.
Definition: utils.h:25
Poi_action type
Real type.
Definition: poi_action.h:62