06-29-2017 11:57 AM
I would like to have something similar to the phasor diagram shipped with Electrical Power Controls and I wonder if anyone was able to do the phasor diagram with .NET graph controls? NI has not shipped a built-in phasor diagram control but I guess someone with strong knowledge of measurement studio may be able to create have something with .NET graph controls.
Solved! Go to Solution.
06-29-2017 05:38 PM
Measurement Studio does not have a control specifically targeted to this scenario, but the PolarGraph can be adapted to act as a phasor diagram using a custom renderer. I have attached a small example project that shows one way to accomplish this.
06-30-2017 09:15 AM - edited 06-30-2017 09:18 AM
Thanks, phansen. I am a Winform guy so I did not pay attention to WPF controls and I missed this.
06-30-2017 12:22 PM
A qui
@phansen wrote:
Measurement Studio does not have a control specifically targeted to this scenario, but the
PolarGraphcan be adapted to act as a phasor diagram using a custom renderer. I have attached a small example project that shows one way to accomplish this.
A very quick question - if I want to have the
ScaleKind="Degrees"
How should I create the data range for Plot 1, Plot 2, and Plot 3?
06-30-2017 12:51 PM
Unfortunately, the PolarGraph does not yet support automatic conversion of radian data to degrees (there is an existing task to implement this in the next release of Measurement Studio).
As a workaround, you can convert the data to degrees before sending it to the graph. In the example project, updating the main window constructor with the following conversion logic (in addition to the ScaleKind="Degrees" change you mentioned) will show the original data against a degree scale:
var converted = new Point[data.Length];
for( int i = 0; i < data.Length; ++i ) {
ComplexDouble value = data[i];
converted[i] = new Point( value.Phase * 180.0 / Math.PI, value.Magnitude );
}
graph.Data.AddRange( converted.Cast<object>( ) );