充放电一体机FGCD通信程序【二期初版】
whyclxw
2021-09-01 48b0d8bf2db9a5a0950946ad03544504633a86d0
BattMonitor_FGCD-A059NT/src/com/dev/fgcd/comm/FGCD_TestDataDownLoad.java
@@ -83,6 +83,7 @@
      for(int i=0;i<fbofile.files.length;i++) {
         //当前下载文件
         FBOFile file = fbofile.files[i];
         fbofile.file_downloadNum=i;//设置当前下载文件的索引
         if(now_download_state == DownLoadState_UserCancel) {
            file.setDownload_state(DownLoadState_UserCancel);
            file.setDownload_flag(DownloadFlag_Fail);
@@ -93,7 +94,7 @@
         }
         nowFbo = file;
         ReadTestData = true;
         fbofile.initDownLoadState();
         fbofile.initDownLoadState();//文件信息下载初始化
         file.setDownload_state(DownLoadState_ReadData);   
         while(ReadTestData) {
            try {
@@ -127,19 +128,24 @@
               
               if(nowFbo.getDownload_state() == DownLoadState_ExportData) {
                  //解析本地数据文件并导入数据库
                  boolean flag = readFBOFileData(file,pool);
                  /*boolean flag = readFBOFileData(file,pool);
                  if(flag) {
                     nowFbo.setDownload_state(DownLoadState_ExportSucc);
                  }else {
                     nowFbo.setDownload_state(DownLoadState_ExportFail);
                  }
                  }*/
                  //开启新线程导入数据库
                  FGCD_Export_Thread_SQL export_Thread=new FGCD_Export_Thread_SQL(pool, nowFbo, fbofile);
                  new Thread(export_Thread).start();
               }
               System.out.println("nowFbo.getDownload_state():"+nowFbo.getDownload_state());
               if(nowFbo.getDownload_state() == DownLoadState_ExportFail
                  || nowFbo.getDownload_state() == DownLoadState_ExportSucc) {
                  ReadTestData = false;
               }
               file.setDownload_state(nowFbo.getDownload_state());
               /*file.setDownload_state(nowFbo.getDownload_state());
               updateDownLoadProgress(pool,fbofile);      //更新当前下载进度
               */
               Thread.sleep(50);
            } catch(Exception e) {
               e.printStackTrace();
@@ -181,7 +187,7 @@
       }
       if(f.exists()) {
         //删除下载的FBO文件
         f.delete();
         //f.delete();
       }   
       return flag;      
   }