/// <summary> /// Creates a new <see cref="PhasorDefinition"/> from specified parameters. /// </summary> /// <param name="parent">The <see cref="ConfigurationCell"/> parent of this <see cref="PhasorDefinition"/>.</param> /// <param name="label">The label of this <see cref="PhasorDefinition"/>.</param> /// <param name="scale">The integer scaling value of this <see cref="PhasorDefinition"/>.</param> /// <param name="type">The <see cref="PhasorType"/> of this <see cref="PhasorDefinition"/>.</param> /// <param name="voltageReference">The associated <see cref="IPhasorDefinition"/> that represents the voltage reference (if any).</param> public PhasorDefinition(ConfigurationCell parent, string label, uint scale, PhasorType type, PhasorDefinition voltageReference) : base(parent, label, scale, 0.0D, type, voltageReference) { }
private void buttonPhasorAdd_Click(object sender, RoutedEventArgs e) { ConfigurationCell selectedDevice = this.SelectedDevice; if (selectedDevice != null) { PhasorDefinition phasor = new PhasorDefinition(selectedDevice, "Phasor " + (selectedDevice.PhasorDefinitions.Count + 1), 1, PhasorType.Current, null); selectedDevice.PhasorDefinitions.Add(phasor); listBoxPhasors.SelectedIndex = (selectedDevice.PhasorDefinitions.Count - 1); } }
/// <summary> /// Creates a new <see cref="PhasorDefinition"/> from specified parameters. /// </summary> /// <param name="parent">The <see cref="ConfigurationCell"/> parent of this <see cref="PhasorDefinition"/>.</param> /// <param name="label">The label of this <see cref="PhasorDefinition"/>.</param> /// <param name="scale">The integer scaling value of this <see cref="PhasorDefinition"/>.</param> /// <param name="type">The <see cref="PhasorType"/> of this <see cref="PhasorDefinition"/>.</param> /// <param name="voltageReference">The associated <see cref="IPhasorDefinition"/> that represents the voltage reference (if any).</param> /// <param name="originalSourceIndex">The original source phasor index, if applicable.</param> /// <param name="phase">The phase of this <see cref="PhasorDefinition"/>.</param> public PhasorDefinition(ConfigurationCell parent, string label, uint scale, PhasorType type, PhasorDefinition voltageReference, int originalSourceIndex = -1, char phase = '+') : base(parent, label, scale, 0.0D, type, voltageReference) { OriginalSourceIndex = originalSourceIndex; Phase = phase; }