civil-tools-v 0.0.3__py3-none-any.whl → 0.0.5__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.
@@ -0,0 +1,93 @@
1
+ from ..BasicPltPlotter import SeismicPlotter, GetTicks
2
+ from typing import List
3
+ import numpy as np
4
+ import matplotlib.pyplot as plt
5
+
6
+
7
+ class DriftPlotter(SeismicPlotter):
8
+ def __init__(self, floor_num=8, fig_num=2):
9
+ super().__init__(fig_num, floor_num)
10
+ self.__limit = None
11
+ self.type = "层间位移角"
12
+
13
+ def set_data(
14
+ self,
15
+ wind_x: List[float],
16
+ wind_y: List[float],
17
+ seismic_x: List[float],
18
+ seismic_y: List[float],
19
+ ):
20
+ # 验证数据长度
21
+ data_dict = {
22
+ "wind_x": wind_x,
23
+ "wind_y": wind_y,
24
+ "seismic_x": seismic_x,
25
+ "seismic_y": seismic_y,
26
+ }
27
+ for name, data_list in data_dict.items():
28
+ self._validate_list_length(data_list, name)
29
+
30
+ self._ax1_x = 1 / np.array(wind_x)
31
+ self._ax1_y = 1 / np.array(wind_y)
32
+ self._ax2_x = 1 / np.array(seismic_x)
33
+ self._ax2_y = 1 / np.array(seismic_y)
34
+
35
+ def set_limit(self, limit: float):
36
+ self.__limit = limit
37
+
38
+ def plot(self):
39
+ if self.__limit:
40
+ self.__plot_limit()
41
+ kwargs_x = self.kwargs_x.copy()
42
+ kwargs_x["label"] = "X风"
43
+ kwargs_y = self.kwargs_y.copy()
44
+ kwargs_y["label"] = "Y风"
45
+ self.axes[0].plot(self._ax1_x, self._y_values, **kwargs_x)
46
+ self.axes[0].plot(self._ax1_y, self._y_values, **kwargs_y)
47
+ kwargs_x["label"] = "X小震"
48
+ kwargs_y["label"] = "Y小震"
49
+ self.axes[1].plot(self._ax2_x, self._y_values, **kwargs_x)
50
+ self.axes[1].plot(self._ax2_y, self._y_values, **kwargs_y)
51
+ self.__adjust_lim()
52
+ self.__add_titles()
53
+
54
+ def __adjust_lim(self):
55
+ xmaxs = [self._ax1_x.max(), self._ax2_x.max()]
56
+ for i in range(2):
57
+ self.axes[i].set_xlim(left=0, right=xmaxs[i] * 1.2)
58
+ self.axes[i].set_yticks(self._y_major_ticks)
59
+ self.axes[i].set_yticks(self._y_minor_ticks, minor=True)
60
+ x_ticks = GetTicks(xmaxs[i])
61
+ x_ticks = self.__shrink_x_ticks(x_ticks)
62
+ self.axes[i].set_xticks(x_ticks)
63
+ X_ticklabels = [0] + ["1/%d" % (1 / s) for s in x_ticks[1:]]
64
+ self.axes[i].set_xticklabels(X_ticklabels)
65
+
66
+ def __shrink_x_ticks(self, x_ticks):
67
+ if len(x_ticks) <= 4:
68
+ return x_ticks
69
+ new_x_ticks = []
70
+ for i in range(len(x_ticks)):
71
+ if i % 2 == 0:
72
+ new_x_ticks.append(x_ticks[i])
73
+ return new_x_ticks
74
+
75
+ def __plot_limit(self):
76
+ limitation = self.__limit
77
+ for ax in self.axes:
78
+ ax.vlines(
79
+ x=1 / limitation,
80
+ ymin=0,
81
+ ymax=self.floor_num,
82
+ color="r",
83
+ linewidth=3,
84
+ ls="--",
85
+ label=f"限值1/{limitation}",
86
+ )
87
+
88
+ def __add_titles(self):
89
+ self.axes[0].set_ylabel(self.y_label)
90
+ self.axes[0].set_xlabel(f"风下{self.type}")
91
+ self.axes[1].set_xlabel(f"小震下{self.type}")
92
+ self.axes[0].legend(framealpha=0, fontsize=12, loc=1)
93
+ self.axes[1].legend(framealpha=0, fontsize=12, loc=1)
@@ -1,2 +1,3 @@
1
1
  from .ShearMassRatio import ShearMassRatioPlotter
2
2
  from .ShearMoment import ShearMomentPlotter
3
+ from .Drift import DriftPlotter
@@ -168,6 +168,38 @@ class ValuePeer:
168
168
  return {"X": self.x, "Y": self.y}
169
169
 
170
170
 
