Exemplo n.º 1
0
        private void Sub_AM1_Compensation(OC_Mode mode, int band)
        {
            if (vars.Optic_Compensation_Stop == false)
            {
                RGB_Double HBM_GR1_Voltage = ocparam.Get_OC_Mode_RGB_Voltage(mode, band, gray: 10);
                RGB_Double AM1_Margin      = DP213OCSet.Get_AM1_Margin();

                RGB_Double New_AM1_Voltage = Get_New_AM1_Voltage(HBM_GR1_Voltage, AM1_Margin);
                RGB_Double AM0_Voltage     = ocparam.Get_OC_Mode_AM0_Voltage(mode, band);

                if (Is_All_AM1_Voltages_Lower_Than_AM0_Voltages(New_AM1_Voltage, AM0_Voltage))
                {
                    ocparam.Set_OC_Mode_AM1(New_AM1_Voltage, mode, band);
                    Set_All_AM1_WithSameValues(ocparam.Get_OC_Mode_AM1(mode, band));
                }
                else
                {
                    vars.Optic_Compensation_Stop    = true;
                    vars.Optic_Compensation_Succeed = false;
                    api.WriteLine("(Out of Range)At lease One AM1 > AM0, AM1 Compensation NG", Color.Red);
                }
            }
        }