Comments (9)
This ticket would greatly aid us in being able to use proto for lower-level data, e.g. bit fields. This is a key item keeping us from more fully adopting proto/grpc-labview as an IDL for interfaces between LabVIEW and other supported languages (py, C++, etc). This came up on the volta project (private repo in NI org), but we've encountered other examples of wanting this use case.
Also, minor note of value from Chris in 20, rings vs enums:
We should create proper rings for them in LabVIEW. Enums can be sparse and have repeated values so we will have to create rings to support all possible enums.
Edit: FYI to @eyesonvis
from grpc-labview.
I think you should allow the user to choose either a ring or an enum. Although an enum is not always possible, it is much better than a ring.
from grpc-labview.
Neither rings nor enums will fulfill all the desired use cases, so we're going to need to decide which benefits are more important.
Rings allow sparse values and localization.
Enums provide better diagram readability (e.g., on Case Structure frames). As type definitions, they will update all instances when the item list changes.
Neither rings nor enums will allow multiple names for the same numeric value.
In my opinion, enums are supposed to be logically independent of their numeric backing value, and so users should have a function that does a look up when they need to get a number for an enum value. Similarly, users can have a corresponding ring for places where localization is required, and a function that looks up the corresponding enum value so that the rings are only UI/API elements, and their numeric value is never used in code.
from grpc-labview.
Listing down some of Enum features as defined in Proto3 and if they can be supported with LabVIEW Ring or Enum
Enum features as defined in proto 3 | LabVIEW Ring | LabVIEW Enum |
---|---|---|
must contain a constant that maps to Zero as its value | Yes | Yes |
use enum type declared in one message as the type of a field in a different message | Yes | Yes |
Enum value must be in the range of 32-bit integer | Yes | No |
Non sequential values | No (can workaround?) | No (can workaround?) |
Aliases - Same value to different enum constants | No | No |
Reserved Values - The proto buff compiler will complain if any future users try to use the identifiers specified as Reserved | No | No |
from grpc-labview.
We're planning to implement this feature using LabVIEW Enums. This means that users will have to call a look-up function to get the numeric value for an enum item.
from grpc-labview.
This means that users will have to call a look-up function get the numeric value for an enum item.
Sorry, what does this mean? LabVIEW Enums are already numbers, so what is this look-up?
from grpc-labview.
The proto buf might say:
A=0;
B=0;
C=1;
D=20;
But the LabVIEW enum will be 0, 1, 2, 3. We'll provide a VI that takes the (typedef) enum type and returns the Int32 value.
from grpc-labview.
Ah, so it would only be if teh User actually needed the numeric value that they would need to use this look up.
from grpc-labview.
Support for Enum type is now present in Version 1.0.0.2 release
from grpc-labview.
Related Issues (20)
- Admin test issue HOT 1
- Test auto issue creation
- Error handling in the examples needs improvement
- Use classes/refnums instead of a U64 ID
- Service method VIs should support non-default error handling
- Installation of gRPC library for Labview HOT 1
- How to Force TLSv1.2 or Http1.0/1.1? HOT 2
- how to setup gRPC for nirfsg with the target file from a Labview example? HOT 2
- Run CI tests action times out HOT 1
- Memory Leak?->Violation? HOT 3
- Error code -999 HOT 3
- gRPC Roundtrip Latency Jitter on LVRT
- Errors while trying to regenerate code after making some modifications in the messages in the same protofile. HOT 2
- Errors while trying to regenerate code after making modifications in rpc methods of a service. HOT 1
- LabVIEW Crash if Client and Server Datatypes Do Not Match
- Potential "Opened File Leakage" Issue when Running with RT HOT 10
- Missing Typedef in Generated code When Enum is Defined inside the Imported Proto File HOT 1
- Missing Typedef in Code Generation When Enum is Defined in Imported Proto File HOT 1
- Missing Typedef in Code Generation When Enum is Defined in Imported Proto File HOT 1
- Missing Typedef in Code Generation When Enum is Defined in Imported Proto File
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpc-labview.