Clear the open minors: lost marking and overrun logging, form teardown guard, line breaks and ERANGE in config, probe strength
The E-1608 source marks every restart as lost and logs each overrun; its form stops touching siblings after the chooser destroys them; the link skips command id 0, retries a full-buffer discover send and ignores a zero-length scan read. Session files escape \n and \r; get_int and get_double reject out-of-range values; the UDPS port spin reports changes; a skipped source panel says why on stderr. The E-1608 probe now checks the signal names and the reconnect itself. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
6245811699
commit
87822ed4f5
9 files changed
+95
-18
No files matched your search
+18
-3
@@ -2058,8 +2058,19 @@ gboolean e1608_probe_report(gpointer user) {
|
||||
for (const SignalInfo& si : sigs) names += (names.empty() ? "" : ",") + si.name;
|
||||
const double rate = sigs.empty() ? 0.0 : sigs.front().sampling_rate;
|
||||
const std::uint64_t frames = a->model->stats().frames.load(std::memory_order_relaxed);
|
||||
const bool stream_ok = up && sigs.size() == expect && std::fabs(rate - s.scan_rate) < 1e-6 &&
|
||||
frames > 0;
|
||||
// The signals' order is part of the contract: the enabled analog inputs, then the plotted DI
|
||||
// lines, then the counter. Swapped channels must not read ok.
|
||||
std::string expect_names;
|
||||
const auto add_name = [&](const std::string& n) { expect_names += (expect_names.empty() ? "" : ",") + n; };
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
if (s.ai_on[i]) add_name("AI" + std::to_string(i));
|
||||
}
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
if (s.plot[i]) add_name("DI" + std::to_string(i));
|
||||
}
|
||||
if (s.plot_counter) add_name("Counter");
|
||||
const bool stream_ok = up && sigs.size() == expect && names == expect_names &&
|
||||
std::fabs(rate - s.scan_rate) < 1e-6 && frames > 0;
|
||||
std::fprintf(stderr,
|
||||
"[e1608] stream: connected=%d signals=%zu expect=%zu names=%s frames=%" G_GUINT64_FORMAT
|
||||
" rate=%.3f ok=%d\n",
|
||||
@@ -2146,13 +2157,17 @@ gboolean e1608_probe_resumed(gpointer user) {
|
||||
App* a = static_cast<App*>(user);
|
||||
if (a->window == nullptr) return G_SOURCE_REMOVE;
|
||||
const std::uint64_t after = a->model->stats().frames.load(std::memory_order_relaxed);
|
||||
// Frames alone also grow on a link that never dropped: the reconnect must have happened too.
|
||||
e1608::E1608Source* src = e1608_source(a);
|
||||
const bool reconnected = src != nullptr && src->connects() >= 2;
|
||||
std::fprintf(stderr, "[e1608] resumed: frames_before=%" G_GUINT64_FORMAT " frames_after=%" G_GUINT64_FORMAT
|
||||
" ok=%d\n",
|
||||
g_e1608_frames_before, after, after > g_e1608_frames_before ? 1 : 0);
|
||||
g_e1608_frames_before, after, reconnected && after > g_e1608_frames_before ? 1 : 0);
|
||||
std::fflush(stderr);
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
/// After the mock dropped the link: the source's connect count, then (500 ms later) whether the stream moves.
|
||||
gboolean e1608_probe_reconnect(gpointer user) {
|
||||
App* a = static_cast<App*>(user);
|
||||
if (a->window == nullptr) return G_SOURCE_REMOVE;
|
||||
|
||||
Reference in new issue
Block a user