diff --git a/Common/Cpp/Exceptions.cpp b/Common/Cpp/Exceptions.cpp index 12ee7d5b43..301fc07318 100644 --- a/Common/Cpp/Exceptions.cpp +++ b/Common/Cpp/Exceptions.cpp @@ -29,6 +29,14 @@ std::string Exception::to_str() const{ } +ParseException::ParseException(std::string message_string) + : m_message(std::move(message_string)) +{ + std::string str = ParseException::name(); + str += ": " + message(); + std::cerr << str << std::endl; +} + FileException::FileException(Logger* logger, const char* location, std::string message_string, std::string file) diff --git a/Common/Cpp/Exceptions.h b/Common/Cpp/Exceptions.h index 5c27db8b3f..0c6bcb3f29 100644 --- a/Common/Cpp/Exceptions.h +++ b/Common/Cpp/Exceptions.h @@ -77,7 +77,7 @@ class OperationCancelledException : public Exception{ class ParseException : public Exception{ public: ParseException() = default; - ParseException(std::string message) : m_message(std::move(message)) {} + ParseException(std::string message); virtual const char* name() const override{ return "ParseException"; } virtual std::string message() const override{ return m_message; } protected: diff --git a/SerialPrograms/Source/CommonFramework/Globals.cpp b/SerialPrograms/Source/CommonFramework/Globals.cpp index 90ae6833e0..9c3cb719ac 100644 --- a/SerialPrograms/Source/CommonFramework/Globals.cpp +++ b/SerialPrograms/Source/CommonFramework/Globals.cpp @@ -220,6 +220,10 @@ const std::string& RESOURCE_PATH(){ static std::string path = get_resource_path(); return path; } +const std::string& DOWNLOADED_RESOURCE_PATH(){ + static std::string path = RUNTIME_BASE_PATH() + "DownloadedResources/"; + return path; +} const std::string& TRAINING_PATH(){ static std::string path = get_training_path(); return path; diff --git a/SerialPrograms/Source/CommonFramework/Globals.h b/SerialPrograms/Source/CommonFramework/Globals.h index 55ce1a91ce..754b585e14 100644 --- a/SerialPrograms/Source/CommonFramework/Globals.h +++ b/SerialPrograms/Source/CommonFramework/Globals.h @@ -76,6 +76,10 @@ const std::string& USER_FILE_PATH(); // Resource folder path. Resources include JSON files, images, sound files and others required by // various automation programs. const std::string& RESOURCE_PATH(); + +// Folder path that holds Downloaded resources +const std::string& DOWNLOADED_RESOURCE_PATH(); + // Hold ML training data. const std::string& TRAINING_PATH(); diff --git a/SerialPrograms/Source/CommonFramework/VideoPipeline/VideoOverlay.h b/SerialPrograms/Source/CommonFramework/VideoPipeline/VideoOverlay.h index 340d8a23c1..476b39767a 100644 --- a/SerialPrograms/Source/CommonFramework/VideoPipeline/VideoOverlay.h +++ b/SerialPrograms/Source/CommonFramework/VideoPipeline/VideoOverlay.h @@ -81,8 +81,8 @@ class VideoOverlay{ public: struct MouseListener{ virtual void on_mouse_press(double x, double y){} - virtual void on_mouse_release(double x, double y){}; - virtual void on_mouse_move(double x, double y){}; + virtual void on_mouse_release(double x, double y){} + virtual void on_mouse_move(double x, double y){} }; void add_mouse_listener(MouseListener& listener); void remove_mouse_listener(MouseListener& listener); @@ -95,7 +95,7 @@ class VideoOverlay{ struct KeyEventListener{ virtual void on_key_press(QKeyEvent* event){} - virtual void on_key_release(QKeyEvent* event){}; + virtual void on_key_release(QKeyEvent* event){} }; void add_keyevent_listener(KeyEventListener& listener); void remove_keyevent_listener(KeyEventListener& listener);