#pragma once
|
#include <string>
|
#include <iostream>
|
#include <list>
|
#include "ImgUtil.h"
|
#include "RecognitionManager.h"
|
#include "THSActionUtil.h"
|
#include "BaseCapture.h"
|
|
enum TradeType
|
{
|
TRADE_TYPE_BUY,
|
TRADE_TYPE_SELL,
|
};
|
|
|
struct TradeSuccessData
|
{
|
|
string code;
|
string time;
|
string num;
|
string money;
|
string price;
|
string trade_num;
|
TradeType type;
|
//¸¨Öú¹¦ÄÜ
|
int index;
|
};
|
|
|
struct TradeDelegateData
|
{
|
string code;
|
string time;
|
string apply_time;//É걨ʱ¼ä
|
string num;
|
string price;
|
string trade_price;
|
string trade_num;
|
TradeType type;
|
//¸¨Öú¹¦ÄÜ
|
int index;
|
};
|
|
typedef void (*CallbackFun_Trade_Success)(list<TradeSuccessData> dataList, void* contex);
|
|
typedef void (*CallbackFun_Trade_Delegate)(list<TradeDelegateData> dataList,string avaiableMoney, void* contex);
|
|
|
class TradeListCapture
|
{
|
private:
|
//½»Ò×ʱ¶Îʶ±ð
|
static bool tradeTimeCapture_success;
|
static bool tradeTimeCapture_delegate;
|
static OpenCLExcuter* openCLExcuterDelegate;
|
static OpenCLExcuter* openCLExcuterSuccess;
|
static RecognitionManager* recognitionManager;
|
static bool inited;
|
|
//ÊÇ·ñÕýÔÚÖ´ÐÐ
|
static bool running_s;
|
static bool running_d;
|
static bool kill_d;
|
static bool kill_s;
|
static CallbackFun_Trade_Success data_callback_success;
|
static CallbackFun_Trade_Delegate data_callback_delegate;
|
static void* context;
|
static void _run_s();
|
static void _run_d();
|
|
//ίÍд°Ìå
|
static HWND trade_delegate_win;
|
//³É¹¦´°Ìå
|
static HWND trade_success_win;
|
//¾«¼ò°æÎ¯Íд°Ìå
|
static HWND trade_simple_delegate_win;
|
|
|
|
|
public:
|
|
static void setTradeTimeCapture_delegate(bool enable) {
|
tradeTimeCapture_delegate = enable;
|
}
|
|
static void setTradeTimeCapture_success(bool enable) {
|
tradeTimeCapture_success = enable;
|
}
|
|
void init(CallbackFun_Trade_Success callback_s, CallbackFun_Trade_Delegate callback_d, void* context);
|
|
//ÖØÐ´´½¨Ïß³Ì
|
void reCreateTradeSuccessRunning();
|
void reCreateTradeDelegateRunning();
|
|
void refreshTradeDelegateHWND();
|
void refreshTradeSimpleDelegateHWND();
|
void refreshTradeSuccessHWND();
|
static cv::Mat grayImgs(cv::Mat img,OpenCLExcuter* openCLExcuter);
|
|
//½»Ò׳ɹ¦
|
static list<TradeSuccessData> captureTradeSuccessInfo(cv::Mat img);
|
|
static list<TradeSuccessData> captureTradeSuccessInfo();
|
|
|
//רҵ°æ½»Ò×ίÍÐ
|
static list<TradeDelegateData> captureTradeDelegateInfo(cv::Mat img);
|
|
static list<TradeDelegateData> captureTradeDelegateInfo();
|
|
//¾«¼ò°æ½»Ò×ίÍÐ
|
static list<TradeDelegateData> captureSimpleTradeDelegateInfo(cv::Mat img);
|
|
static list<TradeDelegateData> captureSimpleTradeDelegateInfo();
|
|
//»ñÈ¡ÕË»§µÄÊ£Óà×ʽð
|
static string getAvaiableMoney();
|
// »ñÈ¡¾«¼ò°æµÄ¿ÉÓÃÓà¶î
|
static string getSimpleAvaiableMoney();
|
|
|
bool isInited();
|
|
bool isRunningTradeSuccess();
|
|
bool isRunningTradeDelegate();
|
//¿ªÊ¼
|
void startTradeSuccess();
|
//½áÊø
|
void stopTradeSuccess();
|
|
//¿ªÊ¼
|
void startTradeDelegate();
|
//½áÊø
|
void stopTradeDelegate();
|
};
|