Пример #1
0
        private void Sub_DP213_Get_Intial_R_G_B_Using_3Points_Method(Gamma_Set Set, int band, int gray, OC_Mode Mode)
        {
            RGB_Double Prvious_Gray_Gamma_Voltage;

            if (gray == 4 || gray == 6 || gray == 8)
            {
                Prvious_Gray_Gamma_Voltage = storage.Get_Voltage_All_band_gray_Gamma(Set, band, (gray - 2));
            }
            else
            {
                Prvious_Gray_Gamma_Voltage = storage.Get_Voltage_All_band_gray_Gamma(Set, band, (gray - 1));
            }

            double Voltage_VREF4095 = storage.Get_Voltage_VREF4095();
            double Voltage_VREF0    = storage.Get_Voltage_VREF0();

            int[]    Band_Gray_Gamma_Red           = new int[band * DP213_Static.Max_Gray_Amount];    //Prev bands' grays
            int[]    Band_Gray_Gamma_Green         = new int[band * DP213_Static.Max_Gray_Amount];    //Prev bands' grays
            int[]    Band_Gray_Gamma_Blue          = new int[band * DP213_Static.Max_Gray_Amount];    //Prev bands' grays
            double[] Band_Gray_Finally_Measured_Lv = new double[band * DP213_Static.Max_Gray_Amount]; //Prev bands' grays
            int[]    Band_Vreg1_Dec = new int[band + 1];                                              //Pre + Current bands

            double[] Band_Voltage_AM1_R = new double[band + 1];                                       //Pre + Current bands
            double[] Band_Voltage_AM1_G = new double[band + 1];                                       //Pre + Current bands
            double[] Band_Voltage_AM1_B = new double[band + 1];                                       //Pre + Current bands

            for (int b = 0; b < band; b++)
            {
                for (int g = 0; g < DP213_Static.Max_Gray_Amount; g++)
                {
                    Band_Gray_Gamma_Red[(b * DP213_Static.Max_Gray_Amount) + g]           = storage.Get_All_band_gray_Gamma(Set, b, g).int_R;
                    Band_Gray_Gamma_Green[(b * DP213_Static.Max_Gray_Amount) + g]         = storage.Get_All_band_gray_Gamma(Set, b, g).int_G;
                    Band_Gray_Gamma_Blue[(b * DP213_Static.Max_Gray_Amount) + g]          = storage.Get_All_band_gray_Gamma(Set, b, g).int_B;
                    Band_Gray_Finally_Measured_Lv[(b * DP213_Static.Max_Gray_Amount) + g] = dp213_mornitoring().Get_Mode_Measured_Values(b, g, Mode).double_Lv;
                }
                Band_Vreg1_Dec[b]     = storage.Get_Normal_Dec_Vreg1(Set, b);
                Band_Voltage_AM1_R[b] = storage.Get_Band_Set_Voltage_AM1(Set, b).double_R;
                Band_Voltage_AM1_G[b] = storage.Get_Band_Set_Voltage_AM1(Set, b).double_G;
                Band_Voltage_AM1_B[b] = storage.Get_Band_Set_Voltage_AM1(Set, b).double_B;
            }
            Band_Vreg1_Dec[band]     = vars.Vreg1;
            Band_Voltage_AM1_R[band] = storage.Get_Band_Set_Voltage_AM1(Set, band).double_R;
            Band_Voltage_AM1_G[band] = storage.Get_Band_Set_Voltage_AM1(Set, band).double_G;
            Band_Voltage_AM1_B[band] = storage.Get_Band_Set_Voltage_AM1(Set, band).double_B;

            for (int b = 0; b < band; b++)
            {
                Band_Vreg1_Dec[b] = storage.Get_Normal_Dec_Vreg1(Set, b);
            }

            f1().GB_Status_AppendText_Nextline("Before) R/G/B/Vreg1 = " + vars.Gamma.int_R.ToString() + "/" + vars.Gamma.int_G.ToString().ToString() + "/" + vars.Gamma.int_B.ToString() + "/" + vars.Vreg1, Color.Blue);

            Imported_my_cpp_dll.DP213_Get_Intial_R_G_B_Using_3Points_Method
                (Combine_Lv_Ratio,
                Band_Voltage_AM1_R,
                Band_Voltage_AM1_G,
                Band_Voltage_AM1_B,
                ref vars.Gamma.int_R,
                ref vars.Gamma.int_G,
                ref vars.Gamma.int_B,
                Get_Is_Selected_Bands(Mode),
                Band_Gray_Gamma_Red,
                Band_Gray_Gamma_Green,
                Band_Gray_Gamma_Blue,
                Band_Gray_Finally_Measured_Lv,
                Band_Vreg1_Dec,
                band,
                gray,
                vars.Target.double_Lv,
                Prvious_Gray_Gamma_Voltage.double_R,
                Prvious_Gray_Gamma_Voltage.double_G,
                Prvious_Gray_Gamma_Voltage.double_B,
                Voltage_VREF4095,
                Voltage_VREF0);

            f1().GB_Status_AppendText_Nextline("After C++(PolyI)) R/G/B/Vreg1 = " + vars.Gamma.int_R.ToString() + "/" + vars.Gamma.int_G.ToString().ToString() + "/" + vars.Gamma.int_B.ToString() + "/" + vars.Vreg1, Color.Red);
            init_algorithm_storage_cpp.Set_All_band_gray_Gamma(Set, band, gray, vars.Gamma);
        }