Example #1
0
        private void GetMeasurementsButton_Click(object sender, EventArgs e)
        {
            data.name        = nameTextBox.Text;
            data.projectorID = projectorSerialNumberTextBox.Text;
            data.lampType    = lampTypeTextBox.Text;

            WhiteMeasurementsPanel.Enabled = true;
            WhiteLuxTextLabel.Text         = "Measuring White...";

            projector.OpenShutter();
            projector.WhiteTP();
            refreshMinolta();
            WhiteLuxTextLabel.Text = "White";
            data.whiteNinePoint    = GetLuxData(minolta.ReadNine());
            data.whiteCorners      = GetLuxData(minolta.ReadNine());

            DisplayWhiteData(data.whiteNinePoint, data.whiteCorners);

            BlackMeasurmentsPanel.Enabled = true;
            BlackLuxTextLabel.Text        = "Measuring Black...";
            this.Refresh();
            projector.BlackTP();

            refreshMinolta();
            BlackLuxTextLabel.Text = "Black";
            data.blackNinePoint    = GetLuxData(minolta.ReadNine());
            data.blackCorners      = GetLuxData(minolta.ReadCorners());

            DisplayBlackData(data.blackNinePoint, data.blackCorners);

            DarkMeasurementsPanel.Enabled = true;
            DarkLuxTextLabel.Text         = "Measuring Dark...";
            this.Refresh();
            projector.CloseShutter();

            refreshMinolta();
            DarkLuxTextLabel.Text = "Dark";
            data.darkNinePoint    = GetLuxData(minolta.ReadNine());
            data.darkCorners      = GetLuxData(minolta.ReadCorners());

            DisplayDarkData(data.darkNinePoint, data.darkCorners);
            this.Refresh();

            data.ansiLumens = Calculations.AnsiLumens(data.whiteNinePoint);
            Console.WriteLine("data class Lumens: " + data.ansiLumens);
            data.ansiUniformity     = Calculations.AnsiUniformity(data.whiteNinePoint, data.whiteCorners);
            data.dpUniformity       = Calculations.DPUniformity(data.whiteNinePoint);
            data.fullScreenContrast = Calculations.FullScreenContrast(data.whiteNinePoint, data.blackNinePoint, data.darkNinePoint);
            data.centreLumens       = Calculations.CenterLumens(data.whiteNinePoint[4]);
            data.centreContrast     = Calculations.CenterContrast(data.whiteNinePoint[4], data.blackNinePoint[4], data.darkNinePoint[4]);

            DisplayReadings(data.ansiLumens, data.ansiUniformity, data.dpUniformity, data.fullScreenContrast, data.centreLumens, data.centreContrast);

            pleasewait.ShowDialog();
        }
Example #2
0
        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);
                    }));
                }
            }));
        }