09-24-2019 04:11 AM - edited 01-24-2020 08:29 AM
Author: Piotr Kruczkowski
Copyright: Copyright (c) 2019, National Instruments
License: Sample Code License
Compatible LabVIEW Versions: >= 2019.
Compatible OS Versions: ALL.
Description:
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.
https://en.wikipedia.org/wiki/Tree_(data_structure)
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
KNOWN ISSUES:
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,
11-14-2019 08:11 AM
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.
11-14-2019 03:07 PM
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.
11-15-2019 03:12 AM
I am already fixing it another way. I don't want to touch schemas, I am deathly afraid of regular expressions 😄
12-15-2019 09:10 PM
Hey Piotr,
This looks really interesting. I've been working on something similar here:
https://github.com/tannerblair/advanced-labview-variant-tools
It currently does json instead of xml, but I'm interested in comparing notes if you are interested.
12-16-2019 03:49 PM
Hi Piotr,
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?
12-17-2019 06:54 AM - edited 12-17-2019 07:14 AM
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 🙂
12-17-2019 06:55 AM
I am working on publishing it as we speak 🙂
12-18-2019 10:43 AM
12-18-2019 11:20 AM
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.