|
@@ -42,7 +42,6 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
private Context mAlertContext;
|
|
|
//MainActivity mMainAct = new MainActivity();
|
|
|
private byte[] mRawdataBytes = new byte[42*30*2*2];
|
|
|
- private byte[] mManualRef = new byte[42*30*2*2];
|
|
|
private int[] mManualRefInt = new int[42*30*2];
|
|
|
private static final int RAWDATA_MESSAGE = 0;
|
|
|
private static final int LOG1_MESSAG = 1;
|
|
@@ -80,11 +79,8 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
private EditText edt_TestiInformation; //显示测试过程信息
|
|
|
|
|
|
private boolean isReceiverMessage = true;
|
|
|
-
|
|
|
private boolean isNeedFindDevice = true;
|
|
|
|
|
|
- private int bottonMode = 0;
|
|
|
-
|
|
|
private UsbInterface mUsbInterface;
|
|
|
private Context mContext;
|
|
|
|
|
@@ -101,19 +97,18 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
private TextView tvMinimum; //显示最小值
|
|
|
private TextView tvDataContent; //显示当前处于何种数值模式:原始值、差值、基准……
|
|
|
private TextView tvMAD; //显示最大相邻偏差
|
|
|
+ private TextView mtextView;
|
|
|
|
|
|
- public String stTestLog; //测试信息存放字符串
|
|
|
- String stTestLogShow= ""; //测试信息合并起来存放字符串
|
|
|
+ public String stTestLog; //最大最小值测试信息存放字符串
|
|
|
+ String stTestLogShow= ""; //最大最小值测试信息合并起来存放字符串
|
|
|
|
|
|
- public String Update_log;
|
|
|
- public String Update_log1;
|
|
|
- String updateLogShow= "";
|
|
|
+ public String Update_log; //短路测试信息存放字符串
|
|
|
+ String updateLogShow= ""; //短路测试信息合并起来存放字符串
|
|
|
|
|
|
private byte showFlag = 0; //
|
|
|
private byte btTestStep = 0;
|
|
|
|
|
|
- private EditText mError;
|
|
|
- private TextView tvUpDataResult;
|
|
|
+ private EditText edtShortCircuitInfo; //the info of short circuit test
|
|
|
|
|
|
private static final byte gt9110h_short_dsp_code[] = {
|
|
|
0x02,0x0c,(byte)0xb7,(byte)0x8f,0x08,0x7e,0x00,0x7f,0x71,0x7d,0x00,0x7b,0x01,0x7a,(byte)0xa5,0x79,
|
|
@@ -564,11 +559,11 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
edt_ColNum = (EditText) findViewById(R.id.inputcolnum);
|
|
|
edt_Maximum = (EditText) findViewById(R.id.inputmaximum);
|
|
|
edt_Minimum = (EditText) findViewById(R.id.inputminimum);
|
|
|
- edt_TestiInformation = (EditText) findViewById(R.id.testinformation); //显示测试过程信息
|
|
|
+ edt_TestiInformation = (EditText) findViewById(R.id.maxandmintestinfo); //显示测试过程信息
|
|
|
edt_TestiInformation.setKeyListener(null);
|
|
|
|
|
|
- mError = (EditText) findViewById(R.id.error);
|
|
|
- mError.setKeyListener(null);
|
|
|
+ edtShortCircuitInfo = (EditText) findViewById(R.id.shortcircuitinfo);
|
|
|
+ edtShortCircuitInfo.setKeyListener(null);
|
|
|
}
|
|
|
|
|
|
private void InitListener(){
|
|
@@ -693,7 +688,6 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
//if(0x80 == mUsbEndpointIn)
|
|
|
//mlog1.setEnabled(true);
|
|
|
- //mToggle = false;
|
|
|
//isDetached = true;
|
|
|
isNeedFindDevice = false;
|
|
|
// mSendMessage.setEnabled(true);
|
|
@@ -795,9 +789,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointIn, wBuffer, offset, 0x40, 3000);
|
|
|
|
|
|
if (i != 0x40) {
|
|
|
- // mError.setText("iicWrite Failed");
|
|
|
return false;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
address = address + 63;
|
|
@@ -859,9 +851,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointOut, iicWriteData, 0, 0x40, 100);
|
|
|
|
|
|
if (i != 0x40) {
|
|
|
- // mError.setText("iicWrite Failed");
|
|
|
return false;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
address = address + 57;
|
|
@@ -887,7 +877,6 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
iicByteData[7] = data;
|
|
|
if ((null == mUsbEndpointIn) || (null == mUsbEndpointOut)){
|
|
|
i=0;
|
|
|
- // mrawlog.setText("mUsbEndpointIn is null");
|
|
|
}
|
|
|
else {
|
|
|
i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointOut, iicByteData, 0, 0x40, 100);
|
|
@@ -899,14 +888,6 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- private boolean iicTest() {
|
|
|
-
|
|
|
- if(isReceiverMessage)
|
|
|
- return false;
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
//发送命令,使得S818可以通过IIC向GT9的固定地址读取1byte数据
|
|
|
private byte iicByteRead(byte addressHigh,byte addressLow) {
|
|
|
|
|
@@ -918,11 +899,9 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
iicByteData[6] = 0x01; //lengthlow
|
|
|
|
|
|
iicByteData[7] = 0x00;
|
|
|
- // mThreadPool.execute(new Runnable() {
|
|
|
- // @Override
|
|
|
- // public void run() {
|
|
|
+
|
|
|
int i;
|
|
|
- boolean byteReceiverLoop = true;
|
|
|
+
|
|
|
i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointOut, iicByteData, 0, 0x40, 100);
|
|
|
if (i != 0x40)
|
|
|
return 0x77; //用0x77来表示传输失败
|
|
@@ -931,8 +910,6 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
isReceiverMessage = false; //先关闭循环接收信息
|
|
|
|
|
|
- // while(byteReceiverLoop) {
|
|
|
-
|
|
|
i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointIn, mBytes, 0, 0x40, 3000);
|
|
|
|
|
|
SystemClock.sleep(12); //加长时间,避免数据显示错乱乱闪
|
|
@@ -941,32 +918,18 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
return mBytes[1];
|
|
|
else
|
|
|
return 0x77; //用0x77来表示传输失败
|
|
|
- // }
|
|
|
-
|
|
|
- // return 0x77; //用0x77来表示传输失败
|
|
|
- // }
|
|
|
- // });
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private boolean changeToDebugMode() {
|
|
|
|
|
|
- byte maddressHigh = (byte)0x80;
|
|
|
- byte maddressLow = (byte)0x46;
|
|
|
- byte msubcommand =0x0f ; //
|
|
|
- byte mdata = (byte)0x01;
|
|
|
-
|
|
|
- //if(false) {
|
|
|
- maddressHigh = (byte) 0x80;
|
|
|
- maddressLow = (byte) 0x40;
|
|
|
- msubcommand = (byte) 0x06; //ENTRY_DEBUG_MODE
|
|
|
- mdata = (byte) 0x01;
|
|
|
+ byte maddressHigh = (byte) 0x80;
|
|
|
+ byte maddressLow = (byte) 0x40;
|
|
|
+ byte msubcommand = (byte) 0x06; //ENTRY_DEBUG_MODE
|
|
|
+ byte mdata = (byte) 0x01;
|
|
|
|
|
|
if (!iicByteWrite(maddressHigh, maddressLow, msubcommand, mdata)) {
|
|
|
- // mrawlog.setText("[changeDebug]0x8040 write failed");
|
|
|
return false;
|
|
|
}
|
|
|
- //}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
@@ -980,14 +943,8 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
|
|
|
- //mrawlog.setText("[changeNormal]0x8040 write failed");
|
|
|
-
|
|
|
return false;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- //mrawlog.setText("[changeNormal]0x8040 write success");
|
|
|
- }
|
|
|
|
|
|
return true;
|
|
|
}
|
|
@@ -995,60 +952,36 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
byte showAddressHigh = (byte)0x8b;
|
|
|
byte showAddressLow = (byte)0x98; //需要显示的 address
|
|
|
- private int[] datatemp = new int[42*30*2];
|
|
|
+ private int[] datatemp = new int[42 * 30 * 2];
|
|
|
private boolean getRawdata() {
|
|
|
|
|
|
- byte maddressHigh = (byte)0x80;
|
|
|
- byte maddressLow = (byte)0x40; //rawdata address
|
|
|
- byte msubcommand =0x0d ; // READ_SYNC
|
|
|
+ byte maddressHigh = (byte)0x8b;
|
|
|
+ byte maddressLow = (byte)0x98; //rawdata address
|
|
|
+ byte msubcommand = (byte)0x0d; // READ_SYNC
|
|
|
byte mdata = (byte)0x01;
|
|
|
- //if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
- // mrawlog.setText("READ_SYNC write failed");
|
|
|
- // return false;
|
|
|
- //}
|
|
|
-
|
|
|
|
|
|
if(!iicRead(showAddressHigh,showAddressLow,mRawdataBytes,colnum * rownum * 2)) { //读取rawData
|
|
|
- // mrawlog.setText("iicRead rawdata failed");
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
maddressHigh = (byte)0x81;
|
|
|
maddressLow = (byte)0x4E; // SYNC address
|
|
|
- msubcommand =0x0f ; // READ_SYNC
|
|
|
+ msubcommand = 0x0f; // READ_SYNC
|
|
|
mdata = (byte)0x00;
|
|
|
|
|
|
- // MainActivity mMainAct = new MainActivity();
|
|
|
if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
- // mrawlog.setText("0x814E_SYNC write failed");
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- private TextView mrawlog;
|
|
|
- private TextView mtextView;
|
|
|
- //private TextView mt1;
|
|
|
- //private TextView mt2;
|
|
|
- //private TextView mt3;
|
|
|
- //private TextView mt4;
|
|
|
- //private Button mrd1;
|
|
|
- //private Button mbk;
|
|
|
- //private Button mmd;
|
|
|
- //private Button md;
|
|
|
- //private Button mr;
|
|
|
- //private Button msumr;
|
|
|
-
|
|
|
public void initTextView() {
|
|
|
- mrawlog = (TextView) findViewById(R.id.rawlog);
|
|
|
mtextView = (TextView) findViewById(R.id.textView);
|
|
|
tvMaximum = (TextView) findViewById(R.id.maximumshow);
|
|
|
tvMinimum = (TextView) findViewById(R.id.minimumshow);
|
|
|
tvDataContent = (TextView) findViewById(R.id.datacontentshow);
|
|
|
tvMAD = (TextView) findViewById(R.id.madshow);
|
|
|
-
|
|
|
- tvUpDataResult = (TextView) findViewById(R.id.updataresult);
|
|
|
}
|
|
|
|
|
|
int count = 1000;
|
|
@@ -1058,7 +991,6 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
@Override
|
|
|
public void run() {
|
|
|
|
|
|
- int watch_dog = 0;
|
|
|
byte syncFlag = 1;
|
|
|
|
|
|
if (showFlag == 6)
|
|
@@ -1075,9 +1007,8 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
stTestLogShow = "";
|
|
|
|
|
|
- stTestLog = "开始测试最大最小值!";
|
|
|
+ stTestLog = getResources().getString(R.string.startmaxmintest);
|
|
|
stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- stTestLogShow = stTestLogShow.concat("\n");
|
|
|
}
|
|
|
|
|
|
while(showFlag!=4) {
|
|
@@ -1092,7 +1023,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
byte maddressHigh = (byte) 0x81;
|
|
|
byte maddressLow = (byte) 0x4E; //_rRW_MISCTL__SWRST_B0_
|
|
|
syncFlag = iicByteRead(maddressHigh, maddressLow);
|
|
|
- watch_dog++;
|
|
|
+
|
|
|
//while ((syncFlag == 0 )|| (syncFlag == 0x77)) {
|
|
|
if (((syncFlag == 0) || (syncFlag == 0x77)) ){
|
|
|
SystemClock.sleep(1);
|
|
@@ -1173,7 +1104,6 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
int tempcol = 0;
|
|
|
int temprow = 0;
|
|
|
boolean flag = false;
|
|
|
- int length;
|
|
|
String dv;
|
|
|
int maxdata;
|
|
|
int mindata;
|
|
@@ -1229,19 +1159,10 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
tvMinimum.setText(Integer.toString(mindata));
|
|
|
break;
|
|
|
|
|
|
- case LOG1_MESSAG://
|
|
|
- mrawlog.setText("0x814E_SYNC read failed");
|
|
|
- break;
|
|
|
-
|
|
|
case CLEAR_MESSAGE://清除数据
|
|
|
mtextView.setText("");
|
|
|
break;
|
|
|
|
|
|
- case LOG2_MESSAGE://成功发送数据
|
|
|
-
|
|
|
- mrawlog.setText("0x814E_SYNC read success,count == 0");
|
|
|
- break;
|
|
|
-
|
|
|
case CONNECTED_SUCCESS: //连接成功
|
|
|
btn_RawdataShow.setEnabled(true);
|
|
|
btn_DiffdataShow.setEnabled(true);
|
|
@@ -1339,10 +1260,9 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
case TEST_DATA_MESSAGE: //
|
|
|
if (1 == btTestStep)
|
|
|
{
|
|
|
- mError.setText(Update_log);
|
|
|
- mError.setSelection(mError.getText().length());
|
|
|
+ edtShortCircuitInfo.setText(Update_log);
|
|
|
+ edtShortCircuitInfo.setSelection(edtShortCircuitInfo.getText().length());
|
|
|
|
|
|
- tvUpDataResult.setText(Update_log1);
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -1380,17 +1300,16 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
}
|
|
|
|
|
|
byTestCount++;
|
|
|
- stTestLog = "采样第" + Integer.toString(byTestCount) + "帧";
|
|
|
+ stTestLog = getResources().getString(R.string.sampling) + Integer.toString(byTestCount) + getResources().getString(R.string.frame);
|
|
|
|
|
|
if (byTestCount >= 16)
|
|
|
{
|
|
|
- stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- stTestLogShow = stTestLogShow.concat("\n");
|
|
|
+ stTestLogShow = "";
|
|
|
|
|
|
- stTestLog = "测试完成!!";
|
|
|
+ stTestLog = getResources().getString(R.string.maxmintestfinish);
|
|
|
stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- stTestLogShow = stTestLogShow.concat("\n");
|
|
|
|
|
|
+ /*
|
|
|
stTestLog = "最大值超过阈值的次数:" + Integer.toString(byMaximumOverCount);
|
|
|
stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
stTestLogShow = stTestLogShow.concat("\n");
|
|
@@ -1398,59 +1317,53 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
stTestLog = "最小值超过阈值的次数:" + Integer.toString(byMinimumOverCount);
|
|
|
stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
stTestLogShow = stTestLogShow.concat("\n");
|
|
|
-
|
|
|
+ */
|
|
|
if (byMaximumOverCount >= 15)
|
|
|
{
|
|
|
bTestMaxResult = false;
|
|
|
- stTestLog = "最大值超限!!";
|
|
|
+ stTestLog = getResources().getString(R.string.maxoutrange);
|
|
|
stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- stTestLogShow = stTestLogShow.concat("\n");
|
|
|
}
|
|
|
else if(byMaximumOverCount < 2)
|
|
|
{
|
|
|
bTestMaxResult = true;
|
|
|
- stTestLog = "最大值测试pass";
|
|
|
- stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- stTestLogShow = stTestLogShow.concat("\n");
|
|
|
+ //stTestLog = "最大值测试pass,";
|
|
|
+ //stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
bTestMaxResult = false;
|
|
|
- stTestLog = "最大值在临界范围,存在风险!!";
|
|
|
+ stTestLog = getResources().getString(R.string.maxisrisk);
|
|
|
stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- stTestLogShow = stTestLogShow.concat("\n");
|
|
|
}
|
|
|
|
|
|
|
|
|
if (byMinimumOverCount >= 15)
|
|
|
{
|
|
|
bTestMinResult = false;
|
|
|
- stTestLog = "最小值超限!!";
|
|
|
+ stTestLog = getResources().getString(R.string.minoutrange);
|
|
|
stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- stTestLogShow = stTestLogShow.concat("\n");
|
|
|
}
|
|
|
else if (byMinimumOverCount < 2)
|
|
|
{
|
|
|
bTestMinResult = true;
|
|
|
- stTestLog = "最小值测试pass";
|
|
|
- stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- stTestLogShow = stTestLogShow.concat("\n");
|
|
|
+ //stTestLog = "最小值测试pass。";
|
|
|
+ //stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
bTestMinResult = false;
|
|
|
- stTestLog = "最小值在临界范围,存在风险!!";
|
|
|
+ stTestLog = getResources().getString(R.string.minisrisk);
|
|
|
stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- stTestLogShow = stTestLogShow.concat("\n");
|
|
|
}
|
|
|
|
|
|
if ((bTestMaxResult == true) && (bTestMinResult == true))
|
|
|
{
|
|
|
- stTestLog = "测 试 Pass !!";
|
|
|
+ stTestLog = getResources().getString(R.string.testpass);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- stTestLog = "测 试 NG !!";
|
|
|
+ stTestLog = getResources().getString(R.string.testng);
|
|
|
}
|
|
|
|
|
|
showFlag = 5; //stop
|
|
@@ -1469,7 +1382,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- //-----------------------------------short test code start-------------------------------------------------------------------------//
|
|
|
+ //-----------------------------------short circuit test code start----------------------------------------------------------------------//
|
|
|
private int GT9xxxGetRxIndex(int nSensor)
|
|
|
{
|
|
|
for (int i = 0; i < 30; i++)
|
|
@@ -1500,65 +1413,58 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
boolean memCmp(byte[] sBuffer,byte[] deBuffer,int offset,int length) {
|
|
|
|
|
|
- {
|
|
|
- try {
|
|
|
-
|
|
|
- for (int i = 0; i < length; i++) {
|
|
|
- if (sBuffer[i] != deBuffer[offset + i]) {
|
|
|
- // FwUpdateMessage(L"Recall frame data fail,not equal.", MSG_ERR);
|
|
|
- // mError.setText("Recall frame data fail,not equal.");
|
|
|
- StringBuilder stringBuilder = new StringBuilder("sBuffer[i]=");
|
|
|
- int v = sBuffer[i] & 0xFF;
|
|
|
- String hv = Integer.toHexString(v);
|
|
|
- stringBuilder.append(hv);
|
|
|
- stringBuilder.append(",dBuffer[offset + i]=");
|
|
|
+ try {
|
|
|
|
|
|
- v = deBuffer[offset + i]& 0xFF;
|
|
|
- hv = Integer.toHexString(v);
|
|
|
- stringBuilder.append(hv);
|
|
|
- stringBuilder.append(",i=");
|
|
|
+ for (int i = 0; i < length; i++) {
|
|
|
+ if (sBuffer[i] != deBuffer[offset + i]) {
|
|
|
+ StringBuilder stringBuilder = new StringBuilder("sBuffer[i]=");
|
|
|
+ int v = sBuffer[i] & 0xFF;
|
|
|
+ String hv = Integer.toHexString(v);
|
|
|
+ stringBuilder.append(hv);
|
|
|
+ stringBuilder.append(",dBuffer[offset + i]=");
|
|
|
|
|
|
- stringBuilder.append(i);
|
|
|
- stringBuilder.append(",offset=");
|
|
|
- stringBuilder.append(offset);
|
|
|
- stringBuilder.append(".\n");
|
|
|
+ v = deBuffer[offset + i]& 0xFF;
|
|
|
+ hv = Integer.toHexString(v);
|
|
|
+ stringBuilder.append(hv);
|
|
|
+ stringBuilder.append(",i=");
|
|
|
|
|
|
+ stringBuilder.append(i);
|
|
|
+ stringBuilder.append(",offset=");
|
|
|
+ stringBuilder.append(offset);
|
|
|
+ stringBuilder.append(".\n");
|
|
|
|
|
|
- for (int j = 0; j < 129; i++) {
|
|
|
|
|
|
- v = sBuffer[i+j] & 0xFF;
|
|
|
- hv = Integer.toHexString(v);
|
|
|
- stringBuilder.append(hv);
|
|
|
- stringBuilder.append(",");
|
|
|
- }
|
|
|
- return false;
|
|
|
+ for (int j = 0; j < 129; i++) {
|
|
|
+
|
|
|
+ v = sBuffer[i+j] & 0xFF;
|
|
|
+ hv = Integer.toHexString(v);
|
|
|
+ stringBuilder.append(hv);
|
|
|
+ stringBuilder.append(",");
|
|
|
}
|
|
|
+ return false;
|
|
|
}
|
|
|
- } catch (ArithmeticException e) {
|
|
|
- e.printStackTrace();
|
|
|
- } catch (ArrayIndexOutOfBoundsException e) {
|
|
|
- e.printStackTrace();
|
|
|
}
|
|
|
+ } catch (ArithmeticException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (ArrayIndexOutOfBoundsException e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
boolean recallCheck(byte addressHigh,byte addressLow,byte[] dBuffer,int offset,int length)
|
|
|
{
|
|
|
- //BYTE* pbBuf = new BYTE[wLen];
|
|
|
byte[] recallBuf =new byte[length+0x3000];
|
|
|
|
|
|
- //if(false)
|
|
|
- {
|
|
|
- if (!iicRead(addressHigh, addressLow, recallBuf, length)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (!memCmp(recallBuf, dBuffer, offset, length)) { //recallBuf为回读的数据,dBuffer为源数据
|
|
|
- return false;
|
|
|
- }
|
|
|
+ if (!iicRead(addressHigh, addressLow, recallBuf, length)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!memCmp(recallBuf, dBuffer, offset, length)) { //recallBuf为回读的数据,dBuffer为源数据
|
|
|
+ return false;
|
|
|
}
|
|
|
- return true;
|
|
|
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
private boolean LoadShortFw() {
|
|
@@ -1568,7 +1474,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
byte mdata = (byte)0x00;
|
|
|
|
|
|
if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
- Update_log = "[Short Test]Touch IC reset failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Touch IC reset failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1611,7 +1517,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (0x0C != iicByteRead(maddressHigh,maddressLow))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Hold IC failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Hold IC failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1622,7 +1528,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
maddressLow = (byte)0xB0; //_rRW_MISCTL__SWRST_B0_
|
|
|
if (0x00 != iicByteRead(maddressHigh,maddressLow))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Disable watch dog failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Disable watch dog failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1635,7 +1541,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
msubcommand =0x0f ; //no command
|
|
|
if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Clear cache enable failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Clear cache enable failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1648,7 +1554,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Set _rRW_MISCTL__BOOTCTL_B0_ failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Set _rRW_MISCTL__BOOTCTL_B0_ failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1661,7 +1567,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Select _bRW_MISCTL__SRAM_BANK failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Select _bRW_MISCTL__SRAM_BANK failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1674,7 +1580,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Enable _bRW_MISCTL__MEM_CD_EN failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Enable _bRW_MISCTL__MEM_CD_EN failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1686,7 +1592,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!iicWrite(maddressHigh, maddressLow, gt9110h_short_dsp_code, 0, gt9110h_short_dsp_code.length))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Burn 8k ShortFw failed";
|
|
|
+ Update_log = "Burn 8k short circuit Fw failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
|
|
|
return false;
|
|
@@ -1696,7 +1602,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!recallCheck(maddressHigh, maddressLow, gt9110h_short_dsp_code, 0, gt9110h_short_dsp_code.length))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Recall check 8k ShortFW failed";
|
|
|
+ Update_log = "Recall check 8k short circuit FW failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1709,7 +1615,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Clear IC run flag failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Clear IC run flag failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1722,7 +1628,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Set _rRW_MISCTL__BOOT_OPT_B0_ failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Set _rRW_MISCTL__BOOT_OPT_B0_ failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1735,7 +1641,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Stop reset CPU failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Stop reset CPU failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1748,7 +1654,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Set _rRW_MISCTL__SWRST_B0_ failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Set _rRW_MISCTL__SWRST_B0_ failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1819,7 +1725,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (3 == i)
|
|
|
{
|
|
|
- Update_log = "[Short Test]Short test init failed";
|
|
|
+ Update_log = "Short circuit test init failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
|
|
|
return false;
|
|
@@ -1830,7 +1736,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!iicWrite(maddressHigh, maddressLow, GT9xxxShortConfig, 0, 80)) {
|
|
|
|
|
|
- Update_log = "[Short Test]Send short config failed";
|
|
|
+ Update_log = "Send short circuit config failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
|
|
|
return false;
|
|
@@ -1845,7 +1751,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
{
|
|
|
- Update_log = "[Short Test]Step9 set _rRW_MISCTL__CLR_IC_RUN failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Step9 set _rRW_MISCTL__CLR_IC_RUN failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1872,7 +1778,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
SystemClock.sleep(20);
|
|
|
}
|
|
|
|
|
|
- Update_log = "[Short Test]Short test failed";
|
|
|
+ Update_log = "Short circuit test failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
|
|
|
return false;
|
|
@@ -1902,7 +1808,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
/* step3-1 判断是否有短路 */
|
|
|
if (0x00 == testResult)
|
|
|
{
|
|
|
- Update_log = "[Short Test]Short test finish";
|
|
|
+ Update_log = getResources().getString(R.string.shorttestfinish);
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return true;
|
|
|
}
|
|
@@ -1925,6 +1831,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
int ishortpin1,ishortpin2;
|
|
|
|
|
|
/* step3-5 输出短路通道号和阻抗*/
|
|
|
+ Update_log = "";
|
|
|
|
|
|
/* step3-5-1 计算TX与TX的阻抗*/
|
|
|
if (TX_TO_TX_SHORT == (testResult & TX_TO_TX_SHORT)
|
|
@@ -1934,7 +1841,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
maddressHigh = (byte)0x88;
|
|
|
maddressLow = (byte)0x60;
|
|
|
if(!iicRead(maddressHigh,maddressLow,m_txShortData,txShortNum * 149)) { //读取rawData
|
|
|
- Update_log = "[Short Test]Step3-4-1 cal impedance of Tx&Tx failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Step3-4-1 cal impedance of Tx&Tx failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -1967,14 +1874,10 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
if (Resistance < 0)
|
|
|
Resistance = 0;
|
|
|
|
|
|
- //CString str;
|
|
|
- //str.Format(L"Tx%d and Tx%d: %dK ohm", GT9xxxGetTxIndex(shortPinNum & 0x7F), GT9xxxGetTxIndex(j), Resistance);
|
|
|
- //TODO
|
|
|
-
|
|
|
ishortpin1 = GT9xxxGetTxIndex(shortPinNum & 0x7F);
|
|
|
ishortpin2 = GT9xxxGetTxIndex(j);
|
|
|
|
|
|
- Update_log = Update_log.concat("[Short Test]Tx" + Integer.toString(ishortpin1) + " and Tx"
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(ishortpin1) + " and Tx"
|
|
|
+ Integer.toString(ishortpin2) + ": " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
|
|
|
if (Resistance > 800)
|
|
@@ -2006,25 +1909,20 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
Resistance = (int)(wSelfCode * 60) / wRxShortCode[j] - 60;
|
|
|
}
|
|
|
|
|
|
- if (Resistance < 0)Resistance = 0;
|
|
|
- //CString str;
|
|
|
- //str.Format(L"Tx%d and Rx%d: %dK ohm", GT9xxxGetTxIndex(shortPinNum & 0x7F), GT9xxxGetRxIndex(j), Resistance);
|
|
|
- //todo
|
|
|
+ if (Resistance < 0)
|
|
|
+ Resistance = 0;
|
|
|
|
|
|
ishortpin1 = GT9xxxGetTxIndex(shortPinNum & 0x7F);
|
|
|
ishortpin2 = GT9xxxGetRxIndex(j);
|
|
|
|
|
|
- Update_log = Update_log.concat("[Short Test]Tx" + Integer.toString(ishortpin1) + " and Rx"
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(ishortpin1) + " and Rx"
|
|
|
+ Integer.toString(ishortpin2) + ": " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
|
|
|
if (Resistance > 800)
|
|
|
{
|
|
|
- //AppendMessage(str, MESSAGE_PAY_ATTENTION);
|
|
|
-
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
continue;
|
|
|
}
|
|
|
- //AppendMessage(str, MESSAGE_ERR);
|
|
|
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
bFailed = true;
|
|
@@ -2038,7 +1936,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
maddressHigh = (byte)0xA0;
|
|
|
maddressLow = (byte)0xD2;
|
|
|
if(!iicRead(maddressHigh,maddressLow,m_rxShortData,rxShortNum * 65)) { //读取rawData
|
|
|
- Update_log = "[Short Test]Step3-4-2 cal impedance of Rx&Rx failed";
|
|
|
+ Update_log = "[Short-Circuit Test]Step3-4-2 cal impedance of Rx&Rx failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -2060,21 +1958,17 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
Resistance = (int)(wSelfCode * 60) / wRxShortCode[j] - 60;
|
|
|
|
|
|
- if (Resistance < 0)Resistance = 0;
|
|
|
- //CString str;
|
|
|
- //str.Format(L"Rx%d and Rx%d: %dK ohm", GT9xxxGetRxIndex(shortPinNum & 0x7F), GT9xxxGetRxIndex(j), Resistance);
|
|
|
- //todo
|
|
|
+ if (Resistance < 0)
|
|
|
+ Resistance = 0;
|
|
|
|
|
|
ishortpin1 = GT9xxxGetRxIndex(shortPinNum & 0x7F);
|
|
|
ishortpin2 = GT9xxxGetRxIndex(j);
|
|
|
|
|
|
- Update_log = Update_log.concat("[Short Test]Rx" + Integer.toString(ishortpin1) + " and Rx"
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Rx" + Integer.toString(ishortpin1) + " and Rx"
|
|
|
+ Integer.toString(ishortpin2) + ": " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
|
|
|
if (Resistance > 800)
|
|
|
{
|
|
|
- //AppendMessage(str, MESSAGE_PAY_ATTENTION);
|
|
|
-
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
continue;
|
|
|
}
|
|
@@ -2092,7 +1986,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
maddressHigh = (byte)0xA5;
|
|
|
maddressLow = (byte)0x31;
|
|
|
if(!iicRead(maddressHigh,maddressLow,m_diffCode,144)) { //读取rawData
|
|
|
- Update_log = "[Short Test]cal impedance of TRX to GNDAVDD failed";
|
|
|
+ Update_log = "[Short-Circuit Test]cal impedance of TRX to GNDAVDD failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return false;
|
|
|
}
|
|
@@ -2115,26 +2009,22 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
Resistance = (int)(52662.85 / DiffData - 40);
|
|
|
}
|
|
|
|
|
|
- if (Resistance < 0)Resistance = 0;
|
|
|
+ if (Resistance < 0)
|
|
|
+ Resistance = 0;
|
|
|
|
|
|
- //CString str;
|
|
|
if (i < 42)
|
|
|
{
|
|
|
ishortpin1 = GT9xxxGetTxIndex(i);
|
|
|
|
|
|
if ((DiffData & 0x8000) == 0x8000)
|
|
|
{
|
|
|
- //str.Format(L"TX%d and AVDD: %dK ohm", GT9xxxGetTxIndex(i), Resistance);
|
|
|
- //todo
|
|
|
if (Resistance < 800)
|
|
|
- Update_log = Update_log.concat("[Short Test]Tx" + Integer.toString(ishortpin1) + " and AVDD: " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(ishortpin1) + " and AVDD: " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //str.Format(L"TX%d and GND: %dK ohm", GT9xxxGetTxIndex(i), Resistance);
|
|
|
- //todo
|
|
|
if (Resistance < 800)
|
|
|
- Update_log = Update_log.concat("[Short Test]Tx" + Integer.toString(ishortpin1) + " and GND: " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(ishortpin1) + " and GND: " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -2143,17 +2033,13 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if ((DiffData & 0x8000) == 0x8000)
|
|
|
{
|
|
|
- //str.Format(L"RX%d and AVDD: %dK ohm", GT9xxxGetRxIndex(i - 42), Resistance);
|
|
|
- //todo
|
|
|
if (Resistance < 800)
|
|
|
- Update_log = Update_log.concat("[Short Test]Rx" + Integer.toString(ishortpin1) + " and AVDD: " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Rx" + Integer.toString(ishortpin1) + " and AVDD: " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //str.Format(L"RX%d and GND: %dK ohm", GT9xxxGetRxIndex(i - 42), Resistance);
|
|
|
- //todo
|
|
|
if (Resistance < 800)
|
|
|
- Update_log = Update_log.concat("[Short Test]Rx" + Integer.toString(ishortpin1) + " and GND: " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Rx" + Integer.toString(ishortpin1) + " and GND: " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
}
|
|
|
}
|
|
|
if (Resistance > 800)
|
|
@@ -2181,19 +2067,18 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
byte mdata = (byte)0x00;
|
|
|
|
|
|
Update_log = "";
|
|
|
- Update_log1 = "";
|
|
|
updateLogShow = "";
|
|
|
|
|
|
- Update_log1 = "Start short test,please wait until finishes...";
|
|
|
+ Update_log = getResources().getString(R.string.startshorttest);
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
|
|
|
if (!LoadShortFw())
|
|
|
{
|
|
|
- Update_log1 = "Load short FW failed,short test NG!!!";
|
|
|
+ Update_log += ", load FW failed, test is NG!!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
|
|
|
if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
- Update_log = "[Short Test]Touch IC reset failed";
|
|
|
+ Update_log += "Reset touch IC failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return;
|
|
|
}
|
|
@@ -2202,11 +2087,11 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!SendShortConfig())
|
|
|
{
|
|
|
- Update_log1 = "Send short config failed,short test NG!!!";
|
|
|
+ Update_log += ", send config failed, test is NG!!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
|
|
|
if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
- Update_log = "[Short Test]Touch IC reset failed";
|
|
|
+ Update_log += "Reset touch IC failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return;
|
|
|
}
|
|
@@ -2215,11 +2100,11 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if (!CalculateShort())
|
|
|
{
|
|
|
- Update_log1 = "Short test NG!!!";
|
|
|
+ Update_log += getResources().getString(R.string.shorttestng);
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
|
|
|
if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
- Update_log = "[Short Test]Touch IC reset failed";
|
|
|
+ Update_log = "Reset touch IC failed!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return;
|
|
|
}
|
|
@@ -2227,21 +2112,21 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
}
|
|
|
|
|
|
if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
- Update_log1 = "Touch IC reset failed,short test NG!!!";
|
|
|
+ Update_log = "Reset touch IC failed, short-circuit test NG!!";
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- Update_log1 = "Short test pass!!!";
|
|
|
+ Update_log += getResources().getString(R.string.testpass);
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
}
|
|
|
|
|
|
- //------------------------------------short test code end----------------------------------------------------------------------//
|
|
|
+ //------------------------------------short circuit test code end------------------------------------------------------------------//
|
|
|
|
|
|
@Override
|
|
|
public void onClick(final View view) {
|
|
|
|
|
|
- if ((edt_ColNum.getText().length()==0)||(edt_RowNum.getText().length()==0)){
|
|
|
+ if ((edt_ColNum.getText().length() == 0) || (edt_RowNum.getText().length() == 0)){
|
|
|
|
|
|
byte addressH = (byte)0x80;
|
|
|
byte addressL = (byte)0x47;
|
|
@@ -2271,7 +2156,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- Toast.makeText(this,"Cfg读取错误,请手动输入要显示的行列数",Toast.LENGTH_SHORT).show();
|
|
|
+ Toast.makeText(this, getResources().getString(R.string.cfgerror), Toast.LENGTH_SHORT).show();
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -2332,7 +2217,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
tvDataContent.setText("[" + getResources().getString(R.string.reffdata) + "]");
|
|
|
getRawdata();
|
|
|
mHandler.sendEmptyMessage(RAWDATA_MESSAGE);
|
|
|
- // showRawdata();
|
|
|
+
|
|
|
break;
|
|
|
|
|
|
case R.id.manualdiff:
|
|
@@ -2357,7 +2242,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
count = 1000;
|
|
|
showAddressHigh = (byte)0x8b;
|
|
|
showAddressLow = (byte)0x98;
|
|
|
- // showRawdata();
|
|
|
+
|
|
|
break;
|
|
|
|
|
|
case R.id.testting: //start test
|
|
@@ -2383,7 +2268,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
if((iMinimum < (iMaximum / 2)) || (iMinimum > iMaximum))
|
|
|
{
|
|
|
- Toast.makeText(this,"最小值阈值不能大于最大值阈值或小于最大值阈值的1/2",Toast.LENGTH_SHORT).show();
|
|
|
+ Toast.makeText(this, getResources().getString(R.string.thresholdlimit), Toast.LENGTH_SHORT).show();
|
|
|
btn_RawdataShow.setEnabled(true);
|
|
|
btn_DiffdataShow.setEnabled(true);
|
|
|
btn_ReffdataShow.setEnabled(true);
|
|
@@ -2438,7 +2323,6 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
}
|
|
|
mUsbEndpointIn = null;
|
|
|
mUsbEndpointOut = null;
|
|
|
- //mToggle = false;
|
|
|
isReceiverMessage = false;
|
|
|
isNeedFindDevice = false;
|
|
|
mThreadPool.shutdownNow();
|