civil-tools-v 0.0.1__py3-none-any.whl → 0.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. CivilTools/Const/CAD.py +2 -0
  2. CivilTools/Const/Concrete.py +144 -0
  3. CivilTools/Const/Steel.py +21 -0
  4. CivilTools/Const/__init__.py +3 -0
  5. CivilTools/DXFGenerator/BasicDXF.py +238 -1
  6. CivilTools/DXFGenerator/DetailDXF.py +324 -0
  7. CivilTools/DXFGenerator/DrawingAttribs.py +45 -0
  8. CivilTools/DXFGenerator/LayerManager.py +37 -0
  9. CivilTools/DXFGenerator/__init__.py +3 -0
  10. CivilTools/FigureGenerator/BasicPNGPlotter.py +28 -25
  11. CivilTools/FigureGenerator/BasicPltPlotter.py +115 -1
  12. CivilTools/FigureGenerator/SeismicReport/ShearMassRatio.py +73 -0
  13. CivilTools/FigureGenerator/SeismicReport/ShearMoment.py +71 -0
  14. CivilTools/FigureGenerator/SeismicReport/__init__.py +2 -0
  15. CivilTools/FigureGenerator/StairCalculationSheetPNGPlotter.py +2 -8
  16. CivilTools/ReportGenerator/BasicGenerator.py +109 -83
  17. CivilTools/ReportGenerator/DocParagraph.py +3 -5
  18. CivilTools/ReportGenerator/DocPicture.py +7 -8
  19. CivilTools/ReportGenerator/DocTable.py +11 -11
  20. CivilTools/ReportGenerator/SeismicReport.py +302 -143
  21. CivilTools/ReportGenerator/SeismicReportTemplate.py +523 -202
  22. CivilTools/ReportGenerator/StairCalculationReport.py +249 -185
  23. CivilTools/ReportGenerator/UtilFunctions.py +108 -104
  24. CivilTools/ReportGenerator/__init__.py +2 -2
  25. CivilTools/YDBLoader/BuildingDefine/Beam/Beam.py +12 -15
  26. CivilTools/YDBLoader/BuildingDefine/Column/Column.py +5 -5
  27. CivilTools/YDBLoader/BuildingDefine/ComponentType.py +1 -1
  28. CivilTools/YDBLoader/BuildingDefine/Geometry/Grid.py +8 -12
  29. CivilTools/YDBLoader/BuildingDefine/Geometry/Joint.py +11 -10
  30. CivilTools/YDBLoader/BuildingDefine/Geometry/StandFloor.py +1 -1
  31. CivilTools/YDBLoader/BuildingDefine/GlobalResult/BasicResult.py +44 -24
  32. CivilTools/YDBLoader/BuildingDefine/GlobalResult/SeismicResult.py +168 -54
  33. CivilTools/YDBLoader/BuildingDefine/Section/Section.py +26 -31
  34. CivilTools/YDBLoader/BuildingDefine/Section/ShapeEnum.py +9 -9
  35. CivilTools/YDBLoader/BuildingDefine/Slab/Slab.py +1 -1
  36. CivilTools/YDBLoader/BuildingDefine/StairPart/LoadDefine.py +16 -10
  37. CivilTools/YDBLoader/BuildingDefine/StairPart/StairComponent.py +41 -37
  38. CivilTools/YDBLoader/BuildingDefine/StairPart/StairPart.py +133 -78
  39. CivilTools/YDBLoader/SQLiteConnector/Connector.py +16 -8
  40. CivilTools/YDBLoader/SQLiteConnector/RowDataFactory.py +19 -17
  41. CivilTools/YDBLoader/SQLiteConnector/YDBTableName.py +31 -20
  42. CivilTools/YDBLoader/YDBLoader.py +128 -110
  43. {civil_tools_v-0.0.1.dist-info → civil_tools_v-0.0.3.dist-info}/METADATA +88 -5
  44. civil_tools_v-0.0.3.dist-info/RECORD +60 -0
  45. {civil_tools_v-0.0.1.dist-info → civil_tools_v-0.0.3.dist-info}/WHEEL +1 -1
  46. civil_tools_v-0.0.1.dist-info/RECORD +0 -50
  47. {civil_tools_v-0.0.1.dist-info → civil_tools_v-0.0.3.dist-info}/LICENSE +0 -0
  48. {civil_tools_v-0.0.1.dist-info → civil_tools_v-0.0.3.dist-info}/top_level.txt +0 -0
