From 27730075dcaa128604030d3b34bee215c516d741 Mon Sep 17 00:00:00 2001 From: n3040 Date: Sun, 16 Jan 2022 21:39:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 6 ++++++ main.py | 12 +++++++++--- metadata.yml | 7 +++++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 Makefile create mode 100644 metadata.yml diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ebeff68 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +target: dist + create-version-file metadata.yml --outfile dist/file_version_info.txt + pyinstaller -F main.py --version-file dist/file_version_info.txt -n Lightening + +dist: + mkdir dist \ No newline at end of file diff --git a/main.py b/main.py index 9fd7147..0e0f38f 100644 --- a/main.py +++ b/main.py @@ -24,7 +24,7 @@ def parameter_display(para: Parameter): def egm(): if len(sys.argv) < 2: - toml_file_path = "article.toml" + toml_file_path = r"article.toml" else: toml_file_path = sys.argv[1] logger.info(f"读取文件{toml_file_path}") @@ -44,10 +44,10 @@ def egm(): ] # 地面倾角,向下为正 para.h_arm = toml_parameter["h_arm"] para.altitude = toml_parameter["altitude"] - para.max_i = toml_parameter["max_i"] para.rated_voltage = toml_parameter["rated_voltage"] toml_optional = toml_dict["optional"] para.voltage_n = toml_optional["voltage_n"] # 工作电压分成多少份来计算 + para.max_i = toml_optional["max_i"] ######################################################### # 以上是需要设置的参数 parameter_display(para) @@ -101,7 +101,13 @@ def egm(): rg_type = "g" # TODO 保护角公式可能有问题,后面改 shield_angle = ( - math.atan((rc_x - rs_x) / ((rs_y - rc_y) + string_c_len)) + math.atan( + (rc_x - rs_x) + / ( + (h_arm[0] - string_g_len - h_arm[phase_conductor_foo + 1]) + + string_c_len + ) + ) * 180 / math.pi ) # 保护角 diff --git a/metadata.yml b/metadata.yml new file mode 100644 index 0000000..0338e6a --- /dev/null +++ b/metadata.yml @@ -0,0 +1,7 @@ +Version: 1.1.0 +#CompanyName: My Imaginary Company +#FileDescription: Simple App +#InternalName: Simple App +#LegalCopyright: © My Imaginary Company. All rights reserved. +#OriginalFilename: SimpleApp.exe +ProductName: Lightening \ No newline at end of file