充放电一体机FGCD通信程序【二期初版】
whyclxw
2021-09-03 cf826529c32d79e78e5fba86d3e4e1483d424d60
最终版本
3个文件已修改
25 ■■■■ 已修改文件
BattMonitor_FGCD-A059NT/src/com/dev/fgcd/comm/FGCD_Task_Thread_SQL.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FGCD-A059NT/src/com/dev/fgcd/comm/FGCD_TestDataDownLoad.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FGCD-A059NT/src/com/dev/fgcd/fbo/FboData.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattMonitor_FGCD-A059NT/src/com/dev/fgcd/comm/FGCD_Task_Thread_SQL.java
@@ -322,7 +322,17 @@
        }
        return (test_record_count+1);
    }
    //手动停止时,如果没有导入完,删除记录
    public static void delete_UserCancel(MysqlConnPool pool,int BattGoupId,int max_test_record_count) {
            ArrayList<String> sql_strs = new ArrayList<>();
            String sql_str_inf = "delete from   "+Sql_Mysql.Tb_FboTestData_Inf_Table+" where test_record_count="+max_test_record_count;
            sql_strs.add(sql_str_inf);
            String sql_str_id = " delete from   "+Sql_Mysql.Tb_FboTestData_Table+BattGoupId+" where test_record_count="+max_test_record_count;
            sql_strs.add(sql_str_id);
            Sql_Mysql sql = new Sql_Mysql(pool);
            sql.makeManualCommit(sql_strs);
            sql.close_con();
    }
    //文件导入进度修改
    public static void updateFBOGressByOneSql(MysqlConnPool pool,int file_sum,int file_block,int battgroupid,int file_downloadNum) {
        //System.out.println("file_downloadNum:"+file_downloadNum);
BattMonitor_FGCD-A059NT/src/com/dev/fgcd/comm/FGCD_TestDataDownLoad.java
@@ -86,8 +86,10 @@
            nowFbo = fbofile.files[i];
            int file_downloadNum=i;//设置当前下载文件的索引
            if(now_download_state == DownLoadState_DownLoadCancel) {
                nowFbo.setDownload_state(DownLoadState_DownLoadCancel);
                nowFbo.setDownload_flag(DownloadFlag_Fail);
                fbofile.files[i].setDownload_state(DownLoadState_DownLoadCancel);
                fbofile.files[i].setDownload_flag(DownloadFlag_Fail);
                FGCD_Task_Thread_SQL.updateFgcd_Filedownload_TableCmdByDevId(pool,fbofile,file_downloadNum);
                continue;
            }
            if(nowFbo.download_flag != DownloadFlag_Start) {
@@ -102,8 +104,8 @@
                        now_download_state = FGCD_ComBase.CMD_DownLoadFBDFile_Over;
                        fbofile.setStop_reason(FialReason_UserCancel);
                        //手动终止下载命令
                        nowFbo.setDownload_flag(DownloadFlag_Fail);
                        nowFbo.setDownload_state(DownLoadState_DownLoadCancel);
                        fbofile.files[file_downloadNum].setDownload_flag(DownloadFlag_Fail);
                        fbofile.files[file_downloadNum].setDownload_state(DownLoadState_DownLoadCancel);
                        fbofile.op_cmd = FGCD_ComBase.CMD_DownLoadFBDFile_Over_ACK;
                        FGCD_Task_Thread_SQL.updateFgcd_Filedownload_TableCmdByDevId(pool, fbofile,file_downloadNum);
                        continue;
BattMonitor_FGCD-A059NT/src/com/dev/fgcd/fbo/FboData.java
@@ -180,6 +180,7 @@
                    int nowFbo_download_state=FGCD_Task_Thread_SQL.quereyDownLoadState_UserCancel(m_ConnPool,battgroupid);
                    if(nowFbo_download_state==FGCD_ComBase.CMD_DownLoadFBDFile_Over) {
                        sucess=false;
                        FGCD_Task_Thread_SQL.delete_UserCancel(m_ConnPool,battgroupid,max_test_record_count);
                        break;
                    }
                    FboDataType mType = new FboDataType();
@@ -198,7 +199,7 @@
                            sucess=sucess&bl;
                            file_block=record_num*(data_inf.BattSum*2 + 32)+256;
                            FGCD_Task_Thread_SQL.updateFBOGressByOneSql(m_ConnPool,file_sum,file_block,battgroupid,file_downloadNum);//插入文件的进度
                            System.err.println("总数:"+file_sum+"  导入数据:"+file_block);
                            //System.err.println("总数:"+file_sum+"  导入数据:"+file_block);
                            record_num++;
                        }
                    }