qtmodel 1.1.9__tar.gz → 1.1.11__tar.gz
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.
Potentially problematic release.
This version of qtmodel might be problematic. Click here for more details.
- {qtmodel-1.1.9 → qtmodel-1.1.11}/PKG-INFO +7 -67
- {qtmodel-1.1.9 → qtmodel-1.1.11}/README.md +5 -65
- qtmodel-1.1.11/qtmodel/core/__init__.py +1 -0
- qtmodel-1.1.11/qtmodel/core/qt_server.py +47 -0
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_analysis_setting.py +63 -100
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_assistant.py +2 -2
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_boundary.py +97 -118
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_construction_stage.py +41 -46
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_dynamic_load.py +95 -124
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_live_load.py +21 -22
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_load.py +36 -51
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_project.py +44 -85
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_property.py +95 -109
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_section.py +75 -84
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_sink_load.py +33 -48
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_static_load.py +108 -141
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_structure.py +117 -145
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_temperature_load.py +95 -122
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/mdb_tendon.py +46 -56
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/odb/odb_model_boundary.py +10 -10
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/odb/odb_model_load.py +12 -12
- qtmodel-1.1.11/qtmodel/odb/odb_model_material.py +30 -0
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/odb/odb_model_section.py +7 -7
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/odb/odb_model_stage.py +5 -5
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/odb/odb_model_structure.py +14 -14
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/odb/odb_result_data.py +16 -16
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/odb/odb_result_plot.py +12 -12
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/odb/odb_view.py +12 -12
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel.egg-info/PKG-INFO +7 -67
- {qtmodel-1.1.9 → qtmodel-1.1.11}/setup.py +2 -2
- qtmodel-1.1.9/qtmodel/core/__init__.py +0 -3
- qtmodel-1.1.9/qtmodel/core/qt_server.py +0 -85
- qtmodel-1.1.9/qtmodel/odb/odb_model_material.py +0 -109
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/__init__.py +0 -0
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/core/data_helper.py +0 -0
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/core/model_db.py +0 -0
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/core/result_db.py +0 -0
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/mdb/__init__.py +0 -0
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel/odb/__init__.py +0 -0
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel.egg-info/SOURCES.txt +0 -0
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel.egg-info/dependency_links.txt +0 -0
- {qtmodel-1.1.9 → qtmodel-1.1.11}/qtmodel.egg-info/top_level.txt +0 -0
- {qtmodel-1.1.9 → qtmodel-1.1.11}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qtmodel
|
|
3
|
-
Version: 1.1.
|
|
4
|
-
Summary: python modeling for qt 2025-
|
|
3
|
+
Version: 1.1.11
|
|
4
|
+
Summary: python modeling for qt 2025-10-13
|
|
5
5
|
Home-page: https://github.com/Inface0443/pyqt
|
|
6
6
|
Author: dqy-zhj
|
|
7
7
|
Author-email: 1105417715@qq.com
|
|
@@ -17,7 +17,7 @@ Dynamic: description-content-type
|
|
|
17
17
|
Dynamic: home-page
|
|
18
18
|
Dynamic: summary
|
|
19
19
|
|
|
20
|
-
> 最新版本 V1.1.
|
|
20
|
+
> 最新版本 V1.1.11 - 2025-10-13
|
|
21
21
|
> pip install --upgrade qtmodel -i https://pypi.org/simple
|
|
22
22
|
- 新增更新结构组接口
|
|
23
23
|
# 建模操作
|
|
@@ -2302,8 +2302,8 @@ from qtmodel import *
|
|
|
2302
2302
|
mdb.add_spectrum_case(name="反应谱工况",info_x=("函数1",1.0))
|
|
2303
2303
|
#Returns: 无
|
|
2304
2304
|
```
|
|
2305
|
-
|
|
2306
|
-
|
|
2305
|
+
### update_spectrum_function
|
|
2306
|
+
todo 更新反应谱函数
|
|
2307
2307
|
> 参数:
|
|
2308
2308
|
> name: 函数名称
|
|
2309
2309
|
> new_name: 新函数名称
|
|
@@ -2625,7 +2625,7 @@ mdb.update_weight_stage(name="施工阶段1",structure_group_name="默认结构
|
|
|
2625
2625
|
#Returns: 无
|
|
2626
2626
|
```
|
|
2627
2627
|
### update_construction_stage
|
|
2628
|
-
|
|
2628
|
+
更新施工阶段信息
|
|
2629
2629
|
> 参数:
|
|
2630
2630
|
> name:施工阶段信息
|
|
2631
2631
|
> new_name:新施工阶段名
|
|
@@ -2921,57 +2921,6 @@ mdb.update_bulking_setting(do_analysis=True,mode_count=3,variable_cases=["工况
|
|
|
2921
2921
|
```
|
|
2922
2922
|
# 视图与结果提取
|
|
2923
2923
|
## 获取材料
|
|
2924
|
-
### get_concrete_material
|
|
2925
|
-
获取混凝土材料信息
|
|
2926
|
-
> 参数:
|
|
2927
|
-
> ids: 材料号支持XtoYbyN形式字符串,默认时输出全部材料
|
|
2928
|
-
```Python
|
|
2929
|
-
# 示例代码
|
|
2930
|
-
from qtmodel import *
|
|
2931
|
-
odb.get_concrete_material() # 获取所有材料信息
|
|
2932
|
-
#Returns: list[dict]
|
|
2933
|
-
```
|
|
2934
|
-
### get_steel_plate_material
|
|
2935
|
-
获取钢材材料信息
|
|
2936
|
-
> 参数:
|
|
2937
|
-
> ids: 材料号支持XtoYbyN形式字符串,默认时输出全部材料
|
|
2938
|
-
```Python
|
|
2939
|
-
# 示例代码
|
|
2940
|
-
from qtmodel import *
|
|
2941
|
-
odb.get_steel_plate_material() # 获取所有钢材材料信息
|
|
2942
|
-
#Returns: list[dict]
|
|
2943
|
-
```
|
|
2944
|
-
### get_pre_stress_bar_material
|
|
2945
|
-
获取钢材材料信息
|
|
2946
|
-
> 参数:
|
|
2947
|
-
> ids: 材料号,默认时输出全部材料
|
|
2948
|
-
```Python
|
|
2949
|
-
# 示例代码
|
|
2950
|
-
from qtmodel import *
|
|
2951
|
-
odb.get_pre_stress_bar_material() # 获取所有预应力材料信息
|
|
2952
|
-
#Returns: list[dict]
|
|
2953
|
-
```
|
|
2954
|
-
### get_steel_bar_material
|
|
2955
|
-
获取钢筋材料信息
|
|
2956
|
-
> 参数:
|
|
2957
|
-
> ids: 材料号,默认None时输出全部材料
|
|
2958
|
-
```Python
|
|
2959
|
-
# 示例代码
|
|
2960
|
-
from qtmodel import *
|
|
2961
|
-
odb.get_steel_bar_material() # 获取所有钢筋材料信息
|
|
2962
|
-
#Returns: list[dict]
|
|
2963
|
-
```
|
|
2964
|
-
### get_user_define_material
|
|
2965
|
-
获取自定义材料信息
|
|
2966
|
-
> 参数:
|
|
2967
|
-
> ids: 材料号支持XtoYbyN形式字符串,默认None时输出全部材料
|
|
2968
|
-
```Python
|
|
2969
|
-
# 示例代码
|
|
2970
|
-
from qtmodel import *
|
|
2971
|
-
odb.get_user_define_material() # 获取所有自定义材料信息
|
|
2972
|
-
odb.get_user_define_material("1to10") # 获取所有自定义材料信息
|
|
2973
|
-
#Returns: list[dict]
|
|
2974
|
-
```
|
|
2975
2924
|
### get_material_data
|
|
2976
2925
|
获取材料信息
|
|
2977
2926
|
> 参数:
|
|
@@ -2987,16 +2936,7 @@ odb.get_material_data() # 获取所有材料信息
|
|
|
2987
2936
|
```Python
|
|
2988
2937
|
# 示例代码
|
|
2989
2938
|
from qtmodel import *
|
|
2990
|
-
odb.get_thickness_data(
|
|
2991
|
-
#Returns:
|
|
2992
|
-
```
|
|
2993
|
-
### get_all_thickness_data
|
|
2994
|
-
获取所有板厚信息
|
|
2995
|
-
> 参数:
|
|
2996
|
-
```Python
|
|
2997
|
-
# 示例代码
|
|
2998
|
-
from qtmodel import *
|
|
2999
|
-
odb.get_all_thickness_data()
|
|
2939
|
+
odb.get_thickness_data()
|
|
3000
2940
|
#Returns: 包含信息为list[dict]
|
|
3001
2941
|
```
|
|
3002
2942
|
## 获取节点信息
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
> 最新版本 V1.1.
|
|
1
|
+
> 最新版本 V1.1.11 - 2025-10-13
|
|
2
2
|
> pip install --upgrade qtmodel -i https://pypi.org/simple
|
|
3
3
|
- 新增更新结构组接口
|
|
4
4
|
# 建模操作
|
|
@@ -2283,8 +2283,8 @@ from qtmodel import *
|
|
|
2283
2283
|
mdb.add_spectrum_case(name="反应谱工况",info_x=("函数1",1.0))
|
|
2284
2284
|
#Returns: 无
|
|
2285
2285
|
```
|
|
2286
|
-
|
|
2287
|
-
|
|
2286
|
+
### update_spectrum_function
|
|
2287
|
+
todo 更新反应谱函数
|
|
2288
2288
|
> 参数:
|
|
2289
2289
|
> name: 函数名称
|
|
2290
2290
|
> new_name: 新函数名称
|
|
@@ -2606,7 +2606,7 @@ mdb.update_weight_stage(name="施工阶段1",structure_group_name="默认结构
|
|
|
2606
2606
|
#Returns: 无
|
|
2607
2607
|
```
|
|
2608
2608
|
### update_construction_stage
|
|
2609
|
-
|
|
2609
|
+
更新施工阶段信息
|
|
2610
2610
|
> 参数:
|
|
2611
2611
|
> name:施工阶段信息
|
|
2612
2612
|
> new_name:新施工阶段名
|
|
@@ -2902,57 +2902,6 @@ mdb.update_bulking_setting(do_analysis=True,mode_count=3,variable_cases=["工况
|
|
|
2902
2902
|
```
|
|
2903
2903
|
# 视图与结果提取
|
|
2904
2904
|
## 获取材料
|
|
2905
|
-
### get_concrete_material
|
|
2906
|
-
获取混凝土材料信息
|
|
2907
|
-
> 参数:
|
|
2908
|
-
> ids: 材料号支持XtoYbyN形式字符串,默认时输出全部材料
|
|
2909
|
-
```Python
|
|
2910
|
-
# 示例代码
|
|
2911
|
-
from qtmodel import *
|
|
2912
|
-
odb.get_concrete_material() # 获取所有材料信息
|
|
2913
|
-
#Returns: list[dict]
|
|
2914
|
-
```
|
|
2915
|
-
### get_steel_plate_material
|
|
2916
|
-
获取钢材材料信息
|
|
2917
|
-
> 参数:
|
|
2918
|
-
> ids: 材料号支持XtoYbyN形式字符串,默认时输出全部材料
|
|
2919
|
-
```Python
|
|
2920
|
-
# 示例代码
|
|
2921
|
-
from qtmodel import *
|
|
2922
|
-
odb.get_steel_plate_material() # 获取所有钢材材料信息
|
|
2923
|
-
#Returns: list[dict]
|
|
2924
|
-
```
|
|
2925
|
-
### get_pre_stress_bar_material
|
|
2926
|
-
获取钢材材料信息
|
|
2927
|
-
> 参数:
|
|
2928
|
-
> ids: 材料号,默认时输出全部材料
|
|
2929
|
-
```Python
|
|
2930
|
-
# 示例代码
|
|
2931
|
-
from qtmodel import *
|
|
2932
|
-
odb.get_pre_stress_bar_material() # 获取所有预应力材料信息
|
|
2933
|
-
#Returns: list[dict]
|
|
2934
|
-
```
|
|
2935
|
-
### get_steel_bar_material
|
|
2936
|
-
获取钢筋材料信息
|
|
2937
|
-
> 参数:
|
|
2938
|
-
> ids: 材料号,默认None时输出全部材料
|
|
2939
|
-
```Python
|
|
2940
|
-
# 示例代码
|
|
2941
|
-
from qtmodel import *
|
|
2942
|
-
odb.get_steel_bar_material() # 获取所有钢筋材料信息
|
|
2943
|
-
#Returns: list[dict]
|
|
2944
|
-
```
|
|
2945
|
-
### get_user_define_material
|
|
2946
|
-
获取自定义材料信息
|
|
2947
|
-
> 参数:
|
|
2948
|
-
> ids: 材料号支持XtoYbyN形式字符串,默认None时输出全部材料
|
|
2949
|
-
```Python
|
|
2950
|
-
# 示例代码
|
|
2951
|
-
from qtmodel import *
|
|
2952
|
-
odb.get_user_define_material() # 获取所有自定义材料信息
|
|
2953
|
-
odb.get_user_define_material("1to10") # 获取所有自定义材料信息
|
|
2954
|
-
#Returns: list[dict]
|
|
2955
|
-
```
|
|
2956
2905
|
### get_material_data
|
|
2957
2906
|
获取材料信息
|
|
2958
2907
|
> 参数:
|
|
@@ -2968,16 +2917,7 @@ odb.get_material_data() # 获取所有材料信息
|
|
|
2968
2917
|
```Python
|
|
2969
2918
|
# 示例代码
|
|
2970
2919
|
from qtmodel import *
|
|
2971
|
-
odb.get_thickness_data(
|
|
2972
|
-
#Returns:
|
|
2973
|
-
```
|
|
2974
|
-
### get_all_thickness_data
|
|
2975
|
-
获取所有板厚信息
|
|
2976
|
-
> 参数:
|
|
2977
|
-
```Python
|
|
2978
|
-
# 示例代码
|
|
2979
|
-
from qtmodel import *
|
|
2980
|
-
odb.get_all_thickness_data()
|
|
2920
|
+
odb.get_thickness_data()
|
|
2981
2921
|
#Returns: 包含信息为list[dict]
|
|
2982
2922
|
```
|
|
2983
2923
|
## 获取节点信息
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__all__ = []
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Optional
|
|
3
|
+
import requests
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class QtServer:
|
|
7
|
+
URL: str = "http://localhost:55125/pythonForQt/"
|
|
8
|
+
MERGE_STR: str = ""
|
|
9
|
+
QT_MERGE: bool = False # 是否合并发送
|
|
10
|
+
QT_VERSION: str = "1.2.3"
|
|
11
|
+
|
|
12
|
+
@staticmethod
|
|
13
|
+
def send_command(command: str = "", header: str = ""):
|
|
14
|
+
"""
|
|
15
|
+
用于单次数据传输,数据传输完成但不刷新UI
|
|
16
|
+
:param command:建议输入json对象(单行)
|
|
17
|
+
:param header: 数据块标识符
|
|
18
|
+
:return:
|
|
19
|
+
"""
|
|
20
|
+
response = requests.post(QtServer.URL,
|
|
21
|
+
headers={'Content-Type': f'{header}'},
|
|
22
|
+
data=command.encode('utf-8'))
|
|
23
|
+
if response.status_code == 200:
|
|
24
|
+
return response.text
|
|
25
|
+
elif response.status_code == 400:
|
|
26
|
+
raise Exception(response.text)
|
|
27
|
+
elif response.status_code == 413:
|
|
28
|
+
raise Exception("请求体过大,请拆分请求或调整服务端或反向代理(Nginx/网关/负载均衡)请求限制")
|
|
29
|
+
elif response.status_code == 504:
|
|
30
|
+
raise Exception("服务端或反向代理(Nginx/网关/负载均衡)超时,请增加最大等待时间")
|
|
31
|
+
else:
|
|
32
|
+
raise Exception("连接错误,请重新尝试")
|
|
33
|
+
|
|
34
|
+
@staticmethod
|
|
35
|
+
def send_dict(header: str, payload: Optional[dict] = None):
|
|
36
|
+
"""
|
|
37
|
+
统一发送:有参数 -> JSON;无参数 -> 不带 command 的 post
|
|
38
|
+
"""
|
|
39
|
+
try:
|
|
40
|
+
if not payload: # None 或 空字典
|
|
41
|
+
return QtServer.send_command(header=header, command="")
|
|
42
|
+
if "version" not in payload:
|
|
43
|
+
payload["version"] = QtServer.QT_VERSION
|
|
44
|
+
json_string = json.dumps(payload, ensure_ascii=False)
|
|
45
|
+
return QtServer.send_command(header=header, command=json_string)
|
|
46
|
+
except Exception as ex:
|
|
47
|
+
raise Exception(ex)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from typing import Union, List, Optional
|
|
2
|
-
from
|
|
2
|
+
from qtmodel.core.qt_server import QtServer
|
|
3
3
|
from qtmodel.core.data_helper import QtDataHelper
|
|
4
4
|
|
|
5
5
|
|
|
@@ -29,7 +29,7 @@ class MdbAnalysisSetting:
|
|
|
29
29
|
Returns: 无
|
|
30
30
|
"""
|
|
31
31
|
try:
|
|
32
|
-
s = "*
|
|
32
|
+
s = "*PJT-SET\r\n" + f"{gravity},{temperature}\r\n"
|
|
33
33
|
# 映射 参数 -> KEY 名
|
|
34
34
|
mapping = {
|
|
35
35
|
"PROJECT": project,
|
|
@@ -43,7 +43,7 @@ class MdbAnalysisSetting:
|
|
|
43
43
|
if val: # 字符串不为空
|
|
44
44
|
s += f"{key}={val}\r\n"
|
|
45
45
|
# print(s)
|
|
46
|
-
QtServer.
|
|
46
|
+
QtServer.send_command(s, "QDAT")
|
|
47
47
|
except Exception as ex:
|
|
48
48
|
raise Exception(ex)
|
|
49
49
|
|
|
@@ -59,12 +59,8 @@ class MdbAnalysisSetting:
|
|
|
59
59
|
mdb.update_global_setting(solver_type=0,calculation_type=2,thread_count=12)
|
|
60
60
|
Returns: 无
|
|
61
61
|
"""
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
# print(s)
|
|
65
|
-
QtServer.post_command(s, "QDAT")
|
|
66
|
-
except Exception as ex:
|
|
67
|
-
raise Exception(ex)
|
|
62
|
+
s = "*GLB-SET\r\n" + f"{solver_type},{calculation_type},{thread_count}\r\n"
|
|
63
|
+
QtServer.send_command(s, "QDAT")
|
|
68
64
|
|
|
69
65
|
@staticmethod
|
|
70
66
|
def update_construction_stage_setting(do_analysis: bool = True, to_end_stage: bool = True,
|
|
@@ -91,18 +87,14 @@ class MdbAnalysisSetting:
|
|
|
91
87
|
do_creep_analysis=True, cable_tension_position=0, consider_completion_stage=True,shrink_creep_type=2)
|
|
92
88
|
Returns: 无
|
|
93
89
|
"""
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
# print(s)
|
|
103
|
-
QtServer.post_command(s, "QDAT")
|
|
104
|
-
except Exception as ex:
|
|
105
|
-
raise Exception(ex)
|
|
90
|
+
do_str = "YES" if do_analysis else "NO"
|
|
91
|
+
toend_str = "YES" if to_end_stage else "NO"
|
|
92
|
+
creep_str = "YES" if do_creep_analysis else "NO"
|
|
93
|
+
comp_str = "YES" if consider_completion_stage else "NO"
|
|
94
|
+
s = "*CS-SET\r\n" + f"{do_str},{toend_str},{other_stage_name},{analysis_type},{creep_str},{cable_tension_position},{comp_str}\r\n"
|
|
95
|
+
s += f"{shrink_creep_type},{creep_load_type},"
|
|
96
|
+
s += f"{'YES' if sub_step_info[0] else 'NO'},{','.join(f'{x:g}' for x in sub_step_info[1:])}\r\n" if sub_step_info else "\r\n"
|
|
97
|
+
QtServer.send_command(s, "QDAT")
|
|
106
98
|
|
|
107
99
|
@staticmethod
|
|
108
100
|
def update_live_load_setting(lateral_spacing: float = 0.1, vertical_spacing: float = 1, damper_calc_type: int = -1,
|
|
@@ -149,30 +141,25 @@ class MdbAnalysisSetting:
|
|
|
149
141
|
displacement_groups=["结构组1","结构组2"])
|
|
150
142
|
Returns: 无
|
|
151
143
|
"""
|
|
144
|
+
s = "*LIV-SET\r\n" + f"{lateral_spacing:g},{vertical_spacing:g},{eccentricity:g},{'YES' if displacement_track else 'NO'},{'YES' if force_track else 'NO'},{'YES' if reaction_track else 'NO'},{'YES' if link_track else 'NO'},{'YES' if constrain_track else 'NO'}\r\n"
|
|
145
|
+
if damper_calc_type != -1:
|
|
146
|
+
s += f"1,{damper_calc_type},{','.join(damper_groups)}\r\n"
|
|
152
147
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
148
|
+
lines = []
|
|
149
|
+
configs = [
|
|
150
|
+
(displacement_track, 2, displacement_calc_type, displacement_groups),
|
|
151
|
+
(force_track, 3, force_calc_type, force_groups),
|
|
152
|
+
(reaction_track, 4, reaction_calc_type, reaction_groups),
|
|
153
|
+
(link_track, 5, link_calc_type, link_groups),
|
|
154
|
+
(constrain_track, 6, constrain_calc_type, constrain_groups),
|
|
155
|
+
]
|
|
157
156
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
(
|
|
161
|
-
(force_track, 3, force_calc_type, force_groups),
|
|
162
|
-
(reaction_track, 4, reaction_calc_type, reaction_groups),
|
|
163
|
-
(link_track, 5, link_calc_type, link_groups),
|
|
164
|
-
(constrain_track, 6, constrain_calc_type, constrain_groups),
|
|
165
|
-
]
|
|
157
|
+
for enabled, code, calc_type, groups in configs:
|
|
158
|
+
if enabled:
|
|
159
|
+
lines.append(QtDataHelper.live_load_set_line(code, calc_type, groups))
|
|
166
160
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
lines.append(QtDataHelper.live_load_set_line(code, calc_type, groups))
|
|
170
|
-
|
|
171
|
-
s = "".join(lines)
|
|
172
|
-
# print(s)
|
|
173
|
-
QtServer.post_command(s, "QDAT")
|
|
174
|
-
except Exception as ex:
|
|
175
|
-
raise Exception(ex)
|
|
161
|
+
s = "".join(lines)
|
|
162
|
+
QtServer.send_command(s, "QDAT")
|
|
176
163
|
|
|
177
164
|
@staticmethod
|
|
178
165
|
def update_non_linear_setting(non_linear_type: int = 1, non_linear_method: int = 1, max_loading_steps: int = 1,
|
|
@@ -192,12 +179,8 @@ class MdbAnalysisSetting:
|
|
|
192
179
|
accuracy_of_displacement=0.0001, accuracy_of_force=0.0001)
|
|
193
180
|
Returns: 无
|
|
194
181
|
"""
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
# print(s)
|
|
198
|
-
QtServer.post_command(s, "QDAT")
|
|
199
|
-
except Exception as ex:
|
|
200
|
-
raise Exception(ex)
|
|
182
|
+
s = "*NON-SET\r\n" + f"{non_linear_type},{non_linear_method},{max_loading_steps},{max_iteration_times},{accuracy_of_displacement:g},{accuracy_of_force:g}\r\n"
|
|
183
|
+
QtServer.send_command(s, "QDAT")
|
|
201
184
|
|
|
202
185
|
@staticmethod
|
|
203
186
|
def update_operation_stage_setting(do_analysis: bool = True, final_stage: str = "",
|
|
@@ -216,18 +199,14 @@ class MdbAnalysisSetting:
|
|
|
216
199
|
mdb.update_operation_stage_setting(do_analysis=True, final_stage="上二恒",static_load_cases=None)
|
|
217
200
|
Returns: 无
|
|
218
201
|
"""
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
# print(s)
|
|
228
|
-
QtServer.post_command(s, "QDAT")
|
|
229
|
-
except Exception as ex:
|
|
230
|
-
raise Exception(ex)
|
|
202
|
+
s = "*OP-SET\r\n" + f"{'YES' if do_analysis else 'NO'},{final_stage}\r\n"
|
|
203
|
+
if static_load_cases is not None:
|
|
204
|
+
s += f"ST={','.join(static_load_cases)}\r\n"
|
|
205
|
+
if sink_load_cases is not None:
|
|
206
|
+
s += f"SM={','.join(sink_load_cases)}\r\n"
|
|
207
|
+
if live_load_cases is not None:
|
|
208
|
+
s += f"MV={','.join(live_load_cases)}\r\n"
|
|
209
|
+
QtServer.send_command(s, "QDAT")
|
|
231
210
|
|
|
232
211
|
@staticmethod
|
|
233
212
|
def update_self_vibration_setting(do_analysis: bool = True, method: int = 1, matrix_type: int = 0,
|
|
@@ -243,12 +222,8 @@ class MdbAnalysisSetting:
|
|
|
243
222
|
mdb.update_self_vibration_setting(do_analysis=True,method=1,matrix_type=0,mode_num=3)
|
|
244
223
|
Returns: 无
|
|
245
224
|
"""
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
# print(s)
|
|
249
|
-
QtServer.post_command(s, "QDAT")
|
|
250
|
-
except Exception as ex:
|
|
251
|
-
raise Exception(ex)
|
|
225
|
+
s = "*VB-SET\r\n" + f"{'YES' if do_analysis else 'NO'},{method},{matrix_type},{mode_num}\r\n"
|
|
226
|
+
QtServer.send_command(s, "QDAT")
|
|
252
227
|
|
|
253
228
|
@staticmethod
|
|
254
229
|
def update_response_spectrum_setting(do_analysis: bool = True, kind: int = 1, by_mode: bool = False,
|
|
@@ -264,15 +239,11 @@ class MdbAnalysisSetting:
|
|
|
264
239
|
mdb.update_response_spectrum_setting(do_analysis=True,kind=1,damping_ratio=0.05)
|
|
265
240
|
Returns: 无
|
|
266
241
|
"""
|
|
267
|
-
|
|
268
|
-
if
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
# print(s)
|
|
273
|
-
QtServer.post_command(s, "QDAT")
|
|
274
|
-
except Exception as ex:
|
|
275
|
-
raise Exception(ex)
|
|
242
|
+
if do_analysis:
|
|
243
|
+
if isinstance(damping_ratio, float):
|
|
244
|
+
damping_ratio = [damping_ratio]
|
|
245
|
+
s = "*RS-SET\r\n" + f"{kind},{'YES' if by_mode else 'NO'},{','.join(f'{x:g}' for x in damping_ratio)}\r\n"
|
|
246
|
+
QtServer.send_command(s, "QDAT")
|
|
276
247
|
|
|
277
248
|
@staticmethod
|
|
278
249
|
def update_time_history_setting(do_analysis: bool = True, output_all: bool = True, groups: Optional[list[str]] = None):
|
|
@@ -286,18 +257,14 @@ class MdbAnalysisSetting:
|
|
|
286
257
|
mdb.update_time_history_setting(do_analysis=True,output_all=True)
|
|
287
258
|
Returns: 无
|
|
288
259
|
"""
|
|
289
|
-
|
|
290
|
-
if
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
# print(s)
|
|
298
|
-
QtServer.post_command(s, "QDAT")
|
|
299
|
-
except Exception as ex:
|
|
300
|
-
raise Exception(ex)
|
|
260
|
+
if do_analysis:
|
|
261
|
+
s = "*TH-SET\r\n" + f"{'YES' if output_all else 'NO'}"
|
|
262
|
+
if groups:
|
|
263
|
+
s += "," + ','.join(groups) + "\r\n"
|
|
264
|
+
else:
|
|
265
|
+
s += "\r\n"
|
|
266
|
+
QtServer.send_command(s, "QDAT")
|
|
267
|
+
QtServer.send_command(s, "QDAT")
|
|
301
268
|
|
|
302
269
|
@staticmethod
|
|
303
270
|
def update_bulking_setting(do_analysis: bool = True, mode_count: int = 3, stage_id: int = -1,
|
|
@@ -319,18 +286,14 @@ class MdbAnalysisSetting:
|
|
|
319
286
|
mdb.update_bulking_setting(do_analysis=True,mode_count=3,variable_cases=["工况1","工况2"])
|
|
320
287
|
Returns: 无
|
|
321
288
|
"""
|
|
322
|
-
|
|
323
|
-
if
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
# print(s)
|
|
332
|
-
QtServer.post_command(s, "QDAT")
|
|
333
|
-
except Exception as ex:
|
|
334
|
-
raise Exception(ex)
|
|
289
|
+
if do_analysis:
|
|
290
|
+
s = "*BUK-SET\r\n" + f"{mode_count},{stage_id},{'YES' if stressed else 'NO'},{calculate_kind}\r\n"
|
|
291
|
+
if variable_cases is None:
|
|
292
|
+
raise Exception("操作错误,可变荷载工况名称集合为必要参数")
|
|
293
|
+
else:
|
|
294
|
+
s += f"VL={','.join(variable_cases)}\r\n"
|
|
295
|
+
if constant_cases is not None:
|
|
296
|
+
s += f"CL={','.join(constant_cases)}\r\n"
|
|
297
|
+
QtServer.send_command(s, "QDAT")
|
|
335
298
|
|
|
336
299
|
# endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from
|
|
1
|
+
from qtmodel.core.qt_server import QtServer
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class MdbAssistant:
|
|
@@ -31,4 +31,4 @@ class MdbAssistant:
|
|
|
31
31
|
"box_num": box_num,
|
|
32
32
|
"material": material,
|
|
33
33
|
}
|
|
34
|
-
return QtServer.
|
|
34
|
+
return QtServer.send_dict("CREATE-CANTILEVER-BRIDGE", payload)
|