From 83f858ae7a06dd427e0a5bfd3b8074ff0b8ecf17 Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Mon, 20 Nov 2023 09:11:32 +0100 Subject: [PATCH] Refs #19743: [ARS] Fix timer flow Signed-off-by: JesusPoderoso --- qml/DomainGraphLayout.qml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/qml/DomainGraphLayout.qml b/qml/DomainGraphLayout.qml index d48cbe94..0c3de6a8 100644 --- a/qml/DomainGraphLayout.qml +++ b/qml/DomainGraphLayout.qml @@ -70,6 +70,7 @@ Item readonly property int scrollbar_max_size_: 12 readonly property int topic_thickness_: 10 readonly property int wheel_displacement_: 30 + readonly property int timer_initial_ms_interval_: 200 readonly property string topic_color_: Theme.grey readonly property string host_color_: Theme.darkGrey readonly property string user_color_: Theme.eProsimaLightBlue @@ -1302,9 +1303,19 @@ Item Timer { id: safety_timer - interval: 200; running: false - onTriggered: { interval += interval; load_model() } - } function stop_timer() { safety_timer.stop() } + interval: timer_initial_ms_interval_; running: false + onTriggered: { + interval += interval + load_model() + } + } + function stop_timer() { + if (safety_timer.running) + { + safety_timer.stop() + safety_timer.interval = timer_initial_ms_interval_ + } + } // Obtain given domain id graph JSON model function load_model()