Pārlūkot izejas kodu

v2.1版本:1、修改测试完成后多采样一帧显示的问题;2、对于GT738X的数据显示,加长了延迟帧数

robbin 3 gadi atpakaļ
vecāks
revīzija
d63cf6c723

+ 2 - 2
app/build.gradle

@@ -7,14 +7,14 @@ android {
         minSdkVersion 18
         targetSdkVersion 28
         versionCode 1
-        versionName "2.0.1"
+        versionName "2.1.0"
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
     }
     android.applicationVariants.all {
         variant ->
             variant.outputs.all{
                 //´Ë´¦Ö¸¶¨Éú³ÉµÄapkÎļþÃû
-                outputFileName = "WingCoolAPK_V2.0.1_20211102.apk"
+                outputFileName = "WingCoolAPK_V2.1.0_20211110.apk"
             }
     }
     lintOptions {

+ 139 - 147
app/src/main/java/com/example/administrator/wingcool_gt9_apk/DataAnalysis.java

@@ -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);

+ 4 - 4
app/src/main/java/com/example/administrator/wingcool_gt9_apk/FirmwareUpdate.java

@@ -1518,11 +1518,11 @@ public class FirmwareUpdate extends AppCompatActivity
             //return false;
         }
        // FwUpdateMessage(L"move data to flash complete......", MSG_NOR);
-     //   mError.setText("[fwGwOrLink]move data to flash complet");
-       // Update_log = "[fwGwOrLink]move data to flash complet";
+     //   mError.setText("[fwGwOrLink]move data to flash complete");
+       // Update_log = "[fwGwOrLink]move data to flash complete";
        // mHandler.sendEmptyMessage(DEBUG_MESSAGE_ERROR);
 
-        Update_log2 =Update_log2.concat("[fwGwOrLink]move data to flash complet\n") ;
+        Update_log2 =Update_log2.concat("[fwGwOrLink]move data to flash complete\n") ;
 
         return true;
     }
@@ -1758,7 +1758,7 @@ public class FirmwareUpdate extends AppCompatActivity
         if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
             return false;
 
-      //  mError.setText("[fw51]move data to flash complet");
+      //  mError.setText("[fw51]move data to flash complete");
        // Update_log = "[fw51]move data to flash complete ";
        // mHandler.sendEmptyMessage(DEBUG_MESSAGE_ERROR);
         Update_log2 =Update_log2.concat("[fw51]move data to flash complete\n") ;

+ 1 - 1
app/src/main/res/values-en/strings.xml

@@ -103,7 +103,7 @@
     <string name="companyaddr">Address:Room 2008, Chuangxingda Business Building, No.36 Liuxian 3rd Road, Baoan District, Shenzhen</string>
     <string name="telephonenum">Telephone:186 8896 1937</string>
     <string name="emailaddr">Email:max@wingcool.cn</string>
-    <string name="version">APK Version:v2.0.1_20211102-Debug Version</string>
+    <string name="version">APK Version:v2.1.0_20211110-Release Version</string>
 
     <!-- other -->
     <string name="app_name">WingCoolAPK</string>

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -103,7 +103,7 @@
     <string name="companyaddr">地址:深圳市宝安区留仙三路 36 号创兴达商务大厦 2008 室</string>
     <string name="telephonenum">电话:186 8896 1937</string>
     <string name="emailaddr">邮箱:max@wingcool.cn</string>
-    <string name="version">APK版本:v2.0.1_20211102-内部版本</string>
+    <string name="version">APK版本:v2.1.0_20211110-发布版本</string>
 
     <!-- other -->
     <string name="app_name">WingCoolAPK</string>