1.修复画代表档距不正确的一个bug。

2.基本能用于孤立档。
This commit is contained in:
n3040 2022-07-29 12:34:44 +08:00
parent 462599b41d
commit 0dc1f3e153
1 changed files with 22 additions and 7 deletions

View File

@ -174,7 +174,7 @@ class StringImpactExcel:
def set_true_color(object, r_or_rgb_list, g=0, b=0): def set_true_color(object, r_or_rgb_list, g=0, b=0):
true_color = object.TrueColor true_color = object.TrueColor
if type(r_or_rgb_list) == List or type(r_or_rgb_list)==list: if type(r_or_rgb_list) == List or type(r_or_rgb_list) == list:
true_color.SetRGB(*r_or_rgb_list) true_color.SetRGB(*r_or_rgb_list)
else: else:
true_color.SetRGB(r_or_rgb_list, g, b) true_color.SetRGB(r_or_rgb_list, g, b)
@ -254,12 +254,18 @@ class StringImpactPlate:
forth_reprtv_span = first_tower_info.forth_representive_span forth_reprtv_span = first_tower_info.forth_representive_span
continouse_sheet.range("B69").value = forth_reprtv_span continouse_sheet.range("B69").value = forth_reprtv_span
high_temperature_tension = continouse_sheet.range("L69").value high_temperature_tension = continouse_sheet.range("L69").value
forth_tower_info = tower_dict[tower_key_list[draw_tower_index[0] + 1]] forth_tower_info: SEntry = tower_dict[tower_key_list[draw_tower_index[0] + 1]]
if forth_tower_info.is_tension_tower:
forth_tower_fitting_length = 0
else:
forth_tower_fitting_length = fitting.fitting_length_dic[
forth_tower_info.fitting
]
gaocha_of_first_tower = ( gaocha_of_first_tower = (
( (
forth_tower_info.tower_height forth_tower_info.tower_height
- forth_tower_info.foundation_low - forth_tower_info.foundation_low
- fitting.fitting_length_dic[forth_tower_info.fitting] - forth_tower_fitting_length
) )
- (first_tower_info.tower_height - first_tower_info.foundation_low) - (first_tower_info.tower_height - first_tower_info.foundation_low)
+ forth_tower_info.altitude_off + forth_tower_info.altitude_off
@ -293,12 +299,18 @@ class StringImpactPlate:
draw_last_tower_key = tower_key_list[draw_tower_index[-1]] draw_last_tower_key = tower_key_list[draw_tower_index[-1]]
last_tower_info = tower_dict[draw_last_tower_key] # 最后一个塔位 last_tower_info = tower_dict[draw_last_tower_key] # 最后一个塔位
back_reprtv_span = last_tower_info.back_representive_span back_reprtv_span = last_tower_info.back_representive_span
back_tower_info = tower_dict[tower_key_list[draw_tower_index[-1] - 1]] back_tower_info: SEntry = tower_dict[tower_key_list[draw_tower_index[-1] - 1]]
if back_tower_info.is_tension_tower:
back_tower_fitting_length = 0
else:
back_tower_fitting_length = fitting.fitting_length_dic[
back_tower_info.fitting
]
gaocha_of_last_tower = ( gaocha_of_last_tower = (
( (
back_tower_info.tower_height back_tower_info.tower_height
- back_tower_info.foundation_low - back_tower_info.foundation_low
- fitting.fitting_length_dic[back_tower_info.fitting] - back_tower_fitting_length
) )
- (last_tower_info.tower_height - last_tower_info.foundation_low) - (last_tower_info.tower_height - last_tower_info.foundation_low)
- last_tower_info.altitude_off - last_tower_info.altitude_off
@ -397,7 +409,7 @@ class ContinuousPlate:
continue continue
if not last_tower_info: if not last_tower_info:
last_tower_info = tower_info last_tower_info = tower_info
if draw_count == draw_count_limit: if draw_count == draw_count_limit - 1:
# 画代表档距 # 画代表档距
representive_span_text = f"{tower_info.back_representive_span:.0f}" representive_span_text = f"{tower_info.back_representive_span:.0f}"
representive_span_text_point = np.array( representive_span_text_point = np.array(
@ -408,7 +420,10 @@ class ContinuousPlate:
APoint(*representive_span_text_point.tolist()), APoint(*representive_span_text_point.tolist()),
3, 3,
) )
set_true_color(added_representive_span_text,ColorEnume.representive_span_text_color_rgb) set_true_color(
added_representive_span_text,
ColorEnume.representive_span_text_color_rgb,
)
if draw_count > draw_count_limit - 1: if draw_count > draw_count_limit - 1:
break break
foundation_low = tower_info.foundation_low foundation_low = tower_info.foundation_low