public void rpc_function_tset(string path) { int rc; string errMsg = ""; string statusMsg = ""; byte[] DUTResp = new byte[0]; PGRemoteRPCClient client = new PGRemoteRPCClient(); rc = client.Connect("", 2799); if (rc < 0) { textBox1.Text = " can't connect to PGReomte"; } //StreamWriter sw = new StreamWriter(picture_path.FileName); StreamReader sr = new StreamReader(path); string line = string.Empty; int temp = 0; while ((line = sr.ReadLine()) != null) { if (line.StartsWith("/")) { if (File.Exists(temp.ToString() + ".txt")) { client.MIPICmd(RPCDefs.RPC_SCRIPT, 0, false, RPCDefs.DT_HS, 0, 0, 0, 0, System.IO.Directory.GetCurrentDirectory() + "\\" + temp.ToString() + ".txt", null, ref errMsg, ref statusMsg); client.PGRemoteQuery(RPCCmds.GET_DUT_RESPONSE, 0, ref DUTResp, ref errMsg, ref statusMsg); textBox1.Text = BitConverter.ToString(DUTResp); try { File.Delete(temp.ToString() + ".txt"); } catch (System.IO.IOException error) { Console.WriteLine(error.ToString()); return; } } temp++; } else { StreamWriter sw = new StreamWriter(temp.ToString() + ".txt", true); sw.WriteLine(line); sw.Close(); } } sr.Close(); }
public void SEND_Video_mode(string file_path) { PGRemoteRPCClient client = new PGRemoteRPCClient(); int rc = client.Connect("", 2799); string errMsg = ""; string statusMsg = ""; byte[] DUTResp = new byte[0]; if (rc < 0) { return; } client.MIPICmd(RPCDefs.PACKED_PIXEL_STREAM_888, 0, false, RPCDefs.DT_HS, 0, 1, 0, 0, file_path, null, ref errMsg, ref statusMsg); client.Disconnect(true); }
public void Send_Split_RPC(string file_path) { PGRemoteRPCClient client = new PGRemoteRPCClient(); int rc = client.Connect("", 2799); string errMsg = ""; string statusMsg = ""; byte[] DUTResp = new byte[0]; if (rc < 0) { return; } //StreamWriter sw = new StreamWriter(picture_path.FileName); StreamReader sr = new StreamReader(file_path); string line = string.Empty; int temp = 0; while ((line = sr.ReadLine()) != null) { if (line.StartsWith("/")) { if (File.Exists(temp.ToString())) { client.MIPICmd(RPCDefs.RPC_SCRIPT, 0, false, RPCDefs.DT_HS, 0, 0, 0, 0, temp.ToString(), null, ref errMsg, ref statusMsg); client.PGRemoteQuery(RPCCmds.GET_DUT_RESPONSE, 0, ref DUTResp, ref errMsg, ref statusMsg); try { File.Delete(temp.ToString()); } catch (System.IO.IOException error) { Console.WriteLine(error.ToString()); return; } temp++; } else { StreamWriter sw = new StreamWriter(temp.ToString() + ".txt", true); sw.WriteLine(line); sw.Close(); } } } }
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(); }