Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Knob problems

Here are list of steps which result in my  problem, which occurs programatically as well as in the vc++ resource editor.
1) Create a top gauge  meter with a range of 0 to 10.
2) Add a pointer that is invisible, set the fill colour to blue and fill value to less than 3
3) Add a pointer that is invisible, set the fill colour to green  and fill value to less than 6
4) Add a pointer that is invisible, set the fill colour to red and fill value to less than 10
note the orig pointrer should be set to visible with no fill style
 
 
Now siwtch style to 'dial' all the fill info is lost and needles become visible, -is this a known bug?
Also when Iam using a knob control how do Programatically turn off the numeric labels on the scale but keep the ticks, it cna be done easily with vc++ resource editor.
I thought there would be a setvisible method in CNiLabels, but that is not the case
Also having a problem with the NINumedit component when comes to redrawing its 3D border, seems to loose it after it gets focus. The component  then becomes flat style component.
If i force a redraw by resizing  the formview it sits on it regains its style.
My version of mstudio is 7.1.0.306.
 
Cheers,
Paul
0 Kudos
Message 1 of 3
(5,213 Views)

Hi,

  With regards to the pointers on the CWKnob control, this was reported to R&D (# CAR 44A4POW3) for further investigation.
R&D is currently investigating this issue.

As far as making the labels dissappear, you can do this using ValuePairs (for every major tick, you need to put in a value pair) :

// Specify the axis range and tick spacing for the CWSlide control.
m_knob_control.Axis.Maximum = 10;
m_knob_control.Axis.Minimum = 0;

// Set divisions to zero to display control without ticks and labels.
m_knob_control.Axis.Ticks.MajorDivisions = 0;
m_knob_control.Axis.Ticks.MinorDivisions = 0;

// Add a value pair to indicate the low end of the axis value range on the CWSlide control.
CNiValuePair vpair = m_knob_control.Axis.ValuePairs.Add();

// Specify the value pair text.
vpair.Name = "0";

// Specify the axis value with which to associate the value pair.
vpair.Value = 0;

// Add a value pair to indicate a point along the axis value range on the CWSlide control.
CNiValuePair vpair2 = m_knob_control.Axis.ValuePairs.Add();

// Specify the value pair text.
vpair2.Name = "5";

// Specify the axis value with which to associate the value pair.
vpair2.Value = 5;

// Add a value pair to indicate the high end of the axis value range on the CWSlide control.
CNiValuePair vpair3 = m_knob_control.Axis.ValuePairs.Add();

// Specify the value pair text.
vpair3.Name = "10";

// Specify the axis value with which to associate the value pair.
vpair3.Value = 10;

// Specify that the value pairs are associated with the axis values and that the labels are visible.
m_knob_control.Axis.ValuePairs.Location = CNiValuePairs::LocationValue;

// decide if we're showing the labels or not (so Value here is just a boolean flag I was using - obviously you don't need this if you're setting it permanently off)
if (Value)
   m_knob_control.Axis.ValuePairs.LabelType = CNiValuePairs::LabelNone;
else
  
m_knob_control.Axis.ValuePairs.LabelType = CNiValuePairs::LabelName;

 

The third issue of the NiNumEdit dropping it's 3D style border when re-drawing - do you have a small project to demonstrate this?

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 3
(5,157 Views)

Another option (thanks to BilalD for this one)

CWKnob1.Axis.Labels.Radial = False;

Specifies if the system draws radial labels
Note This property is valid only when the axis is radial, such as a

CNiKnob.

You keep the minor ticks, and don't need to use value pairs to acheive it at all (as opposed to the previous post)

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 3 of 3
(5,132 Views)