private void SubMode123Compensation(int band, int gray) { //Mode1 cmd.SendGammaSetApplyCMD(DP213OCSet.GetGammaSet(OC_Mode.Mode1)); if (band != 0 && gray == 0) { RVreg1BSubCompensation(OC_Mode.Mode1, band, gray); CopyAndSendVreg1_OCMode1_to_OCMode23(band, gray); } else { RGBSubCompensation(OC_Mode.Mode1, band, gray); } UpdateOCMode23Target(band, gray); UpdateOCMode23InitGamma(band, gray); //Mode2 cmd.SendGammaSetApplyCMD(DP213OCSet.GetGammaSet(OC_Mode.Mode2)); RGBSubCompensation(OC_Mode.Mode2, band, gray); //Mode3 cmd.SendGammaSetApplyCMD(DP213OCSet.GetGammaSet(OC_Mode.Mode3)); RGBSubCompensation(OC_Mode.Mode3, band, gray); }
void Set_and_Send_ELVSS_CMD(OC_Mode SelectedMode, int band, double ELVSS_Voltages) { ocparam.Set_OC_Mode_ELVSS_Voltage(ELVSS_Voltages, SelectedMode, band); byte[][] output_cmd = ModelFactory.Get_DP213_Instance().Get_ELVSS_CMD(DP213OCSet.GetGammaSet(SelectedMode), ocparam.Get_OC_Mode_Cold_ELVSS_Voltages(SelectedMode)); cmd.SendMipiCMD(output_cmd); api.WriteLine("(Set and Send and update_textboxes) set/band ELVSS_Voltages : (" + DP213OCSet.GetGammaSet(SelectedMode).ToString() + "/" + band.ToString() + ")" + ELVSS_Voltages.ToString()); }
private void Black_OC_Initalize(int band) { cmd.DBV_Setting(ocparam.GetDBV(band).ToString("X3")); api.DisplayMonoPattern(new byte[] { 0, 0, 0 }, channel_num); Set_and_Send_AM0(DP213OCSet.Get_BlackCompensation_OCMode(), band, new RGB(0)); Thread.Sleep(300); }
private void WhiteCompensation() { OC_Mode mode = DP213OCSet.Get_WhiteCompensation_OCMode(); cmd.SendGammaSetApplyCMD(DP213OCSet.GetGammaSet(mode)); Band_Gray255_RGB_Compensation(mode, band: 0); Sub_VREF0_Compensation(Get_HBM_RGB_Min_AM2_Voltage()); }
private void GrayLowRefCompensation() { OC_Mode mode = DP213OCSet.Get_LowGrayRefCompensastion_OCMode(); cmd.SendGammaSetApplyCMD(DP213OCSet.GetGammaSet(mode)); base.SingleBand_RGB_Compensation(mode, band: 0); Sub_AM1_Compensation(mode, band: 0); }
private void ELVSSCompensation() { OC_Mode mode = DP213OCSet.Get_ELVSS_OCMode(); cmd.SendGammaSetApplyCMD(DP213OCSet.GetGammaSet(mode)); Band_Gray255_RGB_Compensation(mode, band: 0); Sub_ELVSS_and_Vinit2_Compensation(mode, band: 0, DP213OCSet.Get_ELVSS_Voltage_Max(), DP213OCSet.Get_ELVSS_Voltage_Min()); }
private void Ifneeded_CopyAndSend_Mode123toMode456(int band) { if (band <= DP213OCSet.Get_mode456_max_skip_band()) { CopyAndSend_RGBVreg1ModetoMode(OC_Mode.Mode1, OC_Mode.Mode4, band); CopyAndSend_RGBVreg1ModetoMode(OC_Mode.Mode2, OC_Mode.Mode5, band); CopyAndSend_RGBVreg1ModetoMode(OC_Mode.Mode3, OC_Mode.Mode6, band); } }
private bool REF4095_Compensation() { if (vars.Optic_Compensation_Stop == false) { const double REF4095_Resolution = 0.04; double REF4095_Margin = DP213OCSet.Get_REF4095_Margin(); double Black_Limit_Lv = DP213OCSet.Get_Black_Limit_Lv(); byte REF4095 = (byte)DP213_Static.REF4095_REF0_Max; Set_and_Send_VREF0_VREF4095(REF4095); while (REF4095 > 0) { if (REF4095 == 0) { REF4095 += Convert.ToByte(REF4095_Margin / REF4095_Resolution); Set_and_Send_VREF0_VREF4095(REF4095); api.WriteLine("Black(REF4095) Compensation OK (Case 1)"); return(true); } else { double[] measured = api.measure_XYL(channel_num); api.WriteLine("REF4095 / Lv : " + REF4095 + "/" + measured[2]); if (measured[2] < Black_Limit_Lv) { REF4095--; Set_and_Send_VREF0_VREF4095(REF4095); continue; } else { REF4095 += Convert.ToByte(REF4095_Margin / REF4095_Resolution); if (REF4095 > DP213_Static.REF4095_REF0_Max) { api.WriteLine("Black(REF4095) Compensation Fail (Black Margin Is Not Enough)"); return(false); } else { Set_and_Send_VREF0_VREF4095(REF4095); api.WriteLine("Black(REF4095) Compensation OK (Case 2)"); return(true); } } } } return(true); } return(false); }
public void Compensation() { if (vars.Optic_Compensation_Stop == false && DP213OCSet.Get_IsMain456CompensationApply() == true) { api.WriteLine("DP213 Main456 Compensation() Start", Color.Blue); MainCompensation(); api.WriteLine("DP213 Main456 Compensation() Finish", Color.Green); } else { api.WriteLine("DP213 Main456 Compensation() Skip", Color.Red); } }
private void Set_Vinit2_By_Adding_Offset(OC_Mode SelectedMode, double Found_ELVSS_Voltage) { Gamma_Set Set = DP213OCSet.GetGammaSet(SelectedMode); int Set_Index = Convert.ToInt16(Set); for (int band = 0; band < DP213_Static.Max_HBM_and_Normal_Band_Amount; band++) { double ELVSS_Offset = DP213OCSet.Get_ELVSS_Offset(SelectedMode, band); double Vinit2_Offset = DP213OCSet.Get_Vinit2_Offset(SelectedMode, band); double Vinit2_Voltage = Found_ELVSS_Voltage + ELVSS_Offset + Vinit2_Offset; ocparam.Set_OC_Mode_Vinit2_Voltage(Vinit2_Voltage, SelectedMode, band); } Send_Vinit2_Voltages(SelectedMode); }
private void SingleModeOC(OC_Mode mode) { cmd.SendGammaSetApplyCMD(DP213OCSet.GetGammaSet(mode)); for (int band = 0; band < DP213_Static.Max_HBM_and_Normal_Band_Amount && vars.Optic_Compensation_Stop == false; band++) { if (band > DP213OCSet.Get_mode456_max_skip_band()) { SingleBand_RGB_or_RVreg1B_Compensation(mode, band); } else { ApplyGamma(mode, band); } } }
private void Sub_VREF0_Compensation(double HBM_RGB_Min_AM2_Voltage) { if (vars.Optic_Compensation_Stop == false) { double VREF0_Margin = DP213OCSet.Get_VREF0_Margin(); double New_VREF0_Voltage = (HBM_RGB_Min_AM2_Voltage - VREF0_Margin); api.WriteLine("New VREF0 Voltage : " + New_VREF0_Voltage); if (Is_New_VREF0_Overflow(New_VREF0_Voltage)) { vars.Optic_Compensation_Stop = true; } else { Set_and_Send_VREF0(New_VREF0_Voltage); } } }
protected void RGBSubCompensation(OC_Mode mode, int band, int gray) { InitializeForCompensation(mode, band, gray); Apply_RGB_And_Measure(mode, band, gray); while (vars.Optic_Compensation_Succeed == false && vars.Optic_Compensation_Stop == false) { RGB Gamma = ocparam.Get_OC_Mode_RGB(mode, band, gray); RGBOpticCompensation(ref Gamma, mode, band, gray); if (Is_OC_Infished(ocparam.Get_OC_Mode_LoopCount(mode, band, gray), DP213OCSet.Get_MaxLoopCount())) { break; } Set_RGB_LoopCount(Gamma, mode, band, gray); Apply_RGB_And_Measure(mode, band, gray); } }
private void DisplayPattern(int band, byte GrayVal) { if (band < DP213_Static.Max_HBM_and_Normal_Band_Amount) { api.DisplayMonoPattern(new byte[3] { GrayVal, GrayVal, GrayVal }, channel_num); } else { api.DisplayBoxPattern(new byte[3] { GrayVal, GrayVal, GrayVal }, new byte[3] { 0, 0, 0 }, DP213OCSet.Get_AOD_LeftTopPos(), DP213OCSet.Get_AOD_RightBottomPos(), channel_num); } api.WriteLine("G" + GrayVal + " is applied", Color.Blue); }
private double Get_HBM_RGB_Min_AM2_Voltage() { RGB AM2 = ocparam.Get_OC_Mode_RGB(DP213OCSet.Get_WhiteCompensation_OCMode(), band: 0, gray: 0); int Vreg1 = ocparam.Get_OC_Mode_Vreg1(DP213OCSet.Get_WhiteCompensation_OCMode(), band: 0); int REF0 = ocparam.Get_Normal_REF0(); int REF4095 = ocparam.Get_Normal_REF4095(); double REF0_Voltage = Imported_my_cpp_dll.DP213_VREF0_Dec_to_Voltage(REF0); double REF4095_Voltage = Imported_my_cpp_dll.DP213_VREF4095_Dec_to_Voltage(REF4095); double Vreg1_Voltage = Imported_my_cpp_dll.DP213_Get_Vreg1_Voltage(REF4095_Voltage, REF0_Voltage, Vreg1); RGB_Double AM2_Voltage = new RGB_Double(); AM2_Voltage.double_R = Imported_my_cpp_dll.DP213_Get_AM2_Gamma_Voltage(REF4095_Voltage, Vreg1_Voltage, AM2.int_R); AM2_Voltage.double_G = Imported_my_cpp_dll.DP213_Get_AM2_Gamma_Voltage(REF4095_Voltage, Vreg1_Voltage, AM2.int_G); AM2_Voltage.double_B = Imported_my_cpp_dll.DP213_Get_AM2_Gamma_Voltage(REF4095_Voltage, Vreg1_Voltage, AM2.int_B); api.WriteLine("AM2_Voltage R/G/B : " + AM2_Voltage.double_R + "/" + AM2_Voltage.double_G + "/" + AM2_Voltage.double_B); api.WriteLine("Old VREF0 Voltage : " + REF0_Voltage); return(Get_Min_RGB_Voltage(AM2_Voltage)); }
private bool AM0_Compensation() { RGB_Double AM0_Margin = DP213OCSet.Get_AM0_Margin(); double AM0_Resolution = Imported_my_cpp_dll.Get_DP213_EA9155_AM0_Resolution(ocparam.Get_Normal_REF0(), ocparam.Get_Normal_REF4095()); RGB New_AM0 = new RGB(); New_AM0.int_R = Convert.ToInt32(AM0_Margin.double_R / AM0_Resolution); New_AM0.int_G = Convert.ToInt32(AM0_Margin.double_G / AM0_Resolution); New_AM0.int_B = Convert.ToInt32(AM0_Margin.double_B / AM0_Resolution); bool AM0_OC_Ok = (New_AM0.int_R <= DP213_Static.AM1_AM0_Max) && (New_AM0.int_G <= DP213_Static.AM1_AM0_Max) && (New_AM0.int_B <= DP213_Static.AM1_AM0_Max); api.WriteLine("DP213_Static.AM1_AM0_Max : " + DP213_Static.AM1_AM0_Max); api.WriteLine("New_AM0 R/G/B : " + New_AM0.int_R + "/" + New_AM0.int_G + "/" + New_AM0.int_B); if (AM0_OC_Ok) { Set_All_AM0_WithSameValues(New_AM0); } return(AM0_OC_Ok); }
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); } } }
protected bool IsNotSkipTarget(int band, int gray) { double Target_LV = ocparam.Get_OC_Mode_Target(OC_Mode.Mode1, band, gray).double_Lv; return(Target_LV >= DP213OCSet.Get_SkipTargetLv()); }
void Update_Vreg1_From_Sample() { try { byte[] OCMode1_cmds = DP213Model.getInstance().Get_Normal_Read_Vreg1_CMD(DP213OCSet.GetGammaSet(OC_Mode.Mode1)); byte[] OCMode2_cmds = DP213Model.getInstance().Get_Normal_Read_Vreg1_CMD(DP213OCSet.GetGammaSet(OC_Mode.Mode2)); byte[] OCMode3_cmds = DP213Model.getInstance().Get_Normal_Read_Vreg1_CMD(DP213OCSet.GetGammaSet(OC_Mode.Mode3)); byte[] OCMode4_cmds = DP213Model.getInstance().Get_Normal_Read_Vreg1_CMD(DP213OCSet.GetGammaSet(OC_Mode.Mode4)); byte[] OCMode5_cmds = DP213Model.getInstance().Get_Normal_Read_Vreg1_CMD(DP213OCSet.GetGammaSet(OC_Mode.Mode5)); byte[] OCMode6_cmds = DP213Model.getInstance().Get_Normal_Read_Vreg1_CMD(DP213OCSet.GetGammaSet(OC_Mode.Mode6)); byte[] OCMode1_ReadVreg1 = dprotocal.GetReadData(OCMode1_cmds); byte[] OCMode2_ReadVreg1 = dprotocal.GetReadData(OCMode2_cmds); byte[] OCMode3_ReadVreg1 = dprotocal.GetReadData(OCMode3_cmds); byte[] OCMode4_ReadVreg1 = dprotocal.GetReadData(OCMode4_cmds); byte[] OCMode5_ReadVreg1 = dprotocal.GetReadData(OCMode5_cmds); byte[] OCMode6_ReadVreg1 = dprotocal.GetReadData(OCMode6_cmds); for (int band = 0; band < DP213_Static.Max_HBM_and_Normal_Band_Amount; band++) { Set_OC_Mode_Vreg1(ModelFactory.Get_DP213_Instance().Get_Normal_Vreg1s(OCMode1_ReadVreg1, band), OC_Mode.Mode1, band); Set_OC_Mode_Vreg1(ModelFactory.Get_DP213_Instance().Get_Normal_Vreg1s(OCMode2_ReadVreg1, band), OC_Mode.Mode2, band); Set_OC_Mode_Vreg1(ModelFactory.Get_DP213_Instance().Get_Normal_Vreg1s(OCMode3_ReadVreg1, band), OC_Mode.Mode3, band); Set_OC_Mode_Vreg1(ModelFactory.Get_DP213_Instance().Get_Normal_Vreg1s(OCMode4_ReadVreg1, band), OC_Mode.Mode4, band); Set_OC_Mode_Vreg1(ModelFactory.Get_DP213_Instance().Get_Normal_Vreg1s(OCMode5_ReadVreg1, band), OC_Mode.Mode5, band); Set_OC_Mode_Vreg1(ModelFactory.Get_DP213_Instance().Get_Normal_Vreg1s(OCMode6_ReadVreg1, band), OC_Mode.Mode6, band); } } catch (Exception) { MessageBox.Show("Update_Vreg1_From_Sample() fail"); } }
private void Send_Vinit2_Voltages(OC_Mode SelectedMode) { double[] Vinit2_Voltages = ocparam.Get_OC_Mode_Vinit2_Voltages(SelectedMode); byte[][] output_cmd = ModelFactory.Get_DP213_Instance().Get_Vinit2_CMD(DP213OCSet.GetGammaSet(SelectedMode), Vinit2_Voltages); cmd.SendMipiCMD(output_cmd); api.WriteLine("Send_Vinit2_Voltages, OC_Mode : " + SelectedMode.ToString()); }
protected void ApplyGamma(OC_Mode mode, int band) { RGB AM0 = ocparam.Get_OC_Mode_AM0(mode, band); RGB AM1 = ocparam.Get_OC_Mode_AM1(mode, band); byte[][] output_cmds = ModelFactory.Get_DP213_Instance().Get_Gamma_AM1_AM0_CMD(DP213OCSet.GetGammaSet(mode), band, ocparam.Get_OC_Mode_RGB(mode, band), AM1, AM0); cmd.SendMipiCMD(output_cmds); Thread.Sleep(20); }
protected void ApplyVreg1(OC_Mode mode) { byte[][] output_cmds = ModelFactory.Get_DP213_Instance().Get_Vreg1_CMD(DP213OCSet.GetGammaSet(mode), ocparam.Get_OC_Mode_Vreg1(mode)); cmd.SendMipiCMD(output_cmds); Thread.Sleep(20); }