@@ -9,56 +9,86 @@ from .DocPicture import DocPicture
9
9
  from .SeismicReportTemplate import SRTemplate
10
10
  from .UtilFunctions import add_comma_in_num_str
11
11
 
12
+ from ..YDBLoader.BuildingDefine import MassResult, Period
13
+ from ..FigureGenerator.BasicPltPlotter import BasicPltPlotter, SeismicPlotter
14
+
15
+
16
+ class SeismicReportData:
17
+ def __init__(self, name: str | None = None):
18
+ self.project_name = name
19
+ self.floor_num = 8
20
+ self.yjk_version = None
21
+ self.mass_result = None
22
+ self.period = None
23
+ self.__mock_data()
24
+
25
+ def __mock_data(self):
26
+ self.yjk_version = "6.0.0"
27
+ self.mass_result = MassResult.mock_data()
28
+ self.period = Period.mock_data(num=11, mass_participate=0.01)
29
+
30
+ @property
31
+ def is_valid(self):
32
+ return True
33
+
34
+
12
35
  class SeismicReport(BasicGenerator):
13
- def __init__(self):
36
+ G = 9.8
37
+ """重力加速度"""
38
+
39
+ def __init__(self, all_data: SeismicReportData | None = None):
14
40
  super().__init__()
41
+ self.all_data = all_data
15
42
  # 修改为A3图纸,横向,两栏
16
- self.change_paper_size(PageSize.A3_LANDSCAPE,2)
43
+ self.change_paper_size(PageSize.A3_LANDSCAPE, 2)
17
44
  # 修改纸张Margin,单位mm
18
- self.change_paper_margin(32,25,32,25)
45
+ self.change_paper_margin(32, 25, 32, 25)
19
46
  # 格式统一修改
20
47
  self.body_style.paragraph_format.line_spacing = Pt(22)
21
-
48
+
22
49
  def creat_doc(self):
50
+ if self.all_data == None or not self.all_data.is_valid:
51
+ raise ValueError(
52
+ "The data is not ready, please use set_data() to assign data."
53
+ )
23
54
  self.__add_info()
24
55
  self.__add_seismic_chapter()
25
-
26
-
56
+
27
57
  def __add_info(self):
28
- model_name = "TestModel"
58
+ model_name = self.all_data.project_name
29
59
  par_context = SRTemplate.FIRST_INFO(model_name)
30
60
  paragraph = DocParagraph(par_context)
31
61
  paragraph.style = self.body_style
32
62
  self.add_paragraph(paragraph)
33
-
63
+
34
64
  def __add_seismic_chapter(self):
35
65
  chapter_index = 8
36
- sub_index = 1
66
+ sub_index = 1
37
67
  self.__add_seismic_chapter_title(chapter_index)
38
- sub_index = self.__add_seismic_embedding(chapter_index,sub_index)
68
+ sub_index = self.__add_seismic_embedding(chapter_index, sub_index)
39
69
  sub_index = self.__add_project_mass(chapter_index, sub_index)
