123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import 'dart:typed_data';
- import 'package:vid/us/vid_us_data_reader.dart';
- import 'package:vid/us/vid_us_data_writer.dart';
- enum VidUsModeType {
- Undefined,
- Tissue,
- Flow,
- Doppler,
- TissueTM,
- Tissue3D,
- FlowM,
- }
- class VidUsMode {
- String _name, _displayName;
- VidUsModeType _type;
- String get name => _name;
- String get displayName => _displayName;
- VidUsModeType get type => _type;
- VidUsMode(this._name, this._displayName, this._type);
- Uint8List toBytes() {
- var writer = new VidUsDataWriter();
- writer.writeString(this.name);
- writer.writeString(this.displayName);
- writer.writeByte(this._type.index);
- return writer.data;
- }
- static VidUsMode fromBytes(Uint8List bytes) {
- var reader = new VidUsDataReader(bytes);
- var name = reader.readString();
- var displayName = reader.readString();
- var type = VidUsModeType.values[reader.readByte()];
- return new VidUsMode(name, displayName, type);
- }
- }
|