14#include "canvas_info.h"
16#include "mission_parameter.h"
18#include "property_info.h"
19#include "transition_info.h"
51 QVector<std::shared_ptr<INode>>
getnodes()
const override;
66 QVector<maki::MissionParameter> missionParameters()
const;
68 void setParameters(
const QVector<maki::MissionParameter>& parameters);
70 maki::MissionParameter getParameter(
int index)
const;
71 void addParameter(
const maki::MissionParameter& parameter);
72 void setParameter(
int index,
const maki::MissionParameter& parameter);
73 void removeParameter(
const maki::MissionParameter& parameter);
84 void addNode(std::shared_ptr<NodeSaveInfo> node);
96 QJsonObject
toJson()
const;
126 QVector<std::shared_ptr<IParameter>>
getPossibleStates(
const QString& nodeId)
const;
133 QVector<std::shared_ptr<NodeSaveInfo>>
getPossibleCallers(
const QString& nodeId,
const Types::ControlTypes type)
const;
140 QVector<std::shared_ptr<FlowSaveInfo>>
getEventsFromNode(
const QString& nodeId)
const;
142 QVector<std::shared_ptr<FlowSaveInfo>> getFlowsFromNode(
const QString& nodeId)
const;
150 QVector<std::shared_ptr<FlowSaveInfo>>
getEventsOfTypeFromNode(
const QString& nodeId,
const QList<Types::CallType>& types)
const;
158 std::shared_ptr<FlowSaveInfo>
getEventFromNode(
const QString& nodeId,
const QString& flowName)
const;
160 std::shared_ptr<FlowSaveInfo> getFlowFromNode(
const QString& nodeId,
const QString& flowName)
const;
167 std::shared_ptr<NodeSaveInfo>
getNodeWithId(
const QString& nodeId);
174 std::shared_ptr<FlowSaveInfo>
getFlowWithId(
const QString& flowId);
176 QVector<std::shared_ptr<FlowSaveInfo>> pipelines()
const;
178 void addPipeline(std::shared_ptr<FlowSaveInfo> pipeline);
179 void removePipeline(std::shared_ptr<FlowSaveInfo> pipeline);
181 bool taskHasCapability(
const QString& taskId,
const QString& capabilityId)
const;
200 QVector<std::shared_ptr<NodeSaveInfo>>
findFamilyOfFlowNode(
const QString& nodeId,
const QVector<std::shared_ptr<INode>>& nodes,
201 const Types::ControlTypes type)
const;
203 void findChildrenOfTask(
const std::shared_ptr<INode> task, QVector<std::shared_ptr<NodeSaveInfo>>& nodes,
const Types::ControlTypes type)
const;
211 std::shared_ptr<NodeSaveInfo>
findOwnerTaskOfFlowNode(
const QString& nodeId,
const std::shared_ptr<INode> node)
const;
219 QVector<std::shared_ptr<FlowSaveInfo>>
getEventsFromNode(
const QString& nodeId, QVector<std::shared_ptr<INode>> nodes)
const;
221 QVector<std::shared_ptr<FlowSaveInfo>> getFlowsFromNode(
const QString& nodeId, QVector<std::shared_ptr<INode>> nodes)
const;
229 std::shared_ptr<NodeSaveInfo>
getNodeWithId(
const QString& nodeId,
const QVector<std::shared_ptr<INode>>& nodes);
237 std::shared_ptr<FlowSaveInfo>
getFlowWithId(
const QString& flowId,
const QVector<std::shared_ptr<INode>>& nodes);
Represents information needed to save and load a canvas state.
Definition canvas_info.h:13
QVector< std::shared_ptr< IParameter > > getPossibleStates(const QString &nodeId) const
Get possible states for a node.
Definition save_info.cpp:159
QVector< std::shared_ptr< FlowSaveInfo > > mPipelines
A vector of shared pointers to INode objects representing structural nodes.
Definition save_info.h:191
std::shared_ptr< NodeSaveInfo > findOwnerTaskOfFlowNode(const QString &nodeId, const std::shared_ptr< INode > node) const
Find the parent of a construct.
Definition save_info.cpp:137
QVector< const IParameter * > getparameters() const override
Get all user defined mission parameters.
Definition save_info.cpp:43
static SaveInfo fromJson(const QJsonObject &data)
Create a SaveInfo object from a JSON object.
Definition save_info.cpp:364
CanvasSaveInfo canvasInfo() const
Get the canvas save info.
Definition save_info.cpp:13
QJsonObject toJson() const
Convert the object to JSON format.
Definition save_info.cpp:348
QVector< std::shared_ptr< NodeSaveInfo > > getPossibleCallers(const QString &nodeId, const Types::ControlTypes type) const
Get possible callers for a node.
Definition save_info.cpp:178
std::shared_ptr< NodeSaveInfo > getNodeWithId(const QString &nodeId)
Get a node by ID.
Definition save_info.cpp:268
QVector< std::shared_ptr< NodeSaveInfo > > findFamilyOfFlowNode(const QString &nodeId, const QVector< std::shared_ptr< INode > > &nodes, const Types::ControlTypes type) const
A vector to the available mission parameters.
Definition save_info.cpp:94
QVector< std::shared_ptr< FlowSaveInfo > > getEventsFromNode(const QString &nodeId) const
Get events from a node.
Definition save_info.cpp:184
QVector< maki::MissionParameter > mMissionParameters
A vector of shared pointers to IFlow objects representing the available pipelines.
Definition save_info.h:192
QVector< std::shared_ptr< FlowSaveInfo > > getEventsOfTypeFromNode(const QString &nodeId, const QList< Types::CallType > &types) const
Get events of a specific type from a node.
Definition save_info.cpp:210
std::shared_ptr< FlowSaveInfo > getEventFromNode(const QString &nodeId, const QString &flowName) const
Get an event from a node by name.
Definition save_info.cpp:248
std::shared_ptr< FlowSaveInfo > getFlowWithId(const QString &flowId)
Get a flow by ID.
Definition save_info.cpp:295
void clearNodes()
Removed all nodes from the storage.
Definition save_info.cpp:89
friend QDataStream & operator>>(QDataStream &in, SaveInfo &info)
Deserialize the object from a QDataStream.
Definition save_info.cpp:386
QVector< std::shared_ptr< INode > > mStructuralNodes
The canvas save info.
Definition save_info.h:190
const koda::types::TypeRegistry * getTypesRegistry() const override
Get MAKI's type registry.
Definition save_info.cpp:38
void removeNode(const QString &nodeId)
Remove a node.
Definition save_info.cpp:28
friend QDataStream & operator<<(QDataStream &out, const SaveInfo &info)
Serialize the object to a QDataStream.
Definition save_info.cpp:378
void addNode(std::shared_ptr< NodeSaveInfo > node)
Add a node.
Definition save_info.cpp:23
void setCanvasInfo(const CanvasSaveInfo &info)
Set the canvas save info.
Definition save_info.cpp:18
QVector< std::shared_ptr< INode > > getnodes() const override
Get all nodes.
Definition save_info.cpp:33
SaveInfo()=default
Default constructor.