-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCBase4618.h
42 lines (38 loc) · 973 Bytes
/
CBase4618.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include <opencv2/opencv.hpp>
#include "CControl.h"
#include <thread>
#include <chrono>
/**
*
* @brief Base class meant to provide the framework for a Canvas that you can commincate with a serial device
*
* This class is only meant to be used as a base class and requires the child class to write its own draw and update method. When run is called it will constantly update and draw
*
* @author Garnett Goodacre
*/
class CBase4618
{
protected:
CControl _device; ///< Device to communicate with
cv::Mat _canvas; ///< Canvas to draw on
bool thread_exit = 0; ///< exits all threads when value goes to true
char _key = -1;
public:
/**
* @brief Starts up the threads and waits for 'q' to quit
* @return nothing
*/
void run();
private:
/**
* @brief Pure virtual class for updating anything
* @return nothing
*/
virtual void update() = 0;
/**
* @brief Pure virtual class to draw onto the canvas
* @return nothing
*/
virtual void draw() = 0;
};