Search in sources :

Example 61 with Feature

use of com.google.cloud.vision.v1p4beta1.Feature in project osate2 by osate.

the class FeatureImpl method getPropertyValue.

public void getPropertyValue(Property prop, PropertyAcc pas, Classifier cl, final boolean all) {
    Classifier owner = getContainingClassifier();
    // local contained value
    if (pas.addLocalContained(this, owner) && !all || pas.addLocal(this)) {
        if (!all) {
            return;
        }
    }
    // values from refined features
    Feature refined = getRefined();
    while (refined != null) {
        if (pas.addLocal(refined)) {
            if (!all) {
                return;
            }
        }
        refined = refined.getRefined();
    }
    getPropertyValueHelper(prop, pas, cl, all);
    // feature group TYPE, not an implementation.
    if (prop.isInherit()) {
        owner.getPropertyValueInternal(prop, pas, true, all);
    }
}
Also used : FeatureClassifier(org.osate.aadl2.FeatureClassifier) ComponentClassifier(org.osate.aadl2.ComponentClassifier) Classifier(org.osate.aadl2.Classifier) Feature(org.osate.aadl2.Feature)

Example 62 with Feature

use of com.google.cloud.vision.v1p4beta1.Feature in project osate2 by osate.

the class FeatureGroupTypeImpl method processFeatures.

private void processFeatures(final List<Feature> allFeatures, final List<Feature> refinedFeatures, final List<Feature> localFeatures) {
    /*
		 * Iterate backwards, so when we insert features at the start of the complete list, they
		 * still are inserted in the order of declaration. Keep the refined features in order because
		 * the types get visited from the bottom of the tree up, so the feature being refined will
		 * not have been added to the list yet.
		 */
    for (final ListIterator<Feature> listIter = localFeatures.listIterator(localFeatures.size()); listIter.hasPrevious(); ) {
        final Feature f = listIter.previous();
        final Feature r = f.getRefined();
        if (r == null) {
            allFeatures.add(0, f);
        } else {
            refinedFeatures.add(0, f);
        }
    }
}
Also used : Feature(org.osate.aadl2.Feature) AbstractFeature(org.osate.aadl2.AbstractFeature) ClassifierFeature(org.osate.aadl2.ClassifierFeature)

Example 63 with Feature

use of com.google.cloud.vision.v1p4beta1.Feature in project osate2 by osate.

the class FlowEndImpl method setFeature.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setFeature(Feature newFeature) {
    Feature oldFeature = feature;
    feature = newFeature;
    if (eNotificationRequired()) {
        eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.FLOW_END__FEATURE, oldFeature, feature));
    }
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) Feature(org.osate.aadl2.Feature)

Example 64 with Feature

use of com.google.cloud.vision.v1p4beta1.Feature in project osate2 by osate.

the class FeatureGroupImpl method getAllFeatureGroupType.

/*
	 * Get the feature group type of given feature group or its refinement ancestor, if it has
	 * one, otherwise null.
	 *
	 * @return The FeatureGroupType, or <code>null</code> if none.
	 */
public FeatureGroupType getAllFeatureGroupType() {
    FeatureGroupType cc = getFeatureGroupType();
    Feature f = this;
    while (cc == null && f.getRefined() != null) {
        f = f.getRefined();
        if (f instanceof FeatureGroup) {
            cc = ((FeatureGroup) f).getFeatureGroupType();
        }
    }
    return cc;
}
Also used : FeatureGroup(org.osate.aadl2.FeatureGroup) FeatureGroupType(org.osate.aadl2.FeatureGroupType) Feature(org.osate.aadl2.Feature)

Example 65 with Feature

use of com.google.cloud.vision.v1p4beta1.Feature in project osate2 by osate.

the class Aadl2InstanceUtil method getIncomingConnection.

/**
 * find incoming connection that goes through the feature of the specified component instance
 * @param ci Component instance
 * @param fi Feature instance
 * @return list of connection instances going through the feature
 */
public static EList<ConnectionInstance> getIncomingConnection(ComponentInstance ci, FeatureInstance fi) {
    Feature f = fi.getFeature();
    EList<ConnectionInstance> result = new BasicEList<ConnectionInstance>();
    // allEnclosingConnectionInstances();
    Iterable<ConnectionInstance> it = ci.getSystemInstance().getAllConnectionInstances();
    for (ConnectionInstance connectionInstance : it) {
        ConnectionInstanceEnd dest = connectionInstance.getDestination();
        ComponentInstance destci = dest.getContainingComponentInstance();
        if (containedIn(destci, ci)) {
            EList<ConnectionReference> connreflist = connectionInstance.getConnectionReferences();
            for (ConnectionReference connectionReference : connreflist) {
                ComponentInstance pci = connectionReference.getContext();
                Connection conn = connectionReference.getConnection();
                ConnectionEnd ce = conn.getAllSource();
                if (pci == ci.getContainingComponentInstance() && ce == f) {
                    result.add(connectionInstance);
                }
            }
        }
    }
    return result;
}
Also used : ConnectionInstance(org.osate.aadl2.instance.ConnectionInstance) ConnectionInstanceEnd(org.osate.aadl2.instance.ConnectionInstanceEnd) BasicEList(org.eclipse.emf.common.util.BasicEList) ConnectionReference(org.osate.aadl2.instance.ConnectionReference) ComponentInstance(org.osate.aadl2.instance.ComponentInstance) Connection(org.osate.aadl2.Connection) ConnectionEnd(org.osate.aadl2.ConnectionEnd) Feature(org.osate.aadl2.Feature)

Aggregations

Feature (org.osate.aadl2.Feature)82 ArrayList (java.util.ArrayList)78 Feature (com.google.cloud.vision.v1.Feature)72 AnnotateImageRequest (com.google.cloud.vision.v1.AnnotateImageRequest)69 Image (com.google.cloud.vision.v1.Image)69 BatchAnnotateImagesResponse (com.google.cloud.vision.v1.BatchAnnotateImagesResponse)66 ImageAnnotatorClient (com.google.cloud.vision.v1.ImageAnnotatorClient)66 AnnotateImageResponse (com.google.cloud.vision.v1.AnnotateImageResponse)63 ByteString (com.google.protobuf.ByteString)47 ImageSource (com.google.cloud.vision.v1.ImageSource)38 FileInputStream (java.io.FileInputStream)30 Subcomponent (org.osate.aadl2.Subcomponent)29 EntityAnnotation (com.google.cloud.vision.v1.EntityAnnotation)27 Classifier (org.osate.aadl2.Classifier)27 WebImage (com.google.cloud.vision.v1.WebDetection.WebImage)26 ComponentClassifier (org.osate.aadl2.ComponentClassifier)22 NamedElement (org.osate.aadl2.NamedElement)22 FeatureGroup (org.osate.aadl2.FeatureGroup)18 FeatureInstance (org.osate.aadl2.instance.FeatureInstance)17 FeatureGroupType (org.osate.aadl2.FeatureGroupType)16