Esempio n. 1
0
 /// <summary>
 /// _cm_DoCMReceiveData
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void _cm_DoCMReceiveData(object sender, CMRecvDataEventArgs e)
 {
     lock (this)
     {
         if (e.DataPacket is ResStockDetailLev2DataPacket && HasLevel2)
         {
             if (((ResStockDetailLev2DataPacket)e.DataPacket).Code == Code)
             {
                 SendDataReceived(Code);
                 if (IsPush == false)
                 {
                     Quit();
                 }
             }
         }
         else if (e.DataPacket is ResStockDetailDataPacket && !HasLevel2)
         {
             if (((ResStockDetailDataPacket)e.DataPacket).Code == Code)
             {
                 SendDataReceived(Code);
                 if (IsPush == false)
                 {
                     Quit();
                 }
             }
         }
     }
 }
Esempio n. 2
0
        protected override void _cm_DoCMReceiveData(object sender, CMRecvDataEventArgs e)
        {
            if (e.DataPacket is ResCustomReportOrgDataPacket)
            {
                if (ReceiveCustomReportData != null)
                {
                    ReceiveCustomReportData(((ResCustomReportOrgDataPacket)e.DataPacket).ChangedFields);
                }

                if (ReceiveCustomReportDataEmCode != null)
                {
                    Dictionary <String, List <FieldIndex> > ChangedFields =
                        new Dictionary <String, List <FieldIndex> >(
                            ((ResCustomReportOrgDataPacket)e.DataPacket).ChangedFields.Count);
                    foreach (
                        KeyValuePair <int, List <FieldIndex> > onePair in
                        ((ResCustomReportOrgDataPacket)e.DataPacket).ChangedFields)
                    {
                        Dictionary <FieldIndex, object> memData;
                        ChangedFields[Dc.GetFieldDataString(onePair.Key, FieldIndex.EMCode)] = onePair.Value;
                    }
                    ReceiveCustomReportDataEmCode(ChangedFields);
                }
            }
        }
Esempio n. 3
0
 /// <summary>
 /// _cm_DoCMReceiveData
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void _cm_DoCMReceiveData(object sender, CMRecvDataEventArgs e)
 {
     if (e.DataPacket is ResIndexDetailDataPacket)
     {
         SendDataReceived((e.DataPacket as ResIndexDetailDataPacket).Codes);
     }
 }
Esempio n. 4
0
 /// <summary>
 /// _cm_DoCMReceiveData
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void _cm_DoCMReceiveData(object sender, CMRecvDataEventArgs e)
 {
     if (e.DataPacket is ResSectorQuoteReportDataPacket)
     {
         if (((ResSectorQuoteReportDataPacket)e.DataPacket).PacketStatus == 1)
         {
             SendDataReceived(0);
             if (IsPush == false)
             {
                 Quit();
             }
         }
     }
 }
Esempio n. 5
0
 /// <summary>
 /// _cm_DoCMReceiveData
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void _cm_DoCMReceiveData(object sender, CMRecvDataEventArgs e)
 {
     lock (this)
     {
         if (e.DataPacket is ResHisKLineDataPacket)
         {
             if (((ResHisKLineDataPacket)e.DataPacket).KLineDataRec.Code == _code &&
                 ((ResHisKLineDataPacket)e.DataPacket).KLineDataRec.Cycle == _cycle)
             {
                 SendDataReceived(_code);
             }
         }
     }
 }
Esempio n. 6
0
 /// <summary>
 /// _cm_DoCMReceiveData
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void _cm_DoCMReceiveData(object sender, CMRecvDataEventArgs e)
 {
     if (e.DataPacket is ResHisKLineDataPacket)
     {
         if (((ResHisKLineDataPacket)e.DataPacket).KLineDataRec.Cycle == _cycle &&
             !_receivedCodes.Contains(((ResHisKLineDataPacket)e.DataPacket).KLineDataRec.Code))
         {
             _receivedCodes.Add(((ResHisKLineDataPacket)e.DataPacket).KLineDataRec.Code);
             if (_receivedCodes.Count == _codes.Count)
             {
                 SendDataReceived(_codes[0]);
             }
         }
     }
 }
