LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Does not LabWindows save all the edit changes?

I am going to explain the procedure I am using to customize an specific control. Maybe

the explanation is too much detailed, but I would like you understand the problem.
I have attached a sample project to reinforce this.

Objectives:
To make a numeric dial or similar that:
1- Its minimum value be 0, its maximum 360, and both values coincide.
2- increases its value in opposite direction of the clock hands
3- the only values it shows are this: 0, 45, 90, 135, 180, 225, 270, 315
(in radians, 0, pi/4, pi/2, 3pi/4, pi, 5pi/4, 3pi/2, 7pi/4 )

Getting the first and second objectives is quite easy:
1- Its minimum value be 0, its maximum 360, and both values coincide.
- Create a numeric dial
- Make it big
ger, to make management friendly (125x125 píxels for example).
- At the edit control panel, you make the following changes:
Range values: min 0; max 360
Format&precision: Precision: 0
At the "Quick Edit Window" (upper & right corner):
-put the mouse over the 0 value, and then drag it, exactly, to the 360 value
-again, put the mouse over another value than 0 or 360 and drag it until both values were at the right of the circle.

2- increases its value in opposite direction of the clock hands
- At the "Quick Edit Window", click the text editor button (A) and then click the 360 value to edit it. Change the 360 for 0.


The third objective seems to work well at first:
3- the only values it shows are this: 0, 45, 90, 135, 180, 225, 270, 315
- Making the same as the second step, click the text editor button and then click the 40 value to edit it. Change the 40 for 45.
Well, it seems to be that we are looking for.

If we run the project now, we could observ
e like the panel have not saved the third step.

Could anyone tell me what I am doing wrong? Any alternative ideas?
0 Kudos
Message 1 of 3
(2,892 Views)
Hi Silmarba,

In my opinion, the behaviour you observe depends on that CVI recalculates all graphical objects before painting them on the screen.
I don't know if there is a way to modify this behaviour, so I think you should use an alternative way of doing what you want.

Look at the attached file: I modified your project adding a ring dial and a numeric and filling programmatically the ring with the correct values.

This permits to:
- have the ring filled with all the values required (I generated only integer values, but in case you need them you can easily add fractions)
- show only the desired values (at 45° step as you stated)
- show the desired label (if you want angles in radians, you can generate the appropriate label)

This method ha
s some little problems to be aware of:
- you don't have a continuous variation of the angle value while moving the dial (ring is essentially a discrete instrument)
- you cannot paint the ticks, otherwise a black ring appears between the dial and the labels
- you need an additional numeric to display the actual angle value in digits, 'cause the dial hasn't a built-in digital display

Hope this helps
Roberto


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 3
(2,892 Views)
Hi Roberto,
I have looked at your code but is more important for my application that the control have a continuous variation of the angle value rather than it only shows the angle values I told you.
For that reason, it is not a valid solution this time.
I am very grateful for your help anyway.

Kisses,
Silmarba
0 Kudos
Message 3 of 3
(2,892 Views)