VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

System Explorer keeps weirdly sorting my CD items

Solved!
Go to solution

Hi,

 

I am developing my first VCD and I noticed that in the System Explorer, when navigating my CD tree, the items sometimes get alphabetically sorted.

It happens only on the first time that I expand one of my sections after building the tree.

Also, the tree is only partially sorted, as some sections still have their children in the original (non-alphabetical) order.

 

How can I disable this? I want the items to be displayed in the order in which I added them.

As the sorting is only partial, it seems more like a bug to me…

 

Here is an example of my tree after the unwanted sorting where my Channels "C" and "M" were originally created in the inverse order "M" then "C".

Also C's children were sorted as C, F, H, S, while M's children still have the original order F, C, H, S.

 

raphschru_1-1681396905583.png

 

Thanks for your help,

Raphaël.

0 Kudos
Message 1 of 7
(2,400 Views)
Solution
Accepted by topic author raphschru

Hey,

you should add <ExcludeFromAlphabeticalOrder>true</ExcludeFromAlphabeticalOrder> Custom Device XML Tag to the CD page definition in your custom device XML.

CLA, CTA, CLED
Message 2 of 7
(2,386 Views)

Thanks a lot, that worked!

 

Now I'm wondering why my items got partially sorted, none of my pages had this XML tag before.

0 Kudos
Message 3 of 7
(2,368 Views)

Well, it works quite well for list of channels with enumerated names (like ChnName_###) but for more complicated trees with mixture of channels and section pages it simply sorts items with it's own weird logic. 

CLA, CTA, CLED
0 Kudos
Message 4 of 7
(2,356 Views)

The logic of sorting is simply the order how it was added (how it is physically store in nivssysdef file)...

CLA, CTA

0 Kudos
Message 5 of 7
(2,303 Views)

After further testing, it seems the way the System Explorer is displaying tree items is even weirder than I thought.

Sorry I had to unmark the proposed solution because I found even more sorting/display problems:

 

 

1. Clicking on the built-in menu item "Open Item Hierarchy" moves the selected item to its alphabetical order, even with the appropriate XML tag supposed to prevent that.

Example:
Initial situation:
raphschru_2-1681980475639.png
After clicking "Open Item Hierarchy" on section "C" (All pages have the XML tag to remove automatic sorting though):
raphschru_3-1681981975853.png

 

 

2. Building the tree at the initialization of the VCD (within InitializationVI) causes an incomplete display of the generated items. I must then click on "Open Item Hierarchy" to force displaying the missing items. On the contrary, building the tree after the VCD creation (e.g. by a menu action) will display all the items correctly.

 

Example:

Building the tree at Initialization: missing channel "C" (I must then click on "Open Item Hierarchy" to force the appearance of the missing item):

raphschru_8-1681982483652.png

Building the tree after the VCD creation: all channels are correctly displayed at once:

raphschru_7-1681982455329.png

 

 

3. Also when building the tree at initialization, the generated sections have inconsistent expansion state. Some are initially open while other are initially closed without apparent logic. On the contrary, building the tree after the VCD creation will make all the generated sections expanded.

 

 

This is a bit of a pain to try to cancel what the tree is doing wrong… The original item order is important for the user because it defines how blocks of data are sent through our protocol.

 

 

So I have further questions:

 

A. Is there a way to remove the built-in items "Open Item Hierarchy" and "Close Item Hierarchy". I don't know if they behave like that for performance reasons or if they are just poorly coded, but I would prefer having nothing rather than counterintuitive functionalities.

 

B. Is there a way to control the expanded state for each item during or after tree creation ? My tree is quite complicated and navigating through inconsistently opened and closed items may be a pain for the user.

 

 

Thanks,

Raphaël.

0 Kudos
Message 6 of 7
(2,212 Views)

Well in the end it seems the tag did the trick, I don't know why I still had these sorting problems after adding it to the XML.

Maybe I just needed to rebuild the custom device and restart VeriStand…

Anyway, concerning my initial question, I can mark it as solved !

 

Regards,

Raphaël.

0 Kudos
Message 7 of 7
(1,875 Views)