Skip to content

nanoFramework Nuget automatic generation #836

@Ellerbach

Description

@Ellerbach

Is your feature request related to a problem? Please describe.
I'm using nanoFramework (see https://github.com/nanoframework/Home) and would like to benefit of UnitsNet unique ability to convert a temperature or a length to almost anything. There are couple of constraints even if nanoFramework is a .NET implementation using C# and capable of using Nugets. IT's very small footprint and on tiny embedded devices like ESP32 with few kilo bytes of memory and storage.

Describe the solution you'd like
In very small embedded solution, size matters and the smallest the best. Ideally, you just bring what you need and have a reasonable balance between size and features. Also nanoFramework has lilimited capacity like no generic, no Linq support.
Ideally, it would be great to generate automatically 1 Nuget package, like for most of the nanoFramework packages, one per unit in a simplified way.
I've implemented with couple of measurements (so they are all grouped in the same project, ideally should be separated) with a minimum set of features that seems to be sufficient in most cases.
I generated those filesby mainly doing copy/paste from the automatically generated content and having few adjustments to make all the FromXXX static factory functions to just take a double as argument.
Example available here: https://github.com/Ellerbach/nanoFrameworkIoT/tree/master/UnitsNet
What can be available and not is adjustable. The static Factory and the properties are the most valuable elements.

Describe alternatives you've considered
Producing manually a specific set of measures, based on the example I gave above. Updated not often. I would prefer the automatic solution.

Additional context
This automatic code generation would make it easier as well to support reusability of bindings (devices) present in .NET IoT (see https://github.com/dotnet/iot/tree/master/src/devices). All sensors are natively using UnitsNet. That would allow more .NET developers to access smaller .NET capable embedded boards like ESP32 using nanoFramework. The example link include some prototype on how this can be achieved. UnuitsNet are part of this all up path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpinnedIssues that should not be auto-closed due to inactivity.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions