Search in sources :

Example 1 with AASModelingKindDataType

use of opc.i4aas.AASModelingKindDataType in project FAAAST-Service by FraunhoferIOSB.

the class ValueConverter method convertModelingKind.

/**
 * Converts the given ModelingKind to the corresponding
 * AASModelingKindDataType.
 *
 * @param value the desired ModelingKind
 * @return The corresponding AASModelingKindDataType
 */
public static AASModelingKindDataType convertModelingKind(ModelingKind value) {
    AASModelingKindDataType retval;
    if (value == null) {
        logger.warn("convertModelingKind: value == null");
        retval = AASModelingKindDataType.Instance;
    } else {
        switch(value) {
            case INSTANCE:
                retval = AASModelingKindDataType.Instance;
                break;
            case TEMPLATE:
                retval = AASModelingKindDataType.Template;
                break;
            default:
                logger.warn("convertModelingKind: unknown value " + value);
                throw new IllegalArgumentException("unknown ModelingKind: " + value);
        }
    }
    return retval;
}
Also used : AASModelingKindDataType(opc.i4aas.AASModelingKindDataType)

Example 2 with AASModelingKindDataType

use of opc.i4aas.AASModelingKindDataType in project FAAAST-Service by FraunhoferIOSB.

the class AASSubmodelElementTypeNodeBase method getModelingKind.

@Mandatory
@Override
public AASModelingKindDataType getModelingKind() {
    UaVariable node = getModelingKindNode();
    if (node == null) {
        throw new RuntimeException("Mandatory node ModelingKind does not exist");
    }
    Variant value = node.getValue().getValue();
    return (AASModelingKindDataType) value.asEnum(AASModelingKindDataType.class);
}
Also used : Variant(com.prosysopc.ua.stack.builtintypes.Variant) UaVariable(com.prosysopc.ua.nodes.UaVariable) AASModelingKindDataType(opc.i4aas.AASModelingKindDataType) Mandatory(com.prosysopc.ua.nodes.Mandatory)

Example 3 with AASModelingKindDataType

use of opc.i4aas.AASModelingKindDataType in project FAAAST-Service by FraunhoferIOSB.

the class AASSubmodelTypeImplBase method getModelingKind.

@Mandatory
@Override
public AASModelingKindDataType getModelingKind() {
    UaVariable node = getModelingKindNode();
    if (node == null) {
        return null;
    }
    Variant value = node.getValue().getValue();
    return (AASModelingKindDataType) value.asEnum(AASModelingKindDataType.class);
}
Also used : Variant(com.prosysopc.ua.stack.builtintypes.Variant) UaVariable(com.prosysopc.ua.nodes.UaVariable) AASModelingKindDataType(opc.i4aas.AASModelingKindDataType) Mandatory(com.prosysopc.ua.nodes.Mandatory)

Example 4 with AASModelingKindDataType

use of opc.i4aas.AASModelingKindDataType in project FAAAST-Service by FraunhoferIOSB.

the class AASSubmodelElementTypeImplBase method getModelingKind.

@Mandatory
@Override
public AASModelingKindDataType getModelingKind() {
    UaVariable node = getModelingKindNode();
    if (node == null) {
        return null;
    }
    Variant value = node.getValue().getValue();
    return (AASModelingKindDataType) value.asEnum(AASModelingKindDataType.class);
}
Also used : Variant(com.prosysopc.ua.stack.builtintypes.Variant) UaVariable(com.prosysopc.ua.nodes.UaVariable) AASModelingKindDataType(opc.i4aas.AASModelingKindDataType) Mandatory(com.prosysopc.ua.nodes.Mandatory)

Example 5 with AASModelingKindDataType

use of opc.i4aas.AASModelingKindDataType in project FAAAST-Service by FraunhoferIOSB.

the class AASSubmodelTypeNodeBase method getModelingKind.

@Mandatory
@Override
public AASModelingKindDataType getModelingKind() {
    UaVariable node = getModelingKindNode();
    if (node == null) {
        throw new RuntimeException("Mandatory node ModelingKind does not exist");
    }
    Variant value = node.getValue().getValue();
    return (AASModelingKindDataType) value.asEnum(AASModelingKindDataType.class);
}
Also used : Variant(com.prosysopc.ua.stack.builtintypes.Variant) UaVariable(com.prosysopc.ua.nodes.UaVariable) AASModelingKindDataType(opc.i4aas.AASModelingKindDataType) Mandatory(com.prosysopc.ua.nodes.Mandatory)

Aggregations

AASModelingKindDataType (opc.i4aas.AASModelingKindDataType)5 Mandatory (com.prosysopc.ua.nodes.Mandatory)4 UaVariable (com.prosysopc.ua.nodes.UaVariable)4 Variant (com.prosysopc.ua.stack.builtintypes.Variant)4