diff --git a/ULDataMgr.cs b/ULDataMgr.cs index 38cfac1..be6a005 100644 --- a/ULDataMgr.cs +++ b/ULDataMgr.cs @@ -20,6 +20,18 @@ namespace upper_limit_crawler public float m_fLossCut; } + public struct BLACKLIST + { + public BLACKLIST(string strCode, int iTime) + { + m_strCode = strCode; + m_iTime = iTime; + } + + public string m_strCode; + public int m_iTime; + } + public class ULDataMgr { public SETTING m_Setting = new SETTING(); @@ -27,7 +39,7 @@ namespace upper_limit_crawler ULTrader m_Trader = new ULTrader(); Dictionary m_WatchList = new Dictionary(); - List m_BlackList = new List(); + List m_BlackList = new List(); public ULDataMgr() { @@ -99,12 +111,20 @@ namespace upper_limit_crawler public void AddBlackList(string strCode) { - m_BlackList.Add(strCode); + int iTime = int.Parse(UlUtil.GetCurTime().ToString("HHmmss")); + BLACKLIST black = new BLACKLIST(strCode, iTime); + m_BlackList.Add(black); + } + + bool IsIn5Min(int iTime) + { + int iCurTime = int.Parse(UlUtil.GetCurTime().ToString("HHmmss")); + return (iTime >= iCurTime - 500); } public bool IsInBlackList(string strCode) { - return m_BlackList.Contains(strCode); + return m_BlackList.Any(r => r.m_strCode == strCode && IsIn5Min(r.m_iTime)); } public Dictionary GetWatchList()