40
- sub_index = self.__add_period( chapter_index,sub_index)
41
- sub_index = self.__add_shear_mass_ratio( chapter_index,sub_index)
42
- sub_index = self.__add_shear_and_moment( chapter_index,sub_index)
43
- sub_index = self.__add_horizental_moment_ratio_for_column( chapter_index,sub_index)
44
- sub_index = self.__add_disp_and_drift( chapter_index,sub_index)
45
- sub_index = self.__add_horizental_stiffness_ratio( chapter_index,sub_index)
46
- sub_index = self.__add_rotation_ratio( chapter_index,sub_index)
47
- sub_index = self.__add_stiffness_mass_ratio( chapter_index,sub_index)
48
- sub_index = self.__add_shear_capacity_ratio( chapter_index,sub_index)
49
- sub_index = self.__add_wind_acc( chapter_index,sub_index)
50
-
51
-
52
-
53
- def __add_seismic_chapter_title(self,chapter_index :int):
54
-
55
- yjk_version = "6.0.0"
56
-
70
+ sub_index = self.__add_period(chapter_index, sub_index)
71
+ sub_index = self.__add_shear_mass_ratio(chapter_index, sub_index)
72
+ sub_index = self.__add_shear_and_moment(chapter_index, sub_index)
73
+ sub_index = self.__add_horizental_moment_ratio_for_column(
74
+ chapter_index, sub_index
75
+ )
76
+ sub_index = self.__add_disp_and_drift(chapter_index, sub_index)
77
+ sub_index = self.__add_horizental_stiffness_ratio(chapter_index, sub_index)
78
+ sub_index = self.__add_rotation_ratio(chapter_index, sub_index)
79
+ sub_index = self.__add_stiffness_mass_ratio(chapter_index, sub_index)
80
+ sub_index = self.__add_shear_capacity_ratio(chapter_index, sub_index)
81
+ sub_index = self.__add_wind_acc(chapter_index, sub_index)
82
+
83
+ def __add_seismic_chapter_title(self, chapter_index: int):
84
+ # 获取需要的数据
85
+ yjk_version = self.all_data.yjk_version
86
+ # 开始生成报告
57
87
  current_context = SRTemplate.SEISMIC_CHAPTER_TITLE
58
88
  par_context = DocParagraph(current_context.title(chapter_index))
59
- par_context.par_level = 1
60
- self.add_title(par_context,12,6)
61
- paragraph_texts = current_context.paragraph(chapter_index,yjk_version)
89
+ par_context.par_level = 1
90
+ self.add_title(par_context, 12, 6)
91
+ paragraph_texts = current_context.paragraph(chapter_index, yjk_version)
62
92
  for context in paragraph_texts[:-1]:
63
93
  paragraph = DocParagraph(context)
64
94
  paragraph.style = self.body_style
@@ -70,151 +100,280 @@ class SeismicReport(BasicGenerator):
70
100
  paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
71
101
  paragraph.first_line_indent = 0
72
102
  self.add_paragraph(paragraph)
73
-
103
+
74
104
  figure_title = current_context.picture(chapter_index)
75
- paragraph = DocParagraph(figure_title)
76
- paragraph.style = self.small_title_style
77
- paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
78
- self.add_paragraph(paragraph)
79
-
80
- def __add_seismic_embedding(self, chapter_index:int, sub_index:int):
81
-
105
+ self.__insert_table_figure_title(figure_title)
106
+
107
+ def __add_seismic_embedding(self, chapter_index: int, sub_index: int):
108
+
82
109
  current_context = SRTemplate.SEISMIC_EMBEDDING
83
- self.__insert_title_par_2(current_context,chapter_index,sub_index)
84
-
85
- context = current_context.paragraph(chapter_index,sub_index)[0]
86
- paragraph = DocParagraph(context)
87
- paragraph.style = self.body_style
88
- self.add_paragraph(paragraph)
89
-
90
- table_title = current_context.table(chapter_index,sub_index)
91
- paragraph = DocParagraph(table_title)
92
- paragraph.style = self.small_title_style
93
- paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
94
- self.add_paragraph(paragraph)
95
-
96
- table = DocTable(3,7)
97
- table.merge_cells(1,4,2,4)
98
- table.merge_cells(1,5,2,5)
99
- table.set_table_context(current_context.table_context)
110
+ self.__insert_title_par_2(current_context, chapter_index, sub_index)
111
+
112
+ context = current_context.paragraph(chapter_index, sub_index)[0]
113
+ self.__insert_normal_para(context)
114
+
115
+ table_title = current_context.table(chapter_index, sub_index)
116
+ self.__insert_table_figure_title(table_title)
117
+
118
+ table = DocTable(3, 7)
119
+ table.merge_cells(1, 4, 2, 4)
120
+ table.merge_cells(1, 5, 2, 5)
121
+ table.set_table_context(current_context.table_context)
100
122
  self.add_table(table)
101
-
102
-
123
+
103
124
  return sub_index + 1
104
-
105
- def __add_project_mass(self, chapter_index:int, sub_index:int):
106
-
107
- total_mass = 125452
108
- total_area = 4345
109
- average_load = total_mass / total_area * 10
110
-
125
+
126
+ def __add_project_mass(self, chapter_index: int, sub_index: int):
127
+ mass_result = self.all_data.mass_result
128
+ dead_load = mass_result.total_dead_load
129
+ live_load = mass_result.total_live_load * 0.5
130
+ total_load = mass_result.total_load
131
+ total_area = mass_result.total_slab_area
132
+ average_dead_load = f"{dead_load / total_area:.1f}"
133
+ average_live_load = f"{live_load / total_area:.1f}"
134
+ average_total_load = f"{total_load / total_area:.1f}"
135
+
111
136
  current_context = SRTemplate.PROJECT_MASS
112
- self.__insert_title_par_2(current_context,chapter_index,sub_index)
113
-
137
+ self.__insert_title_par_2(current_context, chapter_index, sub_index)
138
+
114
139
  contexts = current_context.paragraph(
115
140
  chapter_index,
116
141
  sub_index,
117
- total_mass = add_comma_in_num_str(total_mass),
118
- total_area = add_comma_in_num_str(total_area),
119
- average_load = average_load
142
+ total_mass=add_comma_in_num_str(int(total_load / SeismicReport.G)),
143
+ total_area=add_comma_in_num_str(int(total_area)),
144
+ average_load=average_total_load,
120
145
  )
121
146
  paragraph = DocParagraph(contexts[0])
122
147
  paragraph.style = self.body_style
123
148
  self.add_paragraph(paragraph)
124
-
125
- table_title = current_context.table(chapter_index,sub_index)
126
- paragraph = DocParagraph(table_title)
127
- paragraph.style = self.small_title_style
128
- paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
129
- self.add_paragraph(paragraph)
130
-
131
- table = DocTable(4,4)
132
- table.set_table_context(current_context.table_context(
133
- A = 1
134
- ))
149
+
150
+ table_title = current_context.table(chapter_index, sub_index)
151
+ self.__insert_table_figure_title(table_title)
152
+
153
+ table = DocTable(4, 4)
154
+ table.set_table_context(
155
+ current_context.table_context(
156
+ dead_mass=add_comma_in_num_str(int(dead_load / SeismicReport.G)),
157
+ live_mass=add_comma_in_num_str(int(live_load / SeismicReport.G)),
158
+ total_mass=add_comma_in_num_str(int(total_load / SeismicReport.G)),
159
+ dead_percentage=f"{dead_load/total_load*100:.1f}%",
160
+ live_percentage=f"{live_load/total_load*100:.1f}%",
161
+ total_percentage="100%",
162
+ dead_average=average_dead_load,
163
+ live_average=average_live_load,
164
+ total_average=average_total_load,
165
+ )
166
+ )
135
167
  self.add_table(table)
136
-
137
-
168
+
138
169
  return sub_index + 1
139
-
140
- def __add_period(self, chapter_index:int, sub_index:int):
170
+
171
+ def __add_period(self, chapter_index: int, sub_index: int):
141
172
  current_context = SRTemplate.PERIOD
142
- self.__insert_title_par_2(current_context,chapter_index,sub_index)
143
-
144
-
173
+ self.__insert_title_par_2(current_context, chapter_index, sub_index)
174
+
175
+ paras = current_context.paragraph(
176
+ self.all_data.period, chapter_index, sub_index
177
+ )
178
+ self.__insert_normal_para(paras[0])
179
+
180
+ table_title = current_context.table(chapter_index, sub_index)
181
+ self.__insert_table_figure_title(table_title)
182
+ period_num = len(self.all_data.period.periods)
183
+ if period_num <= 10:
184
+ row_num = period_num + 1
185
+ else:
186
+ row_num = 12
187
+ table = DocTable(row_num, 6)
188
+ table_context = current_context.table_context
189
+ last_mass_participate_x = 0
190
+ last_mass_participate_y = 0
191
+ for i in range(row_num - 1):
192
+ temp_period = self.all_data.period.periods[i if i <= 9 else row_num - 2]
193
+ if i <= 8 or (i == 9 and row_num == 11) or i > 9:
194
+ table_context.append(
195
+ [
196
+ str(i + 1),
197
+ temp_period.time_str,
198
+ temp_period.movement_coeff,
199
+ temp_period.rotation_coeff,
200
+ temp_period.get_mass_participate_x(last_mass_participate_x),
201
+ temp_period.get_mass_participate_y(last_mass_participate_y),
202
+ ]
203
+ )
204
+ elif i == 9:
205
+ table_context.append(["..."] * 6)
206
+ last_mass_participate_x += temp_period.mass_participate_x
207
+ last_mass_participate_y += temp_period.mass_participate_y
208
+ table.set_table_context(table_context)
209
+ self.add_table(table)
210
+
211
+ self.__insert_normal_para(paras[1])
212
+
213
+ text = "*{(这里需要振型图片!)}"
214
+ titles = ["(a) 第一振型", "(b) 第二振型", "(c) 第三振型"]
215
+ for i in range(3):
216
+ paragraph = DocParagraph(text)
217
+ paragraph.style = self.body_style
218
+ paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
219
+ paragraph.first_line_indent = 0
220
+ self.add_paragraph(paragraph)
221
+ self.__insert_table_figure_title(titles[i])
222
+ figure_title = current_context.picture(chapter_index, sub_index)
223
+ self.__insert_table_figure_title(figure_title)
224
+
145
225
  return sub_index + 1
146
-
147
- def __add_shear_mass_ratio(self, chapter_index:int, sub_index:int):
226
+
227
+ def __add_shear_mass_ratio(self, chapter_index: int, sub_index: int):
148
228
  current_context = SRTemplate.SHEAR_MASS_RATIO
149
- self.__insert_title_par_2(current_context,chapter_index,sub_index)
150
-
151
-
229
+ self.__insert_title_par_2(current_context, chapter_index, sub_index)
230
+
231
+ para = current_context.paragraph(chapter_index, sub_index)
232
+ self.__insert_normal_para(para)
233
+
234
+ table_title = current_context.table(chapter_index, sub_index)
235
+ self.__insert_table_figure_title(table_title)
236
+ table = DocTable(3, 4)
237
+ table.merge_cells(1, 2, 2, 2)
238
+ table.set_table_context(current_context.table_context())
239
+ self.add_table(table)
240
+
241
+ figure = SeismicPlotter()
242
+ figure.test_plot()
243
+ stream = figure.save_to_stream()
244
+ picture = DocPicture(stream, 2)
245
+ self.add_picture(picture)
246
+
247
+ figure_title = current_context.picture(chapter_index, sub_index)
248
+ self.__insert_table_figure_title(figure_title)
249
+
152
250
  return sub_index + 1
