forked from CCOMJHC/camp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbehavior.cpp
More file actions
52 lines (42 loc) · 999 Bytes
/
behavior.cpp
File metadata and controls
52 lines (42 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "behavior.h"
#include <QJsonObject>
Behavior::Behavior(MissionItem *parent): MissionItem(parent)
{
}
void Behavior::writeToMissionPlan(QJsonArray& navArray) const
{
}
void Behavior::writeToMissionPlanObject(QJsonObject& behaviorsObject) const
{
QJsonObject bo;
bo["active"]=m_active;
behaviorsObject[m_behaviorType] = bo;
}
void Behavior::write(QJsonObject& json) const
{
json["type"] = "Behavior";
json["behaviorType"] = m_behaviorType;
json["active"] = m_active;
}
void Behavior::read(const QJsonObject& json)
{
m_behaviorType = json["behaviorType"].toString();
m_active = json["active"].toBool();
}
bool Behavior::active() const
{
return m_active;
}
void Behavior::setActive(bool active)
{
m_active = active;
}
void Behavior::setBehaviorType(const QString& behaviorType)
{
m_behaviorType = behaviorType;
setObjectName("behavior - "+m_behaviorType);
}
const QString & Behavior::behaviorType() const
{
return m_behaviorType;
}