All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ch.ninecode.model.WindDynamics.scala Maven / Gradle / Ivy

package ch.ninecode.model

import com.esotericsoftware.kryo.Kryo
import com.esotericsoftware.kryo.Serializer
import com.esotericsoftware.kryo.io.Input
import com.esotericsoftware.kryo.io.Output
import org.apache.spark.sql.Row

import ch.ninecode.cim.CIMClassInfo
import ch.ninecode.cim.CIMContext
import ch.ninecode.cim.CIMParseable
import ch.ninecode.cim.CIMRelationship
import ch.ninecode.cim.CIMSerializer

/**
 * Constant aerodynamic torque model which assumes that the aerodynamic torque is constant.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.1.1.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param WindGenTurbineType1aIEC [[ch.ninecode.model.WindGenTurbineType1aIEC WindGenTurbineType1aIEC]] Wind turbine type 1A model with which this wind aerodynamic model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindAeroConstIEC
(
    IdentifiedObject: IdentifiedObject = null,
    WindGenTurbineType1aIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindAeroConstIEC.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindAeroConstIEC.fields (position), value)
        emitattr (0, WindGenTurbineType1aIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindAeroConstIEC
extends
    CIMParseable[WindAeroConstIEC]
{
    override val fields: Array[String] = Array[String] (
        "WindGenTurbineType1aIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindGenTurbineType1aIEC", "WindGenTurbineType1aIEC", "1", "1")
    )
    val WindGenTurbineType1aIEC: Fielder = parse_attribute (attribute (cls, fields(0)))

    def parse (context: CIMContext): WindAeroConstIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindAeroConstIEC (
            IdentifiedObject.parse (context),
            mask (WindGenTurbineType1aIEC (), 0)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindAeroConstIEC] = WindAeroConstIECSerializer
}

object WindAeroConstIECSerializer extends CIMSerializer[WindAeroConstIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindAeroConstIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.WindGenTurbineType1aIEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindAeroConstIEC]): WindAeroConstIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindAeroConstIEC (
            parent,
            if (isSet (0)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * One-dimensional aerodynamic model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.1.2.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param ka Aerodynamic gain (ka).
 *        It is a type-dependent parameter.
 * @param thetaomega Initial pitch angle (thetaomega0).
 *        It is a case-dependent parameter.
 * @param WindTurbineType3IEC [[ch.ninecode.model.WindTurbineType3IEC WindTurbineType3IEC]] Wind turbine type 3 model with which this wind aerodynamic model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindAeroOneDimIEC
(
    IdentifiedObject: IdentifiedObject = null,
    ka: Double = 0.0,
    thetaomega: Double = 0.0,
    WindTurbineType3IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindAeroOneDimIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindAeroOneDimIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindAeroOneDimIEC.fields (position), value)
        emitelem (0, ka)
        emitelem (1, thetaomega)
        emitattr (2, WindTurbineType3IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindAeroOneDimIEC
extends
    CIMParseable[WindAeroOneDimIEC]
{
    override val fields: Array[String] = Array[String] (
        "ka",
        "thetaomega",
        "WindTurbineType3IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindTurbineType3IEC", "WindTurbineType3IEC", "1", "0..1")
    )
    val ka: Fielder = parse_element (element (cls, fields(0)))
    val thetaomega: Fielder = parse_element (element (cls, fields(1)))
    val WindTurbineType3IEC: Fielder = parse_attribute (attribute (cls, fields(2)))

    def parse (context: CIMContext): WindAeroOneDimIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindAeroOneDimIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (ka (), 0)),
            toDouble (mask (thetaomega (), 1)),
            mask (WindTurbineType3IEC (), 2)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindAeroOneDimIEC] = WindAeroOneDimIECSerializer
}

object WindAeroOneDimIECSerializer extends CIMSerializer[WindAeroOneDimIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindAeroOneDimIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.ka),
            () => output.writeDouble (obj.thetaomega),
            () => output.writeString (obj.WindTurbineType3IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindAeroOneDimIEC]): WindAeroOneDimIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindAeroOneDimIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Two-dimensional aerodynamic model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.1.3.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param dpomega Partial derivative of aerodynamic power with respect to changes in WTR speed (dpomega).
 *        It is a type-dependent parameter.
 * @param dptheta Partial derivative of aerodynamic power with respect to changes in pitch angle (dptheta).
 *        It is a type-dependent parameter.
 * @param dpv1 Partial derivative (dpv1).
 *        It is a type-dependent parameter.
 * @param omegazero Rotor speed if the wind turbine is not derated (omega0).
 *        It is a type-dependent parameter.
 * @param pavail Available aerodynamic power (pavail).
 *        It is a case-dependent parameter.
 * @param thetav2 Blade angle at twice rated wind speed (thetav2).
 *        It is a type-dependent parameter.
 * @param thetazero Pitch angle if the wind turbine is not derated (theta0).
 *        It is a case-dependent parameter.
 * @param WindTurbineType3IEC [[ch.ninecode.model.WindTurbineType3IEC WindTurbineType3IEC]] Wind turbine type 3 model with which this wind aerodynamic model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindAeroTwoDimIEC
(
    IdentifiedObject: IdentifiedObject = null,
    dpomega: Double = 0.0,
    dptheta: Double = 0.0,
    dpv1: Double = 0.0,
    omegazero: Double = 0.0,
    pavail: Double = 0.0,
    thetav2: Double = 0.0,
    thetazero: Double = 0.0,
    WindTurbineType3IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindAeroTwoDimIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindAeroTwoDimIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindAeroTwoDimIEC.fields (position), value)
        emitelem (0, dpomega)
        emitelem (1, dptheta)
        emitelem (2, dpv1)
        emitelem (3, omegazero)
        emitelem (4, pavail)
        emitelem (5, thetav2)
        emitelem (6, thetazero)
        emitattr (7, WindTurbineType3IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindAeroTwoDimIEC
extends
    CIMParseable[WindAeroTwoDimIEC]
{
    override val fields: Array[String] = Array[String] (
        "dpomega",
        "dptheta",
        "dpv1",
        "omegazero",
        "pavail",
        "thetav2",
        "thetazero",
        "WindTurbineType3IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindTurbineType3IEC", "WindTurbineType3IEC", "1", "0..1")
    )
    val dpomega: Fielder = parse_element (element (cls, fields(0)))
    val dptheta: Fielder = parse_element (element (cls, fields(1)))
    val dpv1: Fielder = parse_element (element (cls, fields(2)))
    val omegazero: Fielder = parse_element (element (cls, fields(3)))
    val pavail: Fielder = parse_element (element (cls, fields(4)))
    val thetav2: Fielder = parse_element (element (cls, fields(5)))
    val thetazero: Fielder = parse_element (element (cls, fields(6)))
    val WindTurbineType3IEC: Fielder = parse_attribute (attribute (cls, fields(7)))

    def parse (context: CIMContext): WindAeroTwoDimIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindAeroTwoDimIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (dpomega (), 0)),
            toDouble (mask (dptheta (), 1)),
            toDouble (mask (dpv1 (), 2)),
            toDouble (mask (omegazero (), 3)),
            toDouble (mask (pavail (), 4)),
            toDouble (mask (thetav2 (), 5)),
            toDouble (mask (thetazero (), 6)),
            mask (WindTurbineType3IEC (), 7)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindAeroTwoDimIEC] = WindAeroTwoDimIECSerializer
}

object WindAeroTwoDimIECSerializer extends CIMSerializer[WindAeroTwoDimIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindAeroTwoDimIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.dpomega),
            () => output.writeDouble (obj.dptheta),
            () => output.writeDouble (obj.dpv1),
            () => output.writeDouble (obj.omegazero),
            () => output.writeDouble (obj.pavail),
            () => output.writeDouble (obj.thetav2),
            () => output.writeDouble (obj.thetazero),
            () => output.writeString (obj.WindTurbineType3IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindAeroTwoDimIEC]): WindAeroTwoDimIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindAeroTwoDimIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readDouble else 0.0,
            if (isSet (4)) input.readDouble else 0.0,
            if (isSet (5)) input.readDouble else 0.0,
            if (isSet (6)) input.readDouble else 0.0,
            if (isSet (7)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Current limitation model.
 *
 * The current limitation model combines the physical limits and the control limits.
 * Reference: IEC 61400-27-1:2015, 5.6.5.8.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param imax Maximum continuous current at the wind turbine terminals (imax).
 *        It is a type-dependent parameter.
 * @param imaxdip Maximum current during voltage dip at the wind turbine terminals (imaxdip).
 *        It is a project-dependent parameter.
 * @param kpqu Partial derivative of reactive current limit (Kpqu) versus voltage.
 *        It is a type-dependent parameter.
 * @param mdfslim Limitation of type 3 stator current (MDFSLim). MDFSLim = 1 for wind turbines type 4.
 *        It is a type-dependent parameter.
 *        false= total current limitation (0 in the IEC model)
 *        true=stator current limitation (1 in the IEC model).
 * @param mqpri Prioritisation of Q control during UVRT (Mqpri).
 *        It is a project-dependent parameter.
 *        true = reactive power priority (1 in the IEC model)
 *        false = active power priority (0 in the IEC model).
 * @param tufiltcl Voltage measurement filter time constant (Tufiltcl) (>= 0).
 *        It is a type-dependent parameter.
 * @param upqumax Wind turbine voltage in the operation point where zero reactive current can be delivered (upqumax).
 *        It is a type-dependent parameter.
 * @param WindDynamicsLookupTable [[ch.ninecode.model.WindDynamicsLookupTable WindDynamicsLookupTable]] The wind dynamics lookup table associated with this current control limitation model.
 * @param WindTurbineType3or4IEC [[ch.ninecode.model.WindTurbineType3or4IEC WindTurbineType3or4IEC]] Wind turbine type 3 or type 4 model with which this wind control current limitation model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindContCurrLimIEC
(
    IdentifiedObject: IdentifiedObject = null,
    imax: Double = 0.0,
    imaxdip: Double = 0.0,
    kpqu: Double = 0.0,
    mdfslim: Boolean = false,
    mqpri: Boolean = false,
    tufiltcl: Double = 0.0,
    upqumax: Double = 0.0,
    WindDynamicsLookupTable: List[String] = null,
    WindTurbineType3or4IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindContCurrLimIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindContCurrLimIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindContCurrLimIEC.fields (position), value)
        def emitattrs (position: Int, value: List[String]): Unit = if (mask (position) && (null != value)) value.foreach (x => emit_attribute (WindContCurrLimIEC.fields (position), x))
        emitelem (0, imax)
        emitelem (1, imaxdip)
        emitelem (2, kpqu)
        emitelem (3, mdfslim)
        emitelem (4, mqpri)
        emitelem (5, tufiltcl)
        emitelem (6, upqumax)
        emitattrs (7, WindDynamicsLookupTable)
        emitattr (8, WindTurbineType3or4IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindContCurrLimIEC
extends
    CIMParseable[WindContCurrLimIEC]
{
    override val fields: Array[String] = Array[String] (
        "imax",
        "imaxdip",
        "kpqu",
        "mdfslim",
        "mqpri",
        "tufiltcl",
        "upqumax",
        "WindDynamicsLookupTable",
        "WindTurbineType3or4IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindDynamicsLookupTable", "WindDynamicsLookupTable", "1..*", "0..1"),
        CIMRelationship ("WindTurbineType3or4IEC", "WindTurbineType3or4IEC", "1", "1")
    )
    val imax: Fielder = parse_element (element (cls, fields(0)))
    val imaxdip: Fielder = parse_element (element (cls, fields(1)))
    val kpqu: Fielder = parse_element (element (cls, fields(2)))
    val mdfslim: Fielder = parse_element (element (cls, fields(3)))
    val mqpri: Fielder = parse_element (element (cls, fields(4)))
    val tufiltcl: Fielder = parse_element (element (cls, fields(5)))
    val upqumax: Fielder = parse_element (element (cls, fields(6)))
    val WindDynamicsLookupTable: FielderMultiple = parse_attributes (attribute (cls, fields(7)))
    val WindTurbineType3or4IEC: Fielder = parse_attribute (attribute (cls, fields(8)))

    def parse (context: CIMContext): WindContCurrLimIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindContCurrLimIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (imax (), 0)),
            toDouble (mask (imaxdip (), 1)),
            toDouble (mask (kpqu (), 2)),
            toBoolean (mask (mdfslim (), 3)),
            toBoolean (mask (mqpri (), 4)),
            toDouble (mask (tufiltcl (), 5)),
            toDouble (mask (upqumax (), 6)),
            masks (WindDynamicsLookupTable (), 7),
            mask (WindTurbineType3or4IEC (), 8)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindContCurrLimIEC] = WindContCurrLimIECSerializer
}

object WindContCurrLimIECSerializer extends CIMSerializer[WindContCurrLimIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindContCurrLimIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.imax),
            () => output.writeDouble (obj.imaxdip),
            () => output.writeDouble (obj.kpqu),
            () => output.writeBoolean (obj.mdfslim),
            () => output.writeBoolean (obj.mqpri),
            () => output.writeDouble (obj.tufiltcl),
            () => output.writeDouble (obj.upqumax),
            () => writeList (obj.WindDynamicsLookupTable, output),
            () => output.writeString (obj.WindTurbineType3or4IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindContCurrLimIEC]): WindContCurrLimIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindContCurrLimIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readBoolean else false,
            if (isSet (4)) input.readBoolean else false,
            if (isSet (5)) input.readDouble else 0.0,
            if (isSet (6)) input.readDouble else 0.0,
            if (isSet (7)) readList (input) else null,
            if (isSet (8)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * P control model type 3.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.5.4.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param dpmax Maximum wind turbine power ramp rate (dpmax).
 *        It is a type-dependent parameter.
 * @param dprefmax Maximum ramp rate of wind turbine reference power (dprefmax).
 *        It is a project-dependent parameter.
 * @param dprefmin Minimum ramp rate of wind turbine reference power (dprefmin).
 *        It is a project-dependent parameter.
 * @param dthetamax Ramp limitation of torque, required in some grid codes (dtmax).
 *        It is a project-dependent parameter.
 * @param dthetamaxuvrt Limitation of torque rise rate during UVRT (dthetamaxUVRT).
 *        It is a project-dependent parameter.
 * @param kdtd Gain for active drive train damping (KDTD).
 *        It is a type-dependent parameter.
 * @param kip PI controller integration parameter (KIp).
 *        It is a type-dependent parameter.
 * @param kpp PI controller proportional gain (KPp).
 *        It is a type-dependent parameter.
 * @param mpuvrt Enable UVRT power control mode (MpUVRT).
 *        It is a project-dependent parameter.
 *        true = voltage control (1 in the IEC model)
 *        false = reactive power control (0 in the IEC model).
 * @param omegadtd Active drive train damping frequency (omegaDTD).
 *        It can be calculated from two mass model parameters. It is a type-dependent parameter.
 * @param omegaoffset Offset to reference value that limits controller action during rotor speed changes (omegaoffset).
 *        It is a case-dependent parameter.
 * @param pdtdmax Maximum active drive train damping power (pDTDmax).
 *        It is a type-dependent parameter.
 * @param tdvs Time delay after deep voltage sags (TDVS) (>= 0).
 *        It is a project-dependent parameter.
 * @param thetaemin Minimum electrical generator torque (temin).
 *        It is a type-dependent parameter.
 * @param thetauscale Voltage scaling factor of reset-torque (tuscale).
 *        It is a project-dependent parameter.
 * @param tomegafiltp3 Filter time constant for generator speed measurement (Tomegafiltp3) (>= 0).
 *        It is a type-dependent parameter.
 * @param tomegaref Time constant in speed reference filter (Tomega,ref) (>= 0).
 *        It is a type-dependent parameter.
 * @param tpfiltp3 Filter time constant for power measurement (Tpfiltp3) (>= 0).
 *        It is a type-dependent parameter.
 * @param tpord Time constant in power order lag (Tpord).
 *        It is a type-dependent parameter.
 * @param tufiltp3 Filter time constant for voltage measurement (Tufiltp3) (>= 0).
 *        It is a type-dependent parameter.
 * @param udvs Voltage limit for hold UVRT status after deep voltage sags (uDVS).
 *        It is a project-dependent parameter.
 * @param updip Voltage dip threshold for P-control (uPdip).
 *        Part of turbine control, often different (e.g 0.8) from converter thresholds. It is a project-dependent parameter.
 * @param zeta Coefficient for active drive train damping (zeta).
 *        It is a type-dependent parameter.
 * @param WindDynamicsLookupTable [[ch.ninecode.model.WindDynamicsLookupTable WindDynamicsLookupTable]] The wind dynamics lookup table associated with this P control type 3 model.
 * @param WindTurbineType3IEC [[ch.ninecode.model.WindTurbineType3IEC WindTurbineType3IEC]] Wind turbine type 3 model with which this wind control P type 3 model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindContPType3IEC
(
    IdentifiedObject: IdentifiedObject = null,
    dpmax: Double = 0.0,
    dprefmax: Double = 0.0,
    dprefmin: Double = 0.0,
    dthetamax: Double = 0.0,
    dthetamaxuvrt: Double = 0.0,
    kdtd: Double = 0.0,
    kip: Double = 0.0,
    kpp: Double = 0.0,
    mpuvrt: Boolean = false,
    omegadtd: Double = 0.0,
    omegaoffset: Double = 0.0,
    pdtdmax: Double = 0.0,
    tdvs: Double = 0.0,
    thetaemin: Double = 0.0,
    thetauscale: Double = 0.0,
    tomegafiltp3: Double = 0.0,
    tomegaref: Double = 0.0,
    tpfiltp3: Double = 0.0,
    tpord: Double = 0.0,
    tufiltp3: Double = 0.0,
    udvs: Double = 0.0,
    updip: Double = 0.0,
    zeta: Double = 0.0,
    WindDynamicsLookupTable: List[String] = null,
    WindTurbineType3IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindContPType3IEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindContPType3IEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindContPType3IEC.fields (position), value)
        def emitattrs (position: Int, value: List[String]): Unit = if (mask (position) && (null != value)) value.foreach (x => emit_attribute (WindContPType3IEC.fields (position), x))
        emitelem (0, dpmax)
        emitelem (1, dprefmax)
        emitelem (2, dprefmin)
        emitelem (3, dthetamax)
        emitelem (4, dthetamaxuvrt)
        emitelem (5, kdtd)
        emitelem (6, kip)
        emitelem (7, kpp)
        emitelem (8, mpuvrt)
        emitelem (9, omegadtd)
        emitelem (10, omegaoffset)
        emitelem (11, pdtdmax)
        emitelem (12, tdvs)
        emitelem (13, thetaemin)
        emitelem (14, thetauscale)
        emitelem (15, tomegafiltp3)
        emitelem (16, tomegaref)
        emitelem (17, tpfiltp3)
        emitelem (18, tpord)
        emitelem (19, tufiltp3)
        emitelem (20, udvs)
        emitelem (21, updip)
        emitelem (22, zeta)
        emitattrs (23, WindDynamicsLookupTable)
        emitattr (24, WindTurbineType3IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindContPType3IEC
extends
    CIMParseable[WindContPType3IEC]
{
    override val fields: Array[String] = Array[String] (
        "dpmax",
        "dprefmax",
        "dprefmin",
        "dthetamax",
        "dthetamaxuvrt",
        "kdtd",
        "kip",
        "kpp",
        "mpuvrt",
        "omegadtd",
        "omegaoffset",
        "pdtdmax",
        "tdvs",
        "thetaemin",
        "thetauscale",
        "tomegafiltp3",
        "tomegaref",
        "tpfiltp3",
        "tpord",
        "tufiltp3",
        "udvs",
        "updip",
        "zeta",
        "WindDynamicsLookupTable",
        "WindTurbineType3IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindDynamicsLookupTable", "WindDynamicsLookupTable", "1..*", "0..1"),
        CIMRelationship ("WindTurbineType3IEC", "WindTurbineType3IEC", "1", "1")
    )
    val dpmax: Fielder = parse_element (element (cls, fields(0)))
    val dprefmax: Fielder = parse_element (element (cls, fields(1)))
    val dprefmin: Fielder = parse_element (element (cls, fields(2)))
    val dthetamax: Fielder = parse_element (element (cls, fields(3)))
    val dthetamaxuvrt: Fielder = parse_element (element (cls, fields(4)))
    val kdtd: Fielder = parse_element (element (cls, fields(5)))
    val kip: Fielder = parse_element (element (cls, fields(6)))
    val kpp: Fielder = parse_element (element (cls, fields(7)))
    val mpuvrt: Fielder = parse_element (element (cls, fields(8)))
    val omegadtd: Fielder = parse_element (element (cls, fields(9)))
    val omegaoffset: Fielder = parse_element (element (cls, fields(10)))
    val pdtdmax: Fielder = parse_element (element (cls, fields(11)))
    val tdvs: Fielder = parse_element (element (cls, fields(12)))
    val thetaemin: Fielder = parse_element (element (cls, fields(13)))
    val thetauscale: Fielder = parse_element (element (cls, fields(14)))
    val tomegafiltp3: Fielder = parse_element (element (cls, fields(15)))
    val tomegaref: Fielder = parse_element (element (cls, fields(16)))
    val tpfiltp3: Fielder = parse_element (element (cls, fields(17)))
    val tpord: Fielder = parse_element (element (cls, fields(18)))
    val tufiltp3: Fielder = parse_element (element (cls, fields(19)))
    val udvs: Fielder = parse_element (element (cls, fields(20)))
    val updip: Fielder = parse_element (element (cls, fields(21)))
    val zeta: Fielder = parse_element (element (cls, fields(22)))
    val WindDynamicsLookupTable: FielderMultiple = parse_attributes (attribute (cls, fields(23)))
    val WindTurbineType3IEC: Fielder = parse_attribute (attribute (cls, fields(24)))

    def parse (context: CIMContext): WindContPType3IEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindContPType3IEC (
            IdentifiedObject.parse (context),
            toDouble (mask (dpmax (), 0)),
            toDouble (mask (dprefmax (), 1)),
            toDouble (mask (dprefmin (), 2)),
            toDouble (mask (dthetamax (), 3)),
            toDouble (mask (dthetamaxuvrt (), 4)),
            toDouble (mask (kdtd (), 5)),
            toDouble (mask (kip (), 6)),
            toDouble (mask (kpp (), 7)),
            toBoolean (mask (mpuvrt (), 8)),
            toDouble (mask (omegadtd (), 9)),
            toDouble (mask (omegaoffset (), 10)),
            toDouble (mask (pdtdmax (), 11)),
            toDouble (mask (tdvs (), 12)),
            toDouble (mask (thetaemin (), 13)),
            toDouble (mask (thetauscale (), 14)),
            toDouble (mask (tomegafiltp3 (), 15)),
            toDouble (mask (tomegaref (), 16)),
            toDouble (mask (tpfiltp3 (), 17)),
            toDouble (mask (tpord (), 18)),
            toDouble (mask (tufiltp3 (), 19)),
            toDouble (mask (udvs (), 20)),
            toDouble (mask (updip (), 21)),
            toDouble (mask (zeta (), 22)),
            masks (WindDynamicsLookupTable (), 23),
            mask (WindTurbineType3IEC (), 24)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindContPType3IEC] = WindContPType3IECSerializer
}

object WindContPType3IECSerializer extends CIMSerializer[WindContPType3IEC]
{
    def write (kryo: Kryo, output: Output, obj: WindContPType3IEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.dpmax),
            () => output.writeDouble (obj.dprefmax),
            () => output.writeDouble (obj.dprefmin),
            () => output.writeDouble (obj.dthetamax),
            () => output.writeDouble (obj.dthetamaxuvrt),
            () => output.writeDouble (obj.kdtd),
            () => output.writeDouble (obj.kip),
            () => output.writeDouble (obj.kpp),
            () => output.writeBoolean (obj.mpuvrt),
            () => output.writeDouble (obj.omegadtd),
            () => output.writeDouble (obj.omegaoffset),
            () => output.writeDouble (obj.pdtdmax),
            () => output.writeDouble (obj.tdvs),
            () => output.writeDouble (obj.thetaemin),
            () => output.writeDouble (obj.thetauscale),
            () => output.writeDouble (obj.tomegafiltp3),
            () => output.writeDouble (obj.tomegaref),
            () => output.writeDouble (obj.tpfiltp3),
            () => output.writeDouble (obj.tpord),
            () => output.writeDouble (obj.tufiltp3),
            () => output.writeDouble (obj.udvs),
            () => output.writeDouble (obj.updip),
            () => output.writeDouble (obj.zeta),
            () => writeList (obj.WindDynamicsLookupTable, output),
            () => output.writeString (obj.WindTurbineType3IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindContPType3IEC]): WindContPType3IEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindContPType3IEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readDouble else 0.0,
            if (isSet (4)) input.readDouble else 0.0,
            if (isSet (5)) input.readDouble else 0.0,
            if (isSet (6)) input.readDouble else 0.0,
            if (isSet (7)) input.readDouble else 0.0,
            if (isSet (8)) input.readBoolean else false,
            if (isSet (9)) input.readDouble else 0.0,
            if (isSet (10)) input.readDouble else 0.0,
            if (isSet (11)) input.readDouble else 0.0,
            if (isSet (12)) input.readDouble else 0.0,
            if (isSet (13)) input.readDouble else 0.0,
            if (isSet (14)) input.readDouble else 0.0,
            if (isSet (15)) input.readDouble else 0.0,
            if (isSet (16)) input.readDouble else 0.0,
            if (isSet (17)) input.readDouble else 0.0,
            if (isSet (18)) input.readDouble else 0.0,
            if (isSet (19)) input.readDouble else 0.0,
            if (isSet (20)) input.readDouble else 0.0,
            if (isSet (21)) input.readDouble else 0.0,
            if (isSet (22)) input.readDouble else 0.0,
            if (isSet (23)) readList (input) else null,
            if (isSet (24)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * P control model type 4A.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.5.5.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param dpmaxp4a Maximum wind turbine power ramp rate (dpmaxp4A).
 *        It is a project-dependent parameter.
 * @param tpordp4a Time constant in power order lag (Tpordp4A) (>= 0).
 *        It is a type-dependent parameter.
 * @param tufiltp4a Voltage measurement filter time constant (Tufiltp4A) (>= 0).
 *        It is a type-dependent parameter.
 * @param WindTurbineType4aIEC [[ch.ninecode.model.WindTurbineType4aIEC WindTurbineType4aIEC]] Wind turbine type 4A model with which this wind control P type 4A model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindContPType4aIEC
(
    IdentifiedObject: IdentifiedObject = null,
    dpmaxp4a: Double = 0.0,
    tpordp4a: Double = 0.0,
    tufiltp4a: Double = 0.0,
    WindTurbineType4aIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindContPType4aIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindContPType4aIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindContPType4aIEC.fields (position), value)
        emitelem (0, dpmaxp4a)
        emitelem (1, tpordp4a)
        emitelem (2, tufiltp4a)
        emitattr (3, WindTurbineType4aIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindContPType4aIEC
extends
    CIMParseable[WindContPType4aIEC]
{
    override val fields: Array[String] = Array[String] (
        "dpmaxp4a",
        "tpordp4a",
        "tufiltp4a",
        "WindTurbineType4aIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindTurbineType4aIEC", "WindTurbineType4aIEC", "1", "1")
    )
    val dpmaxp4a: Fielder = parse_element (element (cls, fields(0)))
    val tpordp4a: Fielder = parse_element (element (cls, fields(1)))
    val tufiltp4a: Fielder = parse_element (element (cls, fields(2)))
    val WindTurbineType4aIEC: Fielder = parse_attribute (attribute (cls, fields(3)))

    def parse (context: CIMContext): WindContPType4aIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindContPType4aIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (dpmaxp4a (), 0)),
            toDouble (mask (tpordp4a (), 1)),
            toDouble (mask (tufiltp4a (), 2)),
            mask (WindTurbineType4aIEC (), 3)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindContPType4aIEC] = WindContPType4aIECSerializer
}

object WindContPType4aIECSerializer extends CIMSerializer[WindContPType4aIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindContPType4aIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.dpmaxp4a),
            () => output.writeDouble (obj.tpordp4a),
            () => output.writeDouble (obj.tufiltp4a),
            () => output.writeString (obj.WindTurbineType4aIEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindContPType4aIEC]): WindContPType4aIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindContPType4aIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * P control model type 4B.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.5.6.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param dpmaxp4b Maximum wind turbine power ramp rate (dpmaxp4B).
 *        It is a project-dependent parameter.
 * @param tpaero Time constant in aerodynamic power response (Tpaero) (>= 0).
 *        It is a type-dependent parameter.
 * @param tpordp4b Time constant in power order lag (Tpordp4B) (>= 0).
 *        It is a type-dependent parameter.
 * @param tufiltp4b Voltage measurement filter time constant (Tufiltp4B) (>= 0).
 *        It is a type-dependent parameter.
 * @param WindTurbineType4bIEC [[ch.ninecode.model.WindTurbineType4bIEC WindTurbineType4bIEC]] Wind turbine type 4B model with which this wind control P type 4B model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindContPType4bIEC
(
    IdentifiedObject: IdentifiedObject = null,
    dpmaxp4b: Double = 0.0,
    tpaero: Double = 0.0,
    tpordp4b: Double = 0.0,
    tufiltp4b: Double = 0.0,
    WindTurbineType4bIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindContPType4bIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindContPType4bIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindContPType4bIEC.fields (position), value)
        emitelem (0, dpmaxp4b)
        emitelem (1, tpaero)
        emitelem (2, tpordp4b)
        emitelem (3, tufiltp4b)
        emitattr (4, WindTurbineType4bIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindContPType4bIEC
extends
    CIMParseable[WindContPType4bIEC]
{
    override val fields: Array[String] = Array[String] (
        "dpmaxp4b",
        "tpaero",
        "tpordp4b",
        "tufiltp4b",
        "WindTurbineType4bIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindTurbineType4bIEC", "WindTurbineType4bIEC", "1", "1")
    )
    val dpmaxp4b: Fielder = parse_element (element (cls, fields(0)))
    val tpaero: Fielder = parse_element (element (cls, fields(1)))
    val tpordp4b: Fielder = parse_element (element (cls, fields(2)))
    val tufiltp4b: Fielder = parse_element (element (cls, fields(3)))
    val WindTurbineType4bIEC: Fielder = parse_attribute (attribute (cls, fields(4)))

    def parse (context: CIMContext): WindContPType4bIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindContPType4bIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (dpmaxp4b (), 0)),
            toDouble (mask (tpaero (), 1)),
            toDouble (mask (tpordp4b (), 2)),
            toDouble (mask (tufiltp4b (), 3)),
            mask (WindTurbineType4bIEC (), 4)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindContPType4bIEC] = WindContPType4bIECSerializer
}

object WindContPType4bIECSerializer extends CIMSerializer[WindContPType4bIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindContPType4bIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.dpmaxp4b),
            () => output.writeDouble (obj.tpaero),
            () => output.writeDouble (obj.tpordp4b),
            () => output.writeDouble (obj.tufiltp4b),
            () => output.writeString (obj.WindTurbineType4bIEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindContPType4bIEC]): WindContPType4bIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindContPType4bIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readDouble else 0.0,
            if (isSet (4)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Pitch angle control model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.5.2.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param dthetamax Maximum pitch positive ramp rate (dthetamax) (> WindContPitchAngleIEC.dthetamin).
 *        It is a type-dependent parameter. Unit = degrees / s.
 * @param dthetamin Maximum pitch negative ramp rate (dthetamin) (< WindContPitchAngleIEC.dthetamax).
 *        It is a type-dependent parameter. Unit = degrees / s.
 * @param kic Power PI controller integration gain (KIc).
 *        It is a type-dependent parameter.
 * @param kiomega Speed PI controller integration gain (KIomega).
 *        It is a type-dependent parameter.
 * @param kpc Power PI controller proportional gain (KPc).
 *        It is a type-dependent parameter.
 * @param kpomega Speed PI controller proportional gain (KPomega).
 *        It is a type-dependent parameter.
 * @param kpx Pitch cross coupling gain (KPX).
 *        It is a type-dependent parameter.
 * @param thetamax Maximum pitch angle (thetamax) (> WindContPitchAngleIEC.thetamin).
 *        It is a type-dependent parameter.
 * @param thetamin Minimum pitch angle (thetamin) (< WindContPitchAngleIEC.thetamax).
 *        It is a type-dependent parameter.
 * @param ttheta Pitch time constant (ttheta) (>= 0).
 *        It is a type-dependent parameter.
 * @param WindTurbineType3IEC [[ch.ninecode.model.WindTurbineType3IEC WindTurbineType3IEC]] Wind turbine type 3 model with which this pitch control model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindContPitchAngleIEC
(
    IdentifiedObject: IdentifiedObject = null,
    dthetamax: Double = 0.0,
    dthetamin: Double = 0.0,
    kic: Double = 0.0,
    kiomega: Double = 0.0,
    kpc: Double = 0.0,
    kpomega: Double = 0.0,
    kpx: Double = 0.0,
    thetamax: Double = 0.0,
    thetamin: Double = 0.0,
    ttheta: Double = 0.0,
    WindTurbineType3IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindContPitchAngleIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindContPitchAngleIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindContPitchAngleIEC.fields (position), value)
        emitelem (0, dthetamax)
        emitelem (1, dthetamin)
        emitelem (2, kic)
        emitelem (3, kiomega)
        emitelem (4, kpc)
        emitelem (5, kpomega)
        emitelem (6, kpx)
        emitelem (7, thetamax)
        emitelem (8, thetamin)
        emitelem (9, ttheta)
        emitattr (10, WindTurbineType3IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindContPitchAngleIEC
extends
    CIMParseable[WindContPitchAngleIEC]
{
    override val fields: Array[String] = Array[String] (
        "dthetamax",
        "dthetamin",
        "kic",
        "kiomega",
        "kpc",
        "kpomega",
        "kpx",
        "thetamax",
        "thetamin",
        "ttheta",
        "WindTurbineType3IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindTurbineType3IEC", "WindTurbineType3IEC", "1", "1")
    )
    val dthetamax: Fielder = parse_element (element (cls, fields(0)))
    val dthetamin: Fielder = parse_element (element (cls, fields(1)))
    val kic: Fielder = parse_element (element (cls, fields(2)))
    val kiomega: Fielder = parse_element (element (cls, fields(3)))
    val kpc: Fielder = parse_element (element (cls, fields(4)))
    val kpomega: Fielder = parse_element (element (cls, fields(5)))
    val kpx: Fielder = parse_element (element (cls, fields(6)))
    val thetamax: Fielder = parse_element (element (cls, fields(7)))
    val thetamin: Fielder = parse_element (element (cls, fields(8)))
    val ttheta: Fielder = parse_element (element (cls, fields(9)))
    val WindTurbineType3IEC: Fielder = parse_attribute (attribute (cls, fields(10)))

    def parse (context: CIMContext): WindContPitchAngleIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindContPitchAngleIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (dthetamax (), 0)),
            toDouble (mask (dthetamin (), 1)),
            toDouble (mask (kic (), 2)),
            toDouble (mask (kiomega (), 3)),
            toDouble (mask (kpc (), 4)),
            toDouble (mask (kpomega (), 5)),
            toDouble (mask (kpx (), 6)),
            toDouble (mask (thetamax (), 7)),
            toDouble (mask (thetamin (), 8)),
            toDouble (mask (ttheta (), 9)),
            mask (WindTurbineType3IEC (), 10)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindContPitchAngleIEC] = WindContPitchAngleIECSerializer
}

object WindContPitchAngleIECSerializer extends CIMSerializer[WindContPitchAngleIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindContPitchAngleIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.dthetamax),
            () => output.writeDouble (obj.dthetamin),
            () => output.writeDouble (obj.kic),
            () => output.writeDouble (obj.kiomega),
            () => output.writeDouble (obj.kpc),
            () => output.writeDouble (obj.kpomega),
            () => output.writeDouble (obj.kpx),
            () => output.writeDouble (obj.thetamax),
            () => output.writeDouble (obj.thetamin),
            () => output.writeDouble (obj.ttheta),
            () => output.writeString (obj.WindTurbineType3IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindContPitchAngleIEC]): WindContPitchAngleIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindContPitchAngleIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readDouble else 0.0,
            if (isSet (4)) input.readDouble else 0.0,
            if (isSet (5)) input.readDouble else 0.0,
            if (isSet (6)) input.readDouble else 0.0,
            if (isSet (7)) input.readDouble else 0.0,
            if (isSet (8)) input.readDouble else 0.0,
            if (isSet (9)) input.readDouble else 0.0,
            if (isSet (10)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Q control model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.5.7.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param iqh1 Maximum reactive current injection during dip (iqh1).
 *        It is a type-dependent parameter.
 * @param iqmax Maximum reactive current injection (iqmax) (> WindContQIEC.iqmin).
 *        It is a type-dependent parameter.
 * @param iqmin Minimum reactive current injection (iqmin) (< WindContQIEC.iqmax).
 *        It is a type-dependent parameter.
 * @param iqpost Post fault reactive current injection (iqpost).
 *        It is a project-dependent parameter.
 * @param kiq Reactive power PI controller integration gain (KI,q).
 *        It is a type-dependent parameter.
 * @param kiu Voltage PI controller integration gain (KI,u).
 *        It is a type-dependent parameter.
 * @param kpq Reactive power PI controller proportional gain (KP,q).
 *        It is a type-dependent parameter.
 * @param kpu Voltage PI controller proportional gain (KP,u).
 *        It is a type-dependent parameter.
 * @param kqv Voltage scaling factor for UVRT current (Kqv).
 *        It is a project-dependent parameter.
 * @param rdroop Resistive component of voltage drop impedance (rdroop) (>= 0).
 *        It is a project-dependent parameter.
 * @param tpfiltq Power measurement filter time constant (Tpfiltq) (>= 0).
 *        It is a type-dependent parameter.
 * @param tpost Length of time period where post fault reactive power is injected (Tpost) (>= 0).
 *        It is a project-dependent parameter.
 * @param tqord Time constant in reactive power order lag (Tqord) (>= 0).
 *        It is a type-dependent parameter.
 * @param tufiltq Voltage measurement filter time constant (Tufiltq) (>= 0).
 *        It is a type-dependent parameter.
 * @param udb1 Voltage deadband lower limit (udb1).
 *        It is a type-dependent parameter.
 * @param udb2 Voltage deadband upper limit (udb2).
 *        It is a type-dependent parameter.
 * @param umax Maximum voltage in voltage PI controller integral term (umax) (> WindContQIEC.umin).
 *        It is a type-dependent parameter.
 * @param umin Minimum voltage in voltage PI controller integral term (umin) (< WindContQIEC.umax).
 *        It is a type-dependent parameter.
 * @param uqdip Voltage threshold for UVRT detection in Q control (uqdip).
 *        It is a type-dependent parameter.
 * @param uref0 User-defined bias in voltage reference (uref0).
 *        It is a case-dependent parameter.
 * @param windQcontrolModesType Types of general wind turbine Q control modes (MqG).
 *        It is a project-dependent parameter.
 * @param windUVRTQcontrolModesType Types of UVRT Q control modes (MqUVRT).
 *        It is a project-dependent parameter.
 * @param xdroop Inductive component of voltage drop impedance (xdroop) (>= 0).
 *        It is a project-dependent parameter.
 * @param WindTurbineType3or4IEC [[ch.ninecode.model.WindTurbineType3or4IEC WindTurbineType3or4IEC]] Wind turbine type 3 or type 4 model with which this reactive control model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindContQIEC
(
    IdentifiedObject: IdentifiedObject = null,
    iqh1: Double = 0.0,
    iqmax: Double = 0.0,
    iqmin: Double = 0.0,
    iqpost: Double = 0.0,
    kiq: Double = 0.0,
    kiu: Double = 0.0,
    kpq: Double = 0.0,
    kpu: Double = 0.0,
    kqv: Double = 0.0,
    rdroop: Double = 0.0,
    tpfiltq: Double = 0.0,
    tpost: Double = 0.0,
    tqord: Double = 0.0,
    tufiltq: Double = 0.0,
    udb1: Double = 0.0,
    udb2: Double = 0.0,
    umax: Double = 0.0,
    umin: Double = 0.0,
    uqdip: Double = 0.0,
    uref0: Double = 0.0,
    windQcontrolModesType: String = null,
    windUVRTQcontrolModesType: String = null,
    xdroop: Double = 0.0,
    WindTurbineType3or4IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindContQIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindContQIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindContQIEC.fields (position), value)
        emitelem (0, iqh1)
        emitelem (1, iqmax)
        emitelem (2, iqmin)
        emitelem (3, iqpost)
        emitelem (4, kiq)
        emitelem (5, kiu)
        emitelem (6, kpq)
        emitelem (7, kpu)
        emitelem (8, kqv)
        emitelem (9, rdroop)
        emitelem (10, tpfiltq)
        emitelem (11, tpost)
        emitelem (12, tqord)
        emitelem (13, tufiltq)
        emitelem (14, udb1)
        emitelem (15, udb2)
        emitelem (16, umax)
        emitelem (17, umin)
        emitelem (18, uqdip)
        emitelem (19, uref0)
        emitattr (20, windQcontrolModesType)
        emitattr (21, windUVRTQcontrolModesType)
        emitelem (22, xdroop)
        emitattr (23, WindTurbineType3or4IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindContQIEC
extends
    CIMParseable[WindContQIEC]
{
    override val fields: Array[String] = Array[String] (
        "iqh1",
        "iqmax",
        "iqmin",
        "iqpost",
        "kiq",
        "kiu",
        "kpq",
        "kpu",
        "kqv",
        "rdroop",
        "tpfiltq",
        "tpost",
        "tqord",
        "tufiltq",
        "udb1",
        "udb2",
        "umax",
        "umin",
        "uqdip",
        "uref0",
        "windQcontrolModesType",
        "windUVRTQcontrolModesType",
        "xdroop",
        "WindTurbineType3or4IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindTurbineType3or4IEC", "WindTurbineType3or4IEC", "1", "1")
    )
    val iqh1: Fielder = parse_element (element (cls, fields(0)))
    val iqmax: Fielder = parse_element (element (cls, fields(1)))
    val iqmin: Fielder = parse_element (element (cls, fields(2)))
    val iqpost: Fielder = parse_element (element (cls, fields(3)))
    val kiq: Fielder = parse_element (element (cls, fields(4)))
    val kiu: Fielder = parse_element (element (cls, fields(5)))
    val kpq: Fielder = parse_element (element (cls, fields(6)))
    val kpu: Fielder = parse_element (element (cls, fields(7)))
    val kqv: Fielder = parse_element (element (cls, fields(8)))
    val rdroop: Fielder = parse_element (element (cls, fields(9)))
    val tpfiltq: Fielder = parse_element (element (cls, fields(10)))
    val tpost: Fielder = parse_element (element (cls, fields(11)))
    val tqord: Fielder = parse_element (element (cls, fields(12)))
    val tufiltq: Fielder = parse_element (element (cls, fields(13)))
    val udb1: Fielder = parse_element (element (cls, fields(14)))
    val udb2: Fielder = parse_element (element (cls, fields(15)))
    val umax: Fielder = parse_element (element (cls, fields(16)))
    val umin: Fielder = parse_element (element (cls, fields(17)))
    val uqdip: Fielder = parse_element (element (cls, fields(18)))
    val uref0: Fielder = parse_element (element (cls, fields(19)))
    val windQcontrolModesType: Fielder = parse_attribute (attribute (cls, fields(20)))
    val windUVRTQcontrolModesType: Fielder = parse_attribute (attribute (cls, fields(21)))
    val xdroop: Fielder = parse_element (element (cls, fields(22)))
    val WindTurbineType3or4IEC: Fielder = parse_attribute (attribute (cls, fields(23)))

    def parse (context: CIMContext): WindContQIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindContQIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (iqh1 (), 0)),
            toDouble (mask (iqmax (), 1)),
            toDouble (mask (iqmin (), 2)),
            toDouble (mask (iqpost (), 3)),
            toDouble (mask (kiq (), 4)),
            toDouble (mask (kiu (), 5)),
            toDouble (mask (kpq (), 6)),
            toDouble (mask (kpu (), 7)),
            toDouble (mask (kqv (), 8)),
            toDouble (mask (rdroop (), 9)),
            toDouble (mask (tpfiltq (), 10)),
            toDouble (mask (tpost (), 11)),
            toDouble (mask (tqord (), 12)),
            toDouble (mask (tufiltq (), 13)),
            toDouble (mask (udb1 (), 14)),
            toDouble (mask (udb2 (), 15)),
            toDouble (mask (umax (), 16)),
            toDouble (mask (umin (), 17)),
            toDouble (mask (uqdip (), 18)),
            toDouble (mask (uref0 (), 19)),
            mask (windQcontrolModesType (), 20),
            mask (windUVRTQcontrolModesType (), 21),
            toDouble (mask (xdroop (), 22)),
            mask (WindTurbineType3or4IEC (), 23)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindContQIEC] = WindContQIECSerializer
}

object WindContQIECSerializer extends CIMSerializer[WindContQIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindContQIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.iqh1),
            () => output.writeDouble (obj.iqmax),
            () => output.writeDouble (obj.iqmin),
            () => output.writeDouble (obj.iqpost),
            () => output.writeDouble (obj.kiq),
            () => output.writeDouble (obj.kiu),
            () => output.writeDouble (obj.kpq),
            () => output.writeDouble (obj.kpu),
            () => output.writeDouble (obj.kqv),
            () => output.writeDouble (obj.rdroop),
            () => output.writeDouble (obj.tpfiltq),
            () => output.writeDouble (obj.tpost),
            () => output.writeDouble (obj.tqord),
            () => output.writeDouble (obj.tufiltq),
            () => output.writeDouble (obj.udb1),
            () => output.writeDouble (obj.udb2),
            () => output.writeDouble (obj.umax),
            () => output.writeDouble (obj.umin),
            () => output.writeDouble (obj.uqdip),
            () => output.writeDouble (obj.uref0),
            () => output.writeString (obj.windQcontrolModesType),
            () => output.writeString (obj.windUVRTQcontrolModesType),
            () => output.writeDouble (obj.xdroop),
            () => output.writeString (obj.WindTurbineType3or4IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindContQIEC]): WindContQIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindContQIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readDouble else 0.0,
            if (isSet (4)) input.readDouble else 0.0,
            if (isSet (5)) input.readDouble else 0.0,
            if (isSet (6)) input.readDouble else 0.0,
            if (isSet (7)) input.readDouble else 0.0,
            if (isSet (8)) input.readDouble else 0.0,
            if (isSet (9)) input.readDouble else 0.0,
            if (isSet (10)) input.readDouble else 0.0,
            if (isSet (11)) input.readDouble else 0.0,
            if (isSet (12)) input.readDouble else 0.0,
            if (isSet (13)) input.readDouble else 0.0,
            if (isSet (14)) input.readDouble else 0.0,
            if (isSet (15)) input.readDouble else 0.0,
            if (isSet (16)) input.readDouble else 0.0,
            if (isSet (17)) input.readDouble else 0.0,
            if (isSet (18)) input.readDouble else 0.0,
            if (isSet (19)) input.readDouble else 0.0,
            if (isSet (20)) input.readString else null,
            if (isSet (21)) input.readString else null,
            if (isSet (22)) input.readDouble else 0.0,
            if (isSet (23)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Constant Q limitation model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.5.9.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param qmax Maximum reactive power (qmax) (> WindContQLimIEC.qmin).
 *        It is a type-dependent parameter.
 * @param qmin Minimum reactive power (qmin) (< WindContQLimIEC.qmax).
 *        It is a type-dependent parameter.
 * @param WindTurbineType3or4IEC [[ch.ninecode.model.WindTurbineType3or4IEC WindTurbineType3or4IEC]] Wind generator type 3 or type 4 model with which this constant Q limitation model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindContQLimIEC
(
    IdentifiedObject: IdentifiedObject = null,
    qmax: Double = 0.0,
    qmin: Double = 0.0,
    WindTurbineType3or4IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindContQLimIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindContQLimIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindContQLimIEC.fields (position), value)
        emitelem (0, qmax)
        emitelem (1, qmin)
        emitattr (2, WindTurbineType3or4IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindContQLimIEC
extends
    CIMParseable[WindContQLimIEC]
{
    override val fields: Array[String] = Array[String] (
        "qmax",
        "qmin",
        "WindTurbineType3or4IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindTurbineType3or4IEC", "WindTurbineType3or4IEC", "0..1", "0..1")
    )
    val qmax: Fielder = parse_element (element (cls, fields(0)))
    val qmin: Fielder = parse_element (element (cls, fields(1)))
    val WindTurbineType3or4IEC: Fielder = parse_attribute (attribute (cls, fields(2)))

    def parse (context: CIMContext): WindContQLimIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindContQLimIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (qmax (), 0)),
            toDouble (mask (qmin (), 1)),
            mask (WindTurbineType3or4IEC (), 2)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindContQLimIEC] = WindContQLimIECSerializer
}

object WindContQLimIECSerializer extends CIMSerializer[WindContQLimIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindContQLimIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.qmax),
            () => output.writeDouble (obj.qmin),
            () => output.writeString (obj.WindTurbineType3or4IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindContQLimIEC]): WindContQLimIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindContQLimIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * QP and QU limitation model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.5.10.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param tpfiltql Power measurement filter time constant for Q capacity (Tpfiltql) (>= 0).
 *        It is a type-dependent parameter.
 * @param tufiltql Voltage measurement filter time constant for Q capacity (Tufiltql) (>= 0).
 *        It is a type-dependent parameter.
 * @param WindDynamicsLookupTable [[ch.ninecode.model.WindDynamicsLookupTable WindDynamicsLookupTable]] The wind dynamics lookup table associated with this QP and QU limitation model.
 * @param WindTurbineType3or4IEC [[ch.ninecode.model.WindTurbineType3or4IEC WindTurbineType3or4IEC]] Wind generator type 3 or type 4 model with which this QP and QU limitation model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindContQPQULimIEC
(
    IdentifiedObject: IdentifiedObject = null,
    tpfiltql: Double = 0.0,
    tufiltql: Double = 0.0,
    WindDynamicsLookupTable: List[String] = null,
    WindTurbineType3or4IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindContQPQULimIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindContQPQULimIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindContQPQULimIEC.fields (position), value)
        def emitattrs (position: Int, value: List[String]): Unit = if (mask (position) && (null != value)) value.foreach (x => emit_attribute (WindContQPQULimIEC.fields (position), x))
        emitelem (0, tpfiltql)
        emitelem (1, tufiltql)
        emitattrs (2, WindDynamicsLookupTable)
        emitattr (3, WindTurbineType3or4IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindContQPQULimIEC
extends
    CIMParseable[WindContQPQULimIEC]
{
    override val fields: Array[String] = Array[String] (
        "tpfiltql",
        "tufiltql",
        "WindDynamicsLookupTable",
        "WindTurbineType3or4IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindDynamicsLookupTable", "WindDynamicsLookupTable", "1..*", "0..1"),
        CIMRelationship ("WindTurbineType3or4IEC", "WindTurbineType3or4IEC", "0..1", "0..1")
    )
    val tpfiltql: Fielder = parse_element (element (cls, fields(0)))
    val tufiltql: Fielder = parse_element (element (cls, fields(1)))
    val WindDynamicsLookupTable: FielderMultiple = parse_attributes (attribute (cls, fields(2)))
    val WindTurbineType3or4IEC: Fielder = parse_attribute (attribute (cls, fields(3)))

    def parse (context: CIMContext): WindContQPQULimIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindContQPQULimIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (tpfiltql (), 0)),
            toDouble (mask (tufiltql (), 1)),
            masks (WindDynamicsLookupTable (), 2),
            mask (WindTurbineType3or4IEC (), 3)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindContQPQULimIEC] = WindContQPQULimIECSerializer
}

object WindContQPQULimIECSerializer extends CIMSerializer[WindContQPQULimIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindContQPQULimIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.tpfiltql),
            () => output.writeDouble (obj.tufiltql),
            () => writeList (obj.WindDynamicsLookupTable, output),
            () => output.writeString (obj.WindTurbineType3or4IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindContQPQULimIEC]): WindContQPQULimIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindContQPQULimIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) readList (input) else null,
            if (isSet (3)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Rotor resistance control model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.5.3.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param kirr Integral gain in rotor resistance PI controller (KIrr).
 *        It is a type-dependent parameter.
 * @param komegafilt Filter gain for generator speed measurement (Komegafilt).
 *        It is a type-dependent parameter.
 * @param kpfilt Filter gain for power measurement (Kpfilt).
 *        It is a type-dependent parameter.
 * @param kprr Proportional gain in rotor resistance PI controller (KPrr).
 *        It is a type-dependent parameter.
 * @param rmax Maximum rotor resistance (rmax) (> WindContRotorRIEC.rmin).
 *        It is a type-dependent parameter.
 * @param rmin Minimum rotor resistance (rmin) (< WindContRotorRIEC.rmax).
 *        It is a type-dependent parameter.
 * @param tomegafiltrr Filter time constant for generator speed measurement (Tomegafiltrr) (>= 0).
 *        It is a type-dependent parameter.
 * @param tpfiltrr Filter time constant for power measurement (Tpfiltrr) (>= 0).
 *        It is a type-dependent parameter.
 * @param WindDynamicsLookupTable [[ch.ninecode.model.WindDynamicsLookupTable WindDynamicsLookupTable]] The wind dynamics lookup table associated with this rotor resistance control model.
 * @param WindGenTurbineType2IEC [[ch.ninecode.model.WindGenTurbineType2IEC WindGenTurbineType2IEC]] Wind turbine type 2 model with whitch this wind control rotor resistance model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindContRotorRIEC
(
    IdentifiedObject: IdentifiedObject = null,
    kirr: Double = 0.0,
    komegafilt: Double = 0.0,
    kpfilt: Double = 0.0,
    kprr: Double = 0.0,
    rmax: Double = 0.0,
    rmin: Double = 0.0,
    tomegafiltrr: Double = 0.0,
    tpfiltrr: Double = 0.0,
    WindDynamicsLookupTable: List[String] = null,
    WindGenTurbineType2IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindContRotorRIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindContRotorRIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindContRotorRIEC.fields (position), value)
        def emitattrs (position: Int, value: List[String]): Unit = if (mask (position) && (null != value)) value.foreach (x => emit_attribute (WindContRotorRIEC.fields (position), x))
        emitelem (0, kirr)
        emitelem (1, komegafilt)
        emitelem (2, kpfilt)
        emitelem (3, kprr)
        emitelem (4, rmax)
        emitelem (5, rmin)
        emitelem (6, tomegafiltrr)
        emitelem (7, tpfiltrr)
        emitattrs (8, WindDynamicsLookupTable)
        emitattr (9, WindGenTurbineType2IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindContRotorRIEC
extends
    CIMParseable[WindContRotorRIEC]
{
    override val fields: Array[String] = Array[String] (
        "kirr",
        "komegafilt",
        "kpfilt",
        "kprr",
        "rmax",
        "rmin",
        "tomegafiltrr",
        "tpfiltrr",
        "WindDynamicsLookupTable",
        "WindGenTurbineType2IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindDynamicsLookupTable", "WindDynamicsLookupTable", "1..*", "0..1"),
        CIMRelationship ("WindGenTurbineType2IEC", "WindGenTurbineType2IEC", "1", "1")
    )
    val kirr: Fielder = parse_element (element (cls, fields(0)))
    val komegafilt: Fielder = parse_element (element (cls, fields(1)))
    val kpfilt: Fielder = parse_element (element (cls, fields(2)))
    val kprr: Fielder = parse_element (element (cls, fields(3)))
    val rmax: Fielder = parse_element (element (cls, fields(4)))
    val rmin: Fielder = parse_element (element (cls, fields(5)))
    val tomegafiltrr: Fielder = parse_element (element (cls, fields(6)))
    val tpfiltrr: Fielder = parse_element (element (cls, fields(7)))
    val WindDynamicsLookupTable: FielderMultiple = parse_attributes (attribute (cls, fields(8)))
    val WindGenTurbineType2IEC: Fielder = parse_attribute (attribute (cls, fields(9)))

    def parse (context: CIMContext): WindContRotorRIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindContRotorRIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (kirr (), 0)),
            toDouble (mask (komegafilt (), 1)),
            toDouble (mask (kpfilt (), 2)),
            toDouble (mask (kprr (), 3)),
            toDouble (mask (rmax (), 4)),
            toDouble (mask (rmin (), 5)),
            toDouble (mask (tomegafiltrr (), 6)),
            toDouble (mask (tpfiltrr (), 7)),
            masks (WindDynamicsLookupTable (), 8),
            mask (WindGenTurbineType2IEC (), 9)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindContRotorRIEC] = WindContRotorRIECSerializer
}

object WindContRotorRIECSerializer extends CIMSerializer[WindContRotorRIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindContRotorRIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.kirr),
            () => output.writeDouble (obj.komegafilt),
            () => output.writeDouble (obj.kpfilt),
            () => output.writeDouble (obj.kprr),
            () => output.writeDouble (obj.rmax),
            () => output.writeDouble (obj.rmin),
            () => output.writeDouble (obj.tomegafiltrr),
            () => output.writeDouble (obj.tpfiltrr),
            () => writeList (obj.WindDynamicsLookupTable, output),
            () => output.writeString (obj.WindGenTurbineType2IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindContRotorRIEC]): WindContRotorRIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindContRotorRIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readDouble else 0.0,
            if (isSet (4)) input.readDouble else 0.0,
            if (isSet (5)) input.readDouble else 0.0,
            if (isSet (6)) input.readDouble else 0.0,
            if (isSet (7)) input.readDouble else 0.0,
            if (isSet (8)) readList (input) else null,
            if (isSet (9)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Look up table for the purpose of wind standard models.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param input Input value (x) for the lookup table function.
 * @param lookupTableFunctionType Type of the lookup table function.
 * @param output Output value (y) for the lookup table function.
 * @param sequence Sequence numbers of the pairs of the input (x) and the output (y) of the lookup table function.
 * @param WindContCurrLimIEC [[ch.ninecode.model.WindContCurrLimIEC WindContCurrLimIEC]] The current control limitation model with which this wind dynamics lookup table is associated.
 * @param WindContPType3IEC [[ch.ninecode.model.WindContPType3IEC WindContPType3IEC]] The P control type 3 model with which this wind dynamics lookup table is associated.
 * @param WindContQPQULimIEC [[ch.ninecode.model.WindContQPQULimIEC WindContQPQULimIEC]] The QP and QU limitation model with which this wind dynamics lookup table is associated.
 * @param WindContRotorRIEC [[ch.ninecode.model.WindContRotorRIEC WindContRotorRIEC]] The rotor resistance control model with which this wind dynamics lookup table is associated.
 * @param WindGenType3bIEC [[ch.ninecode.model.WindGenType3bIEC WindGenType3bIEC]] The generator type 3B model with which this wind dynamics lookup table is associated.
 * @param WindPitchContPowerIEC [[ch.ninecode.model.WindPitchContPowerIEC WindPitchContPowerIEC]] The pitch control power model with which this wind dynamics lookup table is associated.
 * @param WindPlantFreqPcontrolIEC [[ch.ninecode.model.WindPlantFreqPcontrolIEC WindPlantFreqPcontrolIEC]] The frequency and active power wind plant control model with which this wind dynamics lookup table is associated.
 * @param WindPlantReactiveControlIEC [[ch.ninecode.model.WindPlantReactiveControlIEC WindPlantReactiveControlIEC]] The voltage and reactive power wind plant control model with which this wind dynamics lookup table is associated.
 * @param WindProtectionIEC [[ch.ninecode.model.WindProtectionIEC WindProtectionIEC]] The grid protection model with which this wind dynamics lookup table is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindDynamicsLookupTable
(
    IdentifiedObject: IdentifiedObject = null,
    input: Double = 0.0,
    lookupTableFunctionType: String = null,
    output: Double = 0.0,
    sequence: Int = 0,
    WindContCurrLimIEC: String = null,
    WindContPType3IEC: String = null,
    WindContQPQULimIEC: String = null,
    WindContRotorRIEC: String = null,
    WindGenType3bIEC: String = null,
    WindPitchContPowerIEC: String = null,
    WindPlantFreqPcontrolIEC: String = null,
    WindPlantReactiveControlIEC: String = null,
    WindProtectionIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindDynamicsLookupTable.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindDynamicsLookupTable.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindDynamicsLookupTable.fields (position), value)
        emitelem (0, input)
        emitattr (1, lookupTableFunctionType)
        emitelem (2, output)
        emitelem (3, sequence)
        emitattr (4, WindContCurrLimIEC)
        emitattr (5, WindContPType3IEC)
        emitattr (6, WindContQPQULimIEC)
        emitattr (7, WindContRotorRIEC)
        emitattr (8, WindGenType3bIEC)
        emitattr (9, WindPitchContPowerIEC)
        emitattr (10, WindPlantFreqPcontrolIEC)
        emitattr (11, WindPlantReactiveControlIEC)
        emitattr (12, WindProtectionIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindDynamicsLookupTable
extends
    CIMParseable[WindDynamicsLookupTable]
{
    override val fields: Array[String] = Array[String] (
        "input",
        "lookupTableFunctionType",
        "output",
        "sequence",
        "WindContCurrLimIEC",
        "WindContPType3IEC",
        "WindContQPQULimIEC",
        "WindContRotorRIEC",
        "WindGenType3bIEC",
        "WindPitchContPowerIEC",
        "WindPlantFreqPcontrolIEC",
        "WindPlantReactiveControlIEC",
        "WindProtectionIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindContCurrLimIEC", "WindContCurrLimIEC", "0..1", "1..*"),
        CIMRelationship ("WindContPType3IEC", "WindContPType3IEC", "0..1", "1..*"),
        CIMRelationship ("WindContQPQULimIEC", "WindContQPQULimIEC", "0..1", "1..*"),
        CIMRelationship ("WindContRotorRIEC", "WindContRotorRIEC", "0..1", "1..*"),
        CIMRelationship ("WindGenType3bIEC", "WindGenType3bIEC", "0..1", "1..*"),
        CIMRelationship ("WindPitchContPowerIEC", "WindPitchContPowerIEC", "0..1", "1..*"),
        CIMRelationship ("WindPlantFreqPcontrolIEC", "WindPlantFreqPcontrolIEC", "0..1", "1..*"),
        CIMRelationship ("WindPlantReactiveControlIEC", "WindPlantReactiveControlIEC", "0..1", "1..*"),
        CIMRelationship ("WindProtectionIEC", "WindProtectionIEC", "0..1", "1..*")
    )
    val input: Fielder = parse_element (element (cls, fields(0)))
    val lookupTableFunctionType: Fielder = parse_attribute (attribute (cls, fields(1)))
    val output: Fielder = parse_element (element (cls, fields(2)))
    val sequence: Fielder = parse_element (element (cls, fields(3)))
    val WindContCurrLimIEC: Fielder = parse_attribute (attribute (cls, fields(4)))
    val WindContPType3IEC: Fielder = parse_attribute (attribute (cls, fields(5)))
    val WindContQPQULimIEC: Fielder = parse_attribute (attribute (cls, fields(6)))
    val WindContRotorRIEC: Fielder = parse_attribute (attribute (cls, fields(7)))
    val WindGenType3bIEC: Fielder = parse_attribute (attribute (cls, fields(8)))
    val WindPitchContPowerIEC: Fielder = parse_attribute (attribute (cls, fields(9)))
    val WindPlantFreqPcontrolIEC: Fielder = parse_attribute (attribute (cls, fields(10)))
    val WindPlantReactiveControlIEC: Fielder = parse_attribute (attribute (cls, fields(11)))
    val WindProtectionIEC: Fielder = parse_attribute (attribute (cls, fields(12)))

    def parse (context: CIMContext): WindDynamicsLookupTable =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindDynamicsLookupTable (
            IdentifiedObject.parse (context),
            toDouble (mask (input (), 0)),
            mask (lookupTableFunctionType (), 1),
            toDouble (mask (output (), 2)),
            toInteger (mask (sequence (), 3)),
            mask (WindContCurrLimIEC (), 4),
            mask (WindContPType3IEC (), 5),
            mask (WindContQPQULimIEC (), 6),
            mask (WindContRotorRIEC (), 7),
            mask (WindGenType3bIEC (), 8),
            mask (WindPitchContPowerIEC (), 9),
            mask (WindPlantFreqPcontrolIEC (), 10),
            mask (WindPlantReactiveControlIEC (), 11),
            mask (WindProtectionIEC (), 12)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindDynamicsLookupTable] = WindDynamicsLookupTableSerializer
}

object WindDynamicsLookupTableSerializer extends CIMSerializer[WindDynamicsLookupTable]
{
    def write (kryo: Kryo, output: Output, obj: WindDynamicsLookupTable): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.input),
            () => output.writeString (obj.lookupTableFunctionType),
            () => output.writeDouble (obj.output),
            () => output.writeInt (obj.sequence),
            () => output.writeString (obj.WindContCurrLimIEC),
            () => output.writeString (obj.WindContPType3IEC),
            () => output.writeString (obj.WindContQPQULimIEC),
            () => output.writeString (obj.WindContRotorRIEC),
            () => output.writeString (obj.WindGenType3bIEC),
            () => output.writeString (obj.WindPitchContPowerIEC),
            () => output.writeString (obj.WindPlantFreqPcontrolIEC),
            () => output.writeString (obj.WindPlantReactiveControlIEC),
            () => output.writeString (obj.WindProtectionIEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindDynamicsLookupTable]): WindDynamicsLookupTable =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindDynamicsLookupTable (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readString else null,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readInt else 0,
            if (isSet (4)) input.readString else null,
            if (isSet (5)) input.readString else null,
            if (isSet (6)) input.readString else null,
            if (isSet (7)) input.readString else null,
            if (isSet (8)) input.readString else null,
            if (isSet (9)) input.readString else null,
            if (isSet (10)) input.readString else null,
            if (isSet (11)) input.readString else null,
            if (isSet (12)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Wind turbine IEC type 1A.
 *
 * Reference: IEC 61400-27-1:2015, 5.5.2.2.
 *
 * @param WindTurbineType1or2IEC [[ch.ninecode.model.WindTurbineType1or2IEC WindTurbineType1or2IEC]] Reference to the superclass object.
 * @param WindAeroConstIEC [[ch.ninecode.model.WindAeroConstIEC WindAeroConstIEC]] Wind aerodynamic model associated with this wind turbine type 1A model.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindGenTurbineType1aIEC
(
    WindTurbineType1or2IEC: WindTurbineType1or2IEC = null,
    WindAeroConstIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: WindTurbineType1or2IEC = WindTurbineType1or2IEC

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindGenTurbineType1aIEC.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindGenTurbineType1aIEC.fields (position), value)
        emitattr (0, WindAeroConstIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindGenTurbineType1aIEC
extends
    CIMParseable[WindGenTurbineType1aIEC]
{
    override val fields: Array[String] = Array[String] (
        "WindAeroConstIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindAeroConstIEC", "WindAeroConstIEC", "1", "1")
    )
    val WindAeroConstIEC: Fielder = parse_attribute (attribute (cls, fields(0)))

    def parse (context: CIMContext): WindGenTurbineType1aIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindGenTurbineType1aIEC (
            WindTurbineType1or2IEC.parse (context),
            mask (WindAeroConstIEC (), 0)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindGenTurbineType1aIEC] = WindGenTurbineType1aIECSerializer
}

object WindGenTurbineType1aIECSerializer extends CIMSerializer[WindGenTurbineType1aIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindGenTurbineType1aIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.WindAeroConstIEC)
        )
        WindTurbineType1or2IECSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindGenTurbineType1aIEC]): WindGenTurbineType1aIEC =
    {
        val parent = WindTurbineType1or2IECSerializer.read (kryo, input, classOf[WindTurbineType1or2IEC])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindGenTurbineType1aIEC (
            parent,
            if (isSet (0)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Wind turbine IEC type 1B.
 *
 * Reference: IEC 61400-27-1:2015, 5.5.2.3.
 *
 * @param WindTurbineType1or2IEC [[ch.ninecode.model.WindTurbineType1or2IEC WindTurbineType1or2IEC]] Reference to the superclass object.
 * @param WindPitchContPowerIEC [[ch.ninecode.model.WindPitchContPowerIEC WindPitchContPowerIEC]] Pitch control power model associated with this wind turbine type 1B model.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindGenTurbineType1bIEC
(
    WindTurbineType1or2IEC: WindTurbineType1or2IEC = null,
    WindPitchContPowerIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: WindTurbineType1or2IEC = WindTurbineType1or2IEC

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindGenTurbineType1bIEC.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindGenTurbineType1bIEC.fields (position), value)
        emitattr (0, WindPitchContPowerIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindGenTurbineType1bIEC
extends
    CIMParseable[WindGenTurbineType1bIEC]
{
    override val fields: Array[String] = Array[String] (
        "WindPitchContPowerIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindPitchContPowerIEC", "WindPitchContPowerIEC", "1", "0..1")
    )
    val WindPitchContPowerIEC: Fielder = parse_attribute (attribute (cls, fields(0)))

    def parse (context: CIMContext): WindGenTurbineType1bIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindGenTurbineType1bIEC (
            WindTurbineType1or2IEC.parse (context),
            mask (WindPitchContPowerIEC (), 0)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindGenTurbineType1bIEC] = WindGenTurbineType1bIECSerializer
}

object WindGenTurbineType1bIECSerializer extends CIMSerializer[WindGenTurbineType1bIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindGenTurbineType1bIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.WindPitchContPowerIEC)
        )
        WindTurbineType1or2IECSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindGenTurbineType1bIEC]): WindGenTurbineType1bIEC =
    {
        val parent = WindTurbineType1or2IECSerializer.read (kryo, input, classOf[WindTurbineType1or2IEC])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindGenTurbineType1bIEC (
            parent,
            if (isSet (0)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Wind turbine IEC type 2.
 *
 * Reference: IEC 61400-27-1:2015, 5.5.3.
 *
 * @param WindTurbineType1or2IEC [[ch.ninecode.model.WindTurbineType1or2IEC WindTurbineType1or2IEC]] Reference to the superclass object.
 * @param WindContRotorRIEC [[ch.ninecode.model.WindContRotorRIEC WindContRotorRIEC]] Wind control rotor resistance model associated with wind turbine type 2 model.
 * @param WindPitchContPowerIEC [[ch.ninecode.model.WindPitchContPowerIEC WindPitchContPowerIEC]] Pitch control power model associated with this wind turbine type 2 model.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindGenTurbineType2IEC
(
    WindTurbineType1or2IEC: WindTurbineType1or2IEC = null,
    WindContRotorRIEC: String = null,
    WindPitchContPowerIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: WindTurbineType1or2IEC = WindTurbineType1or2IEC

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindGenTurbineType2IEC.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindGenTurbineType2IEC.fields (position), value)
        emitattr (0, WindContRotorRIEC)
        emitattr (1, WindPitchContPowerIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindGenTurbineType2IEC
extends
    CIMParseable[WindGenTurbineType2IEC]
{
    override val fields: Array[String] = Array[String] (
        "WindContRotorRIEC",
        "WindPitchContPowerIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindContRotorRIEC", "WindContRotorRIEC", "1", "1"),
        CIMRelationship ("WindPitchContPowerIEC", "WindPitchContPowerIEC", "1", "0..1")
    )
    val WindContRotorRIEC: Fielder = parse_attribute (attribute (cls, fields(0)))
    val WindPitchContPowerIEC: Fielder = parse_attribute (attribute (cls, fields(1)))

    def parse (context: CIMContext): WindGenTurbineType2IEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindGenTurbineType2IEC (
            WindTurbineType1or2IEC.parse (context),
            mask (WindContRotorRIEC (), 0),
            mask (WindPitchContPowerIEC (), 1)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindGenTurbineType2IEC] = WindGenTurbineType2IECSerializer
}

object WindGenTurbineType2IECSerializer extends CIMSerializer[WindGenTurbineType2IEC]
{
    def write (kryo: Kryo, output: Output, obj: WindGenTurbineType2IEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.WindContRotorRIEC),
            () => output.writeString (obj.WindPitchContPowerIEC)
        )
        WindTurbineType1or2IECSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindGenTurbineType2IEC]): WindGenTurbineType2IEC =
    {
        val parent = WindTurbineType1or2IECSerializer.read (kryo, input, classOf[WindTurbineType1or2IEC])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindGenTurbineType2IEC (
            parent,
            if (isSet (0)) input.readString else null,
            if (isSet (1)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Parent class supporting relationships to IEC wind turbines type 3 generator models of IEC type 3A and 3B.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param dipmax Maximum active current ramp rate (dipmax).
 *        It is a project-dependent parameter.
 * @param diqmax Maximum reactive current ramp rate (diqmax).
 *        It is a project-dependent parameter.
 * @param xs Electromagnetic transient reactance (xS).
 *        It is a type-dependent parameter.
 * @param WindTurbineType3IEC [[ch.ninecode.model.WindTurbineType3IEC WindTurbineType3IEC]] Wind turbine type 3 model with which this wind generator type 3 is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindGenType3IEC
(
    IdentifiedObject: IdentifiedObject = null,
    dipmax: Double = 0.0,
    diqmax: Double = 0.0,
    xs: Double = 0.0,
    WindTurbineType3IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindGenType3IEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindGenType3IEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindGenType3IEC.fields (position), value)
        emitelem (0, dipmax)
        emitelem (1, diqmax)
        emitelem (2, xs)
        emitattr (3, WindTurbineType3IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindGenType3IEC
extends
    CIMParseable[WindGenType3IEC]
{
    override val fields: Array[String] = Array[String] (
        "dipmax",
        "diqmax",
        "xs",
        "WindTurbineType3IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindTurbineType3IEC", "WindTurbineType3IEC", "0..1", "0..1")
    )
    val dipmax: Fielder = parse_element (element (cls, fields(0)))
    val diqmax: Fielder = parse_element (element (cls, fields(1)))
    val xs: Fielder = parse_element (element (cls, fields(2)))
    val WindTurbineType3IEC: Fielder = parse_attribute (attribute (cls, fields(3)))

    def parse (context: CIMContext): WindGenType3IEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindGenType3IEC (
            IdentifiedObject.parse (context),
            toDouble (mask (dipmax (), 0)),
            toDouble (mask (diqmax (), 1)),
            toDouble (mask (xs (), 2)),
            mask (WindTurbineType3IEC (), 3)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindGenType3IEC] = WindGenType3IECSerializer
}

object WindGenType3IECSerializer extends CIMSerializer[WindGenType3IEC]
{
    def write (kryo: Kryo, output: Output, obj: WindGenType3IEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.dipmax),
            () => output.writeDouble (obj.diqmax),
            () => output.writeDouble (obj.xs),
            () => output.writeString (obj.WindTurbineType3IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindGenType3IEC]): WindGenType3IEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindGenType3IEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * IEC type 3A generator set model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.3.2.
 *
 * @param WindGenType3IEC [[ch.ninecode.model.WindGenType3IEC WindGenType3IEC]] Reference to the superclass object.
 * @param kpc Current PI controller proportional gain (KPc).
 *        It is a type-dependent parameter.
 * @param tic Current PI controller integration time constant (TIc) (>= 0).
 *        It is a type-dependent parameter.
 * @param WindTurbineType4IEC [[ch.ninecode.model.WindTurbineType4IEC WindTurbineType4IEC]] Wind turbine type 4 model with which this wind generator type 3A model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindGenType3aIEC
(
    WindGenType3IEC: WindGenType3IEC = null,
    kpc: Double = 0.0,
    tic: Double = 0.0,
    WindTurbineType4IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: WindGenType3IEC = WindGenType3IEC

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindGenType3aIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindGenType3aIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindGenType3aIEC.fields (position), value)
        emitelem (0, kpc)
        emitelem (1, tic)
        emitattr (2, WindTurbineType4IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindGenType3aIEC
extends
    CIMParseable[WindGenType3aIEC]
{
    override val fields: Array[String] = Array[String] (
        "kpc",
        "tic",
        "WindTurbineType4IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindTurbineType4IEC", "WindTurbineType4IEC", "0..1", "0..1")
    )
    val kpc: Fielder = parse_element (element (cls, fields(0)))
    val tic: Fielder = parse_element (element (cls, fields(1)))
    val WindTurbineType4IEC: Fielder = parse_attribute (attribute (cls, fields(2)))

    def parse (context: CIMContext): WindGenType3aIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindGenType3aIEC (
            WindGenType3IEC.parse (context),
            toDouble (mask (kpc (), 0)),
            toDouble (mask (tic (), 1)),
            mask (WindTurbineType4IEC (), 2)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindGenType3aIEC] = WindGenType3aIECSerializer
}

object WindGenType3aIECSerializer extends CIMSerializer[WindGenType3aIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindGenType3aIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.kpc),
            () => output.writeDouble (obj.tic),
            () => output.writeString (obj.WindTurbineType4IEC)
        )
        WindGenType3IECSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindGenType3aIEC]): WindGenType3aIEC =
    {
        val parent = WindGenType3IECSerializer.read (kryo, input, classOf[WindGenType3IEC])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindGenType3aIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * IEC type 3B generator set model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.3.3.
 *
 * @param WindGenType3IEC [[ch.ninecode.model.WindGenType3IEC WindGenType3IEC]] Reference to the superclass object.
 * @param mwtcwp Crowbar control mode (MWTcwp).
 *        It is a case-dependent parameter.
 *        true = 1 in the IEC model
 *        false = 0 in the IEC model.
 * @param tg Current generation time constant (Tg) (>= 0).
 *        It is a type-dependent parameter.
 * @param two Time constant for crowbar washout filter (Two) (>= 0).
 *        It is a case-dependent parameter.
 * @param WindDynamicsLookupTable [[ch.ninecode.model.WindDynamicsLookupTable WindDynamicsLookupTable]] The wind dynamics lookup table associated with this generator type 3B model.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindGenType3bIEC
(
    WindGenType3IEC: WindGenType3IEC = null,
    mwtcwp: Boolean = false,
    tg: Double = 0.0,
    two: Double = 0.0,
    WindDynamicsLookupTable: List[String] = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: WindGenType3IEC = WindGenType3IEC

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindGenType3bIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindGenType3bIEC.fields (position), value)
        def emitattrs (position: Int, value: List[String]): Unit = if (mask (position) && (null != value)) value.foreach (x => emit_attribute (WindGenType3bIEC.fields (position), x))
        emitelem (0, mwtcwp)
        emitelem (1, tg)
        emitelem (2, two)
        emitattrs (3, WindDynamicsLookupTable)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindGenType3bIEC
extends
    CIMParseable[WindGenType3bIEC]
{
    override val fields: Array[String] = Array[String] (
        "mwtcwp",
        "tg",
        "two",
        "WindDynamicsLookupTable"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindDynamicsLookupTable", "WindDynamicsLookupTable", "1..*", "0..1")
    )
    val mwtcwp: Fielder = parse_element (element (cls, fields(0)))
    val tg: Fielder = parse_element (element (cls, fields(1)))
    val two: Fielder = parse_element (element (cls, fields(2)))
    val WindDynamicsLookupTable: FielderMultiple = parse_attributes (attribute (cls, fields(3)))

    def parse (context: CIMContext): WindGenType3bIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindGenType3bIEC (
            WindGenType3IEC.parse (context),
            toBoolean (mask (mwtcwp (), 0)),
            toDouble (mask (tg (), 1)),
            toDouble (mask (two (), 2)),
            masks (WindDynamicsLookupTable (), 3)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindGenType3bIEC] = WindGenType3bIECSerializer
}

object WindGenType3bIECSerializer extends CIMSerializer[WindGenType3bIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindGenType3bIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeBoolean (obj.mwtcwp),
            () => output.writeDouble (obj.tg),
            () => output.writeDouble (obj.two),
            () => writeList (obj.WindDynamicsLookupTable, output)
        )
        WindGenType3IECSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindGenType3bIEC]): WindGenType3bIEC =
    {
        val parent = WindGenType3IECSerializer.read (kryo, input, classOf[WindGenType3IEC])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindGenType3bIEC (
            parent,
            if (isSet (0)) input.readBoolean else false,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) readList (input) else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * IEC type 4 generator set model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.3.4.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param dipmax Maximum active current ramp rate (dipmax).
 *        It is a project-dependent parameter.
 * @param diqmax Maximum reactive current ramp rate (diqmax).
 *        It is a project-dependent parameter.
 * @param diqmin Minimum reactive current ramp rate (diqmin).
 *        It is a project-dependent parameter.
 * @param tg Time constant (Tg) (>= 0).
 *        It is a type-dependent parameter.
 * @param WindTurbineType4aIEC [[ch.ninecode.model.WindTurbineType4aIEC WindTurbineType4aIEC]] Wind turbine type 4A model with which this wind generator type 4 model is associated.
 * @param WindTurbineType4bIEC [[ch.ninecode.model.WindTurbineType4bIEC WindTurbineType4bIEC]] Wind turbine type 4B model with which this wind generator type 4 model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindGenType4IEC
(
    IdentifiedObject: IdentifiedObject = null,
    dipmax: Double = 0.0,
    diqmax: Double = 0.0,
    diqmin: Double = 0.0,
    tg: Double = 0.0,
    WindTurbineType4aIEC: String = null,
    WindTurbineType4bIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindGenType4IEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindGenType4IEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindGenType4IEC.fields (position), value)
        emitelem (0, dipmax)
        emitelem (1, diqmax)
        emitelem (2, diqmin)
        emitelem (3, tg)
        emitattr (4, WindTurbineType4aIEC)
        emitattr (5, WindTurbineType4bIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindGenType4IEC
extends
    CIMParseable[WindGenType4IEC]
{
    override val fields: Array[String] = Array[String] (
        "dipmax",
        "diqmax",
        "diqmin",
        "tg",
        "WindTurbineType4aIEC",
        "WindTurbineType4bIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindTurbineType4aIEC", "WindTurbineType4aIEC", "0..1", "0..1"),
        CIMRelationship ("WindTurbineType4bIEC", "WindTurbineType4bIEC", "0..1", "0..1")
    )
    val dipmax: Fielder = parse_element (element (cls, fields(0)))
    val diqmax: Fielder = parse_element (element (cls, fields(1)))
    val diqmin: Fielder = parse_element (element (cls, fields(2)))
    val tg: Fielder = parse_element (element (cls, fields(3)))
    val WindTurbineType4aIEC: Fielder = parse_attribute (attribute (cls, fields(4)))
    val WindTurbineType4bIEC: Fielder = parse_attribute (attribute (cls, fields(5)))

    def parse (context: CIMContext): WindGenType4IEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindGenType4IEC (
            IdentifiedObject.parse (context),
            toDouble (mask (dipmax (), 0)),
            toDouble (mask (diqmax (), 1)),
            toDouble (mask (diqmin (), 2)),
            toDouble (mask (tg (), 3)),
            mask (WindTurbineType4aIEC (), 4),
            mask (WindTurbineType4bIEC (), 5)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindGenType4IEC] = WindGenType4IECSerializer
}

object WindGenType4IECSerializer extends CIMSerializer[WindGenType4IEC]
{
    def write (kryo: Kryo, output: Output, obj: WindGenType4IEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.dipmax),
            () => output.writeDouble (obj.diqmax),
            () => output.writeDouble (obj.diqmin),
            () => output.writeDouble (obj.tg),
            () => output.writeString (obj.WindTurbineType4aIEC),
            () => output.writeString (obj.WindTurbineType4bIEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindGenType4IEC]): WindGenType4IEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindGenType4IEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readDouble else 0.0,
            if (isSet (4)) input.readString else null,
            if (isSet (5)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Two mass model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.2.1.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param cdrt Drive train damping (cdrt).
 *        It is a type-dependent parameter.
 * @param hgen Inertia constant of generator (Hgen) (>= 0).
 *        It is a type-dependent parameter.
 * @param hwtr Inertia constant of wind turbine rotor (HWTR) (>= 0).
 *        It is a type-dependent parameter.
 * @param kdrt Drive train stiffness (kdrt).
 *        It is a type-dependent parameter.
 * @param WindTurbineType1or2IEC [[ch.ninecode.model.WindTurbineType1or2IEC WindTurbineType1or2IEC]] Wind generator type 1 or type 2 model with which this wind mechanical model is associated.
 * @param WindTurbineType3IEC [[ch.ninecode.model.WindTurbineType3IEC WindTurbineType3IEC]] Wind turbine type 3 model with which this wind mechanical model is associated.
 * @param WindTurbineType4bIEC [[ch.ninecode.model.WindTurbineType4bIEC WindTurbineType4bIEC]] Wind turbine type 4B model with which this wind mechanical model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindMechIEC
(
    IdentifiedObject: IdentifiedObject = null,
    cdrt: Double = 0.0,
    hgen: Double = 0.0,
    hwtr: Double = 0.0,
    kdrt: Double = 0.0,
    WindTurbineType1or2IEC: String = null,
    WindTurbineType3IEC: String = null,
    WindTurbineType4bIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindMechIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindMechIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindMechIEC.fields (position), value)
        emitelem (0, cdrt)
        emitelem (1, hgen)
        emitelem (2, hwtr)
        emitelem (3, kdrt)
        emitattr (4, WindTurbineType1or2IEC)
        emitattr (5, WindTurbineType3IEC)
        emitattr (6, WindTurbineType4bIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindMechIEC
extends
    CIMParseable[WindMechIEC]
{
    override val fields: Array[String] = Array[String] (
        "cdrt",
        "hgen",
        "hwtr",
        "kdrt",
        "WindTurbineType1or2IEC",
        "WindTurbineType3IEC",
        "WindTurbineType4bIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindTurbineType1or2IEC", "WindTurbineType1or2IEC", "0..1", "1"),
        CIMRelationship ("WindTurbineType3IEC", "WindTurbineType3IEC", "0..1", "1"),
        CIMRelationship ("WindTurbineType4bIEC", "WindTurbineType4bIEC", "0..1", "1")
    )
    val cdrt: Fielder = parse_element (element (cls, fields(0)))
    val hgen: Fielder = parse_element (element (cls, fields(1)))
    val hwtr: Fielder = parse_element (element (cls, fields(2)))
    val kdrt: Fielder = parse_element (element (cls, fields(3)))
    val WindTurbineType1or2IEC: Fielder = parse_attribute (attribute (cls, fields(4)))
    val WindTurbineType3IEC: Fielder = parse_attribute (attribute (cls, fields(5)))
    val WindTurbineType4bIEC: Fielder = parse_attribute (attribute (cls, fields(6)))

    def parse (context: CIMContext): WindMechIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindMechIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (cdrt (), 0)),
            toDouble (mask (hgen (), 1)),
            toDouble (mask (hwtr (), 2)),
            toDouble (mask (kdrt (), 3)),
            mask (WindTurbineType1or2IEC (), 4),
            mask (WindTurbineType3IEC (), 5),
            mask (WindTurbineType4bIEC (), 6)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindMechIEC] = WindMechIECSerializer
}

object WindMechIECSerializer extends CIMSerializer[WindMechIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindMechIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.cdrt),
            () => output.writeDouble (obj.hgen),
            () => output.writeDouble (obj.hwtr),
            () => output.writeDouble (obj.kdrt),
            () => output.writeString (obj.WindTurbineType1or2IEC),
            () => output.writeString (obj.WindTurbineType3IEC),
            () => output.writeString (obj.WindTurbineType4bIEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindMechIEC]): WindMechIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindMechIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readDouble else 0.0,
            if (isSet (4)) input.readString else null,
            if (isSet (5)) input.readString else null,
            if (isSet (6)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Pitch control power model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.5.1.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param dpmax Rate limit for increasing power (dpmax) (> WindPitchContPowerIEC.dpmin).
 *        It is a type-dependent parameter.
 * @param dpmin Rate limit for decreasing power (dpmin) (< WindPitchContPowerIEC.dpmax).
 *        It is a type-dependent parameter.
 * @param pmin Minimum power setting (pmin).
 *        It is a type-dependent parameter.
 * @param pset If pinit < pset then power will be ramped down to pmin.
 *        It is (pset) in the IEC 61400-27-1:2015. It is a type-dependent parameter.
 * @param t1 Lag time constant (T1) (>= 0).
 *        It is a type-dependent parameter.
 * @param tr Voltage measurement time constant (Tr) (>= 0).
 *        It is a type-dependent parameter.
 * @param uuvrt Dip detection threshold (uUVRT).
 *        It is a type-dependent parameter.
 * @param WindDynamicsLookupTable [[ch.ninecode.model.WindDynamicsLookupTable WindDynamicsLookupTable]] The wind dynamics lookup table associated with this pitch control power model.
 * @param WindGenTurbineType1bIEC [[ch.ninecode.model.WindGenTurbineType1bIEC WindGenTurbineType1bIEC]] Wind turbine type 1B model with which this pitch control power model is associated.
 * @param WindGenTurbineType2IEC [[ch.ninecode.model.WindGenTurbineType2IEC WindGenTurbineType2IEC]] Wind turbine type 2 model with which this pitch control power model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindPitchContPowerIEC
(
    IdentifiedObject: IdentifiedObject = null,
    dpmax: Double = 0.0,
    dpmin: Double = 0.0,
    pmin: Double = 0.0,
    pset: Double = 0.0,
    t1: Double = 0.0,
    tr: Double = 0.0,
    uuvrt: Double = 0.0,
    WindDynamicsLookupTable: List[String] = null,
    WindGenTurbineType1bIEC: String = null,
    WindGenTurbineType2IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindPitchContPowerIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindPitchContPowerIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindPitchContPowerIEC.fields (position), value)
        def emitattrs (position: Int, value: List[String]): Unit = if (mask (position) && (null != value)) value.foreach (x => emit_attribute (WindPitchContPowerIEC.fields (position), x))
        emitelem (0, dpmax)
        emitelem (1, dpmin)
        emitelem (2, pmin)
        emitelem (3, pset)
        emitelem (4, t1)
        emitelem (5, tr)
        emitelem (6, uuvrt)
        emitattrs (7, WindDynamicsLookupTable)
        emitattr (8, WindGenTurbineType1bIEC)
        emitattr (9, WindGenTurbineType2IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindPitchContPowerIEC
extends
    CIMParseable[WindPitchContPowerIEC]
{
    override val fields: Array[String] = Array[String] (
        "dpmax",
        "dpmin",
        "pmin",
        "pset",
        "t1",
        "tr",
        "uuvrt",
        "WindDynamicsLookupTable",
        "WindGenTurbineType1bIEC",
        "WindGenTurbineType2IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindDynamicsLookupTable", "WindDynamicsLookupTable", "1..*", "0..1"),
        CIMRelationship ("WindGenTurbineType1bIEC", "WindGenTurbineType1bIEC", "0..1", "1"),
        CIMRelationship ("WindGenTurbineType2IEC", "WindGenTurbineType2IEC", "0..1", "1")
    )
    val dpmax: Fielder = parse_element (element (cls, fields(0)))
    val dpmin: Fielder = parse_element (element (cls, fields(1)))
    val pmin: Fielder = parse_element (element (cls, fields(2)))
    val pset: Fielder = parse_element (element (cls, fields(3)))
    val t1: Fielder = parse_element (element (cls, fields(4)))
    val tr: Fielder = parse_element (element (cls, fields(5)))
    val uuvrt: Fielder = parse_element (element (cls, fields(6)))
    val WindDynamicsLookupTable: FielderMultiple = parse_attributes (attribute (cls, fields(7)))
    val WindGenTurbineType1bIEC: Fielder = parse_attribute (attribute (cls, fields(8)))
    val WindGenTurbineType2IEC: Fielder = parse_attribute (attribute (cls, fields(9)))

    def parse (context: CIMContext): WindPitchContPowerIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindPitchContPowerIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (dpmax (), 0)),
            toDouble (mask (dpmin (), 1)),
            toDouble (mask (pmin (), 2)),
            toDouble (mask (pset (), 3)),
            toDouble (mask (t1 (), 4)),
            toDouble (mask (tr (), 5)),
            toDouble (mask (uuvrt (), 6)),
            masks (WindDynamicsLookupTable (), 7),
            mask (WindGenTurbineType1bIEC (), 8),
            mask (WindGenTurbineType2IEC (), 9)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindPitchContPowerIEC] = WindPitchContPowerIECSerializer
}

object WindPitchContPowerIECSerializer extends CIMSerializer[WindPitchContPowerIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindPitchContPowerIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.dpmax),
            () => output.writeDouble (obj.dpmin),
            () => output.writeDouble (obj.pmin),
            () => output.writeDouble (obj.pset),
            () => output.writeDouble (obj.t1),
            () => output.writeDouble (obj.tr),
            () => output.writeDouble (obj.uuvrt),
            () => writeList (obj.WindDynamicsLookupTable, output),
            () => output.writeString (obj.WindGenTurbineType1bIEC),
            () => output.writeString (obj.WindGenTurbineType2IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindPitchContPowerIEC]): WindPitchContPowerIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindPitchContPowerIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readDouble else 0.0,
            if (isSet (4)) input.readDouble else 0.0,
            if (isSet (5)) input.readDouble else 0.0,
            if (isSet (6)) input.readDouble else 0.0,
            if (isSet (7)) readList (input) else null,
            if (isSet (8)) input.readString else null,
            if (isSet (9)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Parent class supporting relationships to wind turbines type 3 and type 4 and wind plant IEC and user-defined wind plants including their control models.
 *
 * @param DynamicsFunctionBlock [[ch.ninecode.model.DynamicsFunctionBlock DynamicsFunctionBlock]] Reference to the superclass object.
 * @param RemoteInputSignal [[ch.ninecode.model.RemoteInputSignal RemoteInputSignal]] The remote signal with which this power plant is associated.
 * @param WindTurbineType3or4Dynamics [[ch.ninecode.model.WindTurbineType3or4Dynamics WindTurbineType3or4Dynamics]] The wind turbine type 3 or type 4 associated with this wind plant.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindPlantDynamics
(
    DynamicsFunctionBlock: DynamicsFunctionBlock = null,
    RemoteInputSignal: String = null,
    WindTurbineType3or4Dynamics: List[String] = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: DynamicsFunctionBlock = DynamicsFunctionBlock

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindPlantDynamics.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindPlantDynamics.fields (position), value)
        def emitattrs (position: Int, value: List[String]): Unit = if (mask (position) && (null != value)) value.foreach (x => emit_attribute (WindPlantDynamics.fields (position), x))
        emitattr (0, RemoteInputSignal)
        emitattrs (1, WindTurbineType3or4Dynamics)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindPlantDynamics
extends
    CIMParseable[WindPlantDynamics]
{
    override val fields: Array[String] = Array[String] (
        "RemoteInputSignal",
        "WindTurbineType3or4Dynamics"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("RemoteInputSignal", "RemoteInputSignal", "0..1", "0..1"),
        CIMRelationship ("WindTurbineType3or4Dynamics", "WindTurbineType3or4Dynamics", "1..*", "0..1")
    )
    val RemoteInputSignal: Fielder = parse_attribute (attribute (cls, fields(0)))
    val WindTurbineType3or4Dynamics: FielderMultiple = parse_attributes (attribute (cls, fields(1)))

    def parse (context: CIMContext): WindPlantDynamics =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindPlantDynamics (
            DynamicsFunctionBlock.parse (context),
            mask (RemoteInputSignal (), 0),
            masks (WindTurbineType3or4Dynamics (), 1)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindPlantDynamics] = WindPlantDynamicsSerializer
}

object WindPlantDynamicsSerializer extends CIMSerializer[WindPlantDynamics]
{
    def write (kryo: Kryo, output: Output, obj: WindPlantDynamics): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.RemoteInputSignal),
            () => writeList (obj.WindTurbineType3or4Dynamics, output)
        )
        DynamicsFunctionBlockSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindPlantDynamics]): WindPlantDynamics =
    {
        val parent = DynamicsFunctionBlockSerializer.read (kryo, input, classOf[DynamicsFunctionBlock])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindPlantDynamics (
            parent,
            if (isSet (0)) input.readString else null,
            if (isSet (1)) readList (input) else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Frequency and active power controller model.
 *
 * Reference: IEC 61400-27-1:2015, Annex D.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param dprefmax Maximum ramp rate of pWTref request from the plant controller to the wind turbines (dprefmax) (> WindPlantFreqPcontrolIEC.dprefmin).
 *        It is a case-dependent parameter.
 * @param dprefmin Minimum (negative) ramp rate of pWTref request from the plant controller to the wind turbines (dprefmin) (< WindPlantFreqPcontrolIEC.dprefmax).
 *        It is a project-dependent parameter.
 * @param dpwprefmax Maximum positive ramp rate for wind plant power reference (dpWPrefmax) (> WindPlantFreqPcontrolIEC.dpwprefmin).
 *        It is a project-dependent parameter.
 * @param dpwprefmin Maximum negative ramp rate for wind plant power reference (dpWPrefmin) (< WindPlantFreqPcontrolIEC.dpwprefmax).
 *        It is a project-dependent parameter.
 * @param kiwpp Plant P controller integral gain (KIWPp).
 *        It is a project-dependent parameter.
 * @param kiwppmax Maximum PI integrator term (KIWPpmax) (> WindPlantFreqPcontrolIEC.kiwppmin).
 *        It is a project-dependent parameter.
 * @param kiwppmin Minimum PI integrator term (KIWPpmin) (< WindPlantFreqPcontrolIEC.kiwppmax).
 *        It is a project-dependent parameter.
 * @param kpwpp Plant P controller proportional gain (KPWPp).
 *        It is a project-dependent parameter.
 * @param kwppref Power reference gain (KWPpref).
 *        It is a project-dependent parameter.
 * @param prefmax Maximum pWTref request from the plant controller to the wind turbines (prefmax) (> WindPlantFreqPcontrolIEC.prefmin).
 *        It is a project-dependent parameter.
 * @param prefmin Minimum pWTref request from the plant controller to the wind turbines (prefmin) (< WindPlantFreqPcontrolIEC.prefmax).
 *        It is a project-dependent parameter.
 * @param tpft Lead time constant in reference value transfer function (Tpft) (>= 0).
 *        It is a project-dependent parameter.
 * @param tpfv Lag time constant in reference value transfer function (Tpfv) (>= 0).
 *        It is a project-dependent parameter.
 * @param twpffiltp Filter time constant for frequency measurement (TWPffiltp) (>= 0).
 *        It is a project-dependent parameter.
 * @param twppfiltp Filter time constant for active power measurement (TWPpfiltp) (>= 0).
 *        It is a project-dependent parameter.
 * @param WindDynamicsLookupTable [[ch.ninecode.model.WindDynamicsLookupTable WindDynamicsLookupTable]] The wind dynamics lookup table associated with this frequency and active power wind plant model.
 * @param WindPlantIEC [[ch.ninecode.model.WindPlantIEC WindPlantIEC]] Wind plant model with which this wind plant frequency and active power control is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindPlantFreqPcontrolIEC
(
    IdentifiedObject: IdentifiedObject = null,
    dprefmax: Double = 0.0,
    dprefmin: Double = 0.0,
    dpwprefmax: Double = 0.0,
    dpwprefmin: Double = 0.0,
    kiwpp: Double = 0.0,
    kiwppmax: Double = 0.0,
    kiwppmin: Double = 0.0,
    kpwpp: Double = 0.0,
    kwppref: Double = 0.0,
    prefmax: Double = 0.0,
    prefmin: Double = 0.0,
    tpft: Double = 0.0,
    tpfv: Double = 0.0,
    twpffiltp: Double = 0.0,
    twppfiltp: Double = 0.0,
    WindDynamicsLookupTable: List[String] = null,
    WindPlantIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindPlantFreqPcontrolIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindPlantFreqPcontrolIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindPlantFreqPcontrolIEC.fields (position), value)
        def emitattrs (position: Int, value: List[String]): Unit = if (mask (position) && (null != value)) value.foreach (x => emit_attribute (WindPlantFreqPcontrolIEC.fields (position), x))
        emitelem (0, dprefmax)
        emitelem (1, dprefmin)
        emitelem (2, dpwprefmax)
        emitelem (3, dpwprefmin)
        emitelem (4, kiwpp)
        emitelem (5, kiwppmax)
        emitelem (6, kiwppmin)
        emitelem (7, kpwpp)
        emitelem (8, kwppref)
        emitelem (9, prefmax)
        emitelem (10, prefmin)
        emitelem (11, tpft)
        emitelem (12, tpfv)
        emitelem (13, twpffiltp)
        emitelem (14, twppfiltp)
        emitattrs (15, WindDynamicsLookupTable)
        emitattr (16, WindPlantIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindPlantFreqPcontrolIEC
extends
    CIMParseable[WindPlantFreqPcontrolIEC]
{
    override val fields: Array[String] = Array[String] (
        "dprefmax",
        "dprefmin",
        "dpwprefmax",
        "dpwprefmin",
        "kiwpp",
        "kiwppmax",
        "kiwppmin",
        "kpwpp",
        "kwppref",
        "prefmax",
        "prefmin",
        "tpft",
        "tpfv",
        "twpffiltp",
        "twppfiltp",
        "WindDynamicsLookupTable",
        "WindPlantIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindDynamicsLookupTable", "WindDynamicsLookupTable", "1..*", "0..1"),
        CIMRelationship ("WindPlantIEC", "WindPlantIEC", "1", "1")
    )
    val dprefmax: Fielder = parse_element (element (cls, fields(0)))
    val dprefmin: Fielder = parse_element (element (cls, fields(1)))
    val dpwprefmax: Fielder = parse_element (element (cls, fields(2)))
    val dpwprefmin: Fielder = parse_element (element (cls, fields(3)))
    val kiwpp: Fielder = parse_element (element (cls, fields(4)))
    val kiwppmax: Fielder = parse_element (element (cls, fields(5)))
    val kiwppmin: Fielder = parse_element (element (cls, fields(6)))
    val kpwpp: Fielder = parse_element (element (cls, fields(7)))
    val kwppref: Fielder = parse_element (element (cls, fields(8)))
    val prefmax: Fielder = parse_element (element (cls, fields(9)))
    val prefmin: Fielder = parse_element (element (cls, fields(10)))
    val tpft: Fielder = parse_element (element (cls, fields(11)))
    val tpfv: Fielder = parse_element (element (cls, fields(12)))
    val twpffiltp: Fielder = parse_element (element (cls, fields(13)))
    val twppfiltp: Fielder = parse_element (element (cls, fields(14)))
    val WindDynamicsLookupTable: FielderMultiple = parse_attributes (attribute (cls, fields(15)))
    val WindPlantIEC: Fielder = parse_attribute (attribute (cls, fields(16)))

    def parse (context: CIMContext): WindPlantFreqPcontrolIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindPlantFreqPcontrolIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (dprefmax (), 0)),
            toDouble (mask (dprefmin (), 1)),
            toDouble (mask (dpwprefmax (), 2)),
            toDouble (mask (dpwprefmin (), 3)),
            toDouble (mask (kiwpp (), 4)),
            toDouble (mask (kiwppmax (), 5)),
            toDouble (mask (kiwppmin (), 6)),
            toDouble (mask (kpwpp (), 7)),
            toDouble (mask (kwppref (), 8)),
            toDouble (mask (prefmax (), 9)),
            toDouble (mask (prefmin (), 10)),
            toDouble (mask (tpft (), 11)),
            toDouble (mask (tpfv (), 12)),
            toDouble (mask (twpffiltp (), 13)),
            toDouble (mask (twppfiltp (), 14)),
            masks (WindDynamicsLookupTable (), 15),
            mask (WindPlantIEC (), 16)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindPlantFreqPcontrolIEC] = WindPlantFreqPcontrolIECSerializer
}

object WindPlantFreqPcontrolIECSerializer extends CIMSerializer[WindPlantFreqPcontrolIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindPlantFreqPcontrolIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.dprefmax),
            () => output.writeDouble (obj.dprefmin),
            () => output.writeDouble (obj.dpwprefmax),
            () => output.writeDouble (obj.dpwprefmin),
            () => output.writeDouble (obj.kiwpp),
            () => output.writeDouble (obj.kiwppmax),
            () => output.writeDouble (obj.kiwppmin),
            () => output.writeDouble (obj.kpwpp),
            () => output.writeDouble (obj.kwppref),
            () => output.writeDouble (obj.prefmax),
            () => output.writeDouble (obj.prefmin),
            () => output.writeDouble (obj.tpft),
            () => output.writeDouble (obj.tpfv),
            () => output.writeDouble (obj.twpffiltp),
            () => output.writeDouble (obj.twppfiltp),
            () => writeList (obj.WindDynamicsLookupTable, output),
            () => output.writeString (obj.WindPlantIEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindPlantFreqPcontrolIEC]): WindPlantFreqPcontrolIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindPlantFreqPcontrolIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readDouble else 0.0,
            if (isSet (4)) input.readDouble else 0.0,
            if (isSet (5)) input.readDouble else 0.0,
            if (isSet (6)) input.readDouble else 0.0,
            if (isSet (7)) input.readDouble else 0.0,
            if (isSet (8)) input.readDouble else 0.0,
            if (isSet (9)) input.readDouble else 0.0,
            if (isSet (10)) input.readDouble else 0.0,
            if (isSet (11)) input.readDouble else 0.0,
            if (isSet (12)) input.readDouble else 0.0,
            if (isSet (13)) input.readDouble else 0.0,
            if (isSet (14)) input.readDouble else 0.0,
            if (isSet (15)) readList (input) else null,
            if (isSet (16)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Simplified IEC type plant level model.
 *
 * Reference: IEC 61400-27-1:2015, Annex D.
 *
 * @param WindPlantDynamics [[ch.ninecode.model.WindPlantDynamics WindPlantDynamics]] Reference to the superclass object.
 * @param WindPlantFreqPcontrolIEC [[ch.ninecode.model.WindPlantFreqPcontrolIEC WindPlantFreqPcontrolIEC]] Wind plant frequency and active power control model associated with this wind plant.
 * @param WindPlantReactiveControlIEC [[ch.ninecode.model.WindPlantReactiveControlIEC WindPlantReactiveControlIEC]] Wind plant model with which this wind reactive control is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindPlantIEC
(
    WindPlantDynamics: WindPlantDynamics = null,
    WindPlantFreqPcontrolIEC: String = null,
    WindPlantReactiveControlIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: WindPlantDynamics = WindPlantDynamics

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindPlantIEC.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindPlantIEC.fields (position), value)
        emitattr (0, WindPlantFreqPcontrolIEC)
        emitattr (1, WindPlantReactiveControlIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindPlantIEC
extends
    CIMParseable[WindPlantIEC]
{
    override val fields: Array[String] = Array[String] (
        "WindPlantFreqPcontrolIEC",
        "WindPlantReactiveControlIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindPlantFreqPcontrolIEC", "WindPlantFreqPcontrolIEC", "1", "1"),
        CIMRelationship ("WindPlantReactiveControlIEC", "WindPlantReactiveControlIEC", "1", "1")
    )
    val WindPlantFreqPcontrolIEC: Fielder = parse_attribute (attribute (cls, fields(0)))
    val WindPlantReactiveControlIEC: Fielder = parse_attribute (attribute (cls, fields(1)))

    def parse (context: CIMContext): WindPlantIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindPlantIEC (
            WindPlantDynamics.parse (context),
            mask (WindPlantFreqPcontrolIEC (), 0),
            mask (WindPlantReactiveControlIEC (), 1)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindPlantIEC] = WindPlantIECSerializer
}

object WindPlantIECSerializer extends CIMSerializer[WindPlantIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindPlantIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.WindPlantFreqPcontrolIEC),
            () => output.writeString (obj.WindPlantReactiveControlIEC)
        )
        WindPlantDynamicsSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindPlantIEC]): WindPlantIEC =
    {
        val parent = WindPlantDynamicsSerializer.read (kryo, input, classOf[WindPlantDynamics])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindPlantIEC (
            parent,
            if (isSet (0)) input.readString else null,
            if (isSet (1)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Simplified plant voltage and reactive power control model for use with type 3 and type 4 wind turbine models.
 *
 * Reference: IEC 61400-27-1:2015, Annex D.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param dxrefmax Maximum positive ramp rate for wind turbine reactive power/voltage reference (dxrefmax) (> WindPlantReactiveControlIEC.dxrefmin).
 *        It is a project-dependent parameter.
 * @param dxrefmin Maximum negative ramp rate for wind turbine reactive power/voltage reference (dxrefmin) (< WindPlantReactiveControlIEC.dxrefmax).
 *        It is a project-dependent parameter.
 * @param kiwpx Plant Q controller integral gain (KIWPx).
 *        It is a project-dependent parameter.
 * @param kiwpxmax Maximum reactive power/voltage reference from integration (KIWPxmax) (> WindPlantReactiveControlIEC.kiwpxmin).
 *        It is a project-dependent parameter.
 * @param kiwpxmin Minimum reactive power/voltage reference from integration (KIWPxmin) (< WindPlantReactiveControlIEC.kiwpxmax).
 *        It is a project-dependent parameter.
 * @param kpwpx Plant Q controller proportional gain (KPWPx).
 *        It is a project-dependent parameter.
 * @param kwpqref Reactive power reference gain (KWPqref).
 *        It is a project-dependent parameter.
 * @param kwpqu Plant voltage control droop (KWPqu).
 *        It is a project-dependent parameter.
 * @param tuqfilt Filter time constant for voltage-dependent reactive power (Tuqfilt) (>= 0).
 *        It is a project-dependent parameter.
 * @param twppfiltq Filter time constant for active power measurement (TWPpfiltq) (>= 0).
 *        It is a project-dependent parameter.
 * @param twpqfiltq Filter time constant for reactive power measurement (TWPqfiltq) (>= 0).
 *        It is a project-dependent parameter.
 * @param twpufiltq Filter time constant for voltage measurement (TWPufiltq) (>= 0).
 *        It is a project-dependent parameter.
 * @param txft Lead time constant in reference value transfer function (Txft) (>= 0).
 *        It is a project-dependent parameter.
 * @param txfv Lag time constant in reference value transfer function (Txfv) (>= 0).
 *        It is a project-dependent parameter.
 * @param uwpqdip Voltage threshold for UVRT detection in Q control (uWPqdip).
 *        It is a project-dependent parameter.
 * @param windPlantQcontrolModesType Reactive power/voltage controller mode (MWPqmode).
 *        It is a case-dependent parameter.
 * @param xrefmax Maximum xWTref (qWTref or delta uWTref) request from the plant controller (xrefmax) (> WindPlantReactiveControlIEC.xrefmin).
 *        It is a case-dependent parameter.
 * @param xrefmin Minimum xWTref (qWTref or delta uWTref) request from the plant controller (xrefmin) (< WindPlantReactiveControlIEC.xrefmax).
 *        It is a project-dependent parameter.
 * @param WindDynamicsLookupTable [[ch.ninecode.model.WindDynamicsLookupTable WindDynamicsLookupTable]] The wind dynamics lookup table associated with this voltage and reactive power wind plant model.
 * @param WindPlantIEC [[ch.ninecode.model.WindPlantIEC WindPlantIEC]] Wind plant reactive control model associated with this wind plant.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindPlantReactiveControlIEC
(
    IdentifiedObject: IdentifiedObject = null,
    dxrefmax: Double = 0.0,
    dxrefmin: Double = 0.0,
    kiwpx: Double = 0.0,
    kiwpxmax: Double = 0.0,
    kiwpxmin: Double = 0.0,
    kpwpx: Double = 0.0,
    kwpqref: Double = 0.0,
    kwpqu: Double = 0.0,
    tuqfilt: Double = 0.0,
    twppfiltq: Double = 0.0,
    twpqfiltq: Double = 0.0,
    twpufiltq: Double = 0.0,
    txft: Double = 0.0,
    txfv: Double = 0.0,
    uwpqdip: Double = 0.0,
    windPlantQcontrolModesType: String = null,
    xrefmax: Double = 0.0,
    xrefmin: Double = 0.0,
    WindDynamicsLookupTable: List[String] = null,
    WindPlantIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindPlantReactiveControlIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindPlantReactiveControlIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindPlantReactiveControlIEC.fields (position), value)
        def emitattrs (position: Int, value: List[String]): Unit = if (mask (position) && (null != value)) value.foreach (x => emit_attribute (WindPlantReactiveControlIEC.fields (position), x))
        emitelem (0, dxrefmax)
        emitelem (1, dxrefmin)
        emitelem (2, kiwpx)
        emitelem (3, kiwpxmax)
        emitelem (4, kiwpxmin)
        emitelem (5, kpwpx)
        emitelem (6, kwpqref)
        emitelem (7, kwpqu)
        emitelem (8, tuqfilt)
        emitelem (9, twppfiltq)
        emitelem (10, twpqfiltq)
        emitelem (11, twpufiltq)
        emitelem (12, txft)
        emitelem (13, txfv)
        emitelem (14, uwpqdip)
        emitattr (15, windPlantQcontrolModesType)
        emitelem (16, xrefmax)
        emitelem (17, xrefmin)
        emitattrs (18, WindDynamicsLookupTable)
        emitattr (19, WindPlantIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindPlantReactiveControlIEC
extends
    CIMParseable[WindPlantReactiveControlIEC]
{
    override val fields: Array[String] = Array[String] (
        "dxrefmax",
        "dxrefmin",
        "kiwpx",
        "kiwpxmax",
        "kiwpxmin",
        "kpwpx",
        "kwpqref",
        "kwpqu",
        "tuqfilt",
        "twppfiltq",
        "twpqfiltq",
        "twpufiltq",
        "txft",
        "txfv",
        "uwpqdip",
        "windPlantQcontrolModesType",
        "xrefmax",
        "xrefmin",
        "WindDynamicsLookupTable",
        "WindPlantIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindDynamicsLookupTable", "WindDynamicsLookupTable", "1..*", "0..1"),
        CIMRelationship ("WindPlantIEC", "WindPlantIEC", "1", "1")
    )
    val dxrefmax: Fielder = parse_element (element (cls, fields(0)))
    val dxrefmin: Fielder = parse_element (element (cls, fields(1)))
    val kiwpx: Fielder = parse_element (element (cls, fields(2)))
    val kiwpxmax: Fielder = parse_element (element (cls, fields(3)))
    val kiwpxmin: Fielder = parse_element (element (cls, fields(4)))
    val kpwpx: Fielder = parse_element (element (cls, fields(5)))
    val kwpqref: Fielder = parse_element (element (cls, fields(6)))
    val kwpqu: Fielder = parse_element (element (cls, fields(7)))
    val tuqfilt: Fielder = parse_element (element (cls, fields(8)))
    val twppfiltq: Fielder = parse_element (element (cls, fields(9)))
    val twpqfiltq: Fielder = parse_element (element (cls, fields(10)))
    val twpufiltq: Fielder = parse_element (element (cls, fields(11)))
    val txft: Fielder = parse_element (element (cls, fields(12)))
    val txfv: Fielder = parse_element (element (cls, fields(13)))
    val uwpqdip: Fielder = parse_element (element (cls, fields(14)))
    val windPlantQcontrolModesType: Fielder = parse_attribute (attribute (cls, fields(15)))
    val xrefmax: Fielder = parse_element (element (cls, fields(16)))
    val xrefmin: Fielder = parse_element (element (cls, fields(17)))
    val WindDynamicsLookupTable: FielderMultiple = parse_attributes (attribute (cls, fields(18)))
    val WindPlantIEC: Fielder = parse_attribute (attribute (cls, fields(19)))

    def parse (context: CIMContext): WindPlantReactiveControlIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindPlantReactiveControlIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (dxrefmax (), 0)),
            toDouble (mask (dxrefmin (), 1)),
            toDouble (mask (kiwpx (), 2)),
            toDouble (mask (kiwpxmax (), 3)),
            toDouble (mask (kiwpxmin (), 4)),
            toDouble (mask (kpwpx (), 5)),
            toDouble (mask (kwpqref (), 6)),
            toDouble (mask (kwpqu (), 7)),
            toDouble (mask (tuqfilt (), 8)),
            toDouble (mask (twppfiltq (), 9)),
            toDouble (mask (twpqfiltq (), 10)),
            toDouble (mask (twpufiltq (), 11)),
            toDouble (mask (txft (), 12)),
            toDouble (mask (txfv (), 13)),
            toDouble (mask (uwpqdip (), 14)),
            mask (windPlantQcontrolModesType (), 15),
            toDouble (mask (xrefmax (), 16)),
            toDouble (mask (xrefmin (), 17)),
            masks (WindDynamicsLookupTable (), 18),
            mask (WindPlantIEC (), 19)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindPlantReactiveControlIEC] = WindPlantReactiveControlIECSerializer
}

object WindPlantReactiveControlIECSerializer extends CIMSerializer[WindPlantReactiveControlIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindPlantReactiveControlIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.dxrefmax),
            () => output.writeDouble (obj.dxrefmin),
            () => output.writeDouble (obj.kiwpx),
            () => output.writeDouble (obj.kiwpxmax),
            () => output.writeDouble (obj.kiwpxmin),
            () => output.writeDouble (obj.kpwpx),
            () => output.writeDouble (obj.kwpqref),
            () => output.writeDouble (obj.kwpqu),
            () => output.writeDouble (obj.tuqfilt),
            () => output.writeDouble (obj.twppfiltq),
            () => output.writeDouble (obj.twpqfiltq),
            () => output.writeDouble (obj.twpufiltq),
            () => output.writeDouble (obj.txft),
            () => output.writeDouble (obj.txfv),
            () => output.writeDouble (obj.uwpqdip),
            () => output.writeString (obj.windPlantQcontrolModesType),
            () => output.writeDouble (obj.xrefmax),
            () => output.writeDouble (obj.xrefmin),
            () => writeList (obj.WindDynamicsLookupTable, output),
            () => output.writeString (obj.WindPlantIEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindPlantReactiveControlIEC]): WindPlantReactiveControlIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindPlantReactiveControlIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readDouble else 0.0,
            if (isSet (4)) input.readDouble else 0.0,
            if (isSet (5)) input.readDouble else 0.0,
            if (isSet (6)) input.readDouble else 0.0,
            if (isSet (7)) input.readDouble else 0.0,
            if (isSet (8)) input.readDouble else 0.0,
            if (isSet (9)) input.readDouble else 0.0,
            if (isSet (10)) input.readDouble else 0.0,
            if (isSet (11)) input.readDouble else 0.0,
            if (isSet (12)) input.readDouble else 0.0,
            if (isSet (13)) input.readDouble else 0.0,
            if (isSet (14)) input.readDouble else 0.0,
            if (isSet (15)) input.readString else null,
            if (isSet (16)) input.readDouble else 0.0,
            if (isSet (17)) input.readDouble else 0.0,
            if (isSet (18)) readList (input) else null,
            if (isSet (19)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * The grid protection model includes protection against over- and under-voltage, and against over- and under-frequency.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.6.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param dfimax Maximum rate of change of frequency (dFmax).
 *        It is a type-dependent parameter.
 * @param fover Wind turbine over frequency protection activation threshold (fover).
 *        It is a project-dependent parameter.
 * @param funder Wind turbine under frequency protection activation threshold (funder).
 *        It is a project-dependent parameter.
 * @param mzc Zero crossing measurement mode (Mzc).
 *        It is a type-dependent parameter.
 *        true = WT protection system uses zero crossings to detect frequency (1 in the IEC model)
 *        false = WT protection system does not use zero crossings to detect frequency (0 in the IEC model).
 * @param tfma Time interval of moving average window (TfMA) (>= 0).
 *        It is a type-dependent parameter.
 * @param uover Wind turbine over voltage protection activation threshold (uover).
 *        It is a project-dependent parameter.
 * @param uunder Wind turbine under voltage protection activation threshold (uunder).
 *        It is a project-dependent parameter.
 * @param WindDynamicsLookupTable [[ch.ninecode.model.WindDynamicsLookupTable WindDynamicsLookupTable]] The wind dynamics lookup table associated with this grid protection model.
 * @param WindTurbineType1or2IEC [[ch.ninecode.model.WindTurbineType1or2IEC WindTurbineType1or2IEC]] Wind generator type 1 or type 2 model with which this wind turbine protection model is associated.
 * @param WindTurbineType3or4IEC [[ch.ninecode.model.WindTurbineType3or4IEC WindTurbineType3or4IEC]] Wind generator type 3 or type 4 model with which this wind turbine protection model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindProtectionIEC
(
    IdentifiedObject: IdentifiedObject = null,
    dfimax: Double = 0.0,
    fover: Double = 0.0,
    funder: Double = 0.0,
    mzc: Boolean = false,
    tfma: Double = 0.0,
    uover: Double = 0.0,
    uunder: Double = 0.0,
    WindDynamicsLookupTable: List[String] = null,
    WindTurbineType1or2IEC: String = null,
    WindTurbineType3or4IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindProtectionIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindProtectionIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindProtectionIEC.fields (position), value)
        def emitattrs (position: Int, value: List[String]): Unit = if (mask (position) && (null != value)) value.foreach (x => emit_attribute (WindProtectionIEC.fields (position), x))
        emitelem (0, dfimax)
        emitelem (1, fover)
        emitelem (2, funder)
        emitelem (3, mzc)
        emitelem (4, tfma)
        emitelem (5, uover)
        emitelem (6, uunder)
        emitattrs (7, WindDynamicsLookupTable)
        emitattr (8, WindTurbineType1or2IEC)
        emitattr (9, WindTurbineType3or4IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindProtectionIEC
extends
    CIMParseable[WindProtectionIEC]
{
    override val fields: Array[String] = Array[String] (
        "dfimax",
        "fover",
        "funder",
        "mzc",
        "tfma",
        "uover",
        "uunder",
        "WindDynamicsLookupTable",
        "WindTurbineType1or2IEC",
        "WindTurbineType3or4IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindDynamicsLookupTable", "WindDynamicsLookupTable", "1..*", "0..1"),
        CIMRelationship ("WindTurbineType1or2IEC", "WindTurbineType1or2IEC", "0..1", "1"),
        CIMRelationship ("WindTurbineType3or4IEC", "WindTurbineType3or4IEC", "0..1", "1")
    )
    val dfimax: Fielder = parse_element (element (cls, fields(0)))
    val fover: Fielder = parse_element (element (cls, fields(1)))
    val funder: Fielder = parse_element (element (cls, fields(2)))
    val mzc: Fielder = parse_element (element (cls, fields(3)))
    val tfma: Fielder = parse_element (element (cls, fields(4)))
    val uover: Fielder = parse_element (element (cls, fields(5)))
    val uunder: Fielder = parse_element (element (cls, fields(6)))
    val WindDynamicsLookupTable: FielderMultiple = parse_attributes (attribute (cls, fields(7)))
    val WindTurbineType1or2IEC: Fielder = parse_attribute (attribute (cls, fields(8)))
    val WindTurbineType3or4IEC: Fielder = parse_attribute (attribute (cls, fields(9)))

    def parse (context: CIMContext): WindProtectionIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindProtectionIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (dfimax (), 0)),
            toDouble (mask (fover (), 1)),
            toDouble (mask (funder (), 2)),
            toBoolean (mask (mzc (), 3)),
            toDouble (mask (tfma (), 4)),
            toDouble (mask (uover (), 5)),
            toDouble (mask (uunder (), 6)),
            masks (WindDynamicsLookupTable (), 7),
            mask (WindTurbineType1or2IEC (), 8),
            mask (WindTurbineType3or4IEC (), 9)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindProtectionIEC] = WindProtectionIECSerializer
}

object WindProtectionIECSerializer extends CIMSerializer[WindProtectionIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindProtectionIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.dfimax),
            () => output.writeDouble (obj.fover),
            () => output.writeDouble (obj.funder),
            () => output.writeBoolean (obj.mzc),
            () => output.writeDouble (obj.tfma),
            () => output.writeDouble (obj.uover),
            () => output.writeDouble (obj.uunder),
            () => writeList (obj.WindDynamicsLookupTable, output),
            () => output.writeString (obj.WindTurbineType1or2IEC),
            () => output.writeString (obj.WindTurbineType3or4IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindProtectionIEC]): WindProtectionIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindProtectionIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readBoolean else false,
            if (isSet (4)) input.readDouble else 0.0,
            if (isSet (5)) input.readDouble else 0.0,
            if (isSet (6)) input.readDouble else 0.0,
            if (isSet (7)) readList (input) else null,
            if (isSet (8)) input.readString else null,
            if (isSet (9)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Reference frame rotation model.
 *
 * Reference: IEC 61400-27-1:2015, 5.6.3.5.
 *
 * @param IdentifiedObject [[ch.ninecode.model.IdentifiedObject IdentifiedObject]] Reference to the superclass object.
 * @param tpll Time constant for PLL first order filter model (TPLL) (>= 0).
 *        It is a type-dependent parameter.
 * @param upll1 Voltage below which the angle of the voltage is filtered and possibly also frozen (uPLL1).
 *        It is a type-dependent parameter.
 * @param upll2 Voltage (uPLL2) below which the angle of the voltage is frozen if uPLL2 is smaller or equal to uPLL1 .
 *        It is a type-dependent parameter.
 * @param WindTurbineType3or4IEC [[ch.ninecode.model.WindTurbineType3or4IEC WindTurbineType3or4IEC]] Wind turbine type 3 or type 4 model with which this reference frame rotation model is associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindRefFrameRotIEC
(
    IdentifiedObject: IdentifiedObject = null,
    tpll: Double = 0.0,
    upll1: Double = 0.0,
    upll2: Double = 0.0,
    WindTurbineType3or4IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: IdentifiedObject = IdentifiedObject

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindRefFrameRotIEC.cls
        def emitelem (position: Int, value: Any): Unit = if (mask (position)) emit_element (WindRefFrameRotIEC.fields (position), value)
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindRefFrameRotIEC.fields (position), value)
        emitelem (0, tpll)
        emitelem (1, upll1)
        emitelem (2, upll2)
        emitattr (3, WindTurbineType3or4IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindRefFrameRotIEC
extends
    CIMParseable[WindRefFrameRotIEC]
{
    override val fields: Array[String] = Array[String] (
        "tpll",
        "upll1",
        "upll2",
        "WindTurbineType3or4IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindTurbineType3or4IEC", "WindTurbineType3or4IEC", "1", "1")
    )
    val tpll: Fielder = parse_element (element (cls, fields(0)))
    val upll1: Fielder = parse_element (element (cls, fields(1)))
    val upll2: Fielder = parse_element (element (cls, fields(2)))
    val WindTurbineType3or4IEC: Fielder = parse_attribute (attribute (cls, fields(3)))

    def parse (context: CIMContext): WindRefFrameRotIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindRefFrameRotIEC (
            IdentifiedObject.parse (context),
            toDouble (mask (tpll (), 0)),
            toDouble (mask (upll1 (), 1)),
            toDouble (mask (upll2 (), 2)),
            mask (WindTurbineType3or4IEC (), 3)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindRefFrameRotIEC] = WindRefFrameRotIECSerializer
}

object WindRefFrameRotIECSerializer extends CIMSerializer[WindRefFrameRotIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindRefFrameRotIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeDouble (obj.tpll),
            () => output.writeDouble (obj.upll1),
            () => output.writeDouble (obj.upll2),
            () => output.writeString (obj.WindTurbineType3or4IEC)
        )
        IdentifiedObjectSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindRefFrameRotIEC]): WindRefFrameRotIEC =
    {
        val parent = IdentifiedObjectSerializer.read (kryo, input, classOf[IdentifiedObject])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindRefFrameRotIEC (
            parent,
            if (isSet (0)) input.readDouble else 0.0,
            if (isSet (1)) input.readDouble else 0.0,
            if (isSet (2)) input.readDouble else 0.0,
            if (isSet (3)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Parent class supporting relationships to wind turbines type 1 and type 2 and their control models.
 *
 * Generator model for wind turbine of type 1 or type 2 is a standard asynchronous generator model.
 *
 * @param DynamicsFunctionBlock [[ch.ninecode.model.DynamicsFunctionBlock DynamicsFunctionBlock]] Reference to the superclass object.
 * @param AsynchronousMachineDynamics [[ch.ninecode.model.AsynchronousMachineDynamics AsynchronousMachineDynamics]] Asynchronous machine model with which this wind generator type 1 or type 2 model is associated.
 * @param RemoteInputSignal [[ch.ninecode.model.RemoteInputSignal RemoteInputSignal]] Remote input signal used by this wind generator type 1 or type 2 model.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindTurbineType1or2Dynamics
(
    DynamicsFunctionBlock: DynamicsFunctionBlock = null,
    AsynchronousMachineDynamics: String = null,
    RemoteInputSignal: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: DynamicsFunctionBlock = DynamicsFunctionBlock

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindTurbineType1or2Dynamics.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindTurbineType1or2Dynamics.fields (position), value)
        emitattr (0, AsynchronousMachineDynamics)
        emitattr (1, RemoteInputSignal)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindTurbineType1or2Dynamics
extends
    CIMParseable[WindTurbineType1or2Dynamics]
{
    override val fields: Array[String] = Array[String] (
        "AsynchronousMachineDynamics",
        "RemoteInputSignal"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("AsynchronousMachineDynamics", "AsynchronousMachineDynamics", "1", "0..1"),
        CIMRelationship ("RemoteInputSignal", "RemoteInputSignal", "0..1", "0..1")
    )
    val AsynchronousMachineDynamics: Fielder = parse_attribute (attribute (cls, fields(0)))
    val RemoteInputSignal: Fielder = parse_attribute (attribute (cls, fields(1)))

    def parse (context: CIMContext): WindTurbineType1or2Dynamics =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindTurbineType1or2Dynamics (
            DynamicsFunctionBlock.parse (context),
            mask (AsynchronousMachineDynamics (), 0),
            mask (RemoteInputSignal (), 1)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindTurbineType1or2Dynamics] = WindTurbineType1or2DynamicsSerializer
}

object WindTurbineType1or2DynamicsSerializer extends CIMSerializer[WindTurbineType1or2Dynamics]
{
    def write (kryo: Kryo, output: Output, obj: WindTurbineType1or2Dynamics): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.AsynchronousMachineDynamics),
            () => output.writeString (obj.RemoteInputSignal)
        )
        DynamicsFunctionBlockSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindTurbineType1or2Dynamics]): WindTurbineType1or2Dynamics =
    {
        val parent = DynamicsFunctionBlockSerializer.read (kryo, input, classOf[DynamicsFunctionBlock])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindTurbineType1or2Dynamics (
            parent,
            if (isSet (0)) input.readString else null,
            if (isSet (1)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Parent class supporting relationships to IEC wind turbines type 1 and type 2 including their control models.
 *
 * Generator model for wind turbine of IEC type 1 or type 2 is a standard asynchronous generator model.
 * Reference: IEC 61400-27-1:2015, 5.5.2 and 5.5.3.
 *
 * @param WindTurbineType1or2Dynamics [[ch.ninecode.model.WindTurbineType1or2Dynamics WindTurbineType1or2Dynamics]] Reference to the superclass object.
 * @param WindMechIEC [[ch.ninecode.model.WindMechIEC WindMechIEC]] Wind mechanical model associated with this wind generator type 1 or type 2 model.
 * @param WindProtectionIEC [[ch.ninecode.model.WindProtectionIEC WindProtectionIEC]] Wind turbune protection model associated with this wind generator type 1 or type 2 model.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindTurbineType1or2IEC
(
    WindTurbineType1or2Dynamics: WindTurbineType1or2Dynamics = null,
    WindMechIEC: String = null,
    WindProtectionIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: WindTurbineType1or2Dynamics = WindTurbineType1or2Dynamics

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindTurbineType1or2IEC.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindTurbineType1or2IEC.fields (position), value)
        emitattr (0, WindMechIEC)
        emitattr (1, WindProtectionIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindTurbineType1or2IEC
extends
    CIMParseable[WindTurbineType1or2IEC]
{
    override val fields: Array[String] = Array[String] (
        "WindMechIEC",
        "WindProtectionIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindMechIEC", "WindMechIEC", "1", "0..1"),
        CIMRelationship ("WindProtectionIEC", "WindProtectionIEC", "1", "0..1")
    )
    val WindMechIEC: Fielder = parse_attribute (attribute (cls, fields(0)))
    val WindProtectionIEC: Fielder = parse_attribute (attribute (cls, fields(1)))

    def parse (context: CIMContext): WindTurbineType1or2IEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindTurbineType1or2IEC (
            WindTurbineType1or2Dynamics.parse (context),
            mask (WindMechIEC (), 0),
            mask (WindProtectionIEC (), 1)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindTurbineType1or2IEC] = WindTurbineType1or2IECSerializer
}

object WindTurbineType1or2IECSerializer extends CIMSerializer[WindTurbineType1or2IEC]
{
    def write (kryo: Kryo, output: Output, obj: WindTurbineType1or2IEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.WindMechIEC),
            () => output.writeString (obj.WindProtectionIEC)
        )
        WindTurbineType1or2DynamicsSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindTurbineType1or2IEC]): WindTurbineType1or2IEC =
    {
        val parent = WindTurbineType1or2DynamicsSerializer.read (kryo, input, classOf[WindTurbineType1or2Dynamics])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindTurbineType1or2IEC (
            parent,
            if (isSet (0)) input.readString else null,
            if (isSet (1)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Parent class supporting relationships to IEC wind turbines type 3 including their control models.
 *
 * @param WindTurbineType3or4IEC [[ch.ninecode.model.WindTurbineType3or4IEC WindTurbineType3or4IEC]] Reference to the superclass object.
 * @param WindAeroOneDimIEC [[ch.ninecode.model.WindAeroOneDimIEC WindAeroOneDimIEC]] Wind aerodynamic model associated with this wind generator type 3 model.
 * @param WindAeroTwoDimIEC [[ch.ninecode.model.WindAeroTwoDimIEC WindAeroTwoDimIEC]] Wind aerodynamic model associated with this wind turbine type 3 model.
 * @param WindContPType3IEC [[ch.ninecode.model.WindContPType3IEC WindContPType3IEC]] Wind control P type 3 model associated with this wind turbine type 3 model.
 * @param WindContPitchAngleIEC [[ch.ninecode.model.WindContPitchAngleIEC WindContPitchAngleIEC]] Wind control pitch angle model associated with this wind turbine type 3.
 * @param WindGenType3IEC [[ch.ninecode.model.WindGenType3IEC WindGenType3IEC]] Wind generator type 3 model associated with this wind turbine type 3 model.
 * @param WindMechIEC [[ch.ninecode.model.WindMechIEC WindMechIEC]] Wind mechanical model associated with this wind turbine type 3 model.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindTurbineType3IEC
(
    WindTurbineType3or4IEC: WindTurbineType3or4IEC = null,
    WindAeroOneDimIEC: String = null,
    WindAeroTwoDimIEC: String = null,
    WindContPType3IEC: String = null,
    WindContPitchAngleIEC: String = null,
    WindGenType3IEC: String = null,
    WindMechIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: WindTurbineType3or4IEC = WindTurbineType3or4IEC

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindTurbineType3IEC.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindTurbineType3IEC.fields (position), value)
        emitattr (0, WindAeroOneDimIEC)
        emitattr (1, WindAeroTwoDimIEC)
        emitattr (2, WindContPType3IEC)
        emitattr (3, WindContPitchAngleIEC)
        emitattr (4, WindGenType3IEC)
        emitattr (5, WindMechIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindTurbineType3IEC
extends
    CIMParseable[WindTurbineType3IEC]
{
    override val fields: Array[String] = Array[String] (
        "WindAeroOneDimIEC",
        "WindAeroTwoDimIEC",
        "WindContPType3IEC",
        "WindContPitchAngleIEC",
        "WindGenType3IEC",
        "WindMechIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindAeroOneDimIEC", "WindAeroOneDimIEC", "0..1", "1"),
        CIMRelationship ("WindAeroTwoDimIEC", "WindAeroTwoDimIEC", "0..1", "1"),
        CIMRelationship ("WindContPType3IEC", "WindContPType3IEC", "1", "1"),
        CIMRelationship ("WindContPitchAngleIEC", "WindContPitchAngleIEC", "1", "1"),
        CIMRelationship ("WindGenType3IEC", "WindGenType3IEC", "0..1", "0..1"),
        CIMRelationship ("WindMechIEC", "WindMechIEC", "1", "0..1")
    )
    val WindAeroOneDimIEC: Fielder = parse_attribute (attribute (cls, fields(0)))
    val WindAeroTwoDimIEC: Fielder = parse_attribute (attribute (cls, fields(1)))
    val WindContPType3IEC: Fielder = parse_attribute (attribute (cls, fields(2)))
    val WindContPitchAngleIEC: Fielder = parse_attribute (attribute (cls, fields(3)))
    val WindGenType3IEC: Fielder = parse_attribute (attribute (cls, fields(4)))
    val WindMechIEC: Fielder = parse_attribute (attribute (cls, fields(5)))

    def parse (context: CIMContext): WindTurbineType3IEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindTurbineType3IEC (
            WindTurbineType3or4IEC.parse (context),
            mask (WindAeroOneDimIEC (), 0),
            mask (WindAeroTwoDimIEC (), 1),
            mask (WindContPType3IEC (), 2),
            mask (WindContPitchAngleIEC (), 3),
            mask (WindGenType3IEC (), 4),
            mask (WindMechIEC (), 5)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindTurbineType3IEC] = WindTurbineType3IECSerializer
}

object WindTurbineType3IECSerializer extends CIMSerializer[WindTurbineType3IEC]
{
    def write (kryo: Kryo, output: Output, obj: WindTurbineType3IEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.WindAeroOneDimIEC),
            () => output.writeString (obj.WindAeroTwoDimIEC),
            () => output.writeString (obj.WindContPType3IEC),
            () => output.writeString (obj.WindContPitchAngleIEC),
            () => output.writeString (obj.WindGenType3IEC),
            () => output.writeString (obj.WindMechIEC)
        )
        WindTurbineType3or4IECSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindTurbineType3IEC]): WindTurbineType3IEC =
    {
        val parent = WindTurbineType3or4IECSerializer.read (kryo, input, classOf[WindTurbineType3or4IEC])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindTurbineType3IEC (
            parent,
            if (isSet (0)) input.readString else null,
            if (isSet (1)) input.readString else null,
            if (isSet (2)) input.readString else null,
            if (isSet (3)) input.readString else null,
            if (isSet (4)) input.readString else null,
            if (isSet (5)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Parent class supporting relationships to wind turbines type 3 and type 4 and wind plant including their control models.
 *
 * @param DynamicsFunctionBlock [[ch.ninecode.model.DynamicsFunctionBlock DynamicsFunctionBlock]] Reference to the superclass object.
 * @param PowerElectronicsConnection [[ch.ninecode.model.PowerElectronicsConnection PowerElectronicsConnection]] The power electronics connection associated with this wind turbine type 3 or type 4 dynamics model.
 * @param RemoteInputSignal [[ch.ninecode.model.RemoteInputSignal RemoteInputSignal]] Remote input signal used by these wind turbine type 3 or type 4 models.
 * @param WindPlantDynamics [[ch.ninecode.model.WindPlantDynamics WindPlantDynamics]] The wind plant with which the wind turbines type 3 or type 4 are associated.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindTurbineType3or4Dynamics
(
    DynamicsFunctionBlock: DynamicsFunctionBlock = null,
    PowerElectronicsConnection: String = null,
    RemoteInputSignal: String = null,
    WindPlantDynamics: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: DynamicsFunctionBlock = DynamicsFunctionBlock

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindTurbineType3or4Dynamics.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindTurbineType3or4Dynamics.fields (position), value)
        emitattr (0, PowerElectronicsConnection)
        emitattr (1, RemoteInputSignal)
        emitattr (2, WindPlantDynamics)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindTurbineType3or4Dynamics
extends
    CIMParseable[WindTurbineType3or4Dynamics]
{
    override val fields: Array[String] = Array[String] (
        "PowerElectronicsConnection",
        "RemoteInputSignal",
        "WindPlantDynamics"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("PowerElectronicsConnection", "PowerElectronicsConnection", "1", "0..1"),
        CIMRelationship ("RemoteInputSignal", "RemoteInputSignal", "0..1", "0..1"),
        CIMRelationship ("WindPlantDynamics", "WindPlantDynamics", "0..1", "1..*")
    )
    val PowerElectronicsConnection: Fielder = parse_attribute (attribute (cls, fields(0)))
    val RemoteInputSignal: Fielder = parse_attribute (attribute (cls, fields(1)))
    val WindPlantDynamics: Fielder = parse_attribute (attribute (cls, fields(2)))

    def parse (context: CIMContext): WindTurbineType3or4Dynamics =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindTurbineType3or4Dynamics (
            DynamicsFunctionBlock.parse (context),
            mask (PowerElectronicsConnection (), 0),
            mask (RemoteInputSignal (), 1),
            mask (WindPlantDynamics (), 2)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindTurbineType3or4Dynamics] = WindTurbineType3or4DynamicsSerializer
}

object WindTurbineType3or4DynamicsSerializer extends CIMSerializer[WindTurbineType3or4Dynamics]
{
    def write (kryo: Kryo, output: Output, obj: WindTurbineType3or4Dynamics): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.PowerElectronicsConnection),
            () => output.writeString (obj.RemoteInputSignal),
            () => output.writeString (obj.WindPlantDynamics)
        )
        DynamicsFunctionBlockSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindTurbineType3or4Dynamics]): WindTurbineType3or4Dynamics =
    {
        val parent = DynamicsFunctionBlockSerializer.read (kryo, input, classOf[DynamicsFunctionBlock])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindTurbineType3or4Dynamics (
            parent,
            if (isSet (0)) input.readString else null,
            if (isSet (1)) input.readString else null,
            if (isSet (2)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Parent class supporting relationships to IEC wind turbines type 3 and type 4 including their control models.
 *
 * @param WindTurbineType3or4Dynamics [[ch.ninecode.model.WindTurbineType3or4Dynamics WindTurbineType3or4Dynamics]] Reference to the superclass object.
 * @param WIndContQIEC [[ch.ninecode.model.WindContQIEC WindContQIEC]] Wind control Q model associated with this wind turbine type 3 or type 4 model.
 * @param WindContCurrLimIEC [[ch.ninecode.model.WindContCurrLimIEC WindContCurrLimIEC]] Wind control current limitation model associated with this wind turbine type 3 or type 4 model.
 * @param WindContQLimIEC [[ch.ninecode.model.WindContQLimIEC WindContQLimIEC]] Constant Q limitation model associated with this wind generator type 3 or type 4 model.
 * @param WindContQPQULimIEC [[ch.ninecode.model.WindContQPQULimIEC WindContQPQULimIEC]] QP and QU limitation model associated with this wind generator type 3 or type 4 model.
 * @param WindProtectionIEC [[ch.ninecode.model.WindProtectionIEC WindProtectionIEC]] Wind turbune protection model associated with this wind generator type 3 or type 4 model.
 * @param WindRefFrameRotIEC [[ch.ninecode.model.WindRefFrameRotIEC WindRefFrameRotIEC]] Reference frame rotation model associated with this wind turbine type 3 or type 4 model.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindTurbineType3or4IEC
(
    WindTurbineType3or4Dynamics: WindTurbineType3or4Dynamics = null,
    WIndContQIEC: String = null,
    WindContCurrLimIEC: String = null,
    WindContQLimIEC: String = null,
    WindContQPQULimIEC: String = null,
    WindProtectionIEC: String = null,
    WindRefFrameRotIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: WindTurbineType3or4Dynamics = WindTurbineType3or4Dynamics

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindTurbineType3or4IEC.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindTurbineType3or4IEC.fields (position), value)
        emitattr (0, WIndContQIEC)
        emitattr (1, WindContCurrLimIEC)
        emitattr (2, WindContQLimIEC)
        emitattr (3, WindContQPQULimIEC)
        emitattr (4, WindProtectionIEC)
        emitattr (5, WindRefFrameRotIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindTurbineType3or4IEC
extends
    CIMParseable[WindTurbineType3or4IEC]
{
    override val fields: Array[String] = Array[String] (
        "WIndContQIEC",
        "WindContCurrLimIEC",
        "WindContQLimIEC",
        "WindContQPQULimIEC",
        "WindProtectionIEC",
        "WindRefFrameRotIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WIndContQIEC", "WindContQIEC", "1", "1"),
        CIMRelationship ("WindContCurrLimIEC", "WindContCurrLimIEC", "1", "1"),
        CIMRelationship ("WindContQLimIEC", "WindContQLimIEC", "0..1", "0..1"),
        CIMRelationship ("WindContQPQULimIEC", "WindContQPQULimIEC", "0..1", "0..1"),
        CIMRelationship ("WindProtectionIEC", "WindProtectionIEC", "1", "0..1"),
        CIMRelationship ("WindRefFrameRotIEC", "WindRefFrameRotIEC", "1", "1")
    )
    val WIndContQIEC: Fielder = parse_attribute (attribute (cls, fields(0)))
    val WindContCurrLimIEC: Fielder = parse_attribute (attribute (cls, fields(1)))
    val WindContQLimIEC: Fielder = parse_attribute (attribute (cls, fields(2)))
    val WindContQPQULimIEC: Fielder = parse_attribute (attribute (cls, fields(3)))
    val WindProtectionIEC: Fielder = parse_attribute (attribute (cls, fields(4)))
    val WindRefFrameRotIEC: Fielder = parse_attribute (attribute (cls, fields(5)))

    def parse (context: CIMContext): WindTurbineType3or4IEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindTurbineType3or4IEC (
            WindTurbineType3or4Dynamics.parse (context),
            mask (WIndContQIEC (), 0),
            mask (WindContCurrLimIEC (), 1),
            mask (WindContQLimIEC (), 2),
            mask (WindContQPQULimIEC (), 3),
            mask (WindProtectionIEC (), 4),
            mask (WindRefFrameRotIEC (), 5)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindTurbineType3or4IEC] = WindTurbineType3or4IECSerializer
}

object WindTurbineType3or4IECSerializer extends CIMSerializer[WindTurbineType3or4IEC]
{
    def write (kryo: Kryo, output: Output, obj: WindTurbineType3or4IEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.WIndContQIEC),
            () => output.writeString (obj.WindContCurrLimIEC),
            () => output.writeString (obj.WindContQLimIEC),
            () => output.writeString (obj.WindContQPQULimIEC),
            () => output.writeString (obj.WindProtectionIEC),
            () => output.writeString (obj.WindRefFrameRotIEC)
        )
        WindTurbineType3or4DynamicsSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindTurbineType3or4IEC]): WindTurbineType3or4IEC =
    {
        val parent = WindTurbineType3or4DynamicsSerializer.read (kryo, input, classOf[WindTurbineType3or4Dynamics])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindTurbineType3or4IEC (
            parent,
            if (isSet (0)) input.readString else null,
            if (isSet (1)) input.readString else null,
            if (isSet (2)) input.readString else null,
            if (isSet (3)) input.readString else null,
            if (isSet (4)) input.readString else null,
            if (isSet (5)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Parent class supporting relationships to IEC wind turbines type 4 including their control models.
 *
 * @param WindTurbineType3or4IEC [[ch.ninecode.model.WindTurbineType3or4IEC WindTurbineType3or4IEC]] Reference to the superclass object.
 * @param WindGenType3aIEC [[ch.ninecode.model.WindGenType3aIEC WindGenType3aIEC]] Wind generator type 3A model associated with this wind turbine type 4 model.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindTurbineType4IEC
(
    WindTurbineType3or4IEC: WindTurbineType3or4IEC = null,
    WindGenType3aIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: WindTurbineType3or4IEC = WindTurbineType3or4IEC

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindTurbineType4IEC.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindTurbineType4IEC.fields (position), value)
        emitattr (0, WindGenType3aIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindTurbineType4IEC
extends
    CIMParseable[WindTurbineType4IEC]
{
    override val fields: Array[String] = Array[String] (
        "WindGenType3aIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindGenType3aIEC", "WindGenType3aIEC", "0..1", "0..1")
    )
    val WindGenType3aIEC: Fielder = parse_attribute (attribute (cls, fields(0)))

    def parse (context: CIMContext): WindTurbineType4IEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindTurbineType4IEC (
            WindTurbineType3or4IEC.parse (context),
            mask (WindGenType3aIEC (), 0)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindTurbineType4IEC] = WindTurbineType4IECSerializer
}

object WindTurbineType4IECSerializer extends CIMSerializer[WindTurbineType4IEC]
{
    def write (kryo: Kryo, output: Output, obj: WindTurbineType4IEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.WindGenType3aIEC)
        )
        WindTurbineType3or4IECSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindTurbineType4IEC]): WindTurbineType4IEC =
    {
        val parent = WindTurbineType3or4IECSerializer.read (kryo, input, classOf[WindTurbineType3or4IEC])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindTurbineType4IEC (
            parent,
            if (isSet (0)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Wind turbine IEC type 4A.
 *
 * Reference: IEC 61400-27-1:2015, 5.5.5.2.
 *
 * @param WindTurbineType4IEC [[ch.ninecode.model.WindTurbineType4IEC WindTurbineType4IEC]] Reference to the superclass object.
 * @param WindContPType4aIEC [[ch.ninecode.model.WindContPType4aIEC WindContPType4aIEC]] Wind control P type 4A model associated with this wind turbine type 4A model.
 * @param WindGenType4IEC [[ch.ninecode.model.WindGenType4IEC WindGenType4IEC]] Wind generator type 4 model associated with this wind turbine type 4A model.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindTurbineType4aIEC
(
    WindTurbineType4IEC: WindTurbineType4IEC = null,
    WindContPType4aIEC: String = null,
    WindGenType4IEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: WindTurbineType4IEC = WindTurbineType4IEC

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindTurbineType4aIEC.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindTurbineType4aIEC.fields (position), value)
        emitattr (0, WindContPType4aIEC)
        emitattr (1, WindGenType4IEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindTurbineType4aIEC
extends
    CIMParseable[WindTurbineType4aIEC]
{
    override val fields: Array[String] = Array[String] (
        "WindContPType4aIEC",
        "WindGenType4IEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindContPType4aIEC", "WindContPType4aIEC", "1", "1"),
        CIMRelationship ("WindGenType4IEC", "WindGenType4IEC", "0..1", "0..1")
    )
    val WindContPType4aIEC: Fielder = parse_attribute (attribute (cls, fields(0)))
    val WindGenType4IEC: Fielder = parse_attribute (attribute (cls, fields(1)))

    def parse (context: CIMContext): WindTurbineType4aIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindTurbineType4aIEC (
            WindTurbineType4IEC.parse (context),
            mask (WindContPType4aIEC (), 0),
            mask (WindGenType4IEC (), 1)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindTurbineType4aIEC] = WindTurbineType4aIECSerializer
}

object WindTurbineType4aIECSerializer extends CIMSerializer[WindTurbineType4aIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindTurbineType4aIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.WindContPType4aIEC),
            () => output.writeString (obj.WindGenType4IEC)
        )
        WindTurbineType4IECSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindTurbineType4aIEC]): WindTurbineType4aIEC =
    {
        val parent = WindTurbineType4IECSerializer.read (kryo, input, classOf[WindTurbineType4IEC])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindTurbineType4aIEC (
            parent,
            if (isSet (0)) input.readString else null,
            if (isSet (1)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

/**
 * Wind turbine IEC type 4B.
 *
 * Reference: IEC 61400-27-1:2015, 5.5.5.3.
 *
 * @param WindTurbineType4IEC [[ch.ninecode.model.WindTurbineType4IEC WindTurbineType4IEC]] Reference to the superclass object.
 * @param WindContPType4bIEC [[ch.ninecode.model.WindContPType4bIEC WindContPType4bIEC]] Wind control P type 4B model associated with this wind turbine type 4B model.
 * @param WindGenType4IEC [[ch.ninecode.model.WindGenType4IEC WindGenType4IEC]] Wind generator type 4 model associated with this wind turbine type 4B model.
 * @param WindMechIEC [[ch.ninecode.model.WindMechIEC WindMechIEC]] Wind mechanical model associated with this wind turbine type 4B model.
 * @group WindDynamics
 * @groupname WindDynamics Package WindDynamics
 * @groupdesc WindDynamics Wind turbines are generally divided into four types, which are currently significant in power systems.  The four types have the following characteristics:
- type 1: wind turbine with directly grid connected asynchronous generator with fixed rotor resistance (typically squirrel cage);
- type 2: wind turbine with directly grid connected asynchronous generator with variable rotor resistance;
- type 3: wind turbines with doubly-fed asynchronous generators (directly connected stator and rotor connected through power converter);
- type 4: wind turbines connected to the grid through a full size power converter.
Models included in this package are according to IEC 61400-27-1:2015.
 */
