Changeset 346:c0eb803e5b3e in finroc_core-java


Ignore:
Timestamp:
22.02.2021 13:52:25 (5 days ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Tags:
tip
Message:

Adapts to changes in finroc_plugins_data_ports (consistent spelling of 'Metadata')

File:
1 edited

Legend:

Unmodified
Added
Removed
  • remote/RemoteRuntime.java

    r345 r346  
    313313        RemoteTypeConversion getTupleElementOperation = getTypeConversionOperation(RemoteTypeConversion.SupportedTypeFilter.GET_TUPLE_ELEMENT); 
    314314        RemoteTypeConversion adjustLengthOperation = getTypeConversionOperation(RemoteTypeConversion.SupportedTypeFilter.ADJUST_LENGTH); 
    315         RemoteTypeConversion captureMetaDataOperation = getTypeConversionOperation("Capture Meta Data"); 
    316         RemoteTypeConversion appendMetaDataOperation = getTypeConversionOperation("Append Meta Data"); 
     315        RemoteTypeConversion captureMetadataOperation = getTypeConversionOperation("Capture Metadata"); 
     316        RemoteTypeConversion appendMetadataOperation = getTypeConversionOperation("Append Metadata"); 
    317317        RemoteType checkType = sourceType; 
    318318        while (checkType != null) { 
     
    348348            checkType = getUnderlyingTypeOperationsAreInheritedFrom(checkType); 
    349349        } 
    350         if (captureMetaDataOperation != null) { 
     350        if (captureMetadataOperation != null) { 
    351351            for (int i = 0, n = remoteTypes.size(); i < n; i++) { 
    352352                RemoteType type = remoteTypes.get(i); 
    353                 if (IsSupportedMetaDataCaptureType(type)) { 
    354                     fromSourceType.add(new GetCastOperationEntry(captureMetaDataOperation, type, false)); 
    355                 } 
    356             } 
    357         } 
    358         if (appendMetaDataOperation != null) { 
     353                if (IsSupportedMetadataCaptureType(type)) { 
     354                    fromSourceType.add(new GetCastOperationEntry(captureMetadataOperation, type, false)); 
     355                } 
     356            } 
     357        } 
     358        if (appendMetadataOperation != null) { 
    359359            for (int i = 0, n = remoteTypes.size(); i < n; i++) { 
    360360                RemoteType type = remoteTypes.get(i); 
    361                 if (appendMetaDataSupported(sourceType, type)) { 
    362                     fromSourceType.add(new GetCastOperationEntry(appendMetaDataOperation, type, false)); 
     361                if (appendMetadataSupported(sourceType, type)) { 
     362                    fromSourceType.add(new GetCastOperationEntry(appendMetadataOperation, type, false)); 
    363363                } 
    364364            } 
     
    403403            } 
    404404        } 
    405         if (captureMetaDataOperation != null && IsSupportedMetaDataCaptureType(destinationType)) { 
     405        if (captureMetadataOperation != null && IsSupportedMetadataCaptureType(destinationType)) { 
    406406            for (int i = 0, n = remoteTypes.size(); i < n; i++) { 
    407407                RemoteType type = remoteTypes.get(i); 
    408                 fromDestinationType.add(new GetCastOperationEntry(captureMetaDataOperation, type, false)); 
    409             } 
    410         } 
    411         if (appendMetaDataOperation != null && destinationType.getTupleElementTypes() != null) { 
     408                fromDestinationType.add(new GetCastOperationEntry(captureMetadataOperation, type, false)); 
     409            } 
     410        } 
     411        if (appendMetadataOperation != null && destinationType.getTupleElementTypes() != null) { 
    412412            RemoteType newType = remoteTypes.get(destinationType.getTupleElementTypes()[destinationType.getTupleElementTypes().length - 1]); 
    413             if (IsSupportedMetaDataCaptureType(newType)) { 
     413            if (IsSupportedMetadataCaptureType(newType)) { 
    414414                for (int i = 0, n = remoteTypes.size(); i < n; i++) { 
    415415                    RemoteType type = remoteTypes.get(i); 
    416                     if (appendMetaDataSupported(type, destinationType)) { 
    417                         fromDestinationType.add(new GetCastOperationEntry(appendMetaDataOperation, type, false)); 
     416                    if (appendMetadataSupported(type, destinationType)) { 
     417                        fromDestinationType.add(new GetCastOperationEntry(appendMetadataOperation, type, false)); 
    418418                    } 
    419419                } 
     
    526526        } 
    527527 
    528         // Remove nonsense meta data casts 
     528        // Remove nonsense metadata casts 
    529529        for (int i = 0; i < result.size(); i++) { 
    530530            RemoteConnectOptions operation = result.get(i); 
    531             if ((operation.operation1 == captureMetaDataOperation || operation.operation1 == appendMetaDataOperation) && (operation.operation2 == captureMetaDataOperation || operation.operation2 == appendMetaDataOperation)) { 
     531            if ((operation.operation1 == captureMetadataOperation || operation.operation1 == appendMetadataOperation) && (operation.operation2 == captureMetadataOperation || operation.operation2 == appendMetadataOperation)) { 
    532532                result.remove(i); 
    533533                i--; 
    534             } else if ((operation.operation1 == captureMetaDataOperation || operation.operation2 == captureMetaDataOperation) && operation.operation2 != null) { 
     534            } else if ((operation.operation1 == captureMetadataOperation || operation.operation2 == captureMetadataOperation) && operation.operation2 != null) { 
    535535                result.remove(i); 
    536536                i--; 
     
    15711571     * @param sourceType Remote source type 
    15721572     * @param sourceType Remote destinationType type 
    1573      * @return Whether remote AppendMetaData operation supports converting sourceType to destinationType 
    1574      */ 
    1575     boolean appendMetaDataSupported(RemoteType sourceType, RemoteType destinationType) { 
     1573     * @return Whether remote AppendMetadata operation supports converting sourceType to destinationType 
     1574     */ 
     1575    boolean appendMetadataSupported(RemoteType sourceType, RemoteType destinationType) { 
    15761576        short[] sourceTupleElements = sourceType.getTupleElementTypes(); 
    15771577        short[] destinationTupleElements = destinationType.getTupleElementTypes(); 
     
    15911591            } 
    15921592            RemoteType newType = remoteTypes.get(destinationTupleElements[destinationTupleElementCount - 1]); 
    1593             if (IsSupportedMetaDataCaptureType(newType)) { 
     1593            if (IsSupportedMetadataCaptureType(newType)) { 
    15941594                return true; 
    15951595            } 
     
    16001600    /** 
    16011601     * @param type Type to check 
    1602      * @return Whether it is possible to capture type as meta data (with the respective remote conversion operations) 
    1603      */ 
    1604     static boolean IsSupportedMetaDataCaptureType(RemoteType type) { 
    1605         return (type.isCheapCopyType() && (type.getLocalTypeMatch() != RemoteType.LocalTypeMatch.EXACT || type.getDefaultLocalDataType() != Event.TYPE)) || type.getName().equals("finroc.data_ports.MetaData"); 
     1602     * @return Whether it is possible to capture type as metadata (with the respective remote conversion operations) 
     1603     */ 
     1604    static boolean IsSupportedMetadataCaptureType(RemoteType type) { 
     1605        return (type.isCheapCopyType() && (type.getLocalTypeMatch() != RemoteType.LocalTypeMatch.EXACT || type.getDefaultLocalDataType() != Event.TYPE)) || type.getName().equals("finroc.data_ports.Metadata"); 
    16061606    } 
    16071607} 
Note: See TracChangeset for help on using the changeset viewer.