From a8974019757dbb5ef25e7a7cda31a522346a63c4 Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Mon, 22 Jul 2024 15:31:55 +0200 Subject: [PATCH] Log is truncated and no longer appended, decrease camera link status check update --- backend/logger/src/logger.cpp | 4 ++-- frontend/server/public/stylesheets/style/style.css | 2 +- frontend/website/src/map/map.ts | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/logger/src/logger.cpp b/backend/logger/src/logger.cpp index 4e9abbef..aa7c191b 100644 --- a/backend/logger/src/logger.cpp +++ b/backend/logger/src/logger.cpp @@ -31,11 +31,11 @@ void Logger::setDirectory(string newDirPath) void Logger::Open() { try { - m_Logfile.open((m_dirPath + m_sFileName).c_str(), ios::out | ios::app); + m_Logfile.open((m_dirPath + m_sFileName).c_str(), ios::out | std::ios::trunc); } catch (...) { std::filesystem::path m_dirPath = std::filesystem::temp_directory_path(); - m_Logfile.open((m_dirPath.string() + m_sFileName).c_str(), ios::out | ios::app); + m_Logfile.open((m_dirPath.string() + m_sFileName).c_str(), ios::out | std::ios::trunc); } } diff --git a/frontend/server/public/stylesheets/style/style.css b/frontend/server/public/stylesheets/style/style.css index b11b094c..7f3bb7fd 100644 --- a/frontend/server/public/stylesheets/style/style.css +++ b/frontend/server/public/stylesheets/style/style.css @@ -414,7 +414,7 @@ nav.ol-panel { .ol-panel .ol-group { align-items: center; - column-gap: 12px; + column-gap: 6px; display: flex; flex-direction: row; flex-wrap: nowrap; diff --git a/frontend/website/src/map/map.ts b/frontend/website/src/map/map.ts index d77396ad..e9022422 100644 --- a/frontend/website/src/map/map.ts +++ b/frontend/website/src/map/map.ts @@ -284,7 +284,7 @@ export class Map extends L.Map { /* Periodically check if the camera control endpoint is available */ this.#cameraControlTimer = window.setInterval(() => { this.#checkCameraPort(); - }, 1000) + }, 10000) /* Option buttons */ this.#createUnitMarkerControlButtons(); @@ -648,6 +648,7 @@ export class Map extends L.Map { } setSlaveDCSCamera(newSlaveDCSCamera: boolean) { + this.#checkCameraPort(); this.#slaveDCSCamera = newSlaveDCSCamera; let button = document.getElementById("camera-link-control"); button?.classList.toggle("off", !newSlaveDCSCamera);