- 종목명 검색 개선

- 엑셀 핸들러 추가
- 기타 코드 정리
This commit is contained in:
2017-01-10 19:22:02 +09:00
parent 349de89a05
commit ea5165a4aa
8 changed files with 286 additions and 159 deletions

View File

@@ -17,9 +17,6 @@ namespace NewsCrawler
CPSYSDIBLib.StockChart m_StockChart = new CPSYSDIBLib.StockChart();
bool m_bInitialized = false;
System.Timers.Timer m_timer = new System.Timers.Timer();
ushort m_uiLastReqT = 0;
DSCBO1Lib.CpSvr8092S m_Cp8092S = new DSCBO1Lib.CpSvr8092S();
NewsForm m_Listener = null;
@@ -53,10 +50,6 @@ namespace NewsCrawler
break;
}
m_timer.Interval = 1000;
m_timer.Elapsed += M_timer_Elapsed;
//m_timer.Start();
m_Cp8092S.SetInputValue(0, "*");
m_Cp8092S.Received += Cp8092S_Received;
m_Cp8092S.Subscribe();
@@ -82,52 +75,6 @@ namespace NewsCrawler
//Console.WriteLine(string.Format("[8092S] {0} ({1}:{2})", strContents, strName, strCode));
}
private void M_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
m_timer.Enabled = false;
if(GetLimitRemainCountRQ() < 5)
return;
CPSYSDIBLib.CpMarketWatch Watch = new CPSYSDIBLib.CpMarketWatch();
Watch.SetInputValue(0, "*");
Watch.SetInputValue(1, "1,2");
Watch.SetInputValue(2, 0);
Watch.BlockRequest2(0);
ushort uiLatestT = 0;
int iCount = Watch.GetHeaderValue(2);
if(iCount > 0)
uiLatestT = Watch.GetDataValue(0, 0);
for(int i = 0; i<iCount; i++)
{
ushort uiTime = Watch.GetDataValue(0, i);
string strCode = Watch.GetDataValue(1, i);
string strName = Watch.GetDataValue(2, i);
ushort uiType = Watch.GetDataValue(3, i);
string strContents = Watch.GetDataValue(4, i);
if(uiTime <= m_uiLastReqT)
break;
if(m_uiLastReqT > 0)
{
m_Listener.InsertItem(strContents, "", strCode,
DateTime.ParseExact(uiTime.ToString("0000"), "HHmm", CultureInfo.CurrentCulture),
DateTime.Now,
"", "CYBOS", 0, m_uiLastReqT>0);
}
//Console.WriteLine(string.Format("[{0}][{1}] {2} ({3}:{4})", uiTime, uiType, strContents, strName, strCode));
}
m_uiLastReqT = uiLatestT;
m_timer.Enabled = true;
}
public string[] GetAccounts()
{
return m_CPUtil.AccountNumber;