ni / niveristand-communications-bus-template

Template custom device for using communications buses in VeriStand
http://www.ni.com
MIT License
0 stars 3 forks source link

add support and tests for discrete bit field updates and parity #59

Closed dbendele closed 3 years ago

dbendele commented 3 years ago

What does this Pull Request accomplish?

Adds a faster code path to support discrete value updates.

Why should this Pull Request be merged?

Discrete-value updates were identified as a high-channel, high-performance use case identified during the last Avionics Custom Device meeting.

What testing has been done?

New tests added for discrete and parity functionality moved into this library. Automated functional tests pass. image

dbendele commented 3 years ago

@buckd, I want to prune this PR such that it only contains the files in the Encoding and Decoding folder/library. Is there an easy way to do this? Commits with other libraries are interleaved.

buckd commented 3 years ago

@buckd, I want to prune this PR such that it only contains the files in the Encoding and Decoding folder/library. Is there an easy way to do this? Commits with other libraries are interleaved.

If individual commits only touch Encoding/Decoding, you can cherry-pick them into a different branch and create a PR from there. If a commit contains changes to both the library you want to modify and another library, you'll have to find a way to separate them. That would also be cherry-picking but then removing changes from the other libraries so that branch only has updates you want, which is not really an "easy way". @rtzoeller, any other recommendations?

rtzoeller commented 3 years ago

@buckd, I want to prune this PR such that it only contains the files in the Encoding and Decoding folder/library. Is there an easy way to do this? Commits with other libraries are interleaved.

If individual commits only touch Encoding/Decoding, you can cherry-pick them into a different branch and create a PR from there. If a commit contains changes to both the library you want to modify and another library, you'll have to find a way to separate them. That would also be cherry-picking but then removing changes from the other libraries so that branch only has updates you want, which is not really an "easy way". @rtzoeller, any other recommendations?

We identified that there were two new PR's worth of changes in this branch, plus some changes from an old PR which was squash-merged, and then did roughly the following:

  1. Rebased this branch to exclude changes which had previously been squash merged using git rebase --onto.
  2. Created another branch at the same commit as this one to hold the other new PR's changes.
  3. Ran git rebase -i ballard_arinc_429 while on this branch, and dropped, edited, and squashed commits. This included removing some files from commits which had disparate changes.
  4. @dbendele is going to repeat that process on the other branch, flipping which commits are dropped vs. kept.
rtzoeller commented 3 years ago

Once you get the high level ideas down, git rebase -i is pretty good at holding your hand through the process. We pushed the original branch before starting, to be confident we wouldn't lose work.

niveristand-diff-bot commented 3 years ago

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

Discrete.lvclass--setUp.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Discrete.lvclass--setUp.vi.png)
Discrete.lvclass--tearDown.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Discrete.lvclass--tearDown.vi.png)
Discrete.lvclass--test Update Discrete Bit Field by Data Type.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Discrete.lvclass--test%20Update%20Discrete%20Bit%20Field%20by%20Data%20Type.vi.png)
Discrete.lvclass--test Update Discrete Bit Field by Index.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Discrete.lvclass--test%20Update%20Discrete%20Bit%20Field%20by%20Index.vi.png)
Discrete.lvclass--test Update Discrete Bit Field.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Discrete.lvclass--test%20Update%20Discrete%20Bit%20Field.vi.png)
Encoding and Decoding.lvlib--BCD Decode Integer.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Encoding%20and%20Decoding.lvlib--BCD%20Decode%20Integer.vi.png)
Encoding and Decoding.lvlib--BNR Encode Integer.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Encoding%20and%20Decoding.lvlib--BNR%20Encode%20Integer.vim.png)
Encoding and Decoding.lvlib--BNR Encode.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Encoding%20and%20Decoding.lvlib--BNR%20Encode.vim.png)
Encoding and Decoding.lvlib--Update Bit Field.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Encoding%20and%20Decoding.lvlib--Update%20Bit%20Field.vim.png)
Encoding and Decoding.lvlib--Write Parity.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Encoding%20and%20Decoding.lvlib--Write%20Parity.vim.png)
Parity.lvclass--setUp.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Parity.lvclass--setUp.vi.png)
Parity.lvclass--tearDown.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Parity.lvclass--tearDown.vi.png)
Parity.lvclass--test Set Even Parity by Index.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Parity.lvclass--test%20Set%20Even%20Parity%20by%20Index.vi.png)
Parity.lvclass--test Set Odd Parity by Index.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Parity.lvclass--test%20Set%20Odd%20Parity%20by%20Index.vi.png)
Parity.lvclass--test Set Parity.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/11%3A23%3A51/Parity.lvclass--test%20Set%20Parity.vi.png)
niveristand-diff-bot commented 3 years ago

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

