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

feat(DB): Add method to export clusters to a database file. #236

Merged
merged 1 commit into from Mar 26, 2018

Conversation

d-bohls
Copy link
Contributor

@d-bohls d-bohls commented Mar 10, 2018

Fixes #231

  • This contribution adheres to CONTRIBUTING.md.
  • New tests have been created for any new features or regression tests for bugfixes.
  • tox successfully runs, including unit tests and style checks (see CONTRIBUTING.md).

@d-bohls d-bohls self-assigned this Mar 10, 2018
@d-bohls d-bohls requested a review from jashnani March 10, 2018 05:41
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.005%) to 68.172% when pulling ae89c0c on d-bohls:addClusterSave into 730305b on ni:master.

@coveralls
Copy link

coveralls commented Mar 10, 2018

Coverage Status

Coverage decreased (-0.005%) to 68.172% when pulling 5218cec on d-bohls:addClusterSave into 1af04b0 on ni:master.

@d-bohls
Copy link
Contributor Author

d-bohls commented Mar 10, 2018

nxdb_save_database is documented here:

http://zone.ni.com/reference/en-XX/help/372841P-01/nixnet/nxdbsavedatabase/

I thoroughly tested a ton of scenarios for nxdb_save_database and here is what I found:

  1. A database object can only be saved to a filepath with an xml (FIBEX) extension. Trying to save to LDF or DBC errors, even if the original file was one of these.
  2. The filepath param is only optional for a database object if the opened database has an xml file extension (a FIBEX database). XNET will error if you open a .dbc or .ldf database and call save without a filepath.
  3. Filepath is never optional when you call nxdb_save_database on a cluster.
  4. CAN clusters must specify a filepath with a .dbc extension.
  5. LIN clusters must specify a filepath with a .ldf extension.

Given these results along with the way the C API documentation talks about exporting a cluster, I felt it more appropriate to:

  1. name the method Cluster.export instead of Cluster.save
  2. make the filepath parameter required instead of optional.

@jashnani jashnani merged commit 4004cd3 into ni:master Mar 26, 2018
@d-bohls d-bohls deleted the addClusterSave branch March 26, 2018 20:27
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.

Implement Cluster.save to export a cluster
3 participants