153
-
154
- def __add_shear_and_moment(self, chapter_index:int, sub_index:int):
251
+
252
+ def __add_shear_and_moment(self, chapter_index: int, sub_index: int):
155
253
  current_context = SRTemplate.SHEAR_AND_MOMENT
156
- self.__insert_title_par_2(current_context,chapter_index,sub_index)
157
-
158
-
254
+ self.__insert_title_par_2(current_context, chapter_index, sub_index)
255
+
256
+ para = current_context.paragraph(chapter_index, sub_index)
257
+ self.__insert_normal_para(para)
258
+
259
+ table_title = current_context.table(chapter_index, sub_index)
260
+ self.__insert_table_figure_title(table_title)
261
+ table = DocTable(6, 4)
262
+ table.merge_cells(0, 0, 1, 1)
263
+ table.merge_cells(0, 2, 0, 3)
264
+ table.merge_cells(2, 0, 3, 0)
265
+ table.merge_cells(4, 0, 5, 0)
266
+ table.set_table_context(current_context.table_context())
267
+ self.add_table(table)
268
+
269
+ figure = SeismicPlotter()
270
+ figure.test_plot()
271
+ stream = figure.save_to_stream()
272
+ picture = DocPicture(stream, 2)
273
+ self.add_picture(picture)
274
+
275
+ figure_titles = current_context.picture(chapter_index, sub_index)
276
+ self.__insert_table_figure_title(figure_titles[0])
277
+
278
+ figure = SeismicPlotter()
279
+ figure.test_plot()
280
+ stream = figure.save_to_stream()
281
+ picture = DocPicture(stream, 2)
282
+ self.add_picture(picture)
283
+
284
+ self.__insert_table_figure_title(figure_titles[1])
285
+
159
286
  return sub_index + 1
160
-
161
- def __add_horizental_moment_ratio_for_column(self, chapter_index:int, sub_index:int):
287
+
288
+ def __add_horizental_moment_ratio_for_column(
289
+ self, chapter_index: int, sub_index: int
290
+ ):
162
291
  current_context = SRTemplate.HORIZENTAL_MOMENT_RATIO_FOR_COLUMN
163
- self.__insert_title_par_2(current_context,chapter_index,sub_index)
164
-
165
-
292
+ self.__insert_title_par_2(current_context, chapter_index, sub_index)
293
+
294
+ paras = current_context.paragraph(chapter_index, sub_index)
295
+ self.__insert_normal_para(paras[0])
296
+ self.__insert_normal_para(paras[1])
297
+
298
+ figure = SeismicPlotter()
299
+ figure.test_plot()
300
+ stream = figure.save_to_stream()
301
+ picture = DocPicture(stream, 2)
302
+ self.add_picture(picture)
303
+
304
+ figure_title = current_context.picture(chapter_index, sub_index)
305
+ self.__insert_table_figure_title(figure_title)
306
+
307
+ table_titles = current_context.table(chapter_index, sub_index)
308
+ self.__insert_table_figure_title(table_titles[0])
309
+ row_num = self.all_data.floor_num + 1
310
+ table = DocTable(row_num, 5)
311
+ table_context = current_context.table_context()
312
+ for _ in range(self.all_data.floor_num):
313
+ table_context.append(["--"] * 5)
314
+ table.set_table_context(table_context)
315
+ self.add_table(table)
316
+
317
+ self.__insert_table_figure_title(table_titles[1])
318
+ row_num = self.all_data.floor_num + 1
319
+ table = DocTable(row_num, 5)
320
+ table_context = current_context.table_context()
321
+ for _ in range(self.all_data.floor_num):
322
+ table_context.append(["--"] * 5)
323
+ table.set_table_context(table_context)
324
+ self.add_table(table)
325
+
166
326
  return sub_index + 1