Esempio n. 7
0
 void tcpHistory_OnReceiveData(object sender, CMRecvDataEventArgs e)
 {
     try
     {
         if (DoCMReceiveData != null) //通知界面而已,对于数据的响应在这个类中完成。
         {
             DoCMReceiveData(this,
                             new CMRecvDataEventArgs(e.ServiceType, e.DataPacket, e.Length));
         }
     }
     catch (Exception ex)
     {
         LogUtilities.LogMessage("Err OneTcpConnection_DoReceiveData" + ex.Message);
     }
 }
Esempio n. 8
0
 /// <summary>
 /// _cm_DoCMReceiveData
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void _cm_DoCMReceiveData(object sender, CMRecvDataEventArgs e)
 {
     if (e.DataPacket is ResShortLineStragedytDataPacket)
     {
         if (null != OnTransactionReceived)
         {
             List <OneShortLineDataRec> temp = Dc.GetShortLineData(Dc.UserShortLineTypes);
             if (temp.Count == 0 || null == Dc.GetFieldDataString(temp[temp.Count - 1].Code, FieldIndex.Name))
             {
                 return;
             }
             TransactionDataArgs args = new TransactionDataArgs(temp[temp.Count - 1].Code,
                                                                Dc.GetFieldDataString(temp[temp.Count - 1].Code, FieldIndex.Name),
                                                                EnumUtility.GetShortLineTypeString(temp[temp.Count - 1].SlType));
             OnTransactionReceived(args);
         }
     }
 }
Esempio n. 9
0
 void _httpConnection_OnReceiveData(object sender, CMRecvDataEventArgs e)
 {
     if (SystemConfig.UserInfo.IsSingle)//有新Level2用户登入服务器,则不对行情数据进行处理
     {
         try
         {
             if (DoCMReceiveData != null) //通知界面而已,对于数据的响应在这个类中完成。
             {
                 DoCMReceiveData(this,
                                 new CMRecvDataEventArgs(e.ServiceType, e.DataPacket, e.Length));
             }
         }
         catch (Exception ex)
         {
             LogUtilities.LogMessage("Err OneTcpConnection_DoReceiveData" + ex.Message);
         }
     }
 }
Esempio n. 10
0
 void PushDataPacket()
 {
     while (true)
     {
         CMRecvDataEventArgs dataPacket = null;
         lock (_DataPacketQueue)
         {
             if (_DataPacketQueue.Count > 0)
             {
                 dataPacket = _DataPacketQueue.Dequeue();
             }
         }
         if (dataPacket != null)
         {
             if (OnReceiveData != null)
             {
                 OnReceiveData(this, dataPacket);
             }
         }
         Thread.Sleep(2);
     }
 }
Esempio n. 11
0
 protected override void _cm_DoCMReceiveData(object sender, CMRecvDataEventArgs e)
 {
     if (e.DataPacket.MsgId != CurrentMsgId)
     {
         return;
     }
     if (e.DataPacket is ResNews24HOrgDataPacket && e.DataPacket.MsgId == this.CurrentMsgId)
     {
         int newsCount            = ((ResNews24HOrgDataPacket)e.DataPacket).News24HData.Count;
         NewsDataChangedArgs args = new NewsDataChangedArgs(newsCount);
         _data = Dc.GetNews24HOrgData();
         //_lastData = _data[0];
         if (_data.Count > 0)
         {
             _lastDataDate = _data[0].PublishDate;
             _lastDataTime = _data[0].PublishTime;
         }
         if (OnNewsReceived != null)
         {
             OnNewsReceived(args);
         }
     }
 }
Esempio n. 12
0
 /// <summary>
 /// _cm_DoCMReceiveData
 /// </summary>
 protected virtual void _cm_DoCMReceiveData(object sender, CMRecvDataEventArgs e)
 {
 }