final case class WindTurbineType4bIEC
(
    WindTurbineType4IEC: WindTurbineType4IEC = null,
    WindContPType4bIEC: String = null,
    WindGenType4IEC: String = null,
    WindMechIEC: String = null
)
extends
    Element
{
    /**
     * Return the superclass object.
     *
     * @return The typed superclass nested object.
     * @group Hierarchy
     * @groupname Hierarchy Class Hierarchy Related
     * @groupdesc Hierarchy Members related to the nested hierarchy of CIM classes.
     */
    override def sup: WindTurbineType4IEC = WindTurbineType4IEC

    //
    // Row overrides
    //

    /**
     * Return a copy of this object as a Row.
     *
     * Creates a clone of this object for use in Row manipulations.
     *
     * @return The copy of the object.
     * @group Row
     * @groupname Row SQL Row Implementation
     * @groupdesc Row Members related to implementing the SQL Row interface
     */
    override def copy (): Row = { clone ().asInstanceOf[Row] }

    override def export_fields: String =
    {
        implicit val s: StringBuilder = new StringBuilder (sup.export_fields)
        implicit val clz: String = WindTurbineType4bIEC.cls
        def emitattr (position: Int, value: Any): Unit = if (mask (position)) emit_attribute (WindTurbineType4bIEC.fields (position), value)
        emitattr (0, WindContPType4bIEC)
        emitattr (1, WindGenType4IEC)
        emitattr (2, WindMechIEC)
        s.toString
    }
    override def export: String =
    {
        "\t\n%s\t".format (if (about) "about" else "ID", id, export_fields)
    }
}

