Class CipREAL
- java.lang.Object
-
- com.automation_pros.odva.cip.data.BaseDataType<java.lang.Float>
-
- com.automation_pros.odva.cip.data.CipREAL
-
public class CipREAL extends BaseDataType<java.lang.Float>
-
-
Field Summary
-
Fields inherited from class com.automation_pros.odva.cip.data.BaseDataType
dimensions, memberOffsets, sLogger, variantContext, varyingDimension
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
bytesEach()
Obtain the bytes-per-element of this object's payload encoding.protected int
bytesImpl(int[] indices)
Retrieve the bytes payload size of a single array element (or sole element).CipREAL
copy()
Produce a deep clone of the object.protected void
copyToImpl(BaseDataType<?> dest, int[] indices)
Support deep copy operations one element at a time.protected void
copyToImpl(BaseDataType<?> dest, int[] toIndices, int[] fromIndices)
Support slice copy operations one element at a time.java.lang.String
crcName()
Obtain the name of this type as used for computing structure CRCs.double
doubleValue(int... indices)
For floating point types, upscale as needed to 64-bits.java.lang.Float
get(int[] indices)
Application-side value retrieval.DataDefinitionSeg
getNestingDef()
Return the element (not including array) type definition as a Path Segment, using the abbreviated form if a composite data type.protected void
putPayloadImpl(java.nio.ByteBuffer dest, int[] indices)
All concrete implementations must supply their per-element encoder here.void
set(int[] indices, java.lang.Float val)
Application-side value storage.void
setDimensions(int[] newDimensions)
Update the lengths of the array dimensions to the given values.protected void
setFromTokenImpl(java.lang.String token, int[] indices)
Override this if single elements can be set from single tokens.protected void
setPayloadImpl(java.nio.ByteBuffer source, int[] indices)
All concrete implementations must supply their per-element decoder here.protected java.lang.String
singleToString(int[] indices)
java.lang.String
structCRCString()
Logix processors don't follow CIP Volume 1 Table C-6.9 in their tag read/write routines for structures.CipREAL
wrap(int[] indices)
Application-side wrapper for inner dimensions.-
Methods inherited from class com.automation_pros.odva.cip.data.BaseDataType
alignment, browseInner, browseInnerImpl, bytes, checkDimensions, chkAbbrevType, concatIndices, conditionalSuffix, copyTo, CRC16, CRC16, CRC16, dim2linear, dim2linear, dim2qty, dim2suffix, dimensionToString, extendIntArray, fillIntArray, get, getCompleteDef, getDimensions, getMemberOffsets, getSymbolType, getTypeCode, getVariantContext, getVaryingDimension, hasOffset, incIdx, intArray, intValue, linear2dim, linear2dim, longValue, makeInstance, maxEach, minEach, nestedBytes, nestedBytesEach, nestedBytesImpl, nestedPutPayload, nestedPutPayloadImpl, nestedSetPayload, nestedSetPayloadImpl, putAbbrevType, putPayload, range2suffix, rawCRC16, set, setFromTokenizer, setFromTokenizerImpl, setFromTokenString, setInt, setLong, setMemberOffsets, setPayload, setupTokenizer, setVariantContext, setVariantDimension, setVariantDimension, sliceTo, toString
-
-
-
-
Constructor Detail
-
CipREAL
public CipREAL()
-
CipREAL
public CipREAL(float val)
-
CipREAL
public CipREAL(int[] dimensions)
-
CipREAL
protected CipREAL(CipREAL data, int[] indices)
-
-
Method Detail
-
getNestingDef
public DataDefinitionSeg getNestingDef()
Description copied from class:BaseDataType
Return the element (not including array) type definition as a Path Segment, using the abbreviated form if a composite data type.- Specified by:
getNestingDef
in classBaseDataType<java.lang.Float>
-
crcName
public java.lang.String crcName()
Description copied from class:BaseDataType
Obtain the name of this type as used for computing structure CRCs. Can be different from the name(s) used by the CipPath parser.- Overrides:
crcName
in classBaseDataType<java.lang.Float>
- Returns:
-
setDimensions
public void setDimensions(int[] newDimensions)
Description copied from class:BaseDataType
Update the lengths of the array dimensions to the given values. The number of subscripts must match the current number of subscripts. The operation must be data-preserving.This implementation handles pure Object storage types. Anything else must override.
- Overrides:
setDimensions
in classBaseDataType<java.lang.Float>
-
get
public java.lang.Float get(int[] indices)
Description copied from class:BaseDataType
Application-side value retrieval. Subclasses must implement this function to retrieve elements of the storage array in the application data type.- Specified by:
get
in classBaseDataType<java.lang.Float>
- Parameters:
indices
- Array subscripts. Missing subscripts not allowed.- Returns:
-
doubleValue
public double doubleValue(int... indices)
Description copied from class:BaseDataType
For floating point types, upscale as needed to 64-bits. Otherwise convert from the corresponding integer type.- Overrides:
doubleValue
in classBaseDataType<java.lang.Float>
- Returns:
-
set
public void set(int[] indices, java.lang.Float val)
Description copied from class:BaseDataType
Application-side value storage. Subclasses must implement this function to store one value or complex element into the storage array.- Specified by:
set
in classBaseDataType<java.lang.Float>
- Parameters:
indices
- Array subscripts. Missing subscripts not allowed.
-
bytesEach
public int bytesEach()
Description copied from class:BaseDataType
Obtain the bytes-per-element of this object's payload encoding. Objects with variable length encodings must return zero and implement the bytesImpl(), minEach(), maxEach(), and alignment() methods instead.- Specified by:
bytesEach
in classBaseDataType<java.lang.Float>
- Returns:
- encoded bytes per element
-
setPayloadImpl
protected void setPayloadImpl(java.nio.ByteBuffer source, int[] indices)
Description copied from class:BaseDataType
All concrete implementations must supply their per-element decoder here.- Specified by:
setPayloadImpl
in classBaseDataType<java.lang.Float>
-
setFromTokenImpl
protected void setFromTokenImpl(java.lang.String token, int[] indices)
Description copied from class:BaseDataType
Override this if single elements can be set from single tokens. The default decodes as Long and uses setLong().- Overrides:
setFromTokenImpl
in classBaseDataType<java.lang.Float>
- Parameters:
token
- The single token obtained from the tokenizer for this one element.indices
- The complete set of subscripts
-
putPayloadImpl
protected void putPayloadImpl(java.nio.ByteBuffer dest, int[] indices)
Description copied from class:BaseDataType
All concrete implementations must supply their per-element encoder here.- Specified by:
putPayloadImpl
in classBaseDataType<java.lang.Float>
-
structCRCString
public java.lang.String structCRCString()
Description copied from class:BaseDataType
Logix processors don't follow CIP Volume 1 Table C-6.9 in their tag read/write routines for structures. Instead, they run the CRC over comma-separated ASCII type strings that make up the structure. This is referred to in the Logix Data Access Programming Manual as the "Structure Handle".- Overrides:
structCRCString
in classBaseDataType<java.lang.Float>
- Returns:
-
bytesImpl
protected int bytesImpl(int[] indices)
Description copied from class:BaseDataType
Retrieve the bytes payload size of a single array element (or sole element). Objects with fixed element sizes may simply return bytesEach() here.- Specified by:
bytesImpl
in classBaseDataType<java.lang.Float>
- Returns:
-
copy
public CipREAL copy()
Description copied from class:BaseDataType
Produce a deep clone of the object.- Specified by:
copy
in classBaseDataType<java.lang.Float>
-
copyToImpl
protected void copyToImpl(BaseDataType<?> dest, int[] indices)
Description copied from class:BaseDataType
Support deep copy operations one element at a time.- Specified by:
copyToImpl
in classBaseDataType<java.lang.Float>
-
copyToImpl
protected void copyToImpl(BaseDataType<?> dest, int[] toIndices, int[] fromIndices)
Description copied from class:BaseDataType
Support slice copy operations one element at a time.- Specified by:
copyToImpl
in classBaseDataType<java.lang.Float>
-
wrap
public CipREAL wrap(int[] indices)
Description copied from class:BaseDataType
Application-side wrapper for inner dimensions. Implementations must update memberOffsets if not not using the protected constructor.- Specified by:
wrap
in classBaseDataType<java.lang.Float>
- Parameters:
indices
- Array subscripts. Missing subscripts are allowed.
-
singleToString
protected java.lang.String singleToString(int[] indices)
- Overrides:
singleToString
in classBaseDataType<java.lang.Float>
-
-