Author: Piotr Kruczkowski
Copyright: Copyright (c) 2019, National Instruments
License: Sample Code License
Compatible LabVIEW Versions: >= 2019.
Compatible OS Versions: ALL.
This package is intended to use the inbuilt LV19 Set and Map data types to provide a Tree Map data type. It includes basic functions and helpers to interact with the new Tree Map type.
In computer science, a tree is a widely used abstract data type (ADT)—or data structure implementing this ADT—that simulates a hierarchical tree structure, with a root value and subtrees of children with a parent node, represented as a set of linked nodes.
This package is a little more open, simpler and more native than the previously available Tree API. It should be considered for all new designs.
Please comment for feature requests and bug reports. Collaboration -> https://github.com/Primary-Key/Tree-Map-API
Visualizing Tree Map in Tree Control - The order of elements is defined in alphabetical order, due to the implementation of Sets and Maps in LabVIEW.
The unique ID generation integer appending to have 6 digits of precision filling with zeroes e.g. NodeName_000001 will be the uniquified node name.
This effect will change the order of nodes only with 1M+ nodes with the same name under one parent, something which should almost never happen 🙂
Thank you and enjoy,
There is one limitation I am finding difficult to solve which is the requirement of LV map to have unique node names. This means that if the XML consists of node names which are duplicated under one parent node, this XML will not load correctly.
This can be remedied by validating the XML against a schema that defines each node to have a unique name. The uniqueness can be enforced by the schema. Then, only use the XML if valid, otherwise error out.
I am already fixing it another way. I don't want to touch schemas, I am deathly afraid of regular expressions 😄
This looks really interesting. I've been working on something similar here:
It currently does json instead of xml, but I'm interested in comparing notes if you are interested.
Thanks for maintaining the Tree library through LabVIEW 2019! We have upgraded from 2018 recently and I've replaced the old instances with this new API. The changes were easy to make and my code has simplified, not having to have a reference to the tree manager.
Will this package be published on a repository for download via VIPM?
Hello Sir, I would love to collaborate. I was already thinking about adding JSON support to my API. Did you have a chance to try it out? Btw. you should use Tree Map or my older Tree API instead of creating a new one 🙂
I'm trying to use the Tree Map in another VI.
I have a Tree of available equipment that a user might use. Previously I manually managed this tree control interactively by adding and organizing equipment. I was trying to use the Tree Map to capture the data of this tree control and print to XML so that it can be managed separate from the VI. I ran into a couple issues using the Tree Map that maybe you have thoughts on how to handle.