Exemplo n.º 1
0
        /// <summary>
        /// Processes live data
        /// </summary>
        /// <param name="graphDataFormat">Used to specify the format of the graph</param>
        private static void ProcessLiveData(object graphDataFormat)
        {
            int         count;
            string      data;
            string      scope  = GraphManager.Instance.DefaultGraphComponentsInstance.Scope;
            UpdateSnagl import = new UpdateSnagl(UpdateSnaglWithLiveData);

            while (GraphManager.Instance.LiveEnabled)
            {
                lock (syncObj)
                {
                    if (graphData.Count > 0)
                    {
                        // Read the data from the queue
                        data  = graphData.Dequeue();
                        count = graphData.Count;

                        // Don't update unless you MAKE SURE you know what you're doing and understand deferred execution
                        DispatcherHelper.UIDispatcher.BeginInvoke(import, data, scope, graphDataFormat, count);
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Processes live data
        /// </summary>
        /// <param name="graphDataFormat">Used to specify the format of the graph</param>
        private static void ProcessLiveData(object graphDataFormat)
        {
            int count;
            string data;
            string scope = GraphManager.Instance.DefaultGraphComponentsInstance.Scope;
            UpdateSnagl import = new UpdateSnagl(UpdateSnaglWithLiveData);

            while (GraphManager.Instance.LiveEnabled)
            {
                lock (syncObj)
                {
                    if (graphData.Count > 0)
                    {
                        // Read the data from the queue
                        data = graphData.Dequeue();
                        count = graphData.Count;

                        // Don't update unless you MAKE SURE you know what you're doing and understand deferred execution
                        DispatcherHelper.UIDispatcher.BeginInvoke(import, data, scope, graphDataFormat, count);
                    }
                }
            }
        }