示例#1
0
        /// <summary>Handle the hello message</summary>
        private void HandleMsg(OutMsg.RequestInstrument msg)
        {
            // Get or create a transmitter for the requested instrument
            var trans = Transmitters.GetOrAdd(msg.SymbolCode, k => new Transmitter(msg.SymbolCode, Instrument.CacheDBFilePath(Settings, msg.SymbolCode)));

            // Add the requested time frame
            trans.TimeFrames = trans.TimeFrames.Concat(msg.TimeFrame).Distinct().ToArray();
        }
示例#2
0
        /// <summary>Handle a request to start sending instrument data</summary>
        private void HandleMsg(OutMsg.RequestInstrument req)
        {
            // Add or select the associated transmitter, and ensure the time frames are being sent
            var trans = AddTransmitter(req.SymbolCode);

            trans.TimeFrames = trans.TimeFrames.Concat(req.TimeFrame).Distinct().ToArray();

            // Ensure data is sent, even if it hasn't changed
            trans.ForcePost();
        }