osis-python 0.8.0__tar.gz → 0.8.1__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.
- {osis_python-0.8.0/src/osis_python.egg-info → osis_python-0.8.1}/PKG-INFO +22 -1
- {osis_python-0.8.0 → osis_python-0.8.1}/README.md +21 -0
- {osis_python-0.8.0 → osis_python-0.8.1/src/osis_python.egg-info}/PKG-INFO +22 -1
- {osis_python-0.8.0 → osis_python-0.8.1}/src/osis_python.egg-info/SOURCES.txt +0 -1
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/__init__.py +1 -1
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/boundary/manager.py +1 -1
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/__init__.py +2 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/enums.py +74 -28
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/normalize.py +9 -6
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/element/manager.py +1 -1
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/geometry/manager.py +1 -1
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/live/__init__.py +0 -1
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/live/manager.py +16 -37
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/load/manager.py +1 -1
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/material/manager.py +1 -1
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/node/manager.py +1 -1
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/section/manager.py +14 -6
- osis_python-0.8.0/src/pyosis/live/vehicle.py +0 -121
- {osis_python-0.8.0 → osis_python-0.8.1}/LICENSE +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/pyproject.toml +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/setup.cfg +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/osis_python.egg-info/dependency_links.txt +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/osis_python.egg-info/requires.txt +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/osis_python.egg-info/top_level.txt +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/boundary/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/boundary/interface.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/control/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/control/control.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/control/io.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/control/manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/control/nonlinear.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/all_func.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/apdl_sync.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/basic_manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/batch.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/client.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/command.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/engine.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/exceptions.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/references.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/sdk.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/solver.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/core/sync_apdl_cli.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/display/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/display/interface.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/display/manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/dynamic/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/dynamic/load_to_mass.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/dynamic/manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/dynamic/modal.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/dynamic/seismic.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/element/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/element/interface.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/general/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/general/interface.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/geometry/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/geometry/interface.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/live/analysis.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/live/grade.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/live/lane.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/load/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/load/loadcase.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/load/static.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/load/tendon.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/material/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/material/interface.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/node/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/node/interface.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/post/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/post/combine.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/post/design_check.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/post/display.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/post/manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/project/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/project/interface.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/project/manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/property/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/property/component_thickness.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/property/coordinate.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/property/creep_shrink.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/property/damping.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/property/manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/property/pu_curve.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/quick_building/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/quick_building/interface.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/result/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/result/check.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/result/env.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/result/headless.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/result/loadcase.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/result/manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/result/result.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/section/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/section/common.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/section/composite.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/section/numeric.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/section/param.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/section/rebar.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/section/rib.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/section/steel.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/settlement/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/settlement/interface.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/settlement/manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/stability/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/stability/buckling.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/stability/manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/stage/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/stage/define.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/stage/manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/stage/overall.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/thickness/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/thickness/interface.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/thickness/manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/transfer/__init__.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/transfer/generator.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/transfer/introspect.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/transfer/matrix.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/transfer/out_to_python.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/transfer/parser.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/transfer/routes.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/src/pyosis/transfer/split.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/tests/test_batch.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/tests/test_delete_occupied.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/tests/test_project_manager.py +0 -0
- {osis_python-0.8.0 → osis_python-0.8.1}/tests/test_transfer_fixups.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osis-python
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: A Python client library for Osis APDL
|
|
5
5
|
Author-email: "CCCC Highway Consultant Co. Ltd." <support@osisbim.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -306,6 +306,27 @@ lc.create_gravity()
|
|
|
306
306
|
lc.create_nforce(1, fx=1000)
|
|
307
307
|
```
|
|
308
308
|
|
|
309
|
+
### Enums
|
|
310
|
+
|
|
311
|
+
All type codes live in `pyosis.core.enums`. Each member's **name is the OSIS command-stream spelling**, so a member converts straight to a string; its value is the integer code the JSON carries:
|
|
312
|
+
|
|
313
|
+
```python
|
|
314
|
+
from pyosis.core.enums import ElementType, SectionType
|
|
315
|
+
|
|
316
|
+
SectionType.Rectangle.value # 5 — code as sent by OSIS
|
|
317
|
+
str(SectionType.Rectangle) # "Rectangle"
|
|
318
|
+
SectionType.name_of(5) # "Rectangle"
|
|
319
|
+
SectionType.of(404) # SectionType.Unassigned — unknown code falls back
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Available: `ElementType`, `BoundaryType`, `MaterialType`, `MaterialCode`, `SectionType`, `LoadCaseType`, `SplineType`, `TensionType`, `LiveGradeType`. Data-class fields that carry a type expose a `type_name` / `code_name` / `grade_name` property for convenience.
|
|
323
|
+
|
|
324
|
+
The `Xxx_TYPE_NAMES` dicts from pyosis 0.x are gone; use `XxxType.name_of(code)` instead.
|
|
325
|
+
|
|
326
|
+
> **Migration note (0.8.0):** member names were normalized to the OSIS spelling, so `Enum.name` changed for some values — `SectionType.CUSTOM.name` is now `"CustomShape"`, `ElementType.UNASSIGNED.name` is now `"Unassigned"`. Code that compared against the old names, or indexed the old `*_TYPE_NAMES` dicts, needs updating. The old all-caps aliases (`SectionType.CUSTOM`, `ElementType.UNASSIGNED`, …) still resolve to the same values.
|
|
327
|
+
|
|
328
|
+
> **Migration note (0.8.1):** vehicles are no longer a separate concept. OSIS has no vehicle entity — a vehicle is just one value of the live-load grade (`LiveGradeType.VEHICLE`), alongside highway/crowd/fatigue grades. Removed: `engine.live.vehicle`, `VehicleManager`, `vehicle_manager`, `LiveGrade.is_vehicle`, `LiveGrade.live_type_for_custom`, `LiveTypeForCustom`. Use `engine.live.grade` with `LiveGrade.grade_name` instead. `SplineType` member names also moved to the OSIS spelling (`GENERAL`/`NATURAL`/`ARC3D`/`ARC2D`), so `SplineType.General.name` is now `"GENERAL"`; the old spellings remain as aliases.
|
|
329
|
+
|
|
309
330
|
### Explicit Numbering
|
|
310
331
|
|
|
311
332
|
Some `create_*` functions support explicit numbering via the `no` parameter. If not specified, the number is automatically assigned:
|
|
@@ -275,6 +275,27 @@ lc.create_gravity()
|
|
|
275
275
|
lc.create_nforce(1, fx=1000)
|
|
276
276
|
```
|
|
277
277
|
|
|
278
|
+
### Enums
|
|
279
|
+
|
|
280
|
+
All type codes live in `pyosis.core.enums`. Each member's **name is the OSIS command-stream spelling**, so a member converts straight to a string; its value is the integer code the JSON carries:
|
|
281
|
+
|
|
282
|
+
```python
|
|
283
|
+
from pyosis.core.enums import ElementType, SectionType
|
|
284
|
+
|
|
285
|
+
SectionType.Rectangle.value # 5 — code as sent by OSIS
|
|
286
|
+
str(SectionType.Rectangle) # "Rectangle"
|
|
287
|
+
SectionType.name_of(5) # "Rectangle"
|
|
288
|
+
SectionType.of(404) # SectionType.Unassigned — unknown code falls back
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Available: `ElementType`, `BoundaryType`, `MaterialType`, `MaterialCode`, `SectionType`, `LoadCaseType`, `SplineType`, `TensionType`, `LiveGradeType`. Data-class fields that carry a type expose a `type_name` / `code_name` / `grade_name` property for convenience.
|
|
292
|
+
|
|
293
|
+
The `Xxx_TYPE_NAMES` dicts from pyosis 0.x are gone; use `XxxType.name_of(code)` instead.
|
|
294
|
+
|
|
295
|
+
> **Migration note (0.8.0):** member names were normalized to the OSIS spelling, so `Enum.name` changed for some values — `SectionType.CUSTOM.name` is now `"CustomShape"`, `ElementType.UNASSIGNED.name` is now `"Unassigned"`. Code that compared against the old names, or indexed the old `*_TYPE_NAMES` dicts, needs updating. The old all-caps aliases (`SectionType.CUSTOM`, `ElementType.UNASSIGNED`, …) still resolve to the same values.
|
|
296
|
+
|
|
297
|
+
> **Migration note (0.8.1):** vehicles are no longer a separate concept. OSIS has no vehicle entity — a vehicle is just one value of the live-load grade (`LiveGradeType.VEHICLE`), alongside highway/crowd/fatigue grades. Removed: `engine.live.vehicle`, `VehicleManager`, `vehicle_manager`, `LiveGrade.is_vehicle`, `LiveGrade.live_type_for_custom`, `LiveTypeForCustom`. Use `engine.live.grade` with `LiveGrade.grade_name` instead. `SplineType` member names also moved to the OSIS spelling (`GENERAL`/`NATURAL`/`ARC3D`/`ARC2D`), so `SplineType.General.name` is now `"GENERAL"`; the old spellings remain as aliases.
|
|
298
|
+
|
|
278
299
|
### Explicit Numbering
|
|
279
300
|
|
|
280
301
|
Some `create_*` functions support explicit numbering via the `no` parameter. If not specified, the number is automatically assigned:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osis-python
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: A Python client library for Osis APDL
|
|
5
5
|
Author-email: "CCCC Highway Consultant Co. Ltd." <support@osisbim.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -306,6 +306,27 @@ lc.create_gravity()
|
|
|
306
306
|
lc.create_nforce(1, fx=1000)
|
|
307
307
|
```
|
|
308
308
|
|
|
309
|
+
### Enums
|
|
310
|
+
|
|
311
|
+
All type codes live in `pyosis.core.enums`. Each member's **name is the OSIS command-stream spelling**, so a member converts straight to a string; its value is the integer code the JSON carries:
|
|
312
|
+
|
|
313
|
+
```python
|
|
314
|
+
from pyosis.core.enums import ElementType, SectionType
|
|
315
|
+
|
|
316
|
+
SectionType.Rectangle.value # 5 — code as sent by OSIS
|
|
317
|
+
str(SectionType.Rectangle) # "Rectangle"
|
|
318
|
+
SectionType.name_of(5) # "Rectangle"
|
|
319
|
+
SectionType.of(404) # SectionType.Unassigned — unknown code falls back
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Available: `ElementType`, `BoundaryType`, `MaterialType`, `MaterialCode`, `SectionType`, `LoadCaseType`, `SplineType`, `TensionType`, `LiveGradeType`. Data-class fields that carry a type expose a `type_name` / `code_name` / `grade_name` property for convenience.
|
|
323
|
+
|
|
324
|
+
The `Xxx_TYPE_NAMES` dicts from pyosis 0.x are gone; use `XxxType.name_of(code)` instead.
|
|
325
|
+
|
|
326
|
+
> **Migration note (0.8.0):** member names were normalized to the OSIS spelling, so `Enum.name` changed for some values — `SectionType.CUSTOM.name` is now `"CustomShape"`, `ElementType.UNASSIGNED.name` is now `"Unassigned"`. Code that compared against the old names, or indexed the old `*_TYPE_NAMES` dicts, needs updating. The old all-caps aliases (`SectionType.CUSTOM`, `ElementType.UNASSIGNED`, …) still resolve to the same values.
|
|
327
|
+
|
|
328
|
+
> **Migration note (0.8.1):** vehicles are no longer a separate concept. OSIS has no vehicle entity — a vehicle is just one value of the live-load grade (`LiveGradeType.VEHICLE`), alongside highway/crowd/fatigue grades. Removed: `engine.live.vehicle`, `VehicleManager`, `vehicle_manager`, `LiveGrade.is_vehicle`, `LiveGrade.live_type_for_custom`, `LiveTypeForCustom`. Use `engine.live.grade` with `LiveGrade.grade_name` instead. `SplineType` member names also moved to the OSIS spelling (`GENERAL`/`NATURAL`/`ARC3D`/`ARC2D`), so `SplineType.General.name` is now `"GENERAL"`; the old spellings remain as aliases.
|
|
329
|
+
|
|
309
330
|
### Explicit Numbering
|
|
310
331
|
|
|
311
332
|
Some `create_*` functions support explicit numbering via the `no` parameter. If not specified, the number is automatically assigned:
|
|
@@ -7,7 +7,7 @@ A library for extending OSIS functionality.
|
|
|
7
7
|
A library that allows users to use CAE with great flexibility.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
__version__ = "0.8.
|
|
10
|
+
__version__ = "0.8.1"
|
|
11
11
|
|
|
12
12
|
from .core.engine import OSISEngine
|
|
13
13
|
from .core.batch import batch, flush, batch_state, BatchError
|
|
@@ -88,7 +88,7 @@ class Boundary:
|
|
|
88
88
|
return cls(
|
|
89
89
|
no=as_no(d.get("no")),
|
|
90
90
|
name=as_name(d.get("name")),
|
|
91
|
-
boundary_type=BoundaryType(raw_type)
|
|
91
|
+
boundary_type=BoundaryType.of(raw_type),
|
|
92
92
|
entity_vec=list(d.get("entityVec") or []),
|
|
93
93
|
is_occupied=d.get("isOccupied"),
|
|
94
94
|
is_selected=d.get("isSelected"),
|
|
@@ -19,8 +19,10 @@ from .enums import (
|
|
|
19
19
|
OsisEnum,
|
|
20
20
|
ElementType, BoundaryType, MaterialType, MaterialCode,
|
|
21
21
|
SectionType, LoadCaseType, SplineType, TensionType,
|
|
22
|
+
LiveGradeType,
|
|
22
23
|
element_type_name, boundary_type_name, material_type_name,
|
|
23
24
|
material_code_name, section_type_name, loadcase_type_name,
|
|
25
|
+
spline_type_name, live_grade_name,
|
|
24
26
|
DOF_NAMES, constraints_to_dict,
|
|
25
27
|
)
|
|
26
28
|
from .normalize import as_no, as_name
|
|
@@ -26,6 +26,7 @@ class OsisEnum(IntEnum):
|
|
|
26
26
|
|
|
27
27
|
- ``str(e)`` / ``e.name`` → OSIS 命令流写法(成员名)
|
|
28
28
|
- ``name_of(code)`` → 编码转名字;未知编码或 Unassigned 返回 ""
|
|
29
|
+
- ``of(code)`` → 编码转成员;未知编码退回 Unassigned
|
|
29
30
|
"""
|
|
30
31
|
|
|
31
32
|
def __str__(self) -> str:
|
|
@@ -34,11 +35,16 @@ class OsisEnum(IntEnum):
|
|
|
34
35
|
@classmethod
|
|
35
36
|
def name_of(cls, code, default: str = "") -> str:
|
|
36
37
|
"""编码 → OSIS 命令流写法;未知编码 / Unassigned 返回 default。"""
|
|
38
|
+
member = cls.of(code)
|
|
39
|
+
return default if member.name == "Unassigned" else member.name
|
|
40
|
+
|
|
41
|
+
@classmethod
|
|
42
|
+
def of(cls, code):
|
|
43
|
+
"""编码 → 成员;未知编码 / None → Unassigned(所有子类都定义了它)。"""
|
|
37
44
|
try:
|
|
38
|
-
|
|
45
|
+
return cls(int(code))
|
|
39
46
|
except (ValueError, TypeError):
|
|
40
|
-
return
|
|
41
|
-
return default if member.name == "Unassigned" else member.name
|
|
47
|
+
return cls.Unassigned
|
|
42
48
|
|
|
43
49
|
|
|
44
50
|
# ══════════════════════════════════════════════
|
|
@@ -219,10 +225,7 @@ class SectionType(OsisEnum):
|
|
|
219
225
|
|
|
220
226
|
|
|
221
227
|
class LoadCaseType(OsisEnum):
|
|
222
|
-
"""荷载工况类型(PrepEnum::LoadCase)
|
|
223
|
-
|
|
224
|
-
32=温度、40=施工阶段荷载、52=温度梯度。
|
|
225
|
-
"""
|
|
228
|
+
"""荷载工况类型(PrepEnum::LoadCase)"""
|
|
226
229
|
Unassigned = 0
|
|
227
230
|
USER = 1 # 用户自定义荷载
|
|
228
231
|
D = 2 # 恒荷载
|
|
@@ -240,7 +243,7 @@ class LoadCaseType(OsisEnum):
|
|
|
240
243
|
LP = 14 # 超载
|
|
241
244
|
IL = 15 # 汽车冲击力
|
|
242
245
|
ILP = 16 # 超载冲击力
|
|
243
|
-
CF = 17 #
|
|
246
|
+
CF = 17 # 汽车离心力
|
|
244
247
|
BRK = 18 # 汽车制动力
|
|
245
248
|
BK = 19 # 活荷载引起的纵向内力
|
|
246
249
|
PL = 20 # 人群荷载
|
|
@@ -270,34 +273,44 @@ class LoadCaseType(OsisEnum):
|
|
|
270
273
|
LR = 44 # 屋面活荷载
|
|
271
274
|
S = 45 # 雪荷载
|
|
272
275
|
R = 46 # 雨荷载
|
|
273
|
-
W1 = 47 #
|
|
274
|
-
W2 = 48 #
|
|
275
|
-
WF1 = 49 #
|
|
276
|
-
WF2 = 50 #
|
|
277
|
-
FL = 51
|
|
278
|
-
TG = 52
|
|
279
|
-
CFS = 53
|
|
280
|
-
CFV = 54
|
|
281
|
-
IF = 55
|
|
282
|
-
CRL = 56
|
|
283
|
-
CFD = 57
|
|
276
|
+
W1 = 47 # 活载风
|
|
277
|
+
W2 = 48 # 极限风
|
|
278
|
+
WF1 = 49 # W1 引起的浪
|
|
279
|
+
WF2 = 50 # W2 引起的浪
|
|
280
|
+
FL = 51 # 疲劳荷载
|
|
281
|
+
TG = 52 # 梯度温度
|
|
282
|
+
CFS = 53 # 船舶的撞击作用
|
|
283
|
+
CFV = 54 # 汽车撞击作用
|
|
284
|
+
IF = 55 # 汽车冲击力
|
|
285
|
+
CRL = 56 # 人群荷载
|
|
286
|
+
CFD = 57 # 漂流物的撞击作用
|
|
284
287
|
|
|
285
288
|
UNASSIGNED = 0 # 兼容旧拼写
|
|
286
289
|
|
|
287
290
|
|
|
288
|
-
class SplineType(
|
|
289
|
-
"""
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
291
|
+
class SplineType(OsisEnum):
|
|
292
|
+
"""样条曲线类型(PropEnum::Spline)
|
|
293
|
+
0 = 未分配;名字即 spline3d 命令的类型写法。
|
|
294
|
+
"""
|
|
295
|
+
Unassigned = 0
|
|
296
|
+
GENERAL = 1 # 一般边界
|
|
297
|
+
NATURAL = 2 # 自然边界
|
|
298
|
+
ARC3D = 3 # 3D 圆弧
|
|
299
|
+
ARC2D = 4 # 2D 圆弧
|
|
295
300
|
|
|
296
301
|
UNASSIGNED = 0 # 兼容旧拼写
|
|
302
|
+
General = 1 # 兼容旧命名
|
|
303
|
+
Natural = 2 # 兼容旧命名
|
|
304
|
+
Arc3D = 3 # 兼容旧命名
|
|
305
|
+
Arc2D = 4 # 兼容旧命名
|
|
297
306
|
|
|
298
307
|
|
|
299
|
-
class TensionType(
|
|
300
|
-
"""
|
|
308
|
+
class TensionType(OsisEnum):
|
|
309
|
+
"""钢束张拉方式(LoadEnum::TensionType)
|
|
310
|
+
|
|
311
|
+
不是命令流写法——C++ 用它区分先张/后张的类继承,print name 为空,
|
|
312
|
+
名字只在 Python 侧做分类。
|
|
313
|
+
"""
|
|
301
314
|
Unassigned = 0
|
|
302
315
|
Pre = 1 # 先张法
|
|
303
316
|
In = 2 # 后张法(体内)
|
|
@@ -306,6 +319,35 @@ class TensionType(IntEnum):
|
|
|
306
319
|
UNASSIGNED = 0 # 兼容旧拼写
|
|
307
320
|
|
|
308
321
|
|
|
322
|
+
class LiveGradeType(OsisEnum):
|
|
323
|
+
"""活载等级(LoadEnum::LiveGrade)"""
|
|
324
|
+
Unassigned = 0
|
|
325
|
+
HIGHWAY_I = 1 # 公路-I 级(车道荷载)
|
|
326
|
+
HIGHWAY_II = 2 # 公路-II 级(车道荷载)
|
|
327
|
+
VEHICLE = 3 # 车辆荷载
|
|
328
|
+
CROWD = 4 # 人群荷载
|
|
329
|
+
FATIGUE_I = 5 # 疲劳荷载 I
|
|
330
|
+
FATIGUE_II = 6 # 疲劳荷载 II
|
|
331
|
+
FATIGUE_III = 7 # 疲劳荷载 III
|
|
332
|
+
UF = 8
|
|
333
|
+
V = 9
|
|
334
|
+
VG = 10
|
|
335
|
+
NHWCD = 11
|
|
336
|
+
NHWRQ = 12
|
|
337
|
+
OHWRQ = 13
|
|
338
|
+
CCD_A = 14 # 城-车道 A
|
|
339
|
+
CCD_B = 15 # 城-车道 B
|
|
340
|
+
CCL_A = 16 # 城-车辆 A
|
|
341
|
+
CCL_B = 17 # 城-车辆 B
|
|
342
|
+
CT160 = 18
|
|
343
|
+
CT220 = 19
|
|
344
|
+
CT300 = 20
|
|
345
|
+
CT420 = 21
|
|
346
|
+
CRQ = 22 # 城-人群
|
|
347
|
+
|
|
348
|
+
UNASSIGNED = 0 # 兼容旧拼写
|
|
349
|
+
|
|
350
|
+
|
|
309
351
|
# ══════════════════════════════════════════════
|
|
310
352
|
# 便捷函数(等价于 XxxType.name_of)
|
|
311
353
|
# ══════════════════════════════════════════════
|
|
@@ -316,6 +358,8 @@ material_type_name = MaterialType.name_of
|
|
|
316
358
|
material_code_name = MaterialCode.name_of
|
|
317
359
|
section_type_name = SectionType.name_of
|
|
318
360
|
loadcase_type_name = LoadCaseType.name_of
|
|
361
|
+
spline_type_name = SplineType.name_of
|
|
362
|
+
live_grade_name = LiveGradeType.name_of
|
|
319
363
|
|
|
320
364
|
|
|
321
365
|
# ══════════════════════════════════════════════
|
|
@@ -343,7 +387,9 @@ __all__ = [
|
|
|
343
387
|
"OsisEnum",
|
|
344
388
|
"ElementType", "BoundaryType", "MaterialType", "MaterialCode",
|
|
345
389
|
"SectionType", "LoadCaseType", "SplineType", "TensionType",
|
|
390
|
+
"LiveGradeType",
|
|
346
391
|
"element_type_name", "boundary_type_name", "material_type_name",
|
|
347
392
|
"material_code_name", "section_type_name", "loadcase_type_name",
|
|
393
|
+
"spline_type_name", "live_grade_name",
|
|
348
394
|
"DOF_NAMES", "constraints_to_dict",
|
|
349
395
|
]
|
|
@@ -14,20 +14,23 @@ _SENTINEL = -1
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
def as_no(value):
|
|
17
|
-
"""编号归一:None / -1 / "-1" → None,其余原样返回。"""
|
|
17
|
+
"""编号归一:None / -1 / -1.0 / "-1" / "-1.0" → None,其余原样返回。"""
|
|
18
18
|
if value is None:
|
|
19
19
|
return None
|
|
20
|
+
if isinstance(value, bool): # bool 是 int 子类,先排掉
|
|
21
|
+
return value
|
|
20
22
|
if isinstance(value, str):
|
|
21
23
|
s = value.strip()
|
|
22
|
-
if s
|
|
24
|
+
if not s:
|
|
23
25
|
return None
|
|
24
26
|
try:
|
|
25
27
|
value = int(s)
|
|
26
28
|
except ValueError:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
try:
|
|
30
|
+
value = float(s)
|
|
31
|
+
except ValueError:
|
|
32
|
+
return value # 非数值字符串:原样返回
|
|
33
|
+
if isinstance(value, (int, float)) and value == _SENTINEL:
|
|
31
34
|
return None
|
|
32
35
|
return value
|
|
33
36
|
|
|
@@ -107,7 +107,7 @@ class Element:
|
|
|
107
107
|
raw_type = int(d.get("type"))
|
|
108
108
|
return cls(
|
|
109
109
|
no=d.get("no"),
|
|
110
|
-
element_type=ElementType(raw_type)
|
|
110
|
+
element_type=ElementType.of(raw_type),
|
|
111
111
|
mat=d.get("mat"),
|
|
112
112
|
node_vec=d.get("nodeVec"),
|
|
113
113
|
node_i=d.get("nodeI"),
|
|
@@ -104,7 +104,7 @@ class Spline:
|
|
|
104
104
|
])
|
|
105
105
|
return result
|
|
106
106
|
|
|
107
|
-
spline_type = SplineType(d.get("splineType"))
|
|
107
|
+
spline_type = SplineType.of(d.get("splineType"))
|
|
108
108
|
points_raw = d.get("points")
|
|
109
109
|
points = _extract_points(points_raw, spline_type) if points_raw else None
|
|
110
110
|
|
|
@@ -44,25 +44,21 @@ from .lane import (
|
|
|
44
44
|
osis_lane_mod,
|
|
45
45
|
)
|
|
46
46
|
from ..core.normalize import as_no, as_name
|
|
47
|
+
from ..core.enums import LiveGradeType, live_grade_name
|
|
47
48
|
|
|
48
49
|
|
|
49
50
|
# ──────────────────────────────────────────────
|
|
50
|
-
#
|
|
51
|
+
# 活载等级编码(别名,取值见 core.enums)
|
|
51
52
|
# ──────────────────────────────────────────────
|
|
52
53
|
|
|
53
|
-
LIVE_GRADE_UNASSIGNED =
|
|
54
|
-
LIVE_GRADE_HIGHWAY_I =
|
|
55
|
-
LIVE_GRADE_HIGHWAY_II =
|
|
56
|
-
LIVE_GRADE_VEHICLE =
|
|
57
|
-
LIVE_GRADE_CROWD =
|
|
58
|
-
LIVE_GRADE_FATIGUE_I =
|
|
59
|
-
LIVE_GRADE_FATIGUE_II =
|
|
60
|
-
LIVE_GRADE_FATIGUE_III =
|
|
61
|
-
|
|
62
|
-
LIVE_TYPE_CUSTOM_UNASSIGNED = 0
|
|
63
|
-
LIVE_TYPE_CUSTOM_VEHICLE = 1
|
|
64
|
-
LIVE_TYPE_CUSTOM_TRAIN = 2
|
|
65
|
-
LIVE_TYPE_CUSTOM_CROWD = 3
|
|
54
|
+
LIVE_GRADE_UNASSIGNED = int(LiveGradeType.Unassigned)
|
|
55
|
+
LIVE_GRADE_HIGHWAY_I = int(LiveGradeType.HIGHWAY_I)
|
|
56
|
+
LIVE_GRADE_HIGHWAY_II = int(LiveGradeType.HIGHWAY_II)
|
|
57
|
+
LIVE_GRADE_VEHICLE = int(LiveGradeType.VEHICLE)
|
|
58
|
+
LIVE_GRADE_CROWD = int(LiveGradeType.CROWD)
|
|
59
|
+
LIVE_GRADE_FATIGUE_I = int(LiveGradeType.FATIGUE_I)
|
|
60
|
+
LIVE_GRADE_FATIGUE_II = int(LiveGradeType.FATIGUE_II)
|
|
61
|
+
LIVE_GRADE_FATIGUE_III = int(LiveGradeType.FATIGUE_III)
|
|
66
62
|
|
|
67
63
|
|
|
68
64
|
# ──────────────────────────────────────────────
|
|
@@ -73,18 +69,18 @@ LIVE_TYPE_CUSTOM_CROWD = 3
|
|
|
73
69
|
@dataclass(frozen=True)
|
|
74
70
|
class LiveGrade:
|
|
75
71
|
"""活载等级对象
|
|
76
|
-
|
|
72
|
+
|
|
77
73
|
对应接口 GetAllLiveGradeInfo / GetGradeInfoByNames 返回的数据。
|
|
78
74
|
活载等级定义了车辆荷载、人群荷载、疲劳荷载等的规范参数。
|
|
75
|
+
车辆只是其中一种等级(grade == LiveGradeType.VEHICLE),没有独立的车辆实体。
|
|
79
76
|
"""
|
|
80
77
|
no: int # 编号
|
|
81
78
|
name: str # 名称
|
|
82
79
|
code: int # 规范代码
|
|
83
|
-
grade: int # 等级代码(如 HIGHWAY_I=1, HIGHWAY_II=2, VEHICLE=3
|
|
80
|
+
grade: int # 等级代码(如 HIGHWAY_I=1, HIGHWAY_II=2, VEHICLE=3),取名用 grade_name
|
|
84
81
|
crowd_bridge_type: int # 人群荷载桥型
|
|
85
82
|
crowd_width: float # 人群横向宽度(m)
|
|
86
83
|
fatigue_ii_veichle_center_dis: float # 疲劳II模型车辆中心间距(m)
|
|
87
|
-
live_type_for_custom: int = 0 # 自定义活载类型(0 未定义 / 1 车辆 / 2 列车 / 3 人群)
|
|
88
84
|
related_live_anal: list[str] = field(default_factory=list) # 关联的活载分析名称列表
|
|
89
85
|
related_stages: list[int] = field(default_factory=list) # 关联的施工阶段编号列表
|
|
90
86
|
custom_layout: list[list[float]] = field(default_factory=list) # 自定义布载矩阵
|
|
@@ -95,14 +91,9 @@ class LiveGrade:
|
|
|
95
91
|
code_data_fatigueIII_4x2: list[list[float]] = field(default_factory=list) # 疲劳III模型 4x2 矩阵
|
|
96
92
|
|
|
97
93
|
@property
|
|
98
|
-
def
|
|
99
|
-
"""
|
|
100
|
-
|
|
101
|
-
判据与 C++ 侧一致:grade == VEHICLE(3),或自定义活载类型为车辆/列车。
|
|
102
|
-
"""
|
|
103
|
-
return self.grade == LIVE_GRADE_VEHICLE or self.live_type_for_custom in (
|
|
104
|
-
LIVE_TYPE_CUSTOM_VEHICLE, LIVE_TYPE_CUSTOM_TRAIN,
|
|
105
|
-
)
|
|
94
|
+
def grade_name(self) -> str:
|
|
95
|
+
"""活载等级名(OSIS 写法,如 "HIGHWAY_I" / "VEHICLE");未知编码返回 ""。"""
|
|
96
|
+
return live_grade_name(self.grade)
|
|
106
97
|
|
|
107
98
|
@classmethod
|
|
108
99
|
def _from_dict(cls, d: dict) -> LiveGrade:
|
|
@@ -115,7 +106,6 @@ class LiveGrade:
|
|
|
115
106
|
crowd_bridge_type=d.get("crowdBridgeType"),
|
|
116
107
|
crowd_width=d.get("crowdWidth"),
|
|
117
108
|
fatigue_ii_veichle_center_dis=d.get("fatigueIIVeichleCenterDis"),
|
|
118
|
-
live_type_for_custom=d.get("liveTypeForCustom") or 0,
|
|
119
109
|
related_live_anal=d.get("relatedLiveAnal") or [],
|
|
120
110
|
related_stages=d.get("relatedStages") or [],
|
|
121
111
|
custom_layout=d.get("customLayout") or [],
|
|
@@ -1283,7 +1273,6 @@ class LiveManager:
|
|
|
1283
1273
|
- ``grade``: 活载等级管理器(LiveGradeManager)
|
|
1284
1274
|
- ``lane``: 车道管理器(LaneManager)
|
|
1285
1275
|
- ``case``: 活载工况管理器(LiveCaseManager)
|
|
1286
|
-
- ``vehicle``: 车辆管理器(VehicleManager,活载等级中属于车辆的视图)
|
|
1287
1276
|
|
|
1288
1277
|
用法示例::
|
|
1289
1278
|
|
|
@@ -1304,12 +1293,6 @@ class LiveManager:
|
|
|
1304
1293
|
self._grade_manager = LiveGradeManager()
|
|
1305
1294
|
self._lane_manager = LaneManager()
|
|
1306
1295
|
self._case_manager = LiveCaseManager()
|
|
1307
|
-
self._vehicle_manager = VehicleManager()
|
|
1308
|
-
|
|
1309
|
-
@property
|
|
1310
|
-
def vehicle(self) -> "VehicleManager":
|
|
1311
|
-
"""车辆管理器(车辆 = 活载等级中属于车辆/列车的子集)"""
|
|
1312
|
-
return self._vehicle_manager
|
|
1313
1296
|
|
|
1314
1297
|
@property
|
|
1315
1298
|
def grade(self) -> LiveGradeManager:
|
|
@@ -1381,10 +1364,6 @@ class LiveManager:
|
|
|
1381
1364
|
return f"LiveManager()"
|
|
1382
1365
|
|
|
1383
1366
|
|
|
1384
|
-
# vehicle.py 反向依赖本模块的 LiveGrade 与编码常量,在单例创建前导入可避免循环导入
|
|
1385
|
-
from .vehicle import VehicleManager # noqa: E402
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
1367
|
# ──────────────────────────────────────────────
|
|
1389
1368
|
# 全局单例
|
|
1390
1369
|
# ──────────────────────────────────────────────
|
|
@@ -962,7 +962,7 @@ class TendonProp:
|
|
|
962
962
|
"""从接口 dict 构造 TendonProp 对象(内部使用)"""
|
|
963
963
|
return cls(
|
|
964
964
|
name=d.get("name"),
|
|
965
|
-
tension_type=TensionType(d.get("tensionType")),
|
|
965
|
+
tension_type=TensionType.of(d.get("tensionType")),
|
|
966
966
|
tendon_mat_no=d.get("tendonMatNO"),
|
|
967
967
|
area=d.get("area"),
|
|
968
968
|
code=d.get("code"),
|
|
@@ -69,7 +69,7 @@ class Material:
|
|
|
69
69
|
return cls(
|
|
70
70
|
no=as_no(d.get("no")),
|
|
71
71
|
name=as_name(d.get("name")),
|
|
72
|
-
material_type=MaterialType(raw_type)
|
|
72
|
+
material_type=MaterialType.of(raw_type),
|
|
73
73
|
code=d.get("code"),
|
|
74
74
|
grade=d.get("grade"),
|
|
75
75
|
e=d.get("e"),
|
|
@@ -129,7 +129,7 @@ class NodeManager(BasicManager):
|
|
|
129
129
|
return {
|
|
130
130
|
d["id"]: (d.get("x", 0.0), d.get("y", 0.0), d.get("z", 0.0))
|
|
131
131
|
for d in resp.get("data") or []
|
|
132
|
-
if isinstance(d, dict) and "id"
|
|
132
|
+
if isinstance(d, dict) and d.get("id") is not None
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
# ── 增删改 ────────────────────────────────
|
|
@@ -94,6 +94,7 @@ class Rebar:
|
|
|
94
94
|
has_web_vertical_rebar: bool # 是否有腹板竖筋
|
|
95
95
|
longitudinal_rebars: list[dict] # 纵筋
|
|
96
96
|
longitudinal_rebars_count: int # 纵筋数量
|
|
97
|
+
section_no: int | None = None # 所属截面编号
|
|
97
98
|
@staticmethod
|
|
98
99
|
def empty() -> Rebar:
|
|
99
100
|
"""无钢筋信息时的占位对象(内部使用)"""
|
|
@@ -106,8 +107,12 @@ class Rebar:
|
|
|
106
107
|
longitudinal_rebars_count=0,
|
|
107
108
|
)
|
|
108
109
|
@classmethod
|
|
109
|
-
def _from_dict(cls, d: dict) -> Rebar:
|
|
110
|
-
"""从接口 dict 构造 Rebar 对象(内部使用)
|
|
110
|
+
def _from_dict(cls, d: dict, section_no: int | None = None) -> Rebar:
|
|
111
|
+
"""从接口 dict 构造 Rebar 对象(内部使用)
|
|
112
|
+
|
|
113
|
+
section_no: 所属截面编号。从截面接口取值时由调用方给出;
|
|
114
|
+
all_longitudinal_rebar() 走轻量接口,取 JSON 自带的 "no"。
|
|
115
|
+
"""
|
|
111
116
|
lr = d.get("longitudinalRebars")
|
|
112
117
|
cnt = d.get("longitudinalRebarsCount")
|
|
113
118
|
return cls(
|
|
@@ -117,6 +122,7 @@ class Rebar:
|
|
|
117
122
|
has_web_vertical_rebar=bool(d.get("hasWebVerticalRebar")),
|
|
118
123
|
longitudinal_rebars=list(lr) if isinstance(lr, list) else [],
|
|
119
124
|
longitudinal_rebars_count=int(cnt) if cnt is not None else 0,
|
|
125
|
+
section_no=section_no if section_no is not None else as_no(d.get("no")),
|
|
120
126
|
)
|
|
121
127
|
|
|
122
128
|
# Section 基类
|
|
@@ -164,15 +170,16 @@ class Section:
|
|
|
164
170
|
sp = d.get("stressPoints")
|
|
165
171
|
ct = d.get("contour")
|
|
166
172
|
rel = d.get("relatedElement")
|
|
173
|
+
sec_no = as_no(d.get("no"))
|
|
167
174
|
raw_rebar = d.get("rebar")
|
|
168
175
|
if isinstance(raw_rebar, dict):
|
|
169
|
-
rebar_obj = Rebar._from_dict(raw_rebar)
|
|
176
|
+
rebar_obj = Rebar._from_dict(raw_rebar, sec_no)
|
|
170
177
|
else:
|
|
171
178
|
rebar_obj = Rebar.empty()
|
|
172
179
|
return cls(
|
|
173
180
|
no=as_no(d.get("no")),
|
|
174
181
|
name=as_name(d.get("name")),
|
|
175
|
-
section_type=SectionType(raw_type)
|
|
182
|
+
section_type=SectionType.of(raw_type),
|
|
176
183
|
prop=d.get("prop"),
|
|
177
184
|
offset_type_y=d.get("offsetTypeY"),
|
|
178
185
|
offset_value_y=d.get("offsetValueY"),
|
|
@@ -1095,8 +1102,9 @@ class SectionManager(BasicManager):
|
|
|
1095
1102
|
def all_longitudinal_rebar(self) -> list[Rebar]:
|
|
1096
1103
|
"""获取所有截面的纵向钢筋信息(走 GetAllLongitudinalRebarInfo 端点)
|
|
1097
1104
|
|
|
1098
|
-
|
|
1099
|
-
|
|
1105
|
+
数据更轻量——只有钢筋标志位与纵筋明细,不含截面几何/属性。
|
|
1106
|
+
每一项的 section_no 指出所属截面;服务端尚未在响应里带截面编号时
|
|
1107
|
+
该字段为 None,只能按返回顺序对应截面。
|
|
1100
1108
|
|
|
1101
1109
|
Returns:
|
|
1102
1110
|
list[Rebar]: 各截面的钢筋信息列表
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"""车辆管理器 —— OSIS 里没有独立的“车辆”实体,车辆就是活载等级。
|
|
2
|
-
|
|
3
|
-
osisPREP 只有 LiveGradeInfo,没有 VehicleInfo。所以“车辆”= 活载等级中
|
|
4
|
-
属于车辆/列车的那部分,判据与 C++ 侧一致:
|
|
5
|
-
|
|
6
|
-
grade == LiveGrade::VEHICLE(3)
|
|
7
|
-
或 liveTypeForCustom ∈ {VEHICLE(1), TRAIN(2)} (自定义车辆 / 列车)
|
|
8
|
-
|
|
9
|
-
数据来源两个:
|
|
10
|
-
- /GetAllGradeInfo —— 活载等级表(主来源)
|
|
11
|
-
- /GetAllLiveInfo —— 活载工况的 subLoadCases[].liveGrade / liveGradeEnum
|
|
12
|
-
|
|
13
|
-
用法:
|
|
14
|
-
from pyosis.live import vehicle_manager
|
|
15
|
-
vehicle_manager.names() # 所有车辆名
|
|
16
|
-
vehicle_manager.all() # LiveGrade 对象列表
|
|
17
|
-
vehicle_manager.names_in_use() # 活载工况里实际用到的车辆名
|
|
18
|
-
"""
|
|
19
|
-
|
|
20
|
-
from __future__ import annotations
|
|
21
|
-
|
|
22
|
-
from ..core.client import osis_client
|
|
23
|
-
from .manager import (
|
|
24
|
-
LiveGrade,
|
|
25
|
-
LIVE_GRADE_VEHICLE,
|
|
26
|
-
LIVE_TYPE_CUSTOM_VEHICLE,
|
|
27
|
-
LIVE_TYPE_CUSTOM_TRAIN,
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class VehicleManager:
|
|
32
|
-
"""车辆管理器(活载等级中属于车辆的视图)"""
|
|
33
|
-
|
|
34
|
-
# ── 数据加载 ──────────────────────────────
|
|
35
|
-
|
|
36
|
-
def _load_grades(self) -> list[LiveGrade]:
|
|
37
|
-
"""拉取全部活载等级(未过滤)"""
|
|
38
|
-
resp = osis_client("GetAllGradeInfo", {})
|
|
39
|
-
if not resp.get("success"):
|
|
40
|
-
raise RuntimeError(f"{resp.get('error', 'GetAllGradeInfo 失败')}")
|
|
41
|
-
return [
|
|
42
|
-
LiveGrade._from_dict(d)
|
|
43
|
-
for d in resp.get("data", [])
|
|
44
|
-
if isinstance(d, dict) and "name" in d
|
|
45
|
-
]
|
|
46
|
-
|
|
47
|
-
def all(self) -> list[LiveGrade]:
|
|
48
|
-
"""所有车辆(活载等级里属于车辆/列车的)
|
|
49
|
-
|
|
50
|
-
Returns:
|
|
51
|
-
list[LiveGrade]: 车辆活载等级列表
|
|
52
|
-
|
|
53
|
-
Raises:
|
|
54
|
-
RuntimeError: 查询失败时抛出异常
|
|
55
|
-
"""
|
|
56
|
-
return [g for g in self._load_grades() if g.is_vehicle]
|
|
57
|
-
|
|
58
|
-
def names(self) -> list[str]:
|
|
59
|
-
"""所有车辆的名称"""
|
|
60
|
-
return [g.name for g in self.all()]
|
|
61
|
-
|
|
62
|
-
def get(self, name: str | list[str]) -> LiveGrade | list[LiveGrade | None] | None:
|
|
63
|
-
"""按名称获取车辆(同样的名称语义:不存在返回 None)
|
|
64
|
-
|
|
65
|
-
Args:
|
|
66
|
-
name: 单个名称或名称列表
|
|
67
|
-
|
|
68
|
-
Returns:
|
|
69
|
-
LiveGrade / list[LiveGrade | None] / None
|
|
70
|
-
"""
|
|
71
|
-
names = [name] if isinstance(name, str) else list(name)
|
|
72
|
-
by_name = {g.name: g for g in self.all()}
|
|
73
|
-
found = [by_name.get(n) for n in names]
|
|
74
|
-
if len(found) == 1:
|
|
75
|
-
return found[0]
|
|
76
|
-
return found
|
|
77
|
-
|
|
78
|
-
def count(self) -> int:
|
|
79
|
-
"""车辆总数"""
|
|
80
|
-
return len(self.all())
|
|
81
|
-
|
|
82
|
-
# ── 工况中实际使用 ────────────────────────
|
|
83
|
-
|
|
84
|
-
def names_in_use(self) -> list[str]:
|
|
85
|
-
"""活载工况里实际引用到的车辆名(去重,保持出现顺序)。
|
|
86
|
-
|
|
87
|
-
来源 /GetAllLiveInfo 的 subLoadCases[].liveGrade / liveGradeEnum,
|
|
88
|
-
与活载等级表的车辆判据交叉验证,避免把人群/疲劳等级误算进来。
|
|
89
|
-
"""
|
|
90
|
-
vehicle_names = set(self.names())
|
|
91
|
-
resp = osis_client("GetAllLiveInfo", {})
|
|
92
|
-
if not resp.get("success"):
|
|
93
|
-
raise RuntimeError(f"{resp.get('error', 'GetAllLiveInfo 失败')}")
|
|
94
|
-
|
|
95
|
-
out: list[str] = []
|
|
96
|
-
seen: set[str] = set()
|
|
97
|
-
for case in resp.get("data") or []:
|
|
98
|
-
if not isinstance(case, dict):
|
|
99
|
-
continue
|
|
100
|
-
for sub in case.get("subLoadCases") or []:
|
|
101
|
-
if not isinstance(sub, dict):
|
|
102
|
-
continue
|
|
103
|
-
name = sub.get("liveGrade")
|
|
104
|
-
enum = sub.get("liveGradeEnum")
|
|
105
|
-
if not name:
|
|
106
|
-
continue
|
|
107
|
-
if enum == LIVE_GRADE_VEHICLE or name in vehicle_names:
|
|
108
|
-
if name not in seen:
|
|
109
|
-
seen.add(name)
|
|
110
|
-
out.append(name)
|
|
111
|
-
return out
|
|
112
|
-
|
|
113
|
-
def __repr__(self) -> str:
|
|
114
|
-
return "VehicleManager()"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
# ──────────────────────────────────────────────
|
|
118
|
-
# 全局单例
|
|
119
|
-
# ──────────────────────────────────────────────
|
|
120
|
-
|
|
121
|
-
vehicle_manager = VehicleManager()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|