object WindTurbineType4bIEC
extends
    CIMParseable[WindTurbineType4bIEC]
{
    override val fields: Array[String] = Array[String] (
        "WindContPType4bIEC",
        "WindGenType4IEC",
        "WindMechIEC"
    )
    override val relations: List[CIMRelationship] = List (
        CIMRelationship ("WindContPType4bIEC", "WindContPType4bIEC", "1", "1"),
        CIMRelationship ("WindGenType4IEC", "WindGenType4IEC", "0..1", "0..1"),
        CIMRelationship ("WindMechIEC", "WindMechIEC", "1", "0..1")
    )
    val WindContPType4bIEC: Fielder = parse_attribute (attribute (cls, fields(0)))
    val WindGenType4IEC: Fielder = parse_attribute (attribute (cls, fields(1)))
    val WindMechIEC: Fielder = parse_attribute (attribute (cls, fields(2)))

    def parse (context: CIMContext): WindTurbineType4bIEC =
    {
        implicit val ctx: CIMContext = context
        implicit val bitfields: Array[Int] = Array(0)
        val ret = WindTurbineType4bIEC (
            WindTurbineType4IEC.parse (context),
            mask (WindContPType4bIEC (), 0),
            mask (WindGenType4IEC (), 1),
            mask (WindMechIEC (), 2)
        )
        ret.bitfields = bitfields
        ret
    }

    def serializer: Serializer[WindTurbineType4bIEC] = WindTurbineType4bIECSerializer
}