Discrete.lvclass--setUp.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Discrete.lvclass--setUp.vi.png)
Discrete.lvclass--tearDown.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Discrete.lvclass--tearDown.vi.png)
Discrete.lvclass--test Update Discrete Bit Field by Data Type.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Discrete.lvclass--test%20Update%20Discrete%20Bit%20Field%20by%20Data%20Type.vi.png)
Discrete.lvclass--test Update Discrete Bit Field by Index.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Discrete.lvclass--test%20Update%20Discrete%20Bit%20Field%20by%20Index.vi.png)
Discrete.lvclass--test Update Discrete Bit Field.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Discrete.lvclass--test%20Update%20Discrete%20Bit%20Field.vi.png)
Encoding and Decoding.lvlib--BCD Decode Integer.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Encoding%20and%20Decoding.lvlib--BCD%20Decode%20Integer.vi.png)
Encoding and Decoding.lvlib--BNR Encode Integer.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Encoding%20and%20Decoding.lvlib--BNR%20Encode%20Integer.vim.png)
Encoding and Decoding.lvlib--BNR Encode.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Encoding%20and%20Decoding.lvlib--BNR%20Encode.vim.png)
Encoding and Decoding.lvlib--Update Bit Field.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Encoding%20and%20Decoding.lvlib--Update%20Bit%20Field.vim.png)
Encoding and Decoding.lvlib--Write Parity.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Encoding%20and%20Decoding.lvlib--Write%20Parity.vim.png)
Parity.lvclass--setUp.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Parity.lvclass--setUp.vi.png)
Parity.lvclass--tearDown.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Parity.lvclass--tearDown.vi.png)
Parity.lvclass--test Set Even Parity by Index.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Parity.lvclass--test%20Set%20Even%20Parity%20by%20Index.vi.png)
Parity.lvclass--test Set Odd Parity by Index.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Parity.lvclass--test%20Set%20Odd%20Parity%20by%20Index.vi.png)
Parity.lvclass--test Set Parity.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/17%3A53%3A23/Parity.lvclass--test%20Set%20Parity.vi.png)
niveristand-diff-bot commented 3 years ago

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

Discrete.lvclass--setUp.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Discrete.lvclass--setUp.vi.png)
Discrete.lvclass--tearDown.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Discrete.lvclass--tearDown.vi.png)
Discrete.lvclass--test Update Discrete Bit Field by Data Type.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Discrete.lvclass--test%20Update%20Discrete%20Bit%20Field%20by%20Data%20Type.vi.png)
Discrete.lvclass--test Update Discrete Bit Field by Index.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Discrete.lvclass--test%20Update%20Discrete%20Bit%20Field%20by%20Index.vi.png)
Discrete.lvclass--test Update Discrete Bit Field.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Discrete.lvclass--test%20Update%20Discrete%20Bit%20Field.vi.png)
Encoding and Decoding.lvlib--BCD Decode Integer.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Encoding%20and%20Decoding.lvlib--BCD%20Decode%20Integer.vi.png)
Encoding and Decoding.lvlib--BNR Decode Integer.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Encoding%20and%20Decoding.lvlib--BNR%20Decode%20Integer.vim.png)
Encoding and Decoding.lvlib--BNR Decode.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Encoding%20and%20Decoding.lvlib--BNR%20Decode.vim.png)
Encoding and Decoding.lvlib--BNR Encode Integer.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Encoding%20and%20Decoding.lvlib--BNR%20Encode%20Integer.vim.png)
Encoding and Decoding.lvlib--BNR Encode.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Encoding%20and%20Decoding.lvlib--BNR%20Encode.vim.png)
Encoding and Decoding.lvlib--Get Bits Per Digit from Base.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Encoding%20and%20Decoding.lvlib--Get%20Bits%20Per%20Digit%20from%20Base.vim.png)
Encoding and Decoding.lvlib--Update Bit Field.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Encoding%20and%20Decoding.lvlib--Update%20Bit%20Field.vim.png)
Encoding and Decoding.lvlib--Write Parity.vim.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Encoding%20and%20Decoding.lvlib--Write%20Parity.vim.png)
Parity.lvclass--setUp.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Parity.lvclass--setUp.vi.png)
Parity.lvclass--tearDown.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Parity.lvclass--tearDown.vi.png)
Parity.lvclass--test Set Even Parity by Index.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Parity.lvclass--test%20Set%20Even%20Parity%20by%20Index.vi.png)
Parity.lvclass--test Set Odd Parity by Index.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Parity.lvclass--test%20Set%20Odd%20Parity%20by%20Index.vi.png)
Parity.lvclass--test Set Parity.vi.png ![capture](https://raw.githubusercontent.com/niveristand-diff-bot/diff-images/master/NI/niveristand-communications-bus-template/PR-59/2020-11-19/18%3A54%3A39/Parity.lvclass--test%20Set%20Parity.vi.png)
dbendele commented 3 years ago

Notes to Reviewers: Encoding and Decoding.lvlib--BCD Decode Integer.vi added base to connector pane Encoding and Decoding.lvlib--BNR Decode Integer.vim added to encapsulate decoding to correct data type Encoding and Decoding.lvlib--BNR Encode Integer.vim added to encapsulate encoding logic for all datatypes Encoding and Decoding.lvlib--BNR Encode.vim uses new subVI BNR Encode Integer.vim Encoding and Decoding.lvlib--Get Bits Per Digit from Base.vim added subdiagram labels to clearly indicate base Encoding and Decoding.lvlib--Update Bit Field.vim added VI to provide high speed data path for discrete values Encoding and Decoding.lvlib--Write Parity.vim moved from Protocol class

Tests added for new discrete functionality and for parity write

dbendele commented 3 years ago
  • [ ] There is no real change in BNR Decode.vim. Please revert and then all looks good.

useful change: current index of input BNR encoded value changed from 26 to 0