File tree Expand file tree Collapse file tree
3rd_party_adapters/nlohmann
application_business_rules/serial_interface Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#include < nlohmann/json.hpp>
22#include < serial_interface/JsonGenerator.hpp>
3- #include < serial_interface/TaskIterator.hpp>
43#include < serial_protocol/DeletedTaskObject.hpp>
54#include < serial_protocol/ProtocolVersionObject.hpp>
65#include < serial_protocol/TaskList.hpp>
76#include < serial_protocol/TaskObject.hpp>
7+ #include < tasks/Task.hpp>
88
99constexpr int defaultJsonIndent = 4 ;
1010
@@ -36,10 +36,17 @@ std::string toJsonString<task_tracker_systems::TaskObject>(const task_tracker_sy
3636 return jsonObject.dump (defaultJsonIndent);
3737}
3838
39+ void to_json (nlohmann::json &jsonObject, const device::TaskCollection::const_iterator &iterator)
40+ {
41+ jsonObject[" id" ] = iterator->first ;
42+ jsonObject[" label" ] = iterator->second .getLabel ();
43+ jsonObject[" duration" ] = iterator->second .getLastRecordedDuration ().count ();
44+ }
45+
3946template <>
4047std::string toJsonString<device::TaskCollection>(const device::TaskCollection &object)
4148{
42- std::vector<TaskObjectIterator > itList;
49+ std::vector<device::TaskCollection::const_iterator > itList;
4350 for (auto it = std::cbegin (object); it != std::cend (object); ++it)
4451 {
4552 itList.emplace_back (it);
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ namespace cli = command_line_interpreter;
99// --- define commands ------
1010// --------------------------
1111#include " JsonGenerator.hpp"
12- #include < serial_interface/TaskIterator.hpp>
1312#include < serial_protocol/ProtocolVersionObject.hpp>
1413#include < serial_protocol/TaskList.hpp>
1514#include < serial_protocol/TaskObject.hpp>
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments