From 0dc1f3e153a7ef81fb9dc779fb5ad45fcdf1a3e9 Mon Sep 17 00:00:00 2001 From: n3040 Date: Fri, 29 Jul 2022 12:34:44 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E7=94=BB=E4=BB=A3=E8=A1=A8?= =?UTF-8?q?=E6=A1=A3=E8=B7=9D=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=B8=AAbug=E3=80=82=202.=E5=9F=BA=E6=9C=AC=E8=83=BD=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E5=AD=A4=E7=AB=8B=E6=A1=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PWFile.py | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/PWFile.py b/PWFile.py index e1ad021..2ce19e3 100644 --- a/PWFile.py +++ b/PWFile.py @@ -174,7 +174,7 @@ class StringImpactExcel: def set_true_color(object, r_or_rgb_list, g=0, b=0): 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) else: true_color.SetRGB(r_or_rgb_list, g, b) @@ -254,12 +254,18 @@ class StringImpactPlate: forth_reprtv_span = first_tower_info.forth_representive_span continouse_sheet.range("B69").value = forth_reprtv_span 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 = ( ( forth_tower_info.tower_height - 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) + forth_tower_info.altitude_off @@ -293,12 +299,18 @@ class StringImpactPlate: draw_last_tower_key = tower_key_list[draw_tower_index[-1]] last_tower_info = tower_dict[draw_last_tower_key] # 最后一个塔位 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 = ( ( back_tower_info.tower_height - 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.altitude_off @@ -397,7 +409,7 @@ class ContinuousPlate: continue if not last_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_point = np.array( @@ -408,7 +420,10 @@ class ContinuousPlate: APoint(*representive_span_text_point.tolist()), 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: break foundation_low = tower_info.foundation_low