object WindTurbineType4bIECSerializer extends CIMSerializer[WindTurbineType4bIEC]
{
    def write (kryo: Kryo, output: Output, obj: WindTurbineType4bIEC): Unit =
    {
        val toSerialize: Array[() => Unit] = Array (
            () => output.writeString (obj.WindContPType4bIEC),
            () => output.writeString (obj.WindGenType4IEC),
            () => output.writeString (obj.WindMechIEC)
        )
        WindTurbineType4IECSerializer.write (kryo, output, obj.sup)
        implicit val bitfields: Array[Int] = obj.bitfields
        writeBitfields (output)
        writeFields (toSerialize)
    }

    def read (kryo: Kryo, input: Input, cls: Class[WindTurbineType4bIEC]): WindTurbineType4bIEC =
    {
        val parent = WindTurbineType4IECSerializer.read (kryo, input, classOf[WindTurbineType4IEC])
        implicit val bitfields: Array[Int] = readBitfields (input)
        val obj = WindTurbineType4bIEC (
            parent,
            if (isSet (0)) input.readString else null,
            if (isSet (1)) input.readString else null,
            if (isSet (2)) input.readString else null
        )
        obj.bitfields = bitfields
        obj
    }
}

private[ninecode] object _WindDynamics
{
    def register: List[CIMClassInfo] =
    {
        List (
            WindAeroConstIEC.register,
            WindAeroOneDimIEC.register,
            WindAeroTwoDimIEC.register,
            WindContCurrLimIEC.register,
            WindContPType3IEC.register,
            WindContPType4aIEC.register,
            WindContPType4bIEC.register,
            WindContPitchAngleIEC.register,
            WindContQIEC.register,
            WindContQLimIEC.register,
            WindContQPQULimIEC.register,
            WindContRotorRIEC.register,
            WindDynamicsLookupTable.register,
            WindGenTurbineType1aIEC.register,
            WindGenTurbineType1bIEC.register,
            WindGenTurbineType2IEC.register,
            WindGenType3IEC.register,
            WindGenType3aIEC.register,
            WindGenType3bIEC.register,
            WindGenType4IEC.register,
            WindMechIEC.register,
            WindPitchContPowerIEC.register,
            WindPlantDynamics.register,
            WindPlantFreqPcontrolIEC.register,
            WindPlantIEC.register,
            WindPlantReactiveControlIEC.register,
            WindProtectionIEC.register,
            WindRefFrameRotIEC.register,
            WindTurbineType1or2Dynamics.register,
            WindTurbineType1or2IEC.register,
            WindTurbineType3IEC.register,
            WindTurbineType3or4Dynamics.register,
            WindTurbineType3or4IEC.register,
            WindTurbineType4IEC.register,
            WindTurbineType4aIEC.register,
            WindTurbineType4bIEC.register
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy