40 template <
class dst_type>
43 return dynamic_cast<const dst_type*
>(
this) !=
nullptr;
46 double get_age_in_ms(
bool total =
false)
const;
47 bool interacted()
const;
49 std::shared_ptr<notification_model>& selected,
std::string& error_message);
50 void draw_text(
const char* msg,
int x,
int y,
int h);
51 virtual void set_color_scheme(
float t)
const;
52 void unset_color_scheme()
const;
53 virtual int get_max_lifetime_ms()
const;
55 virtual int calc_height();
58 virtual void draw_dismiss(
ux_window& win,
int x,
int y);
61 virtual void dismiss(
bool snooze) { dismissed =
true; snoozed = snooze; }
75 bool to_close =
false;
82 bool dismissed =
false;
83 bool expanded =
false;
88 bool enable_dismiss =
true;
89 bool enable_expand =
true;
90 bool enable_click =
false;
91 bool enable_complex_dismiss =
false;
95 bool is_delayed()
const;
99 bool animating =
false;
104 void invoke(std::function<
void()>
action);
109 using invoker = std::function<void(std::function<void()>)>;
115 : _process_name(name) {}
121 bool done()
const {
return _done; }
133 virtual void process_flow(
134 std::function<
void()> cleanup,
138 bool _started =
false;
140 bool _failed =
false;
152 float progress_speed = 5.f;
154 int last_progress = 0;
155 float curr_progress_value = 0.f;
156 float threshold_progress = 5.f;
162 : update_manager(manager) {}
164 void draw_progress_bar(
ux_window& win,
int w);
166 void draw_pre_effect(
int x,
int y)
override;
168 std::shared_ptr<process_manager> update_manager =
nullptr;
169 int update_state = 0;
170 int update_state_prev = 0;
178 void set_color_scheme(
float t)
const override;
180 int calc_height()
override;
191 void set_color_scheme(
float t)
const override;
200 std::shared_ptr<notification_model> add_notification(
const notification_data& n);
202 std::function<
void()> custom_action,
203 bool use_custom_action =
true);
204 void add_notification(std::shared_ptr<notification_model>
model);
219 const int MAX_SIZE = 6;
220 std::recursive_mutex
m;
229 void set_color_scheme(
float t )
const override;
241 return{ f * a.
x, f * a.
y, f * a.
z, a.
w };
246 return{ v.
x, v.
y, v.
z, a };
260 void process_flow(std::function<
void()> cleanup,
272 STATE_INITIAL_PROMPT = 0,
273 STATE_IN_PROGRESS = 1,
279 return *std::dynamic_pointer_cast<
export_manager>(update_manager);
284 void set_color_scheme(
float t)
const override;
286 int calc_height()
override;
void draw_text(int x, int y, const char *text)
GLenum GLuint GLenum severity
GLuint const GLchar * name
ImVec4 saturate(const ImVec4 &a, float f)
std::chrono::system_clock::time_point created_time
const std::string _recommended_version_link
void add_log(std::string message)
int calc_height() override
void log(rs2_log_severity severity, const char *message)
std::shared_ptr< notification_model > selected
export_manager & get_manager()
GLdouble GLdouble GLdouble w
GLsizei const GLchar *const * string
std::unique_ptr< rs2::filter > _exporter
const std::string & get_log() const
GLfloat GLfloat GLfloat GLfloat h
double get_timestamp() const
virtual void draw_pre_effect(int x, int y)
std::chrono::system_clock::time_point last_moved
GLboolean GLboolean GLboolean GLboolean a
rs2_notification_category get_category() const
std::function< void(std::function< void()>)> invoker
int get_max_lifetime_ms() const override
const std::string _recommended_version
std::function< void()> custom_action
virtual void draw_expanded(ux_window &win, std::string &error_message)
rs2_log_severity _severity
std::string get_description() const
virtual void dismiss(bool snooze)
GLint GLsizei GLsizei height
std::string get_filename() const
std::chrono::system_clock::time_point last_progress_time
void check_error(std::string &error)
progress_bar _progress_bar
rs2_notification_category category
ImVec4 alpha(const ImVec4 &v, float a)
export_manager(const std::string &fname, std::unique_ptr< rs2::filter > exporter, frame data)
rs2_log_severity get_severity() const
std::chrono::system_clock::time_point last_interacted
rs2_notification_category
Category of the librealsense notification.
std::string _process_name
process_manager(std::string name)
single_consumer_queue< std::function< void()> > dispatch_queue
int get_max_lifetime_ms() const override
std::vector< std::shared_ptr< notification_model > > pending_notifications
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
notification_data(std::string description, rs2_log_severity severity, rs2_notification_category category)
process_notification_model(std::shared_ptr< process_manager > manager)
rs2_log_severity
Severity of the librealsense logger.
const std::string _current_version
rs2_notification_category _category