-
Notifications
You must be signed in to change notification settings - Fork 33
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
Modular decom #134
Modular decom #134
Conversation
Codecov Report
@@ Coverage Diff @@
## master #134 +/- ##
==========================================
+ Coverage 73.66% 73.83% +0.16%
==========================================
Files 426 433 +7
Lines 25558 25809 +251
Branches 559 559
==========================================
+ Hits 18827 19055 +228
- Misses 6647 6670 +23
Partials 84 84
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
I need an example in the demo of how this works on the user side. Don't need every accessor but at least JSON. Also you probably need more unit tests.
@@ -1032,6 +1112,22 @@ def self.from_json(hash) | |||
packet | |||
end | |||
|
|||
def decom | |||
# Read all the RAW at once because this could be optimized by the accessor | |||
json_hash = read_items(@sorted_items) |
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.
So read_items initializes the hash and then we call read_item again but pass given_raw to really populate it? I'm confused about the 2 pass system here.
endianness, hash['array_size'], overflow) | ||
si.key = hash['key'] || hash['name'] |
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.
You didn't want to add key to the constructor? :-)
IGNORE_PARAMETER ID_ITEM | ||
|
||
CMD_UNIQUE_ID_MODE | ||
TLM_UNIQUE_ID_MODE |
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.
Are these required for the new accessor modes? Or if you have the exact same ID_ITEM KEY then no?
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.
They are not required if all the packets have the same Accessor, ID_ITEMS, and keys
# Create the item | ||
item = @item_class.new(name_upcase, bit_offset, bit_size, data_type, endianness, array_size, overflow) | ||
item = @item_class.new(name, bit_offset, bit_size, data_type, endianness, array_size, overflow) |
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.
Does this have other repercussions?
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.
It gets upcased again farther down
I love the new example project with the example of all the different ways you can access the data. This will make it much easier to use for end users. Nicely done! |
Tests pass locally. Merging for now. |
closes #27