From 7eeba20bebc42869ade6dd173f7853f3592c32f0 Mon Sep 17 00:00:00 2001 From: Florian Reimold <11774314+FlorianReimold@users.noreply.github.com> Date: Thu, 16 May 2024 14:51:00 +0200 Subject: [PATCH] [Rec] Fixed "Recording" display bug and some other bugs (#1598) The bugs were caused from changing bit-wise | and & to boolean versions, which caused the latter functions to not be evaluated. Turning around the parameter fixes the issue too, without bit-wise operators (those are prone to warnings) --- .../job_history_model.cpp | 32 +++++++++---------- .../wait_for_shutdown_dialog.cpp | 8 ++--- .../src/ecal_rec_server_cli.cpp | 6 ++-- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_model.cpp b/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_model.cpp index 006c496bed..d9afe991d5 100644 --- a/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_model.cpp +++ b/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_model.cpp @@ -158,15 +158,15 @@ void JobHistoryModel::setRecorderStatuses(const eCAL::rec_server::RecorderStatus if (hdf5_recorder_item == nullptr) continue; bool update_needed_hdf5_rec = false; - update_needed_hdf5_rec = update_needed_hdf5_rec || hdf5_recorder_item->updateStillOnline (recorder_still_online); - update_needed_hdf5_rec = update_needed_hdf5_rec || hdf5_recorder_item->updatePid (pid); - update_needed_hdf5_rec = update_needed_hdf5_rec || hdf5_recorder_item->updateInfoLastCommandResponse(client_job_status.second.info_last_command_response_); - update_needed_hdf5_rec = update_needed_hdf5_rec || hdf5_recorder_item->updateLength ({ client_job_status.second.job_status_.rec_hdf5_status_.total_length_, client_job_status.second.job_status_.rec_hdf5_status_.total_frame_count_ }); - update_needed_hdf5_rec = update_needed_hdf5_rec || hdf5_recorder_item->updateUnflushedFrameCount (client_job_status.second.job_status_.rec_hdf5_status_.unflushed_frame_count_); - update_needed_hdf5_rec = update_needed_hdf5_rec || hdf5_recorder_item->updateState (client_job_status.second.job_status_.state_); - update_needed_hdf5_rec = update_needed_hdf5_rec || hdf5_recorder_item->updateUploadStatus (client_job_status.second.job_status_.upload_status_); - update_needed_hdf5_rec = update_needed_hdf5_rec || hdf5_recorder_item->updateInfo (client_job_status.second.job_status_.rec_hdf5_status_.info_); - update_needed_hdf5_rec = update_needed_hdf5_rec || hdf5_recorder_item->updateIsDeleted (is_deleted); + update_needed_hdf5_rec = hdf5_recorder_item->updateStillOnline (recorder_still_online) || update_needed_hdf5_rec; + update_needed_hdf5_rec = hdf5_recorder_item->updatePid (pid) || update_needed_hdf5_rec; + update_needed_hdf5_rec = hdf5_recorder_item->updateInfoLastCommandResponse(client_job_status.second.info_last_command_response_) || update_needed_hdf5_rec; + update_needed_hdf5_rec = hdf5_recorder_item->updateLength ({ client_job_status.second.job_status_.rec_hdf5_status_.total_length_, client_job_status.second.job_status_.rec_hdf5_status_.total_frame_count_ }) || update_needed_hdf5_rec; + update_needed_hdf5_rec = hdf5_recorder_item->updateUnflushedFrameCount (client_job_status.second.job_status_.rec_hdf5_status_.unflushed_frame_count_) || update_needed_hdf5_rec; + update_needed_hdf5_rec = hdf5_recorder_item->updateState (client_job_status.second.job_status_.state_) || update_needed_hdf5_rec; + update_needed_hdf5_rec = hdf5_recorder_item->updateUploadStatus (client_job_status.second.job_status_.upload_status_) || update_needed_hdf5_rec; + update_needed_hdf5_rec = hdf5_recorder_item->updateInfo (client_job_status.second.job_status_.rec_hdf5_status_.info_) || update_needed_hdf5_rec; + update_needed_hdf5_rec = hdf5_recorder_item->updateIsDeleted (is_deleted) || update_needed_hdf5_rec; if (update_needed_hdf5_rec) { @@ -216,13 +216,13 @@ void JobHistoryModel::setRecorderStatuses(const eCAL::rec_server::RecorderStatus } bool update_needed_addon = false; - update_needed_addon = update_needed_addon || addon_item->updateStillOnline (addon_still_online); - update_needed_addon = update_needed_addon || addon_item->updatePid (pid); - update_needed_addon = update_needed_addon || addon_item->updateLength ({std::chrono::steady_clock::duration(0), addon_id_status_pair.second.total_frame_count_ }); - update_needed_addon = update_needed_addon || addon_item->updateUnflushedFrameCount(addon_id_status_pair.second.unflushed_frame_count_); - update_needed_addon = update_needed_addon || addon_item->updateState (addon_state); - update_needed_addon = update_needed_addon || addon_item->updateInfo (addon_id_status_pair.second.info_); - update_needed_addon = update_needed_addon || addon_item->updateIsDeleted (is_deleted); + update_needed_addon = addon_item->updateStillOnline (addon_still_online) || update_needed_addon; + update_needed_addon = addon_item->updatePid (pid) || update_needed_addon; + update_needed_addon = addon_item->updateLength ({std::chrono::steady_clock::duration(0), addon_id_status_pair.second.total_frame_count_ }) || update_needed_addon; + update_needed_addon = addon_item->updateUnflushedFrameCount(addon_id_status_pair.second.unflushed_frame_count_) || update_needed_addon; + update_needed_addon = addon_item->updateState (addon_state) || update_needed_addon; + update_needed_addon = addon_item->updateInfo (addon_id_status_pair.second.info_) || update_needed_addon; + update_needed_addon = addon_item->updateIsDeleted (is_deleted) || update_needed_addon; if (update_needed_addon) { diff --git a/app/rec/rec_gui/src/widgets/wait_for_shutdown_dialog/wait_for_shutdown_dialog.cpp b/app/rec/rec_gui/src/widgets/wait_for_shutdown_dialog/wait_for_shutdown_dialog.cpp index 5aca3591dd..21bbfad48c 100644 --- a/app/rec/rec_gui/src/widgets/wait_for_shutdown_dialog/wait_for_shutdown_dialog.cpp +++ b/app/rec/rec_gui/src/widgets/wait_for_shutdown_dialog/wait_for_shutdown_dialog.cpp @@ -373,10 +373,10 @@ bool WaitForShutdownDialog::updateAllFields() auto job_history = QEcalRec::instance()->jobHistory(); bool safe_to_exit = true; - safe_to_exit = safe_to_exit && updateWaitForFlushing(); - safe_to_exit = safe_to_exit && updateBuiltInRecorderUploading(job_history); - safe_to_exit = safe_to_exit && updateBuiltInFtpServer(); - safe_to_exit = safe_to_exit && updateNonUploadedMeasurements(); + safe_to_exit = updateWaitForFlushing() && safe_to_exit; + safe_to_exit = updateBuiltInRecorderUploading(job_history) && safe_to_exit; + safe_to_exit = updateBuiltInFtpServer() && safe_to_exit; + safe_to_exit = updateNonUploadedMeasurements() && safe_to_exit; updateItIsSafeToExit(safe_to_exit); diff --git a/app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp b/app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp index d171fff4a7..cea9f6550a 100644 --- a/app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp +++ b/app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp @@ -1568,9 +1568,9 @@ bool IsRecorderBusy(bool print_status) std::cout << "Waiting for the following events:" << std::endl; bool still_busy = false; - still_busy = still_busy || IsAnyClientFlushing (print_status); - still_busy = still_busy || IsAnyClientUploading (print_status); - still_busy = still_busy || IsBuiltInFtpServerBusy(print_status); + still_busy = IsAnyClientFlushing (print_status) || still_busy; + still_busy = IsAnyClientUploading (print_status) || still_busy; + still_busy = IsBuiltInFtpServerBusy(print_status) || still_busy; if (print_status && !still_busy) {