polyfoammesh.gui.log_panel
Classes
|
Read-only log view with burst batching and view-only coalescing. |
- class polyfoammesh.gui.log_panel.LogPanel(parent=None)[source]
Bases:
QTextEditRead-only log view with burst batching and view-only coalescing.
Thread-safety contract is unchanged:
append_logmay be called from any thread. Cross-thread calls are marshalled to the GUI thread through a QueuedConnection and are capped by_BURST_PENDING_CAP; excess lines are dropped and summarised with a “… N lines suppressed …” note.Two performance measures live here, both purely visual:
Batching — lines received on the GUI thread are buffered and flushed on a ~120 ms timer. An isolated line (idle stream, small buffer) is flushed synchronously so normal logging stays prompt.
Coalescing — consecutive
[gmsh] ... still running ...lines replace the previous one in place, and a run of consecutiveImproving ...lines collapses to a single line carrying a running(N lines)count. Only the widget view is affected; no log file, telemetry stream or signal mirrors individual lines (verified), so full fidelity is preserved everywhere it is actually consumed.
- append_log(text)[source]
Thread-safe log append with highlighting, batching and burst protection.
When invoked from a non-main thread the actual text insertion is dispatched to the GUI thread via invokeMethod with a QueuedConnection (prevents the Qt heap corruption that occurred when inserting directly from a QThread worker). If more than
_BURST_PENDING_CAPappends are already queued, the line is dropped and counted — the GUI keeps rendering at a sustainable pace instead of freezing.- Parameters:
text (str)
- staticMetaObject = PySide6.QtCore.QMetaObject("LogPanel" inherits "QTextEdit": Methods: #73 type=Slot, signature=append_log(QString), parameters=QString )