-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for v2 of tdd driver #491
base: main
Are you sure you want to change the base?
Conversation
check for version attribute in the tdd driver(only exists in v2) if found, load the new plugin if version attr not found, the previous version of the plugin is loaded Signed-off-by: Cristina Suteu <[email protected]>
struct osc_plugin_context plugin_ctx; | ||
/* iio */ | ||
struct iio_context *ctx; | ||
/* misc */ | ||
/* misc */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the above look unrelated changes...
|
||
if(!iio_device_find_attr(dev, "version")) { | ||
if (osc_load_glade_file(priv->builder, "cf_axi_tdd") < 0) | ||
goto context_destroy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation looks wrong... Please don't mix styles in the same file/plugin. This one is likely (as I did it :)) using tabs (8 spaces) so please use the same style. It also looks like some widgets have the same attrs (like burst_count and frame_length_ms) so make sure to not duplicate code if not needed.
Also, since for v2 you're initializing all the widgets in cf_axi_tdd_v2_widgets_init(), I would consider in having a precursor patch adding a similar function to the legacy plugin so things are consistent.
|
||
reload_btn = GTK_BUTTON(gtk_builder_get_object(priv->builder, "settings_reload")); | ||
g_signal_connect(G_OBJECT(reload_btn), "clicked", G_CALLBACK(reload_settings), | ||
priv); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also looks to be duplicated code...
PR Description
A new version of the tdd driver will be released soon. This ensures support for both versions of the driver. This is done by checking for the version attribute, which only exists in v2 of the driver. If said attribute is found, osc will load the newly added glade file, with widgets corresponding to the new attribute. If the version attribute is not found, osc will load the old plugin.
Note: this is still under development and will be updated if the requirements/ functionality would change.
PR Type
PR Checklist