private void StartButton_Click(object sender, EventArgs e) { StartButton.Enabled = false; Console.WriteLine(Processing.compensationFactor); try { string selectedResolution = resolutionComboBox.SelectedItem.ToString(); SetScreenArea(selectedResolution); isRunning = true; resolutionComboBox.Enabled = false; } catch (NullReferenceException) { MessageBox.Show("Please select a resolution"); StartButton.Enabled = true; } var t = Task.Run((Action)(() => { while (isRunning) { ninePoint = minolta.ReadNine(); corners = minolta.ReadCorners(); data = Processing.ProcessData(ninePoint); cornerdata = Processing.ProcessData(corners); ansiLumens = Calculations.AnsiLumens(data); Thread.Sleep(80); Invoke(new Action(() => { DisplayReading(data, cornerdata, ansiLumens); })); } })); }
private double[] GetLuxData(string[] data) { double[] lxdata = Processing.ProcessData(data); return(lxdata); }