171
+ class FloorDrift:
172
+ def __init__(
173
+ self,
174
+ floor_height: float,
175
+ drift_max_disp_x: float,
176
+ drift_max_disp_y: float,
177
+ drift_min_disp_x: float,
178
+ drift_min_disp_y: float,
179
+ max_disp_x: float,
180
+ ave_disp_x: float,
181
+ max_disp_y: float,
182
+ ave_disp_y: float,
183
+ ):
184
+ self.floor_height = floor_height
185
+ self.drift_max_disp_x = drift_max_disp_x
186
+ self.drift_max_disp_y = drift_max_disp_y
187
+ self.drift_min_disp_x = drift_min_disp_x
188
+ self.drift_min_disp_y = drift_min_disp_y
189
+ self.max_disp_x = max_disp_x
190
+ self.ave_disp_x = ave_disp_x
191
+ self.max_disp_y = max_disp_y
192
+ self.ave_disp_y = ave_disp_y
193
+
194
+ @property
195
+ def drift_x(self):
196
+ return round(self.floor_height / self.drift_max_disp_x)
197
+
198
+ @property
199
+ def drift_y(self):
200
+ return round(self.floor_height / self.drift_max_disp_y)
201
+
202
+
171
203
  class FloorSeismicResult:
172
204
  def __init__(
173
205
  self,
@@ -177,8 +209,9 @@ class FloorSeismicResult:
177
209
  shear: ValuePeer = None,
178
210
  moment: ValuePeer = None,
179
211
  disp: ValuePeer = None,
180
- stiffness: ValuePeer = None,
212
+ stiffness: List[ValuePeer] = [],
181
213
  shear_capacity: ValuePeer = None,
214
+ drifts: List[FloorDrift] = [],
182
215
  ):
183
216
  self.floor_num = floor_num
184
217
  self.tower_num = tower_num
@@ -188,6 +221,7 @@ class FloorSeismicResult:
188
221
  self.disp = disp
189
222
  self.stiffness = stiffness
190
223
  self.shear_capacity = shear_capacity
224
+ self.drifts = drifts
191
225
 
192
226
  def __str__(self):
193
227
  return f"Flr.{self.floor_num}:Fx={self.force.x};Fy={self.force.y}"
@@ -1,2 +1,9 @@
1
- from .SeismicResult import SinglePeriod, Period, ValuePeer, FloorSeismicResult, SeismicResult
1
+ from .SeismicResult import (
2
+ SinglePeriod,
3
+ Period,
4
+ ValuePeer,
5
+ FloorSeismicResult,
6
+ SeismicResult,
7
+ FloorDrift,
8
+ )
2
9
  from .BasicResult import SingleMassResult, MassResult
@@ -1,9 +1,9 @@
1
1
  from .Beam import Beam
2
2
  from .Section import Section
3
- from .Geometry import Joint,Grid,StandFloor
3
+ from .Geometry import Joint, Grid, StandFloor
4
4
  from .Column import Column
5
5
  from .Slab import Slab
6
6
 
7
7
  from .ComponentType import ComponentType
8
8
  from .GlobalResult import SingleMassResult, MassResult, Period, SinglePeriod
9
- from .GlobalResult import ValuePeer, FloorSeismicResult, SeismicResult
9
+ from .GlobalResult import ValuePeer, FloorSeismicResult, SeismicResult, FloorDrift
@@ -65,6 +65,22 @@ class Connector:
65
65
  print(f"从表 {table_name} 提取数据时出错: {e}")
66
66
  return []
67
67
 
68
+ def extract_table_by_columns_and_filter(
69
+ self, table_name, column_list: List[str], limit_column: str, target_value
70
+ ):
71
+ if self.cursor is None:
72
+ self.connect()
73
+ try:
74
+ column_list_sql = ",".join(column_list)
75
+ self.cursor.execute(
76
+ f"SELECT {column_list_sql} FROM {table_name} WHERE {limit_column}=={target_value}"
77
+ )
78
+ rows = self.cursor.fetchall()
79
+ return rows
80
+ except sqlite3.Error as e:
81
+ print(f"从表 {table_name} 提取数据时出错: {e}")
82
+ return []
83
+
68
84
  def is_table_in_db(self, table_name: str):
69
85
 
70
86
  if self.cursor is None:
@@ -15,6 +15,7 @@ ROTATION = "Rotation"
15
15
 
16
16
  FLOOR_NUM = "FlrNo"
17
17
  TOWER_NUM = "TowNo"
18
+ LOAD_CASE_ID = "LDCase"
18
19
 
19
20
 
20
21
  class YDBTableName:
