From a17738e1545ff7dbef6398b8ec1eab93ab59c9a1 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 30 六月 2022 19:14:47 +0800
Subject: [PATCH] '功能完善'

---
 ConsoleApplication/ScreenDataCapture.h |   50 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/ConsoleApplication/ScreenDataCapture.h b/ConsoleApplication/ScreenDataCapture.h
index ad7338c..1c247f2 100644
--- a/ConsoleApplication/ScreenDataCapture.h
+++ b/ConsoleApplication/ScreenDataCapture.h
@@ -4,20 +4,62 @@
 #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);
 
 };
 

--
Gitblit v1.8.0