Feature/source plugins #1

Merged
martino merged 130 commits from feature/source-plugins into main 2026-11-04 07:35:21 +01:00
2 changed files with 36 additions and 6 deletions
Showing only changes of commit ad5e30f338 - Show all commits

No files matched your search

+4 -2
View File
@@ -2637,7 +2637,7 @@ left the caller's `false` alone would read `dock_shown=0 default=1 ok=0`. The pr
## `[signalpage]` ## `[signalpage]`
``` ```
[signalpage] name=sine open=1 pages=1 enable_visible=1 plot_buttons=1 plot_on_row0=1 plot_on_row0_disabled=1 locked_enable_sensitive=0 removed=1 btn_row0=1 back_to_list=1 row_opens=1 pruned=1 rows=1 [signalpage] name=sine open=1 pages=1 enable_visible=1 plot_buttons=1 plot_on_row0=1 plot_on_row0_disabled=1 locked_enable_sensitive=0 removed=1 btn_row0=1 back_to_list=1 row_opens=1 pruned=1 other_page_kept=1 rows=1
``` ```
`UDPSCOPE_PROBE_SIGNAL_PAGES_MS` builds and drives the page of the first streamed signal. `open=1` (the slide-over shows `signal:<name>`), `pages=1` `UDPSCOPE_PROBE_SIGNAL_PAGES_MS` builds and drives the page of the first streamed signal. `open=1` (the slide-over shows `signal:<name>`), `pages=1`
@@ -2648,7 +2648,9 @@ the same plot), `locked_enable_sensitive=0` (with `signals_locked` set and `sign
the signal lock -- the same goes for a math channel's Edit graph and Delete, which the probe does not read; the probe restores the lock), `removed=1` the signal lock -- the same goes for a math channel's Edit graph and Delete, which the probe does not read; the probe restores the lock), `removed=1`
(the page's "Remove from plots" took it off), `btn_row0=1` (the "Plot on 1" button, the user's path, put it back), `back_to_list=1` ("All signals" (the page's "Remove from plots" took it off), `btn_row0=1` (the "Plot on 1" button, the user's path, put it back), `back_to_list=1` ("All signals"
target), `row_opens=1` (activating the list row opens the page), and `pruned=1`: a math channel's page was opened, its **Delete** button clicked, and target), `row_opens=1` (activating the list row opens the page), and `pruned=1`: a math channel's page was opened, its **Delete** button clicked, and
the slide-over closed and the page was dropped by `signal_pages_sync()`. `pruned=-1` means no math channel could be added; `0` is a stale page. the slide-over closed and the page was dropped by `signal_pages_sync()`. `pruned=-1` means no math channel could be added; `0` is a stale page. `other_page_kept=1`: with the `trigger` page open, a signal page that is not on show was pruned (a math channel added, its page built, the
channel removed) and the slide-over was still on `trigger`, both by `slideover_page()` and by the stack's visible child; `0` is `signal_pages_sync()` parking the stack on the
signals list while the title and the badge marker still name `trigger`; `-1` when there is no `trigger` page or no math channel could be added.
## `[badges]` ## `[badges]`
+32 -4
View File
@@ -232,8 +232,11 @@ void signal_pages_sync(App& app) {
if (signal_index(app, it->first) == std::string::npos) { if (signal_index(app, it->first) == std::string::npos) {
if (slideover_page(app) == page_id(it->first)) slideover_close(app); if (slideover_page(app) == page_id(it->first)) slideover_close(app);
// The stack keeps showing the dying page through the close animation; park it on the list so that // The stack keeps showing the dying page through the close animation; park it on the list so that
// removing the page does not let another signal's page take its place for those frames. // removing the page does not let another signal's page take its place for those frames. Only when it
if (slideover_has_page(app, "signals")) { // is the page on show: parking while the slide-over is open on another page would switch the stack
// away from the page that slideover_page(), the title and the badge marker still name.
const char* shown = gtk_stack_get_visible_child_name(GTK_STACK(app.slideover.stack));
if (shown != nullptr && std::string(shown) == page_id(it->first) && slideover_has_page(app, "signals")) {
gtk_stack_set_visible_child_name(GTK_STACK(app.slideover.stack), "signals"); gtk_stack_set_visible_child_name(GTK_STACK(app.slideover.stack), "signals");
} }
slideover_remove_page(app, page_id(it->first)); slideover_remove_page(app, page_id(it->first));
@@ -417,13 +420,38 @@ gboolean signal_page_probe(gpointer user) {
} }
} }
slideover_close(a); slideover_close(a);
// A page that is not on show is pruned while another panel is open: the slide-over stays on that panel.
int other_page_kept = -1;
if (slideover_has_page(a, "trigger")) {
slideover_open(a, "trigger");
const std::size_t before = a.math.size();
add_math_channel(a);
if (a.math.size() == before + 1) {
const std::string mname = a.math.back().name;
if (signal_page_ensure(a, mname)) {
const bool on_trigger = slideover_page(a) == "trigger";
a.math.pop_back();
apply_math_channels(a);
const char* shown = gtk_stack_get_visible_child_name(GTK_STACK(a.slideover.stack));
other_page_kept = on_trigger && a.signal_pages.count(mname) == 0 && slideover_page(a) == "trigger" &&
shown != nullptr && std::string(shown) == "trigger"
? 1
: 0;
} else {
a.math.pop_back();
apply_math_channels(a);
}
}
slideover_close(a);
}
std::fprintf(stderr, std::fprintf(stderr,
"[signalpage] name=%s open=%d pages=%d enable_visible=%d plot_buttons=%d plot_on_row0=%d " "[signalpage] name=%s open=%d pages=%d enable_visible=%d plot_buttons=%d plot_on_row0=%d "
"plot_on_row0_disabled=%d locked_enable_sensitive=%d " "plot_on_row0_disabled=%d locked_enable_sensitive=%d "
"removed=%d btn_row0=%d back_to_list=%d row_opens=%d pruned=%d rows=%d\n", "removed=%d btn_row0=%d back_to_list=%d row_opens=%d pruned=%d other_page_kept=%d rows=%d\n",
name.c_str(), open, pages, enable_visible, plot_buttons, plot_on_row0, plot_on_row0_disabled, name.c_str(), open, pages, enable_visible, plot_buttons, plot_on_row0, plot_on_row0_disabled,
locked_enable_sensitive, removed, btn_row0, back_to_list, row_opens, pruned, locked_enable_sensitive, removed, btn_row0, back_to_list, row_opens, pruned,
a.rows->row_count()); other_page_kept, a.rows->row_count());
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} }