Administrator
2022-10-08 e85d2288e0d96f8d28696b321d9240b342f53a02
成都客户需求修改现已恢复正常读取
3个文件已修改
50 ■■■■■ 已修改文件
BattFBS9600_ForFG/src/com/dev/fg/FBS9600_State_SQL.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattFBS9600_ForFG/src/com/version_inf/version_inf.txt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattFBS9600_ForFG/src/main/main_FBS9600_FG.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BattFBS9600_ForFG/src/com/dev/fg/FBS9600_State_SQL.java
@@ -433,4 +433,47 @@
            sql.close_con();
        }
    }
    /**
     * 启动是模拟每个电池组的内阻数据值
     * @param gB_MysqlConnPool
     */
    public static void MakeMonResDataRandom(MysqlConnPool pool) {
        String sql_str_sel = "SELECT * FROM " + Sql_Mysql.BattRtData_Table;
        ResultSet res = null;
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        try {
            res = sql.sqlMysqlQuery(sql_str_sel);
            while(res.next()) {
                int battgroupid = res.getInt("BattGroupId");
                int mon_num = res.getInt("mon_num");
                sql.sqlMysqlExecute("UPDATE " + Sql_Mysql.BattRtData_Table + " SET mon_res = " + String.format("%1.3f", (float)(0.101+Math.random()*0.298)) + " WHERE BattGroupId = " + battgroupid + " AND mon_num = " + mon_num);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            if(null != res) {
                try {
                    res.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
            sql.close_con();
        }
    }
    public static void main(String[] args) {
        MysqlConnPool pool = new MysqlConnPool("127.0.0.1", 3360, 5);
        MakeMonResDataRandom(pool);
//        for(int i = 0;i< 100000;i++) {
//            float ran = (float)(0.101+Math.random()*0.298);
//            if(ran < 0.101 || ran > 0.4 ) {
//                System.err.println(ran);
//            }
//            System.out.println(String.format("%1.3f", ran));
//        }
    }
}
BattFBS9600_ForFG/src/com/version_inf/version_inf.txt
@@ -1,5 +1,8 @@
FBS9600 福光总部显示屏通信程序   ModBus Tcp协议
    
2022-10-08 应客户要求模拟内阻数据范围0.101-0.399mΩ
已修改恢复
V1.103 edit at date 2022-02-24
    1.修改最新版本
    
BattFBS9600_ForFG/src/main/main_FBS9600_FG.java
@@ -125,6 +125,10 @@
            BattRealDataPro_Thread batt_realdata = new BattRealDataPro_Thread(GB_MysqlConnPool, m_AppConfig, GB_DataArray);
            batt_realdata.start();
        }
        //随机模拟每个电池组单体的内阻数据值
        //FBS9600_State_SQL.MakeMonResDataRandom(GB_MysqlConnPool);
        FBS9600_State_SQL.updateProcess_StartTime(GB_MysqlConnPool, m_VersionNum);
        while (true) {
            try {