LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a tree control to visualise the steps of a programme

Solved!
Go to solution

 


I want to make a tree with 2 colomns in the. uir. and i have a sequence of a programme in the main. c. 

In the first colomns of the tree i want to display in witch step of the program i am. In the second one i need to display if the test done in every step is pass or fail like the following example :

colomn1.                               colomn2

step1 :initialisation.  

step2 :camera control 1.    test pass

step3: camera control2.      test fail

step4:...…

 

How can I do that.

thanks in advance. 

Message 1 of 5
(2,229 Views)

CVI comes with some examples that demonstrate the use of tree controls: have you looked at them? If yes, can you describe a bit more where you are having difficulties in using the tree?

 

As a side note, are you sure you need to use a tree control? Based on your description I could imagine that a table or even a listbox would be enough to display test results, and are a lot simpler to code than the tree control!



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(2,153 Views)

thanks Roberto, well I'm on an automatic machine cycle and I wanted to make the cycle more clear and understandable for the operator by indicating the current step of the cycle. that's why I thought of making visible the number of the step and its descrtiption in a colomn and in an other one inform him of the result of each step wether its pass or fail because it gives the possibily to display lines of messages and with multiple number of colomn.

I didn't use it before so i didnt knew how to display messeges one after another automaticly on it.. 

0 Kudos
Message 3 of 5
(2,108 Views)
Solution
Accepted by topic author ch1994

In your situation you could prepare the tree by creating items for the test steps with InsertTreeitem, leaving column 2 empty.

During test sequence you could add "Testing..." and then test results by calling SetTreeCellAttribute (panel, control, indexOfRow, IndexOfCell, ATTR_LABEL_TEXT, "A string");

What I was saying is that you could have the same effect using a table or a list control which are a bit easier to use.

The only reason I would use a tree is in case I want to keep all tests executed on screen: the tree gives you the possibility to collapse past tests and leave the unit under test expanded; the operator could at any moment go and expand some single unit records and look at test results.Something like that:

+ Unit 1   S/N 123456    PASS
+ Unit 2   S/N 123457    PASS
- Unit 3   S/N 123458    FAIL
  + Step 1   PASS
  + Step 2   PASS
  + Step 3   FAIL
+ Unit 4   S/N 123459    PASS
+ Unit 5   S/N 123460    Testing...
  + Step 1   PASS
  + Step 2   PASS
  + Step 3   Testing...

Here unit 3 results have been expanded to see which test failed while the machine is going on testing another unit. Unit 1, 2 and 4 are collapsed to save screen space.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 5
(2,051 Views)

Thanks Roberto for your answer it was helpful, I used the tree with InsertTreeItem and I incremented the index for each Item with every step of my program. I had  the same result I was hoping in the photo below .

Thanks a lot ✌️😊

 

0 Kudos
Message 5 of 5
(1,986 Views)