Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Common/Cpp/Exceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Common/Cpp/Exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions SerialPrograms/Source/CommonFramework/Globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions SerialPrograms/Source/CommonFramework/Globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down