/// <summary> /// Creates a new <see cref="PhasorDefinition3"/> from specified parameters. /// </summary> /// <param name="parent">The <see cref="ConfigurationCell3"/> parent of this <see cref="PhasorDefinition3"/>.</param> /// <param name="label">The label of this <see cref="PhasorDefinition3"/>.</param> /// <param name="scale">The integer scaling value of this <see cref="PhasorDefinition3"/>.</param> /// <param name="offset">The offset of this <see cref="PhasorDefinition3"/>.</param> /// <param name="type">The <see cref="PhasorType"/> of this <see cref="PhasorDefinition3"/>.</param> /// <param name="voltageReference">The associated <see cref="IPhasorDefinition"/> that represents the voltage reference (if any).</param> /// <param name="phase">The phase of this <see cref="PhasorDefinition3"/>.</param> public PhasorDefinition3(ConfigurationCell3 parent, string label, uint scale, double offset, PhasorType type, PhasorDefinition3 voltageReference, char phase) : base(parent, label, scale, offset) { PhasorType = type; m_voltageReference = type == PhasorType.Voltage ? this : voltageReference; switch (phase) { case 'A': PhasorComponent = PhasorComponent.PhaseA; break; case 'B': PhasorComponent = PhasorComponent.PhaseB; break; case 'C': PhasorComponent = PhasorComponent.PhaseC; break; case '+': PhasorComponent = PhasorComponent.PositiveSequence; break; case '-': PhasorComponent = PhasorComponent.NegativeSequence; break; case '0': PhasorComponent = PhasorComponent.ZeroSequence; break; default: // If phase is not a value IEEE C37.118-2011 supports, default to positive sequence PhasorComponent = PhasorComponent.PositiveSequence; break; } }
/// <summary> /// Creates a new <see cref="PhasorDefinition3"/> from specified parameters. /// </summary> /// <param name="parent">The <see cref="ConfigurationCell3"/> parent of this <see cref="PhasorDefinition3"/>.</param> /// <param name="label">The label of this <see cref="PhasorDefinition3"/>.</param> /// <param name="scale">The integer scaling value of this <see cref="PhasorDefinition3"/>.</param> /// <param name="offset">The offset of this <see cref="PhasorDefinition3"/>.</param> /// <param name="type">The <see cref="PhasorType"/> of this <see cref="PhasorDefinition3"/>.</param> /// <param name="voltageReference">The associated <see cref="IPhasorDefinition"/> that represents the voltage reference (if any).</param> /// <param name="phase">The phase of this <see cref="PhasorDefinition3"/>.</param> public PhasorDefinition3(ConfigurationCell3 parent, string label, uint scale, double offset, PhasorType type, PhasorDefinition3 voltageReference, char phase) : base(parent, label, scale, offset) { PhasorType = type; m_voltageReference = type == PhasorType.Voltage ? this : voltageReference; PhasorComponent = phase switch { 'A' => PhasorComponent.PhaseA, 'B' => PhasorComponent.PhaseB, 'C' => PhasorComponent.PhaseC, '+' => PhasorComponent.PositiveSequence, '-' => PhasorComponent.NegativeSequence, '0' => PhasorComponent.ZeroSequence, _ => PhasorComponent.PositiveSequence,// If phase is not a value IEEE C37.118-2011 supports, default to positive sequence }; }