fix(stream_reader): add ASCII hex path + binary resync guard

Family-A wafers never send 0xAA 0x88 framing — _run() now routes
to _run_ascii() on first byte dispatch instead of treating the whole
stream as corrupt binary.

Binary path gets a 16 KB give-up cap (bytes, not attempts) so a
permanently-corrupt port can't stall the reader indefinitely. Raw
wire bytes go to DEBUG only; the ERROR line that surfaces in the
Activity Log is kept free of internal buffer content.

- add family_code param to StreamReader for ASCII decode routing
- add _run_binary give-up cap + DEBUG-only hex diagnostic
- fix stop(): close transport on wedged thread (binary + ASCII paths)
- refactor test_stream_reader: consolidate ASCII regression + resync
  give-up + DEBUG-vs-ERROR log split tests; drop redundant parse_line
- extend test_session_controller: live-stream gate for non-X family
- StreamControlPanel.qml: thread-safe stop on tab leave
This commit is contained in:
jack
2026-07-13 12:26:33 -07:00
parent 425f3731cd
commit c4cbc02a15
5 changed files with 269 additions and 160 deletions
@@ -110,8 +110,13 @@ Rectangle {
TabButton {
id: liveTab
// Only X-family wafer firmware supports live streaming
// (C# parity, Form1.cs btnConnect_Click) — other families
// have no live-stream protocol to speak.
readonly property string detectedFamily: (deviceController.lastWaferInfo && deviceController.lastWaferInfo.length > 0) ? deviceController.lastWaferInfo[0] : ""
readonly property bool familySupportsStream: detectedFamily === "X"
text: "Live"
enabled: deviceController.connectionStatus === "Connected"
enabled: deviceController.connectionStatus === "Connected" && familySupportsStream
opacity: enabled ? 1.0 : 0.4
Layout.fillWidth: true
implicitHeight: 24
@@ -120,7 +125,9 @@ Rectangle {
AppToolTip {
visible: disabledHover.containsMouse && !liveTab.enabled
text: "Connect a wafer to enable Live mode"
text: deviceController.connectionStatus !== "Connected"
? "Connect a wafer to enable Live mode"
: "Live mode is only supported on X-family wafers (detected " + liveTab.detectedFamily + ")"
delay: 300
}
@@ -359,12 +366,14 @@ Rectangle {
text: streamController.mode === "live" ? "STOP" : "START"
enabled: streamController.mode === "live"
? true
: deviceController.connectionStatus === "Connected"
: (deviceController.connectionStatus === "Connected" && liveTab.familySupportsStream)
opacity: enabled ? 1.0 : 0.4
AppToolTip {
visible: primaryBtn.hovered && !primaryBtn.enabled
text: "Connect a wafer to enable Live mode"
text: deviceController.connectionStatus !== "Connected"
? "Connect a wafer to enable Live mode"
: "Live mode is only supported on X-family wafers (detected " + liveTab.detectedFamily + ")"
delay: 300
}