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

Some tables do not open while others open. #1

Open
MaximKutovoy opened this issue Oct 31, 2019 · 5 comments
Open

Some tables do not open while others open. #1

MaximKutovoy opened this issue Oct 31, 2019 · 5 comments

Comments

@MaximKutovoy
Copy link

Some tables do not open or wrong read, while others in base open good. Windows-1251 encoding.

acc_list.zip
clarion

@MaximKutovoy
Copy link
Author

Please help read this file

@Trinitek
Copy link
Owner

Trinitek commented Nov 1, 2019

I've identified at least part of the issue, that being that the parser does not interpret Group fields correctly. Your data is being shifted by 10 bytes, which is the total length of the REU and NUM fields that belong to the ACC group.

When I get this fixed and write some tests, would it be okay for me to include your attached file in the integration test?

@MaximKutovoy
Copy link
Author

Yes, of course. I can send another file where there is a problem.

@Trinitek
Copy link
Owner

The latest commit a1194a9 should return the correct table structure with a call to BuildTable(). Group members are not expanded, so you will need to iterate them to get the inner values you want. In other words, the Value property on the ACC group will be a IReadOnlyList<TpsObject>. The first will be the value for REU and the second the value for NUM.

I haven't made a new release yet because I'm still working on getting TpsArrays to deserialize properly. If you are interested in using Deserialize() instead of calling BuildTable(), TpsGroup deserialization should work fine for your purposes, but you will need to deserialize the whole group to a TpsGroup property and enumerate it the same way as above to get the inner values.

[TpsField("ACC")]
public TpsGroup Acc { get; set; }
var reu = (string)Acc.Value[0].Value;
var num = (string)Acc.Value[1].Value;

@MaximKutovoy
Copy link
Author

Thank you so much. Now I can get normal data. I will wait for the release.

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

No branches or pull requests

2 participants