From 58e59e31a49f55b9278afdb51ac1062970a6d882 Mon Sep 17 00:00:00 2001 From: Jared Males Date: Wed, 1 May 2024 22:34:44 -0700 Subject: [PATCH] updated saving state interface --- src/rtimvInterfaces.hpp | 7 +++++++ src/rtimvMainWindow.cpp | 10 ++++++++-- src/rtimvMainWindow.hpp | 12 +++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/rtimvInterfaces.hpp b/src/rtimvInterfaces.hpp index 902d956..f4f2abc 100644 --- a/src/rtimvInterfaces.hpp +++ b/src/rtimvInterfaces.hpp @@ -26,6 +26,13 @@ namespace rtimv { +/// States to indicated whether or not data are being saved +enum class savingState{ on, ///< images are not being saved + waiting, ///< the next image will be saved + off ///< images are being saved + }; + + /// Warning levels used to change colors /** * \todo put this in an rtimv.hpp file. Or, maybe, rtimvInterfaces.hpp should be rtimv.hpp diff --git a/src/rtimvMainWindow.cpp b/src/rtimvMainWindow.cpp index da912d6..d3c9fc9 100644 --- a/src/rtimvMainWindow.cpp +++ b/src/rtimvMainWindow.cpp @@ -1926,13 +1926,18 @@ void rtimvMainWindow::setTarget() } } -void rtimvMainWindow::savingState(bool ss) +void rtimvMainWindow::savingState(rtimv::savingState ss) { - if(ss) + if(ss == rtimv::savingState::on) { ui.graphicsView->saveBoxFontColor("lightgreen"); ui.graphicsView->m_saveBox->setText("S"); } + else if(ss == rtimv::savingState::waiting) + { + ui.graphicsView->saveBoxFontColor("yellow"); + ui.graphicsView->m_saveBox->setText("S"); + } else { ui.graphicsView->saveBoxFontColor("red"); @@ -2603,6 +2608,7 @@ void rtimvMainWindow::borderWarningLevel(rtimv::warningLevel lvl) { ui.graphicsView->setStyleSheet("#graphicsView {border: 0px solid black}"); int w=width(); + //std::cerr << "width: " << w << "\n"; resize(w+1, height()); resize(w,height()); } diff --git a/src/rtimvMainWindow.hpp b/src/rtimvMainWindow.hpp index fc0b057..792ffc9 100644 --- a/src/rtimvMainWindow.hpp +++ b/src/rtimvMainWindow.hpp @@ -44,6 +44,10 @@ using namespace mx::app; #define ViewViewNoImage 1 #define ViewViewModeMax 2 + + + + class rtimvControlPanel; class rtimvMainWindow : public rtimvBase, public application @@ -589,7 +593,13 @@ public slots: /// Called when a user line is selected void userLineDeSelected(StretchLine *sl /**< [in] The StretchLine to update*/); - void savingState(bool ss); + /** Set the saving indicator + * Possible stats are: + * - rtimv::savingState::off images are not being saved + * - rtimv::savingState::waiting the next image will be saved + * - rtimv::savingState::on images are being saved + */ + void savingState(rtimv::savingState ss); public: