|
@@ -344,6 +344,15 @@ class SCADADataProcessor:
|
|
|
adjustments.append(f"类型不符: 计算={turbine_type}, 预期={expected_type}")
|
|
adjustments.append(f"类型不符: 计算={turbine_type}, 预期={expected_type}")
|
|
|
turbine_type = expected_type
|
|
turbine_type = expected_type
|
|
|
|
|
|
|
|
|
|
+ # 第四阶段:特殊处理 - 直驱机型传动比强制设置为1.000
|
|
|
|
|
+ if turbine_type == "直驱":
|
|
|
|
|
+ # 直驱机型传动比强制为1.000
|
|
|
|
|
+ transmission_ratio = 1.000
|
|
|
|
|
+ # 同时调整发电机转速等于叶轮转速(取整)
|
|
|
|
|
+ rated_gen_spd = int(round(rated_rotor_spd))
|
|
|
|
|
+ # 记录调整信息
|
|
|
|
|
+ adjustments.append(f"直驱机型传动比强制设置为1.000")
|
|
|
|
|
+
|
|
|
# 记录调整信息
|
|
# 记录调整信息
|
|
|
if adjustments:
|
|
if adjustments:
|
|
|
logger.info(f"参数调整: {manufacturer} {rated_capacity}kW - " + "; ".join(adjustments))
|
|
logger.info(f"参数调整: {manufacturer} {rated_capacity}kW - " + "; ".join(adjustments))
|
|
@@ -869,6 +878,10 @@ class ModelTurbineManager:
|
|
|
if not (expected_ratio_range[0] <= transmission_ratio <= expected_ratio_range[1]):
|
|
if not (expected_ratio_range[0] <= transmission_ratio <= expected_ratio_range[1]):
|
|
|
adjustments.append(f"传动比调整: {transmission_ratio:.3f}")
|
|
adjustments.append(f"传动比调整: {transmission_ratio:.3f}")
|
|
|
|
|
|
|
|
|
|
+ # 特殊处理:直驱机型传动比强制为1.000
|
|
|
|
|
+ if turbine_type == "直驱" and transmission_ratio != 1.000:
|
|
|
|
|
+ adjustments.append(f"直驱机型传动比强制设置为1.000")
|
|
|
|
|
+
|
|
|
if adjustments:
|
|
if adjustments:
|
|
|
calculation_status = "adjusted"
|
|
calculation_status = "adjusted"
|
|
|
validation_info = "; ".join(adjustments)
|
|
validation_info = "; ".join(adjustments)
|
|
@@ -1075,7 +1088,8 @@ class ModelTurbineManager:
|
|
|
SUM(data_points) as total_data_points,
|
|
SUM(data_points) as total_data_points,
|
|
|
COUNT(CASE WHEN calculation_status = 'success' THEN 1 END) as success_count,
|
|
COUNT(CASE WHEN calculation_status = 'success' THEN 1 END) as success_count,
|
|
|
COUNT(CASE WHEN calculation_status = 'adjusted' THEN 1 END) as adjusted_count,
|
|
COUNT(CASE WHEN calculation_status = 'adjusted' THEN 1 END) as adjusted_count,
|
|
|
- COUNT(CASE WHEN calculation_status = 'error' THEN 1 END) as error_count
|
|
|
|
|
|
|
+ COUNT(CASE WHEN calculation_status = 'error' THEN 1 END) as error_count,
|
|
|
|
|
+ COUNT(CASE WHEN turbine_type = '直驱' AND transmission_ratio = 1.000 THEN 1 END) as direct_drive_with_ratio_1
|
|
|
FROM info_model_turbine
|
|
FROM info_model_turbine
|
|
|
"""
|
|
"""
|
|
|
|
|
|
|
@@ -1101,7 +1115,8 @@ class ModelTurbineManager:
|
|
|
SUM(turbine_count) as turbine_count,
|
|
SUM(turbine_count) as turbine_count,
|
|
|
AVG(transmission_ratio) as avg_ratio,
|
|
AVG(transmission_ratio) as avg_ratio,
|
|
|
AVG(rated_rotor_spd) as avg_rotor_spd,
|
|
AVG(rated_rotor_spd) as avg_rotor_spd,
|
|
|
- AVG(rated_gen_spd) as avg_gen_spd
|
|
|
|
|
|
|
+ AVG(rated_gen_spd) as avg_gen_spd,
|
|
|
|
|
+ COUNT(CASE WHEN transmission_ratio = 1.000 THEN 1 END) as ratio_1_count
|
|
|
FROM info_model_turbine
|
|
FROM info_model_turbine
|
|
|
WHERE turbine_type IS NOT NULL
|
|
WHERE turbine_type IS NOT NULL
|
|
|
GROUP BY turbine_type
|
|
GROUP BY turbine_type
|
|
@@ -1242,6 +1257,7 @@ class ModelTurbineManager:
|
|
|
print(f" 平均额定容量: {round(stats.get('avg_capacity', 0), 1)}kW")
|
|
print(f" 平均额定容量: {round(stats.get('avg_capacity', 0), 1)}kW")
|
|
|
print(f" 已计算参数的机型数: {stats.get('calculated_models', 0)}")
|
|
print(f" 已计算参数的机型数: {stats.get('calculated_models', 0)}")
|
|
|
print(f" 成功计算: {stats.get('success_count', 0)}, 调整后计算: {stats.get('adjusted_count', 0)}, 错误: {stats.get('error_count', 0)}")
|
|
print(f" 成功计算: {stats.get('success_count', 0)}, 调整后计算: {stats.get('adjusted_count', 0)}, 错误: {stats.get('error_count', 0)}")
|
|
|
|
|
+ print(f" 直驱机型传动比=1.000的数量: {stats.get('direct_drive_with_ratio_1', 0)}")
|
|
|
print(f" 使用的总数据点数: {stats.get('total_data_points', 0)}")
|
|
print(f" 使用的总数据点数: {stats.get('total_data_points', 0)}")
|
|
|
|
|
|
|
|
# 显示风机类型分布
|
|
# 显示风机类型分布
|
|
@@ -1255,6 +1271,8 @@ class ModelTurbineManager:
|
|
|
print(f" 平均传动比: {item['avg_ratio']:.3f}, "
|
|
print(f" 平均传动比: {item['avg_ratio']:.3f}, "
|
|
|
f"平均叶轮转速: {item['avg_rotor_spd']:.1f} rpm, "
|
|
f"平均叶轮转速: {item['avg_rotor_spd']:.1f} rpm, "
|
|
|
f"平均发电机转速: {item['avg_gen_spd']:.0f} rpm")
|
|
f"平均发电机转速: {item['avg_gen_spd']:.0f} rpm")
|
|
|
|
|
+ if item['turbine_type'] == '直驱' and item.get('ratio_1_count'):
|
|
|
|
|
+ print(f" 传动比=1.000的机型: {item['ratio_1_count']} 种")
|
|
|
|
|
|
|
|
logger.info("风机机型数据提取和参数计算流程执行完成!")
|
|
logger.info("风机机型数据提取和参数计算流程执行完成!")
|
|
|
return True
|
|
return True
|