Skip to content

Best practices for adding more config keys #59

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

Closed
nseidle opened this issue Aug 23, 2021 · 5 comments · Fixed by #60
Closed

Best practices for adding more config keys #59

nseidle opened this issue Aug 23, 2021 · 5 comments · Fixed by #60

Comments

@nseidle
Copy link
Member

nseidle commented Aug 23, 2021

The ZED-F9R introduces some additional config keys, namely the ESF range of keys (ex: CFG-MSGOUT-UBX_ESF_ALG_I2C). I suspect the ZED-F9T adds a few as well and more modules are always looming on the horizon.

  • How @PaulZC did you export the PDF and then import them in bulk with comments?
  • How should we detect key diffs between PDFs to determine new adds?
@PaulZC
Copy link
Collaborator

PaulZC commented Aug 24, 2021

IIRC, I used the full version of Adobe Acrobat to export the PDF as an xlsx spreadsheet. It was then a couple of hours work to extract and format just the keys and their descriptions from the relevant cells. IIRC having the data in xlsx format made it much easier to discard the surrounding text, like headers and footers etc..

But, for new keys, there must be a simpler way to do this. I suspect the various pdf diff tools that are out there will fail as the differences between say the F9P and the F9T interface descriptions will be huge. However, there may be a 'quick' way to extract just the hex keys making it easier to spot any new ones with a simple diff. I shall think on this...

@PaulZC
Copy link
Collaborator

PaulZC commented Aug 24, 2021

Here's a method which works. It's not particularly quick or elegant, but it works...

  1. Open the interface description in Adobe Acrobat Reader DC (the free version)
  2. Do a File \ Save as Text...
  3. Save the file in Text (Accessible) (*.txt) format
  4. Go make a cup of tea - this takes a while
  5. Open the txt file in Notepad++ or another editor which supports Regular Expressions
  6. The keys will have been saved as individual lines in the format: 0xnnnnnnnn space CR LF
  7. So all we need to do is use a regex to delete everything else
  8. Open Search \ Replace
  9. Click the Search Mode - Regular Expression button
  10. In the "Find what :" box enter: ^(?!.*0x[\dabcdefABCDEF]{8}\s\r\n).*
  11. Clear the "Replace with :" box
  12. Click "Replace All"
  13. You are left with just the keys - and a bunch of empty lines, some of which contain form feeds (\f)
  14. Delete the empty lines (\r\n) by replacing \r\n with nothing - don't panic, this takes a few seconds
  15. Delete the form feeds by replacing \f with nothing
  16. Finally replace the remaining spaces (\s) with \r\n
  17. Save the file

Use KDiff3 or another diff package to see the new additions.
All the keys are included twice - once from the "Configuration Reference" and a second time from the "Configuration Defaults". You can ignore the second half of the differences.
It also helps if you sort the keys in ascending order - by importing into a spreadsheet and using the ascending order tool...

@PaulZC
Copy link
Collaborator

PaulZC commented Aug 24, 2021

I've added the new keys for the ZED-F9R and the ZED-F9T to the release_candidate branch. I'll merge into main as soon as I've tested your Auto IMU code.

@jafrado
Copy link

jafrado commented Aug 24, 2021

“strings <file.pdf>“ should get you the relevant text. strings file.doc | more is the way we used to read Microsoft word documents on Sun workstations in the mid-90’s 😀

I suppose Perl Regex after that for extraction…

@nseidle
Copy link
Member Author

nseidle commented Aug 24, 2021

Amazing. Thanks Paul! And this should serve as a 'how to' to our future selves.

@nseidle nseidle closed this as completed Aug 24, 2021
@PaulZC PaulZC linked a pull request Aug 25, 2021 that will close this issue
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 a pull request may close this issue.

3 participants