Example: Universal Probe - LabVIEW Data to Tree Control
The Universal Probe is a Custom Probe that can view any data, by populating a LabVIEW Tree control with the data. Its input type is a Variant, and it dynamically parses the data. The the "Using the Universal Probe" section, below, on how to use the Universal Probe to probe anything and everything.
For a download and more info visit the Universal Probe page at OpenG.org
This is one way of doing it. Basically start from the parent and for each parent add its children to a queue. Then go over all of them until the queue is empty. There's some cleanup to do, but it shows the basic concept.
Try to take over the world!
Attachments:
tree_v2.vit 22 KB
Similar Messages
-
LabVIEW 8.6 Tree Control Run-time Shortcut Menu in Executable
Has anybody else noticed that the options Open/Close All Items have disappeared from the shortcut runtime menu of a tree control when the application is built? I recently upgraded from 8.5 and those two options have disappeared from all of the tree controls in my application. I tried customizing the menu and adding the options to the menu. Now they appear but on some controls they are disabled and on the others where they don't appear disabled, they simply don't work. Everything works great in the development environment.
I built an executable of one of the LabVIEW tree control examples and the same thing happens. Is this a bug that has already been reported somewhere?
Thanks,
Erin
Attachments:
TestTree.zip 79 KBDear Erin,
I have been able to reproduce the issues you are reporting. I have opened a Corrective Action Request so our R&D Engineers can fix this issue in future versions of LabView. Thank you very much for your feedback. It will be of great help to enhance National Instruments products.
Greetings,
David
National Instruments
Message Edited by Support on 01-29-2009 11:54 AM -
Copying data between tree controls
I am currently using a tree control to list the tables in a database
(with columns as the children under each parent table). Since I
need to duplicate the tree control several times on the front-panel and
display the same data in each, is there a simple way to use data from
one tree control to populate the others? While I could get around
this problem by writing a subVI and running it for each tree control,
it seems as if it would be more efficient in terms of time and memory
to build one tree, and then copy it to the others.
The only other option I can think of is to write a subVI that traverses
the template tree and duplicates all tags in the target tree. The
problem with this, however, is I don't see a way to duplicate the
display text that was associated with each tag.
Any suggestions?
Thanks!
BradFor some reason the attachment did not go through. Re-attaching ...
Attachments:
Tree Transfer.zip 16 KB -
Problems handling xml data for tree control.
Hi,
I have tried using tree control for displaying my xml data
but I had a problem that i did not have labels in my xml data. A
sample xml data is attached. So it displays the whole data at each
level in the tree. The root label will be the entire the xml data
and then one level down the remaining xml data and so on...
How do i solve this issue i,e get the tags names itself as
labels..
Thanks in advance....An update after some efforts..
Could get the folders perfectly i.e until the level of
CPUTime perfectly but could not get the leaf: 32 since i used the
following to set the label.
I would like to know if there is a way to find out if a node
is a leaf or folder and according set the label -
Save Labview tree Control to file and Load from file
I want to save all of the information from my Labview (8.2) tree control to a file and be able to read it back from a file and re-populate the tree control. I am using different symbols as well as multiple columns and level of children in my control. Does anyone have any suggestions on how to do this?
Thanks
Steve M.
Attachments:
tree pic.jpg 60 KBHi Steve,
I found a DF that talks about saving the tree to a spreadsheet file and have included it in this message. To get items from the tree control, you have to use open up the tree and remove all of the items off of that tree, while still preserving the heirarchy of the tree. The indent level property node will preserve the heirarchy of the tree and from there you can get the item tag and cell string.
To transfer the file to a tree, you will then need to read the file and insert items into the tree corresponding to the heirarchy. I have also found a tutorial on how to traverse tree controls.
I hope this helps.
Regards,
Nadim
Applications Engineering
National Instruments -
Items in Tree control move around when data is submitted using custom ItemRenderer
I'm working on a Tree control with an XMLListCollection as
its dataProvider.
The dataProvider has information looking like this :
quote:
<?xml version='1.0' encoding='utf-8'?>
<INFO>
<FIELD label="STR_USER_NAME"
type="text"
value=""
>
</FIELD>
<FIELD label="STR_USER_EMAIL"
type="text"
value=""
>
</FIELD>
<FIELD label="STR_OPTIONAL"
type="branch"
value="0"
>
<FIELD label="STR_USER_ADDRESS"
type="text"
value=""
>
</FIELD>
<FIELD label="STR_USER_POSTAL_CODE"
type="text"
value=""
>
</FIELD>
</FIELD>
</INFO>
So in the Tree control I'd like the information to show up
with a label and
an
editable textbox for each item :
[Label] [textbox]
To do this I made a tree like this :
quote:
<mx:Tree id="userTree"
editable="true"
rendererIsEditor="true"
editorDataField="curVal"
itemRenderer="{new ClassFactory(ItemRendererUser)}"
itemEditEnd="e_ProcessData(event);"
dataDescriptor="{new DataDescriptorUsers()}"
showRoot="false"
verticalScrollPolicy="{ScrollPolicy.AUTO}"
/>
where the e_ProcessData() function looks like this (I used
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/js/html/wwhelp.htm?href=c
elleditor_073_16.html#202105 as a guide) :
quote:
public function e_ProcessData(event:ListEvent):void
event.preventDefault();
userTree.editedItemRenderer.data.@value =
ItemRendererUsers(event.currentTarget.itemEditorInstance).curVal;
userTree.destroyItemEditor();
userTree.dataProvider.notifyItemUpdate(userTree.editedItemRenderer);
} // END OF e_ProcessData()
I attached the rest of the files because they're a little
bit longer.
When I run the program, the data shows up fine when it is
initialized the
very
first time, and I made a test button that just dumps the
contents of the
dataProvider in a trace statement to verify that the data has
been set
properly.
The problem I've run into is whenever the textfield is
edited, the item
that
I've selected jumps around the list.
For example, if I edit the item "STR_USER_NAME" after I
finish the edit, it
will move from the very first position in the Tree to the
bottom of the
Tree.
I traced the contents of the dataProvider and the
dataProvider structure
stays
the same, with the "STR_USER_NAME" at the top, but if I look
at the flex app
in
the web browser, its position is at the bottom of the Tree.
This happens for every other item I try to edit... I read in
the
documentation
that the ItemRenderers are recycled, so it means I should be
checking to
make
sure the initial states are covered, but I'm not sure how
this affects my
application.
Can anyone help me out with this ? Its very confusing - I've
tried making
an
ItemRenderer using pure actionscript, mxml and the
combination you see in
this
example and I always end up with the same behaviour - So I
must be missing
something critical...
// ItemRendererUsers.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="
http://www.adobe.com/2006/mxml"
verticalScrollPolicy="{ScrollPolicy.OFF}"
horizontalScrollPolicy="{ScrollPolicy.OFF}"
creationComplete="initItemRendererUsers();"
>
From my FAQ:
Q: I've created a custom itemRenderer component to use in a
List
based component (Datagrid, TileList, HorizontalList, etc.).
When my List
first displays, everything looks fine, but when I scroll it
or change the
dataProvider, some of the itemRenderers show values or
formatting that
aren't right. How do I fix this?
A: List-based components don't draw a renderer for every item
in the
dataProvider. Instead, they create enough to display what is
on screen now,
plus one or two more waiting in the wings. This means they
recycle the
renderers rather than creating new ones when you change
dataProvider or
scroll up and down. When you use a creationComplete event to
set up the
itemRenderer, that event doesn't happen again when the
renderer is used for
a different set of data. The solution to this is to override
the set data
protected function that most components have.
For more information, check out the following resources:
http://www.adobe.com/devnet/flex/articles/itemrenderers_pt1.html?devcon=f1
http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html
Please note, I post this FAQ weekly, and you can find a
permanent copy of it
here
http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf"peterh8234" <[email protected]> wrote in
message
news:gaqttd$kft$[email protected]..
> Yes - the set and get functions are listed down below.
But the quirky
> behaviour
> is the same regardless of whether I override the set and
get functions or
> not.
>
> I noticed there was another variable called listData -
should I be using
> that
> one or the data variable to read and write to the
dataProvider ?
>
> // _data
> [Bindable] public var _data:Object;
> [Bindable("dataChange")]
> //
> override public function get data():Object
> {
> trace('[ItemRendererDefault.GET data()] called for {' +
> _data.attribute("label") + '}.');
> return _data;
> } // END OF get data()
>
> //
> override public function set data(value:Object):void
> {
> _data.@value = inputText.text;
> trace('[ItemRendererDefault.SET data()] called for {' +
> _data.attribute("label") + '}.');
>
> invalidateProperties();
> } // END OF set data()
Your set data needs to set a flag that gets picked up in
commitProperties()
and does your thing that you were doing before in
creationComplete. You
should see examples of this in the links I posted. Instead of
this:
_data.@value = inputText.text;
you should look at implementing IDropInListItemRenderer,
which will allow
you to dynamically determine which field to look at, instead
of hardcoding
it. You also might wind up overwriting the stored value with
a null value
when the List passes the stored value in. I'd encourage you
to really go
through those links I posted and make sure you understand
what they're
saying. The itemRenderer life cycle is one of the hardest
things to
understand, but once you understand it, it makes many things
in Flex much
easier. It's worth investing the time. -
Can I edit the data already displayed in tree control?
I'm using a tree control to display some data in front panel. But after running the program, can I edit the data already displayed in tree control by using input control and let it change and display dynamically? In invoke nodes I can only find add or delete items in tree but can't find edit...
There is no direct editing option available, same can be achieved in two steps by using
--> Add Item Invoke Node
--> Delete Item Invoke Node
I am not allergic to Kudos, in fact I love Kudos.
Make your LabVIEW experience more CONVENIENT. -
Hi friends.........
Iam using flex tree control data coming from coldfusion file to display grid. As i click the tree folder to change the data from dynamic from grid.
How to pass the folder id from coldfusion file.. Is it possible ?.. Means give any example please....
Any One Help Me......
With Regards.,
Lingu.......When you set the dataProvider for your tree control, you actually pass an array or arraycollection or whatever to that property. The array contains objects coming from your server, right? Each object should contain a property with the folder id, something like:
var arr:Array = [{id: 1, folderID: 34, name: "..."}, {id: 2, folderID: 4, name: "..."}, ...];
Now, when you click an item in your tree or your dataGrid, you can access the folder id by:
myTree.selectedItem.folderID
Hope this helps
Dany -
How to get access to Row Data (Child Text) in a Tree Control Pragmatically?
In LabVIEW 2010, I have entered Row Data into a Tree Control pragmatically using the Add Item method and providing the Child Text array and the Child Tag for the Row. When a Row in the Tree Control is selected, I can get the Row Tag in the Value Property of the Tree. But how do I access the Child Text array data when the Row is selected? I can't seem to find a Tree Control Property or Method that will return that data back again.
What I am trying to do is: once a Row in a Tree is selected and a button is pushed, if the Row Tag is valid, I want to transfer all of the Row data into another similarly formatted Tree. To do that I need the Row Data for the Tree and Row that was selected. I can not find a way to get access to this Row Data after it has been entered into the Tree.
Can anyone tell me how to pragmatically access the Child Text or Row Data in a Tree Control from a selected Row in the Tree? I have the Tag for the Row, but how do I access the data?
Thanks for your assistance.
Solved!
Go to Solution.As mentioned in the posting here, you can use the Active Item:Tag property to set the item to which subsequent property changes apply. This includes pulling the Active Celltring values out in a for loop as you increment the Active Cell:Active Column Number to get the row's Child Text data programmatically as I was originally wanting to do.
Note that wiring a 0 to the ActiveColNum property and reading the String value will return the tree item's visible name (in column 0), but not the unique item Tag (which is somewhat intangible after its creation). Therefore, I save the unique item tag when I add the item to the tree control (the output of the Add Item invoke node) and store it as a separate column of the Child Text array and place it out of sight in the tree control so I have access to it later. It might be useful, it might not.
I find the tree control totally non-intuitive and not well explained anywhere, but that's how a lot of LabVIEW coding is I guess. Play with it long enough and you become an expert. I had to learn the hard way, but I hope this helps someone else.
-Richard
"Computers are useless. They can only give you answers." - Pablo Picasso -
Unnecessar​y Code - Directory Hierarchy in Tree Control.vi Shipping Example
Hello,
Can you guys take a look at the shipping example Directory Hierarchy in Tree Control.vi (---\Program Files\National Instruments\LabVIEW 2010\examples\general\controls\Tree Control Directory.llb\Directory Hierarchy in Tree Control.vi on my machine) and let me know if you see some unnecessary code? I see what seems to be two different updates of the same front panel control in the TRUE frame of the case structure in the middle of the diagram. I can't think of the reason why you would need both updates of the Path to Start the Search control. I think one of the updates would be good enough.
Thanks!Sorry.
Here it is.
Attachments:
Directory Hierarchy in Tree Control BD.png 32 KB -
How to capture right click event on LabVIEW tree control? Thanks.
Here is an example. You cannot get the right click itself--you get a mouse down and see if the right button was clicked.
Attachments:
Untitled.vi 25 KB -
Not able to get the database data into the Tree Control
Hi Everybody,
I have to populate the tree control with nodes and items, which is to be populated from the database, and the tree control is <b>dynamic</b>. I mean, there is a <b>toolbar</b>, whenever a <b>pushbutton is clicked</b>, depending on that the tree contents has to be changed.
If anybody had worked with <b>CL_GUI_COLUMN_TREE</b> control to get the data from database, depending upon the <b>pushbutton selected in Toolbar</b>, please paste the seudocode for it.
Regards,
Abdul,
Intelligroup.
P.S: Helpful answers will be rewarded.have you seen this demo program
SAPCOLUMN_TREE_CONTROL_DEMO
Regards
Raja -
How to use the drop event of the tree control in LabVIEW 8.20?
Hi,
I am using the two tree controls in my application to provide a option for the user to drag and drop item from one tree to the other. I have to validate the user selection. I tried to capture the user drop event using the event structure. The problem I am facing is, I am not able to drop the item even though i have wired a constant true to the filter(Accepted?) in the event case. I have enable the property(Allow droping) in the right menu of the tree control also.
While configuring an event case for (drop, drag entered and some thing like this) only I am getting the problem otherwise it is working fine.
What do i need to do to caprture the drop event ?
Is there any way to avoid the item duplication while droping a new item in the tree control ?
or how can i do this?
Thanks,
Pandiarajan RHi Pandiarajan,
I hope you are doing well today! There is a lengthy discussion on the Tree Control Drag & Drop feature at this forums post including contributions from the developer of the Drag & Drop feature:
Tree Control Drag & Drop in LabVIEW 8
By avoiding item duplication, do you mean that you don't want the same item to be in the old tree control or do you not want more than one item in the new tree control?
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies -
Tree-control for data input?
Hi,
I need to program an input screen for values that have hierarchical dependencies (e.g. sums). I feel, the most adequate user-interface would be a tree control, because of the data dependencies and also because the users asked for a possibility to collapse/expand parts of the data during input.
I had a look at CL_GUI_COLUMN_TREE, but I'm not sure, if it can be used for data input. Has anyone done something like this before or can anybody direct me to some additional sample coding? (the sample coding in the reuse library didn't do it...)
Thanks for your help, greetings, Kathrin!Hello Kathrin,
Since you say that the user's input is hierarchical in nature, it is nice to have a tree-control for input. But, the choice of using a custom-control-version of the tree is a cause for some concern. I cannot recollect any of the SAP screens where the input can be given through such a tree framework (please do let me know if you have come across one). The problem with such a tree would be in the areas of even-handling. Filling the tree with appropriate data at the right times would be another challenge.
However, there's one alternative that I would like to direct your attention to. You must have observed another kind of tree, when you select an application component from the APPLICATION HIERARCHY, which is just like a list. Also, the <i>Transport Organizer (SE09)</i>, <i>Menu Painter (SE41)</i> etc., have this kind of a tree. You can use this if you (or rather your users) are very particular on having a tree display. For more information, you can see the Function Group <b>SEUT</b>, which has the required function modules to accomplish the same. The Function Group is well documented, and you might have to work a little on the function modules themselves.
Please do let me know if this is a suitable option to meet your requirement. All the best,
Regards,
Anand Mandalika. -
LabVIEW 7 Tree Control - Selected Item
Hi,
Has anyone tried the new Tree control in LV7 yet? I can't seem to find a method to programatically determine what item in the tree has been selected by the user other than if the user has double clicked on the tree - can someone point me to the method? From a user interface perspective double clicking an item in a tree shouldn't be the only way to select an item and as a side effect double clicking on the LV7 tree item closes a branch if there are children under the node double clicked on, which is very undesirable when only selecting an item.
Cheers,
WayneWPS,
The tree control's data, which is available from its terminal, is the tag(s) of the selected item(s).
-Jim
Maybe you are looking for
-
No digital audio in/out - help
Cannot establish a digital audio out/in connection. Stuck in analog mode. When I plug in a mini toslink the audio OX driver audio device indicates "headphones". There is no red signal being emitted from the optical cable either. Cable checks out ok o
-
Ipad numbers pop up menu calculation
Hi I am using numbers on my ipad and have two questions. I have a worksheet which has a column with 15 cells that all have a pop up menu. The menu has two choices for answers a: girl b: boy. I need to create a function that will calculate how many bo
-
How to Rotation 3D Image in LabWindows/CVI
Hi All I have a 3D image and i want to rotate its x,y and z axis, how it is possible kindly help me. Regards Umer
-
Well where has I tunes sent my movie rental?
-
PLEASE HELP ME! THIS HAS BEEN HAPPENING FOR ALMOST A MONTH NOW!
Everytime I go on itunes with my internet motem connected it shuts down my computer. It works fine if I have the internet off and no ipod plugged in, but as soon as i put my ipod in or use itunes with internet it shuts down and restarts my computer.