Example #1
0
        /// <summary>
        /// Elapsed イベントハンドラ
        /// </summary>
        /// <param name="sender">イベント発行元</param>
        /// <param name="e">イベント引数</param>
        private void OnTick(object sender, EventArgs e)
        {
            if (this.LineGraphItemCollection.Count > 0)
            {
                foreach (var item in this.LineGraphItemCollection.Where(x => (bool)x.Tag).Select((x, i) => new { a = this._amps[i], f = this._freqs[i], Graph = x }))
                {
                    item.Graph.YData = item.Graph.XData.Select(x => item.a * Math.Sin(2 * Math.PI * item.f * (x + _count) / 1000.0) + 500.0 + 200.0 * (this._rand.NextDouble() - 0.5)).ToArray();
                }

                LineGraphTrigger.ReDraw();
                this._count += 10;
            }
        }
 /// <summary>
 /// 静的なコンストラクタ
 /// </summary>
 static LineGraphTrigger()
 {
     Instance = new LineGraphTrigger();
 }