| | |
| | | #include <map> |
| | | #include "OpenCLExcuter.h" |
| | | #include "CaptureUtil.h" |
| | | #define THS_FRAME_COUNT 1 |
| | | |
| | | typedef void (*CallbackFun)(int index, string code, list<TradeData> dataList, void* contex); |
| | | |
| | | class ScreenDataCapture |
| | | { |
| | | private: |
| | | OpenCLExcuter* openCLExcuter; |
| | | static OpenCLExcuter* openCLExcuter[THS_FRAME_COUNT]; |
| | | static bool inited; |
| | | //是否正在执行 |
| | | static bool running; |
| | | static bool runnings[THS_FRAME_COUNT]; |
| | | static clock_t latest_running_times[THS_FRAME_COUNT]; |
| | | |
| | | static string gpCodes[THS_FRAME_COUNT]; |
| | | |
| | | static CallbackFun data_callback; |
| | | |
| | | static void* context; |
| | | |
| | | static void _run(int index); |
| | | |
| | | |
| | | |
| | | public: |
| | | ScreenDataCapture(); |
| | | //捕获level2的盘口数据 |
| | | list<TradeData> captureLevel2TradeData(int winIndex) throw(int); |
| | | |
| | | //初始化 |
| | | void init(CallbackFun callback, void* context); |
| | | |
| | | list<TradeData> captureLevel2TradeData(cv::Mat oimg,int identify); |
| | | void refreshHWND(); |
| | | |
| | | bool isRunning(); |
| | | |
| | | //开始 |
| | | void start(int index); |
| | | //结束 |
| | | void stop(int index); |
| | | //全部开始 |
| | | void start(); |
| | | //全部结束 |
| | | void stop(); |
| | | //全部开始 |
| | | void startAll(); |
| | | //全部结束 |
| | | void stopAll(); |
| | | |
| | | bool isInited(); |
| | | |
| | | //捕获level2的盘口数据 |
| | | static list<TradeData> captureLevel2TradeData(HWND hwnd,int index) throw(int); |
| | | static list<TradeData> captureLevel2TradeData(cv::Mat oimg,int identify); |
| | | //设置代码 |
| | | static void setGPCode(int index, string code); |
| | | //获取代码 |
| | | static string getGPCode(int index); |
| | | |
| | | }; |
| | | |