#pragma once
|
#include "../common/CMyListCtrl.h"
|
#include "../common/NetworkApi.h"
|
#include <thread>
|
#include <map>
|
// MonitorDlg 对话框
|
|
|
struct TradeDelegateRecord {
|
CString accountID;
|
CString orderLocalID;
|
CString securityID;
|
CString securityName;
|
int direction;
|
CString orderSysID;
|
CString insertTime;
|
CString acceptTime;
|
CString cancelTime;
|
CString limitPrice;
|
int volume;
|
int volumeTraded;
|
int orderStatus;
|
int orderSubmitStatus;
|
CString statusMsg;
|
CString updateTime;
|
};
|
struct TradeDealRecord {
|
CString tradeID;
|
CString orderSysID;
|
CString securityID;
|
CString direction;
|
CString price;
|
CString tradeTime;
|
int volume;
|
|
};
|
|
enum TaskType {
|
REQUEST_TASK_ENV, // 环境更新
|
REQUEST_TASK_L2_SUBSCRIPT,//L2订阅更新
|
};
|
|
class MonitorDlg : public CDialogEx
|
{
|
DECLARE_DYNAMIC(MonitorDlg)
|
|
private:
|
//开盘啦数据警告
|
bool kplDataWarning;
|
|
CString searchCode;
|
|
// 任务更新时间
|
map<TaskType, string> taskUpdateTimeMap;
|
|
const int MAX_LOG_LINES = 100;
|
map<int,COLORREF> labelColors;
|
static bool kill;
|
static std::list<CodeInfo> l2CodesList;
|
static std::list<CodeInfo> l2PositionCodesList;
|
static list<TradeDelegateRecord> delegateList;
|
static list<TradeDealRecord> dealList;
|
static void requestL2CodeList(MonitorDlg* dlg);
|
static void requestL2PositionCodeList(MonitorDlg* dlg);
|
static void requestDelegateList(MonitorDlg* dlg);
|
static void requestDealList(MonitorDlg* dlg);
|
static void autoRefresh(MonitorDlg* dlg);
|
static void requestSystemLog(MonitorDlg* dlg);
|
static void requestL2ListenActiveCount(MonitorDlg* dlg);
|
|
|
|
|
std::thread l2RefreshThread;
|
std::thread l2PositionRefreshThread;
|
std::thread delegateRefreshThread;
|
std::thread dealRefreshThread;
|
std::thread autoRefreshThread;
|
std::thread systemLogThread;
|
std::thread l2ListenActiveThread;
|
|
std::list<CString> logList;
|
int logStartIndex;
|
|
void initView();
|
|
|
static CString MonitorDlg::getOrderStatusDesc(int orderStatus);
|
static CString MonitorDlg::getDirectionDesc(int direction);
|
|
public:
|
MonitorDlg(CWnd* pParent = nullptr); // 标准构造函数
|
virtual ~MonitorDlg();
|
|
// 对话框数据
|
#ifdef AFX_DESIGN_TIME
|
enum { IDD = IDD_MONITOR };
|
#endif
|
|
protected:
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
|
DECLARE_MESSAGE_MAP()
|
public:
|
afx_msg void OnBnClickedButtonRefreshDelegate();
|
afx_msg void OnBnClickedButtonRefreshDeal();
|
afx_msg void OnBnClickedButtonRefreshPosition();
|
afx_msg void OnBnClickedButtonRefreshMoney();
|
afx_msg void OnBnClickedButtonFloatFrame();
|
afx_msg void OnBnClickedButtonTradeRecord();
|
CListCtrl listL2Codes;
|
CMyListCtrl listDelegate;
|
CMyListCtrl listDeal;
|
virtual BOOL OnInitDialog();
|
afx_msg void OnClose();
|
CEdit editCode;
|
afx_msg void OnBnClickedButtonExportL2();
|
CStatic labelHXTradeChannel;
|
CStatic labelJueJinState;
|
afx_msg void OnBnClickedButtonInitData();
|
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
CStatic labelKPLDataInfo;
|
CStatic labelDeviceInfo;
|
CStatic labelMySQL;
|
CStatic labelRedis;
|
CStatic labelRedisTestResult;
|
afx_msg void OnBnClickedButtonRedisTest();
|
CStatic lableRedisAsyncTaskCount;
|
CStatic labelTradeChannelState;
|
afx_msg void OnBnClickedButtonSyncShszCodes();
|
CStatic labelL2SubscriptCodesUpdateTime;
|
CEdit editLog;
|
CStatic labelL2ListenData;
|
afx_msg void OnBnClickedButtonSaveRunningData();
|
CListCtrl listL2PositionCodes;
|
CStatic labelL2PositionSubscriptCodesUpdateTime;
|
afx_msg void OnBnClickedButtonRepaireTask();
|
afx_msg void OnBnClickedButtonSyncZyltVolume();
|
CStatic labelTodayZyltVolumeCount;
|
CEdit editSearchCode;
|
CButton btnSearch;
|
afx_msg void OnBnClickedButtonSearch();
|
CStatic labelTodayKBarsCount;
|
afx_msg void OnBnClickedButtonSyncKBars();
|
CStatic labelDataServerState;
|
CButton checkAutoPullLogs;
|
afx_msg void OnBnClickedButtonOpenLowSuction();
|
afx_msg void OnBnClickedButtonOpenProjectBuild();
|
afx_msg void OnBnClickedButtonRestartSell();
|
};
|