.NET Enums

Hello again,

I'm pursuing using the HDF5 enumerations for storing some data (primarily sensor health & status). And yes, this is all in .NET with C# using the 'unsupported' wrappers.

I'm having trouble getting the data back. I notice the test_enum_dtype() in the HDF5DotNetTests/dtypes project goes through the gyrations of reopening and reading the data it has written, but then no checks are done on that data. I did, and it fails pretty miserably. While the original data are rows of 0's, 1's, & 2's; the return data are mostly 0's with a few 1's in the 2's row.

I tried adapting the charArray struct which worked in reading the strings, but doing so yielded no better results. As a side note I had to downgrade to a 1D array of enums because the .NET Marshal class doesn't handle 2D arrays.

I don't suppose someone has a working example of using Enums using HDF5DotNet?

On the plus side, it is relatively easy to dynamically build an HDF5 enumeration type from a .NET enum.

Scott

···

________________________________
This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.

<EmilyLatella>Nevermind</EmilyLatella>... kinda.

There is a bug in the test_enum_dtype's enum type definition. Since the dtypes enum test actually creates the type twice but with different underlying type sizes; NATIVE_INT vs. NATIVE_SHORT.

When I make them both NATIVE_SHORT, the H5D.read works. I'm still having trouble with enumerations as part of a composite structure.

Scott

···

From: Mitchell, Scott - AES [mailto:Scott.Mitchell@itt.com]
Sent: Monday, June 01, 2009 5:33 PM
To: hdf-forum forum
Subject: [hdf-forum] .NET Enums

Hello again,

I'm pursuing using the HDF5 enumerations for storing some data (primarily sensor health & status). And yes, this is all in .NET with C# using the 'unsupported' wrappers.

I'm having trouble getting the data back. I notice the test_enum_dtype() in the HDF5DotNetTests/dtypes project goes through the gyrations of reopening and reading the data it has written, but then no checks are done on that data. I did, and it fails pretty miserably. While the original data are rows of 0's, 1's, & 2's; the return data are mostly 0's with a few 1's in the 2's row.

I tried adapting the charArray struct which worked in reading the strings, but doing so yielded no better results. As a side note I had to downgrade to a 1D array of enums because the .NET Marshal class doesn't handle 2D arrays.

I don't suppose someone has a working example of using Enums using HDF5DotNet?

On the plus side, it is relatively easy to dynamically build an HDF5 enumeration type from a .NET enum.

Scott

________________________________
This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.