高温氦气物性补全;三通四通能量计算bug修正
This commit is contained in:
1 parent
6fc9afe41d
commit
2b07d996cf
133 files changed
+5230
-253310
No files matched your search
+15
@@ -792,11 +792,18 @@ def _run_system_xml_simulation_profiled(
|
||||
document.simulation.t_stop,
|
||||
)
|
||||
|
||||
def report_property_warning(warning: dict) -> None:
|
||||
fraction = (warning["time"] - document.simulation.t_start) / (
|
||||
document.simulation.t_stop - document.simulation.t_start)
|
||||
emit(round(100 * min(1.0, max(0.0, fraction))), "property-warning",
|
||||
warning["message"], warning["time"], document.simulation.t_stop)
|
||||
|
||||
try:
|
||||
result = simulate_network(
|
||||
network,
|
||||
document.simulation,
|
||||
progress_callback=report_system_progress,
|
||||
warning_callback=report_property_warning,
|
||||
cancel_check=cancel_check,
|
||||
activity_tracker=activity_tracker,
|
||||
raw_series=raw_series,
|
||||
@@ -867,6 +874,14 @@ def simulation_event_stream(
|
||||
) -> None:
|
||||
nonlocal latest_message, latest_phase, latest_progress
|
||||
nonlocal latest_simulated_time, latest_total_time
|
||||
if phase == "property-warning":
|
||||
# A warning is an event, not the current integration phase. Keep
|
||||
# heartbeat/progress state intact while delivering every warning.
|
||||
events.put({"event": "progress", "progress": latest_progress,
|
||||
"phase": phase, "message": message,
|
||||
"simulatedTime": simulated_time, "totalTime": total_time,
|
||||
**activity_tracker.snapshot().as_dict()})
|
||||
return
|
||||
latest_progress = max(latest_progress, min(100, max(0, progress)))
|
||||
latest_phase = phase
|
||||
latest_message = message
|
||||
|
||||
Reference in new issue
Block a user