| | |
| | | static List<SystemConfiguration> configs; |
| | | public static boolean xytognssOpen=false; |
| | | public static boolean gnsstoxyOpen=false; |
| | | public static String language="0"; |
| | | public static int hexport=8234; |
| | | public static int ascallport=7000; |
| | | public static int TrajectoryRetentionDays=30;//轨迹保存天数 |
| | | // 获取系统配置列表 |
| | | public static List<SystemConfiguration> getSystemConfigurations() { |
| | | // 创建配置对象列表 |
| | |
| | | // 数据库密码 |
| | | config.setDatabasePassword(rs.getString("database_password")); |
| | | // HEX数据UDP接收端口 |
| | | config.setHexDataUdpReceivePort(rs.getString("hex_data_udp_receive_port")); |
| | | String hexp=rs.getString("hex_data_udp_receive_port"); |
| | | hexport=Integer.parseInt(hexp); |
| | | config.setHexDataUdpReceivePort(hexp); |
| | | String ascll=rs.getString("ascii_data_udp_receive_port"); |
| | | ascallport=Integer.parseInt(ascll);; |
| | | // ASCII数据UDP接收端口 |
| | | config.setAsciiDataUdpReceivePort(rs.getString("ascii_data_udp_receive_port")); |
| | | config.setAsciiDataUdpReceivePort(ascll); |
| | | |
| | | // TCP数据接收端口1 |
| | | config.setTcpDataReceivePort1(rs.getString("tcp_data_receive_port1")); |
| | | // TCP数据接收端口2 |
| | |
| | | // 位置转发间隔 |
| | | config.setLocationForwardingInterval(rs.getString("location_forwarding_interval")); |
| | | // 轨迹保存天数 |
| | | config.setTrajectorySaveDays(rs.getString("trajectory_save_days")); |
| | | String savedays=rs.getString("trajectory_save_days"); |
| | | if (savedays != null && !savedays.trim().isEmpty()) { |
| | | try { |
| | | TrajectoryRetentionDays= Integer.parseInt(savedays); |
| | | if (TrajectoryRetentionDays <= 0) { |
| | | // 如果转换后的值不是正整数,可以抛出异常或设置为默认值 |
| | | throw new IllegalArgumentException("The value must be a positive integer."); |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | // 如果字符串不是有效的整数格式,可以抛出异常或设置为默认值 |
| | | System.err.println("Invalid number format: " + savedays); |
| | | } |
| | | } |
| | | config.setTrajectorySaveDays(savedays); |
| | | // 标签离线判断时长 |
| | | config.setTagOfflineJudgmentDuration(rs.getString("tag_offline_judgment_duration")); |
| | | // 基站离线判断时长 |
| | |
| | | config.setRealTimeTrajectoryDuration(rs.getString("real_time_trajectory_duration")); |
| | | // 实时轨迹颜色 |
| | | config.setRealTimeTrajectoryColor(rs.getString("real_time_trajectory_color")); |
| | | String langua=rs.getString("system_language"); |
| | | language=langua; |
| | | // 系统语言 |
| | | config.setSystemLanguage(rs.getString("system_language")); |
| | | config.setSystemLanguage(langua); |
| | | // JNA日志开关 |
| | | config.setJnaLogSwitch(rs.getString("jna_log_switch")); |
| | | // 时间片分配方式 |