diff --git a/deps/tools/rpiConfigServer_src/VisionSettings.cpp b/deps/tools/rpiConfigServer_src/VisionSettings.cpp index 2fcf8dc..bcd96f1 100644 --- a/deps/tools/rpiConfigServer_src/VisionSettings.cpp +++ b/deps/tools/rpiConfigServer_src/VisionSettings.cpp @@ -30,6 +30,7 @@ void VisionSettings::Set(const wpi::json& data, return; } data.dump(os, 4); + os << '\n'; } // terminate vision process so it reloads the file diff --git a/deps/tools/rpiConfigServer_src/WebSocketHandlers.cpp b/deps/tools/rpiConfigServer_src/WebSocketHandlers.cpp index 09aa9b8..5d7c559 100644 --- a/deps/tools/rpiConfigServer_src/WebSocketHandlers.cpp +++ b/deps/tools/rpiConfigServer_src/WebSocketHandlers.cpp @@ -216,6 +216,13 @@ void ProcessWsText(wpi::WebSocket& ws, wpi::StringRef msg) { << '\n'; return; } + } else if (subType == "Save") { + try { + VisionSettings::GetInstance()->Set(j.at("settings"), statusFunc); + } catch (const wpi::json::exception& e) { + wpi::errs() << "could not read visionSave value: " << e.what() << '\n'; + return; + } } } else if (t == "networkSave") { auto statusFunc = [s = ws.shared_from_this()](wpi::StringRef msg) { @@ -244,16 +251,6 @@ void ProcessWsText(wpi::WebSocket& ws, wpi::StringRef msg) { wpi::errs() << "could not read networkSave value: " << e.what() << '\n'; return; } - } else if (t == "visionSave") { - auto statusFunc = [s = ws.shared_from_this()](wpi::StringRef msg) { - SendWsText(*s, {{"type", "status"}, {"message", msg}}); - }; - try { - VisionSettings::GetInstance()->Set(j.at("settings"), statusFunc); - } catch (const wpi::json::exception& e) { - wpi::errs() << "could not read visionSave value: " << e.what() << '\n'; - return; - } } }