Skip to content

Commit

Permalink
Remove ID and x-coordinate from the JSON output, adjust WebSocket thr…
Browse files Browse the repository at this point in the history
…ead timing

- The inclusion of 'Id' and 'x' in the JSON output within 'captureDataToJson' has been commented out and replaced by the timestamp field for debugging purposes.
- Restored the 5ms sleep delay in the 'WebSocketHandler' main loop to manage thread timing.

This update temporarily removes the 'id' and 'x' values from the JSON output for debugging purposes and focuses on the timestamp data. It also reintroduces a controlled delay in the WebSocket handling loop to effectively manage processing intervals.
  • Loading branch information
arkadiusz committed Aug 28, 2024
1 parent af20770 commit da1fe60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/jsonhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ nlohmann::json captureDataToJson(const std::map<Omniscope::Id, std::vector<std::
int64_t timestamp = std::get<2>(tuple).time_since_epoch().count();

nlohmann::json dataPoint = {
{"Id", id.serial},
{"x", std::get<0>(tuple)},

// DEBUG ID
// {"Id", id.serial},
// Replaced by a timestamp
// {"x", std::get<0>(tuple)},

{"y", std::get<1>(tuple)},
{"timestamp", timestamp}
};
Expand Down
2 changes: 1 addition & 1 deletion src/websockethandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void WebSocketHandler::startWebSocketThread(const std::set<std::string>& selecte

send(captureData, selected_serials);
}
// std::this_thread::sleep_for(std::chrono::milliseconds(5));
std::this_thread::sleep_for(std::chrono::milliseconds(5));
}
});
webSocketThread.detach();
Expand Down

0 comments on commit da1fe60

Please sign in to comment.