Jump to content

drjdpowell

Members
  • Posts

    1,881
  • Joined

  • Last visited

  • Days Won

    164

Everything posted by drjdpowell

  1. I remember CognoscentUI being quite impressive: https://forums.ni.com/t5/Example-Code/CognoscentUI-XControl-LVOOP-Animation-Unicode-and-Image/ta-p/3495160
  2. JKSH has explained as well as I could the expected use. "Missing from Object" is determined when operating on the Object. I had a look, and it should be reasonably easy to give a different error for a string with only whitespace, but I'll need to understand use case for it better. I, personally, never find the need to write custom error-handling code. By the way, if one's use case is "set from this JSON as much as possible, or use supplied default for items where this is not possible", then one can just not use the error wires at all.
  3. I am actual about to commit to making the next release in LaVIEW 2019, rather than 2017, as VIMs were very new in 2017 and both buggy and of limited capability.
  4. Use case? Why do you need different custom error than the 402841: "Invalid JSON formatting" that you have now?
  5. Since Latin for six is "sex", we could have gone for "sexidecimal".
  6. So? Main.vi knows it might need disposing, as it did the creating, so do the cast.
  7. Note that System could have a method to remove the Transport ("uninject"?). Main.vi can remove the TCP and dispose of it, just before it disposes of System.
  8. The problem I have with the Network Streams QoS arguement is that TCP already does this, using ACKs and retries to ensure an ordered stream. And if I really needed to be sure a message is handled, I need to verify it all the way through the application to the final result, not just through the Network Stream message delivery. For example, if I need to send something to be saved to disk, I need QoS all the way to disk, and would have to implement a custom buffer on the send side, layered on top of Network Streams.
  9. I've never used Network Streams. It appears to me to be an API that makes TCP communication easier, for a specific use case of a one-way stream. But I've seen, on more than one occasion, people use it build APIs for entirely different use cases, ones that would (in the end) be simpler and more performant to base on straight TCP.
  10. I've done this kind of thing, with a 32-bit-only dll needed from a 64-bit one. Actually, it was two 64-bit Test Stations that both needed the same info from the 32-bit equipment, so having both be Clients of the 32-bit Server worked well. I used the TCP capability of Messenger Library, which is very little effort. One question: why Network Streams? If you are wrapping things in your own API then why not a standard TCP connection? What are Network Streams giving you?
  11. Your DB Browser and LabVIEW are possibly using different versions of sqlite. Can you run this in each to detect the version: select sqlite_version();
  12. Does anyone actually use Variants in clusters in this way? To me, this is not even a tertiary use case of JSONtext, so it would be helpful to hear from people with real-world uses. I am tempted to suggest throwing a "Variants not supported" error, but even that would add overhead which I am loath to do.
  13. Please try this fix: jdp_science_jsontext-1.6.6.106.vip
  14. Issue 92: https://bitbucket.org/drjdpowell/jsontext/issues/92/all-integer-types-needed-for-set-map
  15. Again, Variants are tricky, and have two names and serve two purposes. Viewed as a container of named data, your Variants are just placeholders, not actual data themselves (which is why I suggested in the last post to put a named Variant as Data inside the placeholder).
  16. Consider just not including those parameters. Rather than {"A":123,"B":null,"C":789} just have {"A":123,"C":789}; then "B" will be default. Alternately you could put named-Variant values inside your variants (which teh Variant-to-Data node will pass through: Variants are quite tricky, as they can serve both as a temporary container for a value, and a value itself.
  17. LabVIEW Clusters and Arrays do not map directly onto JSON Objects and Arrays. LabVIEW Clusters are fixed-size ordered sets of optionally-named values JSON Objects are variable-size, unordered sets of must-be-named values LabVIEW Arrays are variable sized ordered sets of values all the same type JSON Arrays are variable sized ordered sets of values that can all be different type So a LabVIEW Cluster with unnamed elements cannot map onto a JSON Object, but can map onto a JSON Array. Similarly, mixed-type JSON Arrays cannot be converted to a LabVIEW array, but can be converted to a LabVIEW cluster (assuming you know the number of elements and types). JSONtext thus supports two mappings for LabVIEW Clusters, as explained in Help>>JDP Science>>JSONtext...
  18. People who wish to use Variants and JSON generally want to do this: Put Static-Typed Data in a Variant in a larger data structure Convert larger structure to JSON Send the JSON somewhere Convert JSON back to larger structure (containing Variant) Convert Variant to Static-Typed Data But Step (4) is a big problem, as at that point we don't have access to the Type-description information to rebuild the Variant. But I say do this: Convert Static-Typed Data to JSON Assemble larger JSON from this subJSON Send the JSON somewhere Extract the subJSON Convert subJSON to Static-Typed Data This avoids the problem, as we only need the Type at the first and last steps,where we statically know the type.
  19. I've had multiple requests to "support Variants", but there is a mismatch between Variants (Data plus full type description including name) and JSON (Data with only weak type info: string, number, etc.). To support unflattening JSON to Variant would require a form something like this: { "VarA":{"Variant type":"long","name":"TypedA","Value":123}, "VarB":{"Variant type":"long","name":"TypedB","Value":456} } But this is a rabbit hole I'm not going down. I'd rather ask "Why are you using Variants here instead of subJSON?" This gives you the behaviour you expect:
  20. That is arguably not a bug, as Variants involves two names: the name of the Variant, and the name of the data contained in the Variant. In your case your empty Variants contain unnamed void data, and JSONtext flattens clusters of unnamed elements as JSON Arrays. It is not obvious if it is the best choice to use the data name rather than the Variant name. However, I am sort of tied to the behaviour of the Variant-to-Data node that I use internally to convert Clusters to Arrays of Variants. See this example: Note that Typed clusters and Clusters of Variants containing Typed Data both convert identically, while Variant elements of a cluster never retain the names of the Variants themselves, just the name on the Data in the Variant). The produced JSON matches these choices, made by the programmers of the Variant-to-Data node.
  21. The Object thing is not where I would spend limited effort in performance improvements, as I would expect the User to actually use the item Values and thus require a copy at some point. I would rather improve the JSONpath search algorithm.
  22. I hope Users can do whatever they want using the lower-level functions plus subJSON with the <JSON> tag.
  23. There is support for Sets and Maps in the latest version; I wouldn't want such things require any kind of "hook".
  24. Alternative (6): all attributes are returned as JSON values. Rather than get the attribute as the actual type, the User would get the attribute as a string, then use From JSON to convert to type. One could make VIMs that combine these two steps, and these VIMs might possibly be made to work with non-JSON attributes as well.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.