src/models/bulkio/bulkio-packet.ts
Serializable REDHAWK BULKIO Packet model
Properties |
Methods |
deserialize | ||||||||
deserialize(input: any)
|
||||||||
Defined in src/models/bulkio/bulkio-packet.ts:27
|
||||||||
Deserializes a JSON object into this class
Parameters :
Returns :
this
|
dataBuffer |
dataBuffer:
|
Type : Array<number>
|
Defined in src/models/bulkio/bulkio-packet.ts:24
|
The data buffer of the stream |
EOS |
EOS:
|
Type : boolean
|
Defined in src/models/bulkio/bulkio-packet.ts:16
|
End of Stream (EOS) flag |
SRI |
SRI:
|
Type : SRI
|
Defined in src/models/bulkio/bulkio-packet.ts:20
|
The Signal Related Information (SRI) structure |
sriChanged |
sriChanged:
|
Type : boolean
|
Defined in src/models/bulkio/bulkio-packet.ts:18
|
Flag for if the SRI has changed |
streamID |
streamID:
|
Type : string
|
Defined in src/models/bulkio/bulkio-packet.ts:12
|
Stream ID |
T |
T:
|
Type : PrecisionUTCTime
|
Defined in src/models/bulkio/bulkio-packet.ts:14
|
Precision Time Stamp |
type |
type:
|
Type : BulkioDataType
|
Defined in src/models/bulkio/bulkio-packet.ts:22
|
The Data Type of the buffer |
import { ISerializable } from '../serialization/index';
import { BulkioDataType } from './enums/index';
import { SRI } from './sri';
import { PrecisionUTCTime } from './precision-utc-time';
/**
* Serializable REDHAWK BULKIO Packet model
*/
export class BulkioPacket implements ISerializable<BulkioPacket> {
/** Stream ID */
streamID: string;
/** Precision Time Stamp */
T: PrecisionUTCTime;
/** End of Stream (EOS) flag */
EOS: boolean;
/** Flag for if the SRI has changed */
sriChanged: boolean;
/** The Signal Related Information (SRI) structure */
SRI: SRI;
/** The Data Type of the buffer */
type: BulkioDataType;
/** The data buffer of the stream */
dataBuffer: Array<number>;
/** Deserializes a JSON object into this class */
deserialize(input: any) {
this.streamID = input.streamID;
this.T = new PrecisionUTCTime().deserialize(input.T);
this.EOS = input.EOS;
this.sriChanged = input.sriChanged;
this.SRI = new SRI().deserialize(input.SRI);
this.type = resolve(input.type);
this.dataBuffer = input.dataBuffer;
return this;
}
}
function resolve(dataType: string): BulkioDataType {
switch (dataType) {
// case 'dataOctet':
// return BulkioDataType.dataOctet;
case 'dataShort':
return BulkioDataType.dataShort;
case 'dataLong':
return BulkioDataType.dataLong;
case 'dataLongLong':
return BulkioDataType.dataLongLong;
case 'dataULong' :
return BulkioDataType.dataULong;
case 'dataULongLong' :
return BulkioDataType.dataULongLong;
case 'dataFloat' :
return BulkioDataType.dataFloat;
case 'dataDouble' :
return BulkioDataType.dataDouble;
default:
return BulkioDataType.UNKNOWN;
}
}