Search in sources :

Example 56 with Feature

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

the class AadlUtil method hasOutgoingFeatureSubcomponents.

/**
 * determine whether a component instance has subcomponents that can have
 * outgoing connections
 *
 * @param subcompinstances list of sub component instances
 */
public static boolean hasOutgoingFeatureSubcomponents(EList<? extends ComponentInstance> subcompinstances) {
    for (ComponentInstance o : subcompinstances) {
        EList<FeatureInstance> filist = o.getFeatureInstances();
        for (FeatureInstance fi : filist) {
            Feature f = fi.getFeature();
            if (isOutgoingFeature(f)) {
                return true;
            }
        }
        // subcomponent can be access source
        ComponentCategory cat = o.getCategory();
        if (cat == DATA || cat == BUS || cat == VIRTUAL_BUS || cat == SUBPROGRAM || cat == SUBPROGRAM_GROUP) {
            return true;
        }
    }
    return false;
}
Also used : FeatureInstance(org.osate.aadl2.instance.FeatureInstance) ComponentInstance(org.osate.aadl2.instance.ComponentInstance) Feature(org.osate.aadl2.Feature) AbstractFeature(org.osate.aadl2.AbstractFeature) ComponentCategory(org.osate.aadl2.ComponentCategory)

Example 57 with Feature

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

the class ComponentTypeImpl method getAllFeatures.

/**
 * get list of all features of a component type, including ancestor features
 * In case of refined features the refined feature is returned.
 *
 * @return List of feature objects
 */
// XXX: [AADL 1 -> AADL 2] Added to make instantiation work.
public EList<Feature> getAllFeatures() {
    final EList<Classifier> ancestors = getSelfPlusAllExtended();
    final BasicEList<Feature> returnlist = new BasicEList<Feature>();
    // Process from farthest ancestor to self
    for (ListIterator<Classifier> li = ancestors.listIterator(ancestors.size()); li.hasPrevious(); ) {
        final ComponentType current = (ComponentType) li.previous();
        final EList<Feature> currentFeatures = current.getOwnedFeatures();
        if (currentFeatures != null) {
            for (Iterator<Feature> i = currentFeatures.iterator(); i.hasNext(); ) {
                final Feature fe = i.next();
                final Feature rfe = fe.getRefined();
                if (rfe != null) {
                    returnlist.remove(rfe);
                }
                returnlist.add(fe);
            }
        }
    }
    return returnlist;
}
Also used : ComponentType(org.osate.aadl2.ComponentType) BasicEList(org.eclipse.emf.common.util.BasicEList) Classifier(org.osate.aadl2.Classifier) Feature(org.osate.aadl2.Feature) AbstractFeature(org.osate.aadl2.AbstractFeature) ClassifierFeature(org.osate.aadl2.ClassifierFeature)

Example 58 with Feature

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

the class FeatureImpl method setRefined.

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

Example 59 with Feature

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

the class FeatureImpl method getAllFeatureRefinements.

/*
	 * Return the feature and any of the features it refines
	 *
	 * @return EList of feature
	 */
// XXX: [AADL 1 -> AADL 2] Added to make instantiation and property lookup
// work.
public EList<Feature> getAllFeatureRefinements() {
    BasicEList<Feature> returnlist = new BasicEList<Feature>();
    Feature more = this;
    while (more != null) {
        returnlist.add(more);
        more = more.getRefined();
    }
    return returnlist;
}
Also used : BasicEList(org.eclipse.emf.common.util.BasicEList) Feature(org.osate.aadl2.Feature)

Example 60 with Feature

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

the class FeatureImpl method getPropertyValueInternal.

public void getPropertyValueInternal(final Property prop, final PropertyAcc pas, final boolean fromInstanceSlaveCall, final boolean all) throws InvalidModelException {
    Classifier owner = getContainingClassifier();
    if (pas.addLocalContained(this, owner) && !all || pas.addLocal(this)) {
        if (!all) {
            return;
        }
    }
    // values from refined features
    Feature refined = getRefined();
    while (refined != null) {
        if (pas.addLocalContained(refined, refined.getContainingClassifier())) {
            if (!all) {
                return;
            }
        }
        if (pas.addLocal(refined)) {
            if (!all) {
                return;
            }
        }
        refined = refined.getRefined();
    }
    getPropertyValueInternalHelper(prop, pas, fromInstanceSlaveCall, all);
    // feature group TYPE, not an implementation.
    if (prop.isInherit()) {
        owner.getPropertyValueInternal(prop, pas, fromInstanceSlaveCall, all);
    }
}
Also used : FeatureClassifier(org.osate.aadl2.FeatureClassifier) ComponentClassifier(org.osate.aadl2.ComponentClassifier) Classifier(org.osate.aadl2.Classifier) 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