|
@@ -1168,6 +1168,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
showFlag = 4;
|
|
|
count = 1000;
|
|
|
btTestStep = 0;
|
|
|
+ SystemClock.sleep(10);
|
|
|
break;
|
|
|
case 6: //test
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
@@ -1198,9 +1199,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
Handler mHandler = new Handler() {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
- textGridLayout.removeAllViews();
|
|
|
StringBuilder stringBuilder = new StringBuilder("");
|
|
|
-
|
|
|
int idtemp;
|
|
|
int i = 0;
|
|
|
int tempcol = 0;
|
|
@@ -1213,6 +1212,8 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
switch (msg.what) {
|
|
|
case RAWDATA_MESSAGE://
|
|
|
|
|
|
+ textGridLayout.removeAllViews();
|
|
|
+
|
|
|
maxdata = 0;
|
|
|
mindata = 65535;
|
|
|
i = 0;
|
|
@@ -1303,6 +1304,8 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
break;
|
|
|
|
|
|
case DIFF_MESSAGE://
|
|
|
+ textGridLayout.removeAllViews();
|
|
|
+
|
|
|
maxdata = 0;
|
|
|
mindata = 255;
|
|
|
for (int row = 0; row < rownum; row++) { //Sen
|
|
@@ -1363,7 +1366,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
tvMinimum.setText(Integer.toString(mindata));
|
|
|
break;
|
|
|
case MANUALDIFF_MESSAGE:
|
|
|
-
|
|
|
+ textGridLayout.removeAllViews();
|
|
|
maxdata = -32767;
|
|
|
mindata = 32768;
|
|
|
for (int row = 0; row < rownum; row++) { //Sen
|
|
@@ -1443,187 +1446,176 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
edtShortCircuitInfo.setSelection(edtShortCircuitInfo.getText().length());
|
|
|
|
|
|
break;
|
|
|
- }
|
|
|
+ }else if (btTestStep == 2) {
|
|
|
|
|
|
- int imaxdataid = 65535;
|
|
|
- int imindataid = 65535;
|
|
|
+ int imaxdataid = 65535;
|
|
|
+ int imindataid = 65535;
|
|
|
|
|
|
- maxdata = 0;
|
|
|
- mindata = 65535;
|
|
|
- i = 0;
|
|
|
- //控制行数
|
|
|
- for (int row = 0; row < rownum; row++) {
|
|
|
- //控制列数
|
|
|
- for (int col = 0; col < colnum; col++) {
|
|
|
-
|
|
|
- idtemp = (row + col * rownum) * 2;
|
|
|
- if (byProductType == GT7) //GT7的低位在前
|
|
|
- {
|
|
|
- datatemp[i] = ((mRawdataBytes[idtemp + 1] & 0xFF) << 8) + (mRawdataBytes[idtemp] & 0xFF);
|
|
|
- }else{
|
|
|
- datatemp[i] = ((mRawdataBytes[idtemp] & 0xFF) << 8) + (mRawdataBytes[idtemp + 1] & 0xFF);
|
|
|
- }
|
|
|
-
|
|
|
- //获取最大值
|
|
|
- if (datatemp[i] > maxdata){
|
|
|
- maxdata = datatemp[i];
|
|
|
- imaxdataid = i;
|
|
|
-
|
|
|
- }
|
|
|
- //获取最小值
|
|
|
- if (datatemp[i] < mindata){
|
|
|
- mindata = datatemp[i];
|
|
|
- imindataid = i;
|
|
|
- }
|
|
|
-
|
|
|
- i++;
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- /*
|
|
|
- if (maxdata > iMaximum) //统计最大值大于阈值的次数
|
|
|
- {
|
|
|
- byMaximumOverCount++;
|
|
|
- }
|
|
|
+ maxdata = 0;
|
|
|
+ mindata = 65535;
|
|
|
+ i = 0;
|
|
|
|
|
|
- if (mindata < iMinimum) //统计最小值小于阈值的次数
|
|
|
- {
|
|
|
- byMinimumOverCount++;
|
|
|
- }
|
|
|
- */
|
|
|
+ textGridLayout.removeAllViews();
|
|
|
|
|
|
- if (maxdata > mindata * 2) //统计最大值大于阈值的次数
|
|
|
- {
|
|
|
- byMaximumOverCount++;
|
|
|
- }
|
|
|
+ //控制行数
|
|
|
+ for (int row = 0; row < rownum; row++) {
|
|
|
+ //控制列数
|
|
|
+ for (int col = 0; col < colnum; col++) {
|
|
|
|
|
|
- byTestCount++;
|
|
|
- stTestLog = getResources().getString(R.string.sampling) + Integer.toString(byTestCount) + getResources().getString(R.string.frame);
|
|
|
+ idtemp = (row + col * rownum) * 2;
|
|
|
+ if (byProductType == GT7) //GT7的低位在前
|
|
|
+ {
|
|
|
+ datatemp[i] = ((mRawdataBytes[idtemp + 1] & 0xFF) << 8) + (mRawdataBytes[idtemp] & 0xFF);
|
|
|
+ } else {
|
|
|
+ datatemp[i] = ((mRawdataBytes[idtemp] & 0xFF) << 8) + (mRawdataBytes[idtemp + 1] & 0xFF);
|
|
|
+ }
|
|
|
|
|
|
- if (byTestCount >= 16)
|
|
|
- {
|
|
|
- stTestLogShow = "";
|
|
|
+ //获取最大值
|
|
|
+ if (datatemp[i] > maxdata) {
|
|
|
+ maxdata = datatemp[i];
|
|
|
+ imaxdataid = i;
|
|
|
|
|
|
- stTestLog = getResources().getString(R.string.maxmintestfinish);
|
|
|
- stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ }
|
|
|
+ //获取最小值
|
|
|
+ if (datatemp[i] < mindata) {
|
|
|
+ mindata = datatemp[i];
|
|
|
+ imindataid = i;
|
|
|
+ }
|
|
|
|
|
|
- /*
|
|
|
- stTestLog = "最大值超过阈值的次数:" + Integer.toString(byMaximumOverCount);
|
|
|
- stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- stTestLogShow = stTestLogShow.concat("\n");
|
|
|
+ i++;
|
|
|
|
|
|
- stTestLog = "最小值超过阈值的次数:" + Integer.toString(byMinimumOverCount);
|
|
|
- stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- stTestLogShow = stTestLogShow.concat("\n");
|
|
|
- */
|
|
|
- if (byMaximumOverCount >= 15)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ if (maxdata > iMaximum) //统计最大值大于阈值的次数
|
|
|
{
|
|
|
- bTestMaxResult = false;
|
|
|
- stTestLog = getResources().getString(R.string.maxoutrange);
|
|
|
- stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ byMaximumOverCount++;
|
|
|
}
|
|
|
- else if(byMaximumOverCount < 2)
|
|
|
+
|
|
|
+ if (mindata < iMinimum) //统计最小值小于阈值的次数
|
|
|
{
|
|
|
- bTestMaxResult = true;
|
|
|
- //stTestLog = "最大值测试pass,";
|
|
|
- //stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ byMinimumOverCount++;
|
|
|
}
|
|
|
- else
|
|
|
+ */
|
|
|
+
|
|
|
+ if (maxdata > mindata * 2) //统计最大值大于阈值的次数
|
|
|
{
|
|
|
- bTestMaxResult = false;
|
|
|
- stTestLog = getResources().getString(R.string.maxisrisk);
|
|
|
- stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ byMaximumOverCount++;
|
|
|
}
|
|
|
|
|
|
+ byTestCount++;
|
|
|
+ stTestLog = getResources().getString(R.string.sampling) + Integer.toString(byTestCount) + getResources().getString(R.string.frame);
|
|
|
|
|
|
- if (byMinimumOverCount >= 15)
|
|
|
- {
|
|
|
- bTestMinResult = false;
|
|
|
- stTestLog = getResources().getString(R.string.minoutrange);
|
|
|
+ if (byTestCount >= 16) {
|
|
|
+ stTestLogShow = "";
|
|
|
+
|
|
|
+ stTestLog = getResources().getString(R.string.maxmintestfinish);
|
|
|
stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- }
|
|
|
- else if (byMinimumOverCount < 2)
|
|
|
- {
|
|
|
- bTestMinResult = true;
|
|
|
- //stTestLog = "最小值测试pass。";
|
|
|
- //stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- bTestMinResult = false;
|
|
|
- stTestLog = getResources().getString(R.string.minisrisk);
|
|
|
+
|
|
|
+ /*
|
|
|
+ stTestLog = "最大值超过阈值的次数:" + Integer.toString(byMaximumOverCount);
|
|
|
stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
- }
|
|
|
+ stTestLogShow = stTestLogShow.concat("\n");
|
|
|
|
|
|
- if ((bTestMaxResult == true) && (bTestMinResult == true))
|
|
|
- {
|
|
|
- stTestLog = getResources().getString(R.string.testpass);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- stTestLog = getResources().getString(R.string.testng);
|
|
|
- }
|
|
|
+ stTestLog = "最小值超过阈值的次数:" + Integer.toString(byMinimumOverCount);
|
|
|
+ stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ stTestLogShow = stTestLogShow.concat("\n");
|
|
|
+ */
|
|
|
+ if (byMaximumOverCount >= 15) {
|
|
|
+ bTestMaxResult = false;
|
|
|
+ stTestLog = getResources().getString(R.string.maxoutrange);
|
|
|
+ stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ } else if (byMaximumOverCount < 2) {
|
|
|
+ bTestMaxResult = true;
|
|
|
+ //stTestLog = "最大值测试pass,";
|
|
|
+ //stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ } else {
|
|
|
+ bTestMaxResult = false;
|
|
|
+ stTestLog = getResources().getString(R.string.maxisrisk);
|
|
|
+ stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ }
|
|
|
|
|
|
- i = 0;
|
|
|
- //控制行数
|
|
|
- for (int row = 0; row < rownum; row++) {
|
|
|
- //控制列数
|
|
|
- for (int col = 0; col < colnum + 1; col++) {
|
|
|
|
|
|
- TextView textView = new TextView(mContext);
|
|
|
- GridLayout.LayoutParams params = new GridLayout.LayoutParams();
|
|
|
+ if (byMinimumOverCount >= 15) {
|
|
|
+ bTestMinResult = false;
|
|
|
+ stTestLog = getResources().getString(R.string.minoutrange);
|
|
|
+ stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ } else if (byMinimumOverCount < 2) {
|
|
|
+ bTestMinResult = true;
|
|
|
+ //stTestLog = "最小值测试pass。";
|
|
|
+ //stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ } else {
|
|
|
+ bTestMinResult = false;
|
|
|
+ stTestLog = getResources().getString(R.string.minisrisk);
|
|
|
+ stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ }
|
|
|
|
|
|
- if (col == 0)
|
|
|
- {
|
|
|
- dv = Integer.toString(row);
|
|
|
- }else {
|
|
|
+ if ((bTestMaxResult == true) && (bTestMinResult == true)) {
|
|
|
+ stTestLog = getResources().getString(R.string.testpass);
|
|
|
+ } else {
|
|
|
+ stTestLog = getResources().getString(R.string.testng);
|
|
|
+ }
|
|
|
|
|
|
- dv = Integer.toString(datatemp[i]);
|
|
|
+ i = 0;
|
|
|
+ //控制行数
|
|
|
+ for (int row = 0; row < rownum; row++) {
|
|
|
+ //控制列数
|
|
|
+ for (int col = 0; col < colnum + 1; col++) {
|
|
|
|
|
|
- if ((bypDrvShortFlag[col - 1] == 0x55) || (bypSenShortFlag[row] == 0x55))
|
|
|
- {
|
|
|
- textView.setTextColor(Color.parseColor("#FF0000")); //红色
|
|
|
- }
|
|
|
+ TextView textView = new TextView(mContext);
|
|
|
+ GridLayout.LayoutParams params = new GridLayout.LayoutParams();
|
|
|
|
|
|
- if (bTestMaxResult == false)
|
|
|
- {
|
|
|
- if (imaxdataid == i) { //最大值
|
|
|
- textView.setTextColor(Color.parseColor("#FFFF00")); //黄色
|
|
|
- }else if (imindataid == i) { //最小值
|
|
|
- textView.setTextColor(Color.parseColor("#FFFF00")); //黄色
|
|
|
+ if (col == 0) {
|
|
|
+ dv = Integer.toString(row);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ dv = Integer.toString(datatemp[i]);
|
|
|
+
|
|
|
+ if ((bypDrvShortFlag[col - 1] == 0x55) || (bypSenShortFlag[row] == 0x55)) {
|
|
|
+ textView.setTextColor(Color.parseColor("#FF0000")); //红色
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ if (bTestMaxResult == false) {
|
|
|
+ if (imaxdataid == i) { //最大值
|
|
|
+ textView.setTextColor(Color.parseColor("#FFFF00")); //黄色
|
|
|
+ } else if (imindataid == i) { //最小值
|
|
|
+ textView.setTextColor(Color.parseColor("#FFFF00")); //黄色
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- params.width = 42;
|
|
|
+ params.width = 42;
|
|
|
|
|
|
- i++;
|
|
|
- }
|
|
|
+ i++;
|
|
|
+ }
|
|
|
|
|
|
- textView.setText(dv);
|
|
|
- textView.setGravity(Gravity.CENTER);
|
|
|
- params.setMargins(2,1,2,1);
|
|
|
- textGridLayout.addView(textView,params);
|
|
|
+ textView.setText(dv);
|
|
|
+ textView.setGravity(Gravity.CENTER);
|
|
|
+ params.setMargins(2, 1, 2, 1);
|
|
|
+ textGridLayout.addView(textView, params);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- showFlag = 5; //stop
|
|
|
- btn_RawdataShow.setEnabled(true);
|
|
|
- btn_DiffdataShow.setEnabled(true);
|
|
|
- btn_ReffdataShow.setEnabled(true);
|
|
|
- btn_ManualdiffdataShow.setEnabled(true);
|
|
|
- btn_Manualreff.setEnabled(false);
|
|
|
- btn_StylusDataShow.setEnabled(true);
|
|
|
- btn_Test.setEnabled(true);
|
|
|
+ showFlag = 5; //stop
|
|
|
+ btTestStep = 0;
|
|
|
+ btn_RawdataShow.setEnabled(true);
|
|
|
+ btn_DiffdataShow.setEnabled(true);
|
|
|
+ btn_ReffdataShow.setEnabled(true);
|
|
|
+ btn_ManualdiffdataShow.setEnabled(true);
|
|
|
+ btn_Manualreff.setEnabled(false);
|
|
|
+ btn_StylusDataShow.setEnabled(true);
|
|
|
+ btn_Test.setEnabled(true);
|
|
|
+ }
|
|
|
+ edt_TestiInformation.setText(stTestLogShow + stTestLog);
|
|
|
+ edt_TestiInformation.setSelection(edt_TestiInformation.getText().length());
|
|
|
}
|
|
|
- edt_TestiInformation.setText(stTestLogShow + stTestLog);
|
|
|
- edt_TestiInformation.setSelection(edt_TestiInformation.getText().length());
|
|
|
-
|
|
|
break;
|
|
|
|
|
|
case STYLUS_DATA_MESSAGE:
|
|
|
int layindex = 0;
|
|
|
|
|
|
+ textGridLayout.removeAllViews();
|
|
|
+
|
|
|
for (int index = 0; index < (rownum + colnum + 2); index++) { //驱动和感应数据之间留有2个空位为0
|
|
|
|
|
|
if ((index == colnum) || (index == (colnum + 1))) //跳过两个空位
|
|
@@ -2895,8 +2887,8 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
byDisplayFrameCount = 7;
|
|
|
if (byProductType == GT7) //GT7 数据多,要多加时间间隔
|
|
|
{
|
|
|
- byDisplayFrame = 14;
|
|
|
- byDisplayFrameCount = 14;
|
|
|
+ byDisplayFrame = 16;
|
|
|
+ byDisplayFrameCount = 16;
|
|
|
}
|
|
|
|
|
|
btn_RawdataShow.setEnabled(false);
|