Exemplo n.º 1
0
        public void requestNextWatch()
        {
            string sSymbol;

            if (bMore)
            {
                if (drSelect.Read())
                {
                    sSymbol = drSelect.GetString(0);
                    //Console.WriteLine( "get {0}:{1}", cnt, sSymbol );
                    htSymbols.Add(sSymbol, 1);
                    iq5009.startWatch(sSymbol);
                    cnt++;
                }
                else
                {
                    // close up and finish up
                    bMore = false;
                }
            }
            else
            {
                Console.WriteLine("Finishing counts:" + cnt + ", " + cntQ);
                //if ( 1 < cnt ) {
                //	foreach ( string s in htSymbols.Keys ) Console.WriteLine( "  remaining {0}", s );
                //}
            }
            if (0 == cnt)
            {
                //foreach ( string s in htSymbolsNotFound.Keys ) Console.WriteLine( "  Didn't find {0}", s );
                Console.WriteLine("Done ");

                iq5009.HandleFundamentalMessage -= new FundamentalMessageHandler(iq5009_HandleFundamentalMessage);
                //iq5009.HandleSummaryMessage -= new SummaryMessageHandler(iq5009_HandleSummaryMessage);
                iq5009.HandleWatchSymbolNotFound -= new WatchSymbolNotFoundHandler(iq5009_HandleWatchSymbolNotFound);
                //iq5009.HandleFDel = new Buffer.LineHandler(processF);
                //iq5009.HandleQDel = new Buffer.LineHandler( processQ );
                drSelect.Close();
                db1.Close();
                db2.Close();
                iq5009.Disconnect();

                Pulse();
            }
        }