public ArduinoPlotter(ref Chart chart, ref Label _lblBufferStatus) { chartHandler = new ChartHandler(ref chart, 1000); chartHandler.ConfigureChart("Leituras", "Arduino Plotter", "Pontos", "Valores"); arduinoHandler = new ArduinoHandler(); dataconsumer = new ThreadHandler(() => { if (arduinoHandler.dataWaiting) { chartHandler.AddYToBuffer(arduinoHandler.bufferAquisition.SecureDequeue() * 5 / 1024.0); } }); bufferLabelUpdater = new Timer(); lblBufferStatus = _lblBufferStatus; bufferLabelUpdater.Interval = 50; bufferLabelUpdater.Tick += bufferLabelUpdater_Tick; }
private void addToBufferToolStripMenuItem_Click(object sender, EventArgs e) { mychart.AddYToBuffer(Math.Sin(DateTime.Now.Second + DateTime.Now.Millisecond / 1000.0)); }