-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osc: Implement a way to provide custom algorithm for XY plot
Usage example: /* define the routine with the algorithm */ static void my_xy_transform(gfloat *x_in, gfloat *y_in, gfloat *x_out, gfloat *y_out, unsigned int length, void *user_data) { unsigned int i; for (i = 0; i < length; ++i) { x_out[i] = some_custom_algorithm(x_in[i]); y_out[i] = some_custom_algorithm(y_in[i]); } } /* Look for an already created plot instance that is configured to display XY data. Then, configure it to call your routine. Make sure that the plot is stopped the first time you set the routine. This is to tell the plot to create some internal buffers first. */ bool plot_is_running = false; OscPlot *xy_plot = plugin_find_plot_with_domain(XY_PLOT); if (xy_plot) { plot_is_running = osc_plot_running_state(xy_plot); if (!plot_is_running) { osc_plot_set_xy_transform(xy_plot, my_xy_transform, NULL); } } Signed-off-by: Dan <[email protected]>
- Loading branch information
Showing
3 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters