Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Support for v2 of tdd driver #491

wants to merge 1 commit into from

Conversation

cristina-suteu
Copy link
Contributor

@cristina-suteu cristina-suteu commented Apr 25, 2024

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

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have followed the coding standards and guidelines
  • I have conducted a self-review of my own code changes
  • I have commented new code, particulary complex or unclear areas
  • I have checked in CI output that no new warnings/errors got introduced
  • I have updated documentation accordingly (GitHub Pages, READMEs, etc)

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 */
Copy link
Contributor

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;
Copy link
Contributor

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);
Copy link
Contributor

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants