Exemplo n.º 1
0
        /// <summary>
        /// Adds a single sample to the sampler of the specified name, if the sampler does
        /// not exists it will be created. This function is intended to be used with sampler that
        /// are not bound to a function.
        /// </summary>
        public void AddSample(String name, float value)
        {
            DataSampler sampler;

            if (!samplers.TryGetValue(name, out sampler))
            {
                sampler = new DataSampler(name);
                InsertSampler(name, sampler);
            }
            sampler.InsertSample(value);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds a single sample to the sampler of the specified name, if the sampler does
        /// not exists it will be created with the specified historyLength.
        /// This function is intended to be used with sampler that are not bound to a function.
        /// </summary>
        public void AddSample(string name, float value, int historyLength)
        {
            DataSampler sampler;

            if (!samplers.TryGetValue(name, out sampler))
            {
                sampler = new DataSampler(name, historyLength, 0, default(Func <float>));
                InsertSampler(name, sampler);
            }
            else
            {
                sampler.Values.Capacity = historyLength;
            }
            sampler.InsertSample(value);
        }
Exemplo n.º 3
0
 private void InsertSampler(String name, DataSampler sampler)
 {
     samplers.Add(name, sampler);
     observableSamplers.Add(sampler);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Adds an sampler which is bound to a <c>function</c> that will be sampled
        /// every <c>sampleRate</c> frames. <c>historyLength</c> values will be kept.
        /// </summary>
        public void AddSampler(String name, int historyLength, int sampleRate, Func <float, float> function)
        {
            DataSampler sampler = new DataSampler(name, historyLength, sampleRate, function);

            InsertSampler(name, sampler);
        }
Exemplo n.º 5
0
 void InsertSampler(String name, DataSampler sampler)
 {
     _samplers.Add(name, sampler);
     ObservableSamplers.Add(sampler);
 }