private void button3_Click(object sender, EventArgs e) { int Y_Start = 5; int Y_now = 1; Y_now = Y_Start; OpenFileDialog openOutputData = new OpenFileDialog(); if (openOutputData.ShowDialog() != DialogResult.OK) { return; } output_path = openOutputData.FileName; MIPI_Auto_Test Auto_Control = new MIPI_Auto_Test(); Auto_Control.Excel_open(output_path, 1); Auto_Control.EXcel_sheet_select("AC timing"); //設定條件 //送Data for (int i = Y_Start; i < 180 + Y_Start; i++) { Auto_Control.Write_Excel_cell(i, 19, "123"); } Auto_Control.Save_Excel(); Auto_Control.Close_Excel(); }
private void Auto_Skew_Task() { MIPI_Auto_Test Auto_Control = new MIPI_Auto_Test(); Auto_Control.Excel_open(output_path, 1); Auto_Control.EXcel_sheet_select("Skew"); int x_start = 18; int y_start = 3; int x_now = x_start; int y_now = y_start; int ui_step = 100; float ui = 1 / (Test_Condition.bitrate); float ui_step_unit = ui / ui_step; for (int i = 0; i < 4; i++) { for (int j = 0; j < ui_step; j++) { /*設定條件*/ /*送出Data*/ /*取得回傳值*/ /*寫入excel*/ Auto_Control.Write_Excel_cell(y_now, x_now + j, (ui_step_unit * j).ToString()); } y_now++; x_now = x_start; } Auto_Control.Save_Excel(); Auto_Control.Close_Excel(); }
private void Auto_Swing_Task() { MIPI_Auto_Test Auto_Control = new MIPI_Auto_Test(); Auto_Control.Excel_open(output_path, 1); Auto_Control.EXcel_sheet_select("HS_Swing"); float[,] swing_item = new float[, ] { { 0.29F, -0.15F }, { 0.14F, 0F }, { 0.59F, 0.07F }, { 0.4F, 0.26F } }; int x_start = 3; int y_start = 19; int x_now = x_start; int y_now = y_start; for (int i = 0; i < swing_item.GetLength(0); i++) { for (float bitrate = 100; bitrate <= Test_Condition.bitrate; bitrate += 50) { //設定PG //送Command //Read back //寫入excel Auto_Control.Write_Excel_cell(y_now, x_now, bitrate.ToString() + swing_item[i, 0].ToString() + swing_item[i, 1].ToString()); y_now++; } y_now = y_start; x_now++; } Auto_Control.Save_Excel(); Auto_Control.Close_Excel(); }
public void Video_Auto_thread(int start_X) { PGRemoteRPCClient client = new PGRemoteRPCClient(); int rc = client.Connect("", 2799); string errMsg = ""; string statusMsg = ""; byte[] DUTResp = new byte[0]; if (rc < 0) { return; } MIPI_Auto_Test Auto_Control = new MIPI_Auto_Test(); int excel_X = start_X, excel_Y = 1; Auto_Control.Excel_open(output_path, 2); PG_Setting_Value.lane = Test_Condition.lane; PG_Setting_Value.hsa = Test_Condition.hsa; PG_Setting_Value.hbp = Test_Condition.hbp; PG_Setting_Value.hfp = Test_Condition.hfp; PG_Setting_Value.hact = Test_Condition.hact; PG_Setting_Value.vsa = Test_Condition.vsa; PG_Setting_Value.vbp = Test_Condition.vbp; PG_Setting_Value.vfp = Test_Condition.vfp; PG_Setting_Value.vact = Test_Condition.vact; PG_Setting_Value.framerate = Test_Condition.framerate; PG_Setting_Value.bbp = Test_Condition.bbp; PG_Setting_Value.Calculate_bitrate(); while (PG_Setting_Value.bitrate < Test_Condition.bitrate) { client.PGRemoteCmd(RPCCmds.START_EDIT_CONFIG, ref errMsg, ref statusMsg); client.PGRemoteCmd(RPCCmds.SET_LP_FREQ, (float)18e+6, ref errMsg, ref statusMsg); client.PGRemoteCmd(RPCCmds.SET_HS_FREQ, (PG_Setting_Value.bitrate) / 2 + 1, ref errMsg, ref statusMsg); client.PGRemoteCmd(RPCCmds.END_EDIT_CONFIG, ref errMsg, ref statusMsg); client.PGRemoteCmd(RPCCmds.SET_TIMING_HSYNC, PG_Setting_Value.hsa, ref errMsg, ref statusMsg); client.PGRemoteCmd(RPCCmds.SET_TIMING_HBPORCH, PG_Setting_Value.hbp, ref errMsg, ref statusMsg); client.PGRemoteCmd(RPCCmds.SET_TIMING_HFPORCH, PG_Setting_Value.hfp, ref errMsg, ref statusMsg); client.PGRemoteCmd(RPCCmds.SET_TIMING_HACTIVE, PG_Setting_Value.hact, ref errMsg, ref statusMsg); client.PGRemoteCmd(RPCCmds.SET_TIMING_VSYNC, PG_Setting_Value.vsa, ref errMsg, ref statusMsg); client.PGRemoteCmd(RPCCmds.SET_TIMING_VBPORCH, PG_Setting_Value.vbp, ref errMsg, ref statusMsg); client.PGRemoteCmd(RPCCmds.SET_TIMING_VFPORCH, PG_Setting_Value.vfp, ref errMsg, ref statusMsg); client.PGRemoteCmd(RPCCmds.SET_TIMING_VACTIVE, PG_Setting_Value.vact, ref errMsg, ref statusMsg); client.MIPICmd(RPCDefs.PACKED_PIXEL_STREAM_888, 0, false, RPCDefs.DT_HS, 0, 1, 0, 0, Test_Condition.picture_path, null, ref errMsg, ref statusMsg); client.MIPICmd(RPCDefs.BTA, 0, false, RPCDefs.DT_LP, 0, 0, 0, 0, "", null, ref errMsg, ref statusMsg); Thread.Sleep(5000); client.MIPICmd(RPCDefs.BTA, 0, false, RPCDefs.DT_LP, 0, 0, 0, 0, "", null, ref errMsg, ref statusMsg); client.PGRemoteQuery(RPCCmds.GET_DUT_RESPONSE, 0, ref DUTResp, ref errMsg, ref statusMsg); Auto_Control.Write_Excel_cell(excel_Y, excel_X, "HFP " + PG_Setting_Value.hfp + "HBP " + PG_Setting_Value.hbp + "HSA " + PG_Setting_Value.hsa + "Bit Rate " + (PG_Setting_Value.bitrate) / 1000000); Auto_Control.Write_Excel_cell(excel_Y, excel_X + 1, BitConverter.ToString(DUTResp)); excel_Y++; client.PGRemoteCmd(RPCCmds.PG_ABORT, ref errMsg, ref statusMsg); PG_Setting_Value.hsa += 16; PG_Setting_Value.hbp += 16; PG_Setting_Value.hfp += 16; PG_Setting_Value.Calculate_bitrate(); } client.Disconnect(true); Auto_Control.Save_Excel(); Auto_Control.Close_Excel(); }