-
Notifications
You must be signed in to change notification settings - Fork 4
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
Problems with "domain" values in the objdictedit GUI tool #10
Comments
I can confirm the bug. This is py2 -> py3 migration error. FYI: I'm currently working on a py2 cleanup and with that I believe the XML part will fixed. The UI error still remains. |
* Fix failure on reading the "need" field from node * Increase the viewport size of the index parts in GUI * Add error message if entering invalid data in GUI table editor * Fix bug where UI changes in the table didn't update the data * Added in-line documentation in ODStructTypes * Fix incorrect ValueError when having arrays * FIxed Node.DumpFile not guessing the filetype correctly * Fix handling of DOMAIN, which address #10 Testing * Add new "equiv_files" fixture to test equivalent files * Add test for testing `odg compare` * Added OD-file for DOMAIN and updated OD-files for consistency
The main branch now includes a fix for the DOMAIN object type. @robybona please check if this fixes the problem for you. |
@sveinse I made some tests. Let's say it's needed to create a 6-bytes domain (without indicating the buffer size). Another problem is that the value saved in the All the three values are accepted by the GUI, but the last one is represented in an unexpected way. So, summarizing, the remaining problems are:
|
@robybona Thank you for the report. I've fixed the problems in PR #16. The values you shows were missing from the test suite and didn't work. This is now fixes. Please retest the branch if you have the opportunity. May I add that PS! This issue was not trivial to fix. Spent the better part of a day fixing it. This problem touches file encoding which becomes complicated with legacy py2 OD compatibility. The legacy py2 objdictgen OD-format is ill-suited for how py3 handles strings and unicode. Since py3 doesn't have unicode and strings, DOMAIN broke in py3. Symbols like Well, now I really hope it is done. |
The objdictedit GUI tool seems to incorrectly manage "domain" values.
How to reproduce:
b''
;Here's the problem, because:
b'00'
, orb'11'
, orb'25252525'
is entered, building the dictionary gives the error: "Domain variable not initialized, index: 0x2000, subindex: 0x00";12
is entered, when confirming the data the following error appears: <class 'AttributeError'>: 'bytes' object has no attribute 'encode';0x1234
is entered, when confirming the data the following error appears: <class 'binascii.Error'>: decoding with 'hex_codec' codec failed (Error: Non-hexadecimal digit found).It seems there's no way to insert an acceptable value for "domain" fields.
Something similar happens when opening a
.od
file with the objdictedit GUI tool.Here's an example.
Consider the 0x2300 entry, of "domain" type, with the hexadecimal value:
0x00000000000000
. It is 7 bytes long. The.od
content is:When this
.od
file is opened by the objdictedit GUI tool, the value field shows:b'5c7830305c7830305c7830305c7830305c7830305c7830305c783030'
, that's clearly not the expected one.It should show
00000000000000
.Now, without changing the value, executing "Build dictionary" succeeds. Anyway, the entry is generated like this, in the
.c
file:Again, that's not the expected size and value. It should be:
Here's the behaviour of older versions of objdictedit (I mean: the ones working with Python 2 and wxPython 2.7).
The "domain" value accepted entries like
0x12fc
(it was transformed as12fc
when confirmed), or like12fc
.The general rule was to accept any entry with an even quantity of hexadecimal characters. The entry could be prefixed by 0x, but it was not mandatory. If something different was entered, like non-hexadecimal characters or an odd quantity of characters, the entry was not accepted and the cell was filled back with the old valid value.
The text was updated successfully, but these errors were encountered: