/// <summary> /// 更新單一RTDItem資料 /// </summary> /// <param name="data"></param> public void GetRTDItem(RTDItem data) { if (m_Collection != null && m_Collection.Securities.ContainsKey(data.Security)) { object value = m_Collection[data.Security][data.Field]; if (value != null) { data.Value = value; return; } } //m_Req.Request("FIELD", data.Field); }
/// <summary> /// Excel進行RTD訂閱 /// </summary> /// <param name="TopicID"></param> /// <param name="Strings"></param> /// <param name="GetNewValues"></param> /// <returns></returns> public dynamic ConnectData(int TopicID, ref Array Strings, ref bool GetNewValues) { GetNewValues = true; try { if (m_Subscribes == null) { m_Subscribes = new List <RTDItem>(); } RTDItem temp = new RTDItem(Strings); m_Getter.GetRTDItem(temp); if (temp.Value == null) { //ThreadPool.QueueUserWorkItem((e) => //{ m_Getter.RefillData(temp); //}); } //if (temp.Value != null) { m_Subscribes.Add(temp); } m_Subscribes.Add(temp); } catch (Exception ex) { return("ERROR IN QUERY. " + ex.Message); } if (!m_tmrTimer.Enabled) { m_tmrTimer.Start(); } foreach (var item in m_Subscribes) { if (item.Equals(Strings)) { if (item.TopicID == -1) { item.TopicID = TopicID; } return(item.Value); } } return("Unrecognized"); }
public void RefillData(RTDItem data) { m_Req.Request("QUERY", data.Security + ";" + data.Field); }