167
-
168
- def __add_disp_and_drift(self, chapter_index:int, sub_index:int):
327
+
328
+ def __add_disp_and_drift(self, chapter_index: int, sub_index: int):
169
329
  current_context = SRTemplate.DISP_AND_DRIFT
170
- self.__insert_title_par_2(current_context,chapter_index,sub_index)
171
-
172
-
330
+ self.__insert_title_par_2(current_context, chapter_index, sub_index)
331
+
173
332
  return sub_index + 1
174
-
175
- def __add_horizental_stiffness_ratio(self, chapter_index:int, sub_index:int):
333
+
334
+ def __add_horizental_stiffness_ratio(self, chapter_index: int, sub_index: int):
176
335
  current_context = SRTemplate.HORIZENTAL_STIFFNESS_RATIO
177
- self.__insert_title_par_2(current_context,chapter_index,sub_index)
178
-
179
-
336
+ self.__insert_title_par_2(current_context, chapter_index, sub_index)
337
+
180
338
  return sub_index + 1
181
-
182
- def __add_rotation_ratio(self, chapter_index:int, sub_index:int):
339
+
340
+ def __add_rotation_ratio(self, chapter_index: int, sub_index: int):
183
341
  current_context = SRTemplate.ROTATION_RATIO
184
- self.__insert_title_par_2(current_context,chapter_index,sub_index)
185
-
186
-
342
+ self.__insert_title_par_2(current_context, chapter_index, sub_index)
343
+
187
344
  return sub_index + 1
188
-
189
- def __add_stiffness_mass_ratio(self, chapter_index:int, sub_index:int):
345
+
346
+ def __add_stiffness_mass_ratio(self, chapter_index: int, sub_index: int):
190
347
  current_context = SRTemplate.STIFFNESS_MASS_RATIO
191
- self.__insert_title_par_2(current_context,chapter_index,sub_index)
192
-
193
-
348
+ self.__insert_title_par_2(current_context, chapter_index, sub_index)
349
+
194
350
  return sub_index + 1
195
-
196
- def __add_shear_capacity_ratio(self, chapter_index:int, sub_index:int):
351
+
352
+ def __add_shear_capacity_ratio(self, chapter_index: int, sub_index: int):
197
353
  current_context = SRTemplate.SHEAR_CAPACITY_RATIO
198
- self.__insert_title_par_2(current_context,chapter_index,sub_index)
199
-
200
-
354
+ self.__insert_title_par_2(current_context, chapter_index, sub_index)
355
+
201
356
  return sub_index + 1
202
-
203
- def __add_wind_acc(self, chapter_index:int, sub_index:int):
357
+
358
+ def __add_wind_acc(self, chapter_index: int, sub_index: int):
204
359
  current_context = SRTemplate.WIND_ACC
205
- self.__insert_title_par_2(current_context,chapter_index,sub_index)
206
-
207
-
360
+ self.__insert_title_par_2(current_context, chapter_index, sub_index)
361
+
208
362
  return sub_index + 1
209
-
210
-
363
+
211
364
  def __insert_title_par_2(self, current_context, chapter_index, sub_index):
212
- par_context = DocParagraph(current_context.title(chapter_index,sub_index))
213
- par_context.par_level = 2
214
- self.add_title(par_context,6 ,6 )
215
-
216
-
217
-
218
-
219
-
220
-
365
+ """用于生成二级子目录"""
366
+ par_context = DocParagraph(current_context.title(chapter_index, sub_index))
367
+ par_context.par_level = 2
368
+ self.add_title(par_context, 6, 6)
369
+
370
+ def __insert_normal_para(self, context):
371
+ paragraph = DocParagraph(context)
372
+ paragraph.style = self.body_style
373
+ self.add_paragraph(paragraph)
374
+
375
+ def __insert_table_figure_title(self, context):
376
+ paragraph = DocParagraph(context)
377
+ paragraph.style = self.small_title_style
378
+ paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
379
+ self.add_paragraph(paragraph)