@@ -84,7 +85,7 @@ class YDBTableName:
84
85
  """
85
86
 
86
87
  RESULT_FLOOR_DATA_TABLE = "dsnStatFlrData"
87
- """包含了大多数楼层计算结果,包括风、地震的各类外力、承载力、刚度等"""
88
+ """包含了大多数楼层计算结果,包括风、地震的各类外力、承载力、刚度等等"""
88
89
  RESULT_FLOOR_DATA_USEFUL_COLUMNS_SEISMIC = [
89
90
  FLOOR_NUM,
90
91
  TOWER_NUM,
@@ -94,6 +95,8 @@ class YDBTableName:
94
95
  "FlrVYInf",
95
96
  "FlrMXInf",
96
97
  "FlrMYInf", # 4 5 6 7
98
+ "CZLXInf",
99
+ "CZLYInf",
97
100
  ]
98
101
  """
99
102
  0-floor_num ,
@@ -104,4 +107,81 @@ class YDBTableName:
104
107
  5-Y方向地震层间剪力,
105
108
  6-X方向地震倾覆力矩,
106
109
  7-Y方向地震倾覆力矩,
110
+ 8-X方向抗剪承载力,
111
+ 9-Y方向抗剪承载力,
112
+ """
113
+
114
+ RESULT_FLOOR_DATA_USEFUL_COLUMNS_STIFFNESS = [
115
+ "StiffShearCutXInf",
116
+ "StiffShearCutYInf",
117
+ "StiffShearDisXInf",
118
+ "StiffShearDisYInf",
119
+ "StiffBendXInf",
120
+ "StiffBendYInf",
121
+ ]
122
+ """
123
+ 包含了楼层的各类刚度,剪切刚度、剪力位移计算刚度、剪弯刚度
124
+ 0-剪切刚度X ,
125
+ 1-剪切刚度Y ,
126
+ 2-剪力位移计算刚度X,
127
+ 3-剪力位移计算刚度Y,
128
+ 4-剪弯刚度X,
129
+ 5-剪弯刚度Y,
130
+ """
131
+
132
+ RESULT_FLOOR_DATA_USEFUL_COLUMNS_WIND = [
133
+ FLOOR_NUM,
134
+ TOWER_NUM,
135
+ "FlrWindFInf",
136
+ "FlrWindVInf", # 0 1 2 3
137
+ "FlrWindMInf",
138
+ ]
139
+ """
140
+ 0-floor_num ,
141
+ 1-tower_num ,
142
+ 2-XY方向顺风外力,
143
+ 3-XY方向顺风剪力,
144
+ 4-XY方向顺风弯矩,
145
+ """
146
+
147
+ DISP_FLOOR_DATA_TABLE = "dsnStatDis"
148
+ """包含了楼层在不同工况下的楼层位移"""
149
+
150
+ DISP_FLOOR_DATA_USEFUL_COLUMNS_WIND = [
151
+ FLOOR_NUM,
152
+ TOWER_NUM,
153
+ LOAD_CASE_ID,
154
+ "MaxFlrAngleDis",
155
+ "MinFlrAngleDis",
156
+ "MaxD",
157
+ "MassAveD",
158
+ ]
159
+ """
160
+ 0-floor_num ,
161
+ 1-tower_num ,
162
+ 2-loadCaseID,需要做筛选
163
+ 3-最大层间位移,
164
+ 4-最小层间位移,
165
+ 5-最大位移,
166
+ 6-平均位移,
167
+ """
168
+
169
+ ADJUST_COEF_TABLE = "dsnStatFlrAdjCoe"
170
+ """楼层调整系数表格"""
171
+ ADJUST_COEF_USEFUL_COLUMN = [FLOOR_NUM, TOWER_NUM, "JZBCoeXInf", "JZBCoeYInf"]
172
+ """
173
+ 0-floor_num ,
174
+ 1-tower_num ,
175
+ 2-X方向剪重比调整系数
176
+ 3-Y方向剪重比调整系数
177
+ """
178
+
179
+ REAL_FLOOR_TABLE = "pmFlrAssembly"
180
+ """楼层调整系数表格"""
181
+ REAL_FLOOR_USEFUL_COLUMN = ["No", STD_FLR_ID, "Level", "Height"]
182
+ """
183
+ 0-楼层编号 ,
184
+ 1-标准层ID ,
185
+ 2-层底高度
186
+ 3-楼层高度
107
187
  """
@@ -1,6 +1,6 @@
1
1
  from .BuildingDefine import Beam, Column, Joint, ComponentType, Grid
2
2
  from .BuildingDefine import SinglePeriod, Period, MassResult, SingleMassResult
3
- from .BuildingDefine import ValuePeer, FloorSeismicResult, SeismicResult
3
+ from .BuildingDefine import ValuePeer, FloorSeismicResult, SeismicResult, FloorDrift
4
4
  from .BuildingDefine.Section import Section, ShapeEnum
5
5
  from .SQLiteConnector import Connector, YDBTableName, RowDataFactory
6
6
  from .YDBType import YDBType
@@ -199,9 +199,33 @@ class YDBLoader:
199
199
  self.__check_result_model("seismic")
200
200
  table_name = YDBTableName.RESULT_FLOOR_DATA_TABLE
201
201
  useful_columns = YDBTableName.RESULT_FLOOR_DATA_USEFUL_COLUMNS_SEISMIC
202
+ useful_columns_stiffness = (
203
+ YDBTableName.RESULT_FLOOR_DATA_USEFUL_COLUMNS_STIFFNESS
204
+ )
202
205
  row_data = self.connector.extract_table_by_columns(table_name, useful_columns)
206
+ stiffness_row_data = self.connector.extract_table_by_columns(
207
+ table_name, useful_columns_stiffness
208
+ )
209
+
210
+ table_disp_name = YDBTableName.DISP_FLOOR_DATA_TABLE
211
+ useful_columns_disp = YDBTableName.DISP_FLOOR_DATA_USEFUL_COLUMNS_WIND
212
+
213
+ seismic_load_cases = self.__get_seismic_loadcase_numbers()
214
+
215
+ seismic_disp_x_row_data = self.connector.extract_table_by_columns_and_filter(
216
+ table_disp_name, useful_columns_disp, "LDCase", seismic_load_cases[0]
217
+ )
218
+ seismic_disp_y_row_data = self.connector.extract_table_by_columns_and_filter(
219
+ table_disp_name, useful_columns_disp, "LDCase", seismic_load_cases[1]
220
+ )
221
+ jzb_coeff = self.__get_JZBCoe()
222
+ floor_height = self.__get_floor_height()
203
223
  floor_result_list = []
204
- for temp_floor in row_data:
224
+ for i in range(len(row_data)):
225
+ temp_floor = row_data[i]
226
+ temp_floor_stiffness = stiffness_row_data[i]
227
+ temp_disp_x = seismic_disp_x_row_data[i]
228
+ temp_disp_y = seismic_disp_y_row_data[i]
205
229
  floor_num = RowDataFactory.extract_int(temp_floor, 0)
206
230
  tower_num = RowDataFactory.extract_int(temp_floor, 1)
207
231
  force_x = RowDataFactory.convert_to_float(
@@ -222,16 +246,206 @@ class YDBLoader:
222
246
  moment_y = RowDataFactory.convert_to_float(
223
247
  RowDataFactory.extract_list(temp_floor, 7)[1]
224
248
  )
249
+ shear_cap_x = RowDataFactory.convert_to_float(
250
+ RowDataFactory.extract_list(temp_floor, 8)[1]
251
+ )
252
+ shear_cap_y = RowDataFactory.convert_to_float(
253
+ RowDataFactory.extract_list(temp_floor, 9)[1]
254
+ )
255
+ stiff_x_shear_cut = RowDataFactory.convert_to_float(
256
+ RowDataFactory.extract_list(temp_floor_stiffness, 0)[1]
257
+ )
258
+ stiff_y_shear_cut = RowDataFactory.convert_to_float(
259
+ RowDataFactory.extract_list(temp_floor_stiffness, 1)[1]
260
+ )
261
+ stiff_x_shear_dis = RowDataFactory.convert_to_float(
262
+ RowDataFactory.extract_list(temp_floor_stiffness, 2)[1]
263
+ )
264
+ stiff_y_shear_dis = RowDataFactory.convert_to_float(
265
+ RowDataFactory.extract_list(temp_floor_stiffness, 3)[1]
266
+ )
267
+ stiff_x_shear_bend = RowDataFactory.convert_to_float(
268
+ RowDataFactory.extract_list(temp_floor_stiffness, 4)[1]
269
+ )
270
+ stiff_y_shear_bend = RowDataFactory.convert_to_float(
271
+ RowDataFactory.extract_list(temp_floor_stiffness, 5)[1]
272
+ )
273
+
274
+ max_drift_disp_x = RowDataFactory.convert_to_float(temp_disp_x[3])
275
+ max_drift_disp_y = RowDataFactory.convert_to_float(temp_disp_y[3])
276
+
277
+ min_drift_disp_x = RowDataFactory.convert_to_float(temp_disp_x[4])
278
+ min_drift_disp_y = RowDataFactory.convert_to_float(temp_disp_y[4])
279
+
280
+ max_disp_x = RowDataFactory.convert_to_float(temp_disp_x[5])
281
+ max_disp_y = RowDataFactory.convert_to_float(temp_disp_y[5])
282
+
283
+ ave_disp_x = RowDataFactory.convert_to_float(temp_disp_x[6])
284
+ ave_disp_y = RowDataFactory.convert_to_float(temp_disp_y[6])
285
+
225
286
  force = ValuePeer(force_x, force_y)
226
287
  shear = ValuePeer(shear_x, shear_y)
227
288
  moment = ValuePeer(moment_x, moment_y)
289
+ disp = ValuePeer(
290
+ max_disp_x * jzb_coeff[floor_num][0],
291
+ max_disp_y * jzb_coeff[floor_num][1],
292
+ )
293
+ stiffness_list = [
294
+ ValuePeer(stiff_x_shear_cut, stiff_y_shear_cut),
295
+ ValuePeer(stiff_x_shear_dis, stiff_y_shear_dis),
296
+ ValuePeer(stiff_x_shear_bend, stiff_y_shear_bend),
297
+ ]
298
+ shear_capacity = ValuePeer(shear_cap_x, shear_cap_y)
299
+ drifts = [
300
+ FloorDrift(
301
+ floor_height[floor_num],
302
+ max_drift_disp_x * jzb_coeff[floor_num][0],
303
+ max_drift_disp_y * jzb_coeff[floor_num][1],
304
+ min_drift_disp_x * jzb_coeff[floor_num][0],
305
+ min_drift_disp_y * jzb_coeff[floor_num][1],
306
+ max_disp_x * jzb_coeff[floor_num][0],
307
+ max_disp_y * jzb_coeff[floor_num][1],
308
+ ave_disp_x * jzb_coeff[floor_num][0],
309
+ ave_disp_y * jzb_coeff[floor_num][1],
310
+ )
311
+ ]
228
312
  temp_floor_result = FloorSeismicResult(
229
- floor_num, tower_num, force, shear, moment
313
+ floor_num,
314
+ tower_num,
315
+ force,
316
+ shear,
317
+ moment,
318
+ disp,
319
+ stiffness_list,
320
+ shear_capacity,
321
+ drifts,
230
322
  )
231
323
  floor_result_list.append(temp_floor_result)
232
324
 
233
325
  return SeismicResult(floor_result_list)
234
326
 
327
+ def get_wind_result(self) -> SeismicResult:
328
+ self.__check_result_model("wind")
329
+ table_name = YDBTableName.RESULT_FLOOR_DATA_TABLE
330
+ useful_columns = YDBTableName.RESULT_FLOOR_DATA_USEFUL_COLUMNS_WIND
331
+ row_data = self.connector.extract_table_by_columns(table_name, useful_columns)
332
+
333
+ table_disp_name = YDBTableName.DISP_FLOOR_DATA_TABLE
334
+ useful_columns_disp = YDBTableName.DISP_FLOOR_DATA_USEFUL_COLUMNS_WIND
335
+
336
+ wind_load_cases = self.__get_wind_loadcase_numbers()
337
+
338
+ wind_disp_x_row_data = self.connector.extract_table_by_columns_and_filter(
339
+ table_disp_name, useful_columns_disp, "LDCase", wind_load_cases[0]
340
+ )
341
+ wind_disp_y_row_data = self.connector.extract_table_by_columns_and_filter(
342
+ table_disp_name, useful_columns_disp, "LDCase", wind_load_cases[1]
343
+ )
344
+
345
+ floor_result_list = []
346
+ floor_height = self.__get_floor_height()
347
+
348
+ for i in range(len(row_data)):
349
+ temp_floor = row_data[i]
350
+ temp_disp_x = wind_disp_x_row_data[i]
351
+ temp_disp_y = wind_disp_y_row_data[i]
352
+ floor_num = RowDataFactory.extract_int(temp_floor, 0)
353
+ tower_num = RowDataFactory.extract_int(temp_floor, 1)
354
+ force_x = RowDataFactory.convert_to_float(
355
+ RowDataFactory.extract_list(temp_floor, 2)[1]
356
+ )
357
+ force_y = RowDataFactory.convert_to_float(
358
+ RowDataFactory.extract_list(temp_floor, 2)[3]
359
+ )
360
+ shear_x = RowDataFactory.convert_to_float(
361
+ RowDataFactory.extract_list(temp_floor, 3)[1]
362
+ )
363
+ shear_y = RowDataFactory.convert_to_float(
364
+ RowDataFactory.extract_list(temp_floor, 3)[3]
365
+ )
366
+ moment_x = RowDataFactory.convert_to_float(
367
+ RowDataFactory.extract_list(temp_floor, 4)[1]
368
+ )
369
+ moment_y = RowDataFactory.convert_to_float(
370
+ RowDataFactory.extract_list(temp_floor, 4)[3]
371
+ )
372
+
373
+ max_drift_disp_x = RowDataFactory.convert_to_float(temp_disp_x[3])
374
+ max_drift_disp_y = RowDataFactory.convert_to_float(temp_disp_y[3])
375
+
376
+ min_drift_disp_x = RowDataFactory.convert_to_float(temp_disp_x[4])
377
+ min_drift_disp_y = RowDataFactory.convert_to_float(temp_disp_y[4])
378
+
379
+ max_disp_x = RowDataFactory.convert_to_float(temp_disp_x[5])
380
+ max_disp_y = RowDataFactory.convert_to_float(temp_disp_y[5])
381
+
382
+ ave_disp_x = RowDataFactory.convert_to_float(temp_disp_x[6])
383
+ ave_disp_y = RowDataFactory.convert_to_float(temp_disp_y[6])
384
+
385
+ force = ValuePeer(abs(force_x), abs(force_y))
386
+ shear = ValuePeer(abs(shear_x), abs(shear_y))
387
+ moment = ValuePeer(abs(moment_x), abs(moment_y))
388
+ disp = ValuePeer(123, 245)
389
+ drifts = [
390
+ FloorDrift(
391
+ floor_height[floor_num],
392
+ max_drift_disp_x,
393
+ max_drift_disp_y,
394
+ min_drift_disp_x,
395
+ min_drift_disp_y,
396
+ max_disp_x,
397
+ max_disp_y,
398
+ ave_disp_x,
399
+ ave_disp_y,
400
+ )
401
+ ]
402
+ temp_floor_result = FloorSeismicResult(
403
+ floor_num, tower_num, force, shear, moment, disp, drifts=drifts
404
+ )
405
+
406
+ floor_result_list.append(temp_floor_result)
407
+ return SeismicResult(floor_result_list)
408
+
409
+ def __get_wind_loadcase_numbers(self):
410
+ return [2, 4]
411
+
412
+ def __get_seismic_loadcase_numbers(self):
413
+ return [9, 10]
414
+
415
+ def __get_JZBCoe(self):
416
+ if hasattr(self, "jzb_coeff"):
417
+ return self.jzb_coeff
418
+ table_name = YDBTableName.ADJUST_COEF_TABLE
419
+ useful_column = YDBTableName.ADJUST_COEF_USEFUL_COLUMN
420
+ row_data = self.connector.extract_table_by_columns(table_name, useful_column)
421
+ jzb_coeff = {}
422
+ for temp_data in row_data:
423
+ floor_num = RowDataFactory.extract_int(temp_data, 0)
424
+ # tower_num = RowDataFactory.extract_int(temp_data, 1)
425
+ coeff_x = RowDataFactory.convert_to_float(
426
+ RowDataFactory.extract_list(temp_data, 2)[1]
427
+ )
428
+ coeff_y = RowDataFactory.convert_to_float(
429
+ RowDataFactory.extract_list(temp_data, 3)[1]
430
+ )
431
+ jzb_coeff[floor_num] = [coeff_x, coeff_y]
432
+ self.jzb_coeff = jzb_coeff
433
+ return self.jzb_coeff
434
+
435
+ def __get_floor_height(self):
436
+ if hasattr(self, "floor_height"):
437
+ return self.floor_height
438
+ table_name = YDBTableName.REAL_FLOOR_TABLE
439
+ useful_column = YDBTableName.REAL_FLOOR_USEFUL_COLUMN
440
+ row_data = self.connector.extract_table_by_columns(table_name, useful_column)
441
+ floor_height = {}
442
+ for temp_data in row_data:
443
+ floor_num = RowDataFactory.extract_int(temp_data, 0)
444
+ height = RowDataFactory.extract_float(temp_data, 3)
445
+ floor_height[floor_num] = height
446
+ self.floor_height = floor_height
447
+ return self.floor_height
448
+
235
449
 
236
450
  if __name__ == "__main__":
237
451
  file_path = "testfiles/dtlmodel1.ydb"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: civil_tools_v
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: A powerful tool for civil engineer in their work.
5
5
  Home-page: https://github.com/VincentXGao/civil-tools
6
6
  Author: Xinyu Gao (Vincent)
@@ -12,9 +12,10 @@ CivilTools/FigureGenerator/BasicPNGPlotter.py,sha256=7PjRuArFc4y-NYy6WQCyfkpCahV
12
12
  CivilTools/FigureGenerator/BasicPltPlotter.py,sha256=DNuBgg5qwi0kbttrNLcnAr1G1rYNunNCOaLwc5_8dzk,4002
13
13
  CivilTools/FigureGenerator/StairCalculationSheetPNGPlotter.py,sha256=iVOEY3MXu7x9D1d3W6fofPCUOHaR06lT9CsssNGqeBI,200
14
14
  CivilTools/FigureGenerator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ CivilTools/FigureGenerator/SeismicReport/Drift.py,sha256=DSP1i3FxbvIyKVAYJyze1UmAMNqQSv0WpGzwZfMFYOQ,3250
15
16
  CivilTools/FigureGenerator/SeismicReport/ShearMassRatio.py,sha256=XpmPA9PeRED4Xzl_5LgJVgm9jEHuTda2GAFs5zMfVP8,2731
16
17
  CivilTools/FigureGenerator/SeismicReport/ShearMoment.py,sha256=dYa4SK20u6MJXDsLAkpGk8t2U2tu3bEmBheu5D5nHek,2660
17
- CivilTools/FigureGenerator/SeismicReport/__init__.py,sha256=W4yE7-BWQ1aiG-_oR7A08L6TtpIA-dlebtuGpU2-uOM,96
18
+ CivilTools/FigureGenerator/SeismicReport/__init__.py,sha256=QPYbo9DvhHmTwccgcZfsV7_TWephS_F44xbWgry9WXg,129
18
19
  CivilTools/ReportGenerator/BasicGenerator.py,sha256=h5FDZvk0X0BozZrLFWxdvcUd2JjERIVUauTscdpi8zw,11329
19
20
  CivilTools/ReportGenerator/DocParagraph.py,sha256=xJ9VWbi3IFu5nwJAS56ooQ49bCk4EBvme6IaY46DRP4,428
20
21
  CivilTools/ReportGenerator/DocPicture.py,sha256=9bJ6Zjw7Z6yB_h_H1_2wL9KZxA14zW-jmsKb_EEGxAc,246
@@ -24,11 +25,11 @@ CivilTools/ReportGenerator/SeismicReportTemplate.py,sha256=TxgRBCT0vW25AMYvuAtrV
24
25
  CivilTools/ReportGenerator/StairCalculationReport.py,sha256=gr2fafvYjTJCM4_JIiE9G5xbiy4W30TfmEjj3DW882Q,21566
25
26
  CivilTools/ReportGenerator/UtilFunctions.py,sha256=7qvAsZvoJN9pakENjBMYhrqP73xj5T4FuhSHa1t8lSA,9398
26
27
  CivilTools/ReportGenerator/__init__.py,sha256=1FVcNtNFstmE8zEFABs9oVw7rHiulvUKx0tD1GNFJ58,332
27
- CivilTools/YDBLoader/YDBLoader.py,sha256=2lwJn1oEU_aHWPbOu6pGZbJqpZLdEoTFqSjeZ4jE7fM,11109
28
+ CivilTools/YDBLoader/YDBLoader.py,sha256=4-s4qvdB5gp1SF0nchOYEYJId9dqgfXgPyVaJ89J4jw,20634
28
29
  CivilTools/YDBLoader/YDBType.py,sha256=KVk_qpOwp4yAsHn96L5PAVTMMO8SU4lFOnnTMsH_qP0,109
29
30
  CivilTools/YDBLoader/__init__.py,sha256=dOomroeul9yiQQ3FZQVhnfYav43sDv1hUltoA0BrmLw,144
30
31
  CivilTools/YDBLoader/BuildingDefine/ComponentType.py,sha256=soUKmSeeY6dCO4IMrLuaF3GcOj8HgzeCQOtudTSqhno,146
31
- CivilTools/YDBLoader/BuildingDefine/__init__.py,sha256=er4GVwvtqOI0G-vzARApPVkS1ntbUiA2d5oa8BsBTq0,343
32
+ CivilTools/YDBLoader/BuildingDefine/__init__.py,sha256=QKph7vyA64vRrb7ZIYCdGJE4KWOiwMbYsyd6ztmT10M,359
32
33
  CivilTools/YDBLoader/BuildingDefine/Beam/Beam.py,sha256=h84shEe7Pg8k32-2ifgpKg8IqNDKxb58kKdsMflistg,673
33
34
  CivilTools/YDBLoader/BuildingDefine/Beam/__init__.py,sha256=3H9M7yiiio2q4SfdfUv2I2uhokFZv_IOkivE1PRWXus,24
34
35
  CivilTools/YDBLoader/BuildingDefine/Column/Column.py,sha256=Sqt_IiaiAgsDTR-TLF3bGiJ4KvFsFW0y7RlXCVqkEi0,423
@@ -38,8 +39,8 @@ CivilTools/YDBLoader/BuildingDefine/Geometry/Joint.py,sha256=MjJ2CkNOgnQYCbmOeau
38
39
  CivilTools/YDBLoader/BuildingDefine/Geometry/StandFloor.py,sha256=lxh5l_H9dl4udvt0zjsWVkF1JLgURC5dfisfEenHnrY,29
39
40
  CivilTools/YDBLoader/BuildingDefine/Geometry/__init__.py,sha256=8eX2KQlOvtqnJqZ8QTc8HTCEuTv6xk1JeIeFdBoGpYQ,86
40
41
  CivilTools/YDBLoader/BuildingDefine/GlobalResult/BasicResult.py,sha256=5M6Y0k1pvrsC9HskmPkMvEbsIESbRkjMNUttU1Y5JBc,1817
41
- CivilTools/YDBLoader/BuildingDefine/GlobalResult/SeismicResult.py,sha256=KoaQmF57_C2-EjVxYr1uu8ZVy_F_Ih-7yeYckkDvhYo,6825
42
- CivilTools/YDBLoader/BuildingDefine/GlobalResult/__init__.py,sha256=cquJ_qevVkhpHRKKNJl8g_3WlmOhvejV4HthYhO0ZZI,150
42
+ CivilTools/YDBLoader/BuildingDefine/GlobalResult/SeismicResult.py,sha256=SuTnjog98EnWtAy-SJA8xCEIDV_h0ZPNsOreNpvV2Lk,7848
43
+ CivilTools/YDBLoader/BuildingDefine/GlobalResult/__init__.py,sha256=aTlINh84E9QeiGXsehcnHGoJhO9OqdFGRTpyUPeH8VY,198
43
44
  CivilTools/YDBLoader/BuildingDefine/Section/Section.py,sha256=wFWHKbrf1VUeCM2fVbrCDERGvcaTqE6gmLiV2RO7cNs,1644
44
45
  CivilTools/YDBLoader/BuildingDefine/Section/ShapeEnum.py,sha256=hTHx2wnNp1hMhRDM5upxxhgTpYGFF23rolfPpUcJFiI,856
45
46
  CivilTools/YDBLoader/BuildingDefine/Section/__init__.py,sha256=lX7D2FvzQzzZ7B6F4MnXGpAxcwbyVdJreBOZMRmsQmQ,64
@@ -49,12 +50,12 @@ CivilTools/YDBLoader/BuildingDefine/StairPart/LoadDefine.py,sha256=DYYjAlndN5J--
49
50
  CivilTools/YDBLoader/BuildingDefine/StairPart/StairComponent.py,sha256=E0VL9c0WC9CPVsf3ByXn49SExx6GKFalHRauhkawaLE,3066
50
51
  CivilTools/YDBLoader/BuildingDefine/StairPart/StairPart.py,sha256=0HLLcQbjOECbWHPKtci4mNOWv7CcgO4UVrtUyPwfeQw,8537
51
52
  CivilTools/YDBLoader/BuildingDefine/StairPart/__init__.py,sha256=Z7tqd0HHG_Wg1qFTt4kiJxofz08DLBnTywpY5vtJmZk,145
52
- CivilTools/YDBLoader/SQLiteConnector/Connector.py,sha256=TWr8SNdYrL3WqMVC3NqLfk6JwZmEEGNwGkEKCeeQbYM,2882
53
+ CivilTools/YDBLoader/SQLiteConnector/Connector.py,sha256=Yw0A0buUfrQDEHYNfvUNy-NjXt80ZSFF3N1YPdtPAFc,3495
53
54
  CivilTools/YDBLoader/SQLiteConnector/RowDataFactory.py,sha256=CRStFrV9ac2bi_R1CB6LW4_MrXhMtfyOFWgrT31PkI4,1537
54
- CivilTools/YDBLoader/SQLiteConnector/YDBTableName.py,sha256=X71ka_a4CU39_r6_jtW2BO9nQe_wiequ4ELE77rvfVA,2614
55
+ CivilTools/YDBLoader/SQLiteConnector/YDBTableName.py,sha256=Ab5SdIx7v-gO_MfJmwSkp9HeATi3BK58zWuZi812qeI,4624
55
56
  CivilTools/YDBLoader/SQLiteConnector/__init__.py,sha256=0WWCCdLvlX0Rp-CjcVQc9oQ2b770Zd5TcMGxWBtToS4,116
56
- civil_tools_v-0.0.3.dist-info/LICENSE,sha256=nq3TNN3UrfULANUGIRvaZAI1jUn6HlYeLxIRjJvDxCc,1088
57
- civil_tools_v-0.0.3.dist-info/METADATA,sha256=KepJhL96WNYk3DIcl27ThIj0iBJFUwud1L5obualo08,6184
58
- civil_tools_v-0.0.3.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
59
- civil_tools_v-0.0.3.dist-info/top_level.txt,sha256=AP0ng4FJ3z78LnGOjUzZaGRMMp-lDtw91Rlia8z--wM,11
60
- civil_tools_v-0.0.3.dist-info/RECORD,,
57
+ civil_tools_v-0.0.5.dist-info/LICENSE,sha256=nq3TNN3UrfULANUGIRvaZAI1jUn6HlYeLxIRjJvDxCc,1088
58
+ civil_tools_v-0.0.5.dist-info/METADATA,sha256=kmkyz6LlkjAyLWvvHj7cnR63IWDw72HQN6ZHv6y2Nc4,6184
59
+ civil_tools_v-0.0.5.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
60
+ civil_tools_v-0.0.5.dist-info/top_level.txt,sha256=AP0ng4FJ3z78LnGOjUzZaGRMMp-lDtw91Rlia8z--wM,11
61
+ civil_tools_v-0.0.5.dist-info/RECORD,,