Example usage for javax.activation UnsupportedDataTypeException printStackTrace

List of usage examples for javax.activation UnsupportedDataTypeException printStackTrace

Introduction

In this page you can find the example usage for javax.activation UnsupportedDataTypeException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:org.interpss.mapper.odm.impl.acsc.AbstractODMAcscDataMapper.java

private void setBusLoadEquivShuntY(ShortCircuitBusXmlType acscBusXml, AcscBus acscBus) {
    // at this point we assume that acscContributeLoadList has been consolidated to
    // the acscEquivLoad. The consolidation logic is implemented in AcscParserHelper.createBusScEquivLoadData()

    // we should not check condition here, since by arriving here acscLoadData should be of type ShortCircuitLoadDataXmlType 
    //if(acscBusXml.getLoadData().getEquivLoad().getValue() instanceof ShortCircuitLoadDataXmlType){

    ShortCircuitLoadDataXmlType acscLoadData = (ShortCircuitLoadDataXmlType) acscBusXml.getLoadData()
            .getEquivLoad().getValue();/* w w w  .j a  v  a 2 s.com*/

    // 1) positive sequence 
    if (acscBus.isConstPLoad() || acscBus.isConstILoad()) {
        /*
         * Use unit voltage vmag=1.0 to initialize the equivalent shuntY
         * 
         * For load flow-based short circuit analysis, 
         *  equivY_actual = equivY_0/v^2   for Constant Power load
         *                = equivY_0/v    for Constant current load
         * 
         */
        Complex eqivShuntY1 = acscBus.getLoad().conjugate();
        acscBus.setScLoadShuntY1(eqivShuntY1);
    } else if (acscBus.isFunctionLoad()) {
        try {
            throw new UnsupportedDataTypeException(
                    "ZIP function load is not supported for converting to positive sequence shunt load");
        } catch (UnsupportedDataTypeException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    //2) Negative part
    //2.1) if sequence data provided, it represents all loads connected to the bus

    if (acscLoadData.getShuntLoadNegativeY() != null) {
        YXmlType y2 = acscLoadData.getShuntLoadNegativeY();
        UnitType unit = ToYUnit.f(y2.getUnit());
        Complex ypu = UnitHelper.yConversion(new Complex(y2.getRe(), y2.getIm()), acscBus.getBaseVoltage(),
                acscBus.getNetwork().getBaseKva(), unit, UnitType.PU);
        acscBus.setScLoadShuntY2(ypu);
    }
    //1.2) else, shuntY2 = shuntY1 for the constant MVA and/or current part.
    else {
        if (acscBus.isConstPLoad() || acscBus.isConstILoad()) {
            /*
             * Use unit voltage vmag=1.0 to initialize the equivalent shuntY
             * 
             * For load flow-based short circuit analysis, 
             *  equivY_actual = equivY_0/v^2   for Constant Power load
             *                = equivY_0/v    for Constant current load
             * 
             */
            Complex eqivShuntY2 = acscBus.getLoad().conjugate();
            acscBus.setScLoadShuntY2(eqivShuntY2);
        } else if (acscBus.isFunctionLoad()) {
            try {
                throw new UnsupportedDataTypeException(
                        "ZIP function load is not supported for converting to negative sequence shunt load");
            } catch (UnsupportedDataTypeException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

    }

    //2) Zero sequence part
    if (acscLoadData.getShuntLoadZeroY() != null) {
        YXmlType y0 = acscLoadData.getShuntLoadNegativeY();
        UnitType unit = ToYUnit.f(y0.getUnit());
        Complex ypu = UnitHelper.yConversion(new Complex(y0.getRe(), y0.getIm()), acscBus.getBaseVoltage(),
                acscBus.getNetwork().getBaseKva(), unit, UnitType.PU);
        acscBus.setScLoadShuntY0(ypu);
    }
    // If not provided ,then the load is open from the zero sequence network
    //}
}

From source file:org.interpss.mapper.odm.impl.acsc.AbstractODMAcscParserMapper.java

private void setBusLoadEquivShuntY(ShortCircuitBusXmlType acscBusXml, AcscBus acscBus) {
    // at this point we assume that acscContributeLoadList has been consolidated to
    // the acscEquivLoad. The consolidation logic is implemented in AcscParserHelper.createBusScEquivLoadData()

    // we should not check condition here, since by arriving here acscLoadData should be of type ShortCircuitLoadDataXmlType 
    //if(acscBusXml.getLoadData().getEquivLoad().getValue() instanceof ShortCircuitLoadDataXmlType){
    //System.out.println("proc equiv load of bus#"+acscBus.getId());   
    ShortCircuitLoadDataXmlType acscLoadData = AcscParserHelper.getDefaultScLoad(acscBusXml.getLoadData());

    // 1) positive sequence 
    if (acscBus.isConstPLoad() || acscBus.isConstILoad()) {
        /*/*from   w  w w  .  ja va 2 s.  com*/
         * Use unit voltage vmag=1.0 to initialize the equivalent shuntY
         * 
         * For load flow-based short circuit analysis, 
         *  equivY_actual = equivY_0/v^2   for Constant Power load
         *                = equivY_0/v    for Constant current load
         * 
         */
        //TODO InterPSS ACSC algo will automatically calculate scLoadShuntY1 based on load flow or by setting v=1.0 
        //Complex eqivShuntY1= acscBus.getLoadPQ().conjugate();
        //acscBus.setScLoadShuntY1(eqivShuntY1);
    } else if (acscBus.isFunctionLoad()) {
        try {
            throw new UnsupportedDataTypeException(
                    "ZIP function load is not supported for converting to positive sequence shunt load");
        } catch (UnsupportedDataTypeException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    //2) Negative part
    //2.1) if sequence data provided, it represents all loads connected to the bus

    if (acscLoadData.getShuntLoadNegativeY() != null) {
        YXmlType y2 = acscLoadData.getShuntLoadNegativeY();
        UnitType unit = toYUnit.apply(y2.getUnit());
        Complex ypu = UnitHelper.yConversion(new Complex(y2.getRe(), y2.getIm()), acscBus.getBaseVoltage(),
                acscBus.getNetwork().getBaseKva(), unit, UnitType.PU);
        acscBus.setScLoadShuntY2(ypu);
    }
    //1.2) else, shuntY2 = shuntY1 for the constant MVA and/or current part.
    else {
        if (acscBus.isConstPLoad() || acscBus.isConstILoad()) {
            /*
             * Use unit voltage vmag=1.0 to initialize the equivalent shuntY
             * 
             * For load flow-based short circuit analysis, 
             *  equivY_actual = equivY_0/v^2   for Constant Power load
             *                = equivY_0/v    for Constant current load
             * 
             */
            //TODO InterPSS ACSC algo will automatically calculate scLoadShuntY2 if it is not provided. 
            //Complex eqivShuntY2= acscBus.getLoadPQ().conjugate();
            //acscBus.setScLoadShuntY2(eqivShuntY2);
        } else if (acscBus.isFunctionLoad()) {
            try {
                throw new UnsupportedDataTypeException(
                        "ZIP function load is not supported for converting to negative sequence shunt load");
            } catch (UnsupportedDataTypeException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

    }

    //2) Zero sequence part
    if (acscLoadData.getShuntLoadZeroY() != null) {
        YXmlType y0 = acscLoadData.getShuntLoadNegativeY();
        UnitType unit = toYUnit.apply(y0.getUnit());
        Complex ypu = UnitHelper.yConversion(new Complex(y0.getRe(), y0.getIm()), acscBus.getBaseVoltage(),
                acscBus.getNetwork().getBaseKva(), unit, UnitType.PU);
        acscBus.setScLoadShuntY0(ypu);
    }
    // If not provided ,then the load is open from the zero sequence network
    //}
}