2786 lines
92 KiB
Dart
2786 lines
92 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'app_database.dart';
|
|
|
|
// ignore_for_file: type=lint
|
|
class $MissionsTable extends Missions with TableInfo<$MissionsTable, Mission> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$MissionsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'PRIMARY KEY AUTOINCREMENT',
|
|
),
|
|
);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _locationMeta = const VerificationMeta(
|
|
'location',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> location = GeneratedColumn<String>(
|
|
'location',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
defaultValue: currentDateAndTime,
|
|
);
|
|
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
|
|
'updatedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
|
|
'updated_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
defaultValue: currentDateAndTime,
|
|
);
|
|
static const VerificationMeta _waypointsJsonMeta = const VerificationMeta(
|
|
'waypointsJson',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> waypointsJson = GeneratedColumn<String>(
|
|
'waypoints_json',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _isDirtyMeta = const VerificationMeta(
|
|
'isDirty',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> isDirty = GeneratedColumn<bool>(
|
|
'is_dirty',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("is_dirty" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(true),
|
|
);
|
|
static const VerificationMeta _serverIdMeta = const VerificationMeta(
|
|
'serverId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> serverId = GeneratedColumn<String>(
|
|
'server_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
name,
|
|
location,
|
|
createdAt,
|
|
updatedAt,
|
|
waypointsJson,
|
|
isDirty,
|
|
serverId,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'missions';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Mission> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('location')) {
|
|
context.handle(
|
|
_locationMeta,
|
|
location.isAcceptableOrUnknown(data['location']!, _locationMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('updated_at')) {
|
|
context.handle(
|
|
_updatedAtMeta,
|
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('waypoints_json')) {
|
|
context.handle(
|
|
_waypointsJsonMeta,
|
|
waypointsJson.isAcceptableOrUnknown(
|
|
data['waypoints_json']!,
|
|
_waypointsJsonMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_waypointsJsonMeta);
|
|
}
|
|
if (data.containsKey('is_dirty')) {
|
|
context.handle(
|
|
_isDirtyMeta,
|
|
isDirty.isAcceptableOrUnknown(data['is_dirty']!, _isDirtyMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('server_id')) {
|
|
context.handle(
|
|
_serverIdMeta,
|
|
serverId.isAcceptableOrUnknown(data['server_id']!, _serverIdMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Mission map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Mission(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
location: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}location'],
|
|
),
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
updatedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}updated_at'],
|
|
)!,
|
|
waypointsJson: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}waypoints_json'],
|
|
)!,
|
|
isDirty: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}is_dirty'],
|
|
)!,
|
|
serverId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}server_id'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$MissionsTable createAlias(String alias) {
|
|
return $MissionsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Mission extends DataClass implements Insertable<Mission> {
|
|
final int id;
|
|
final String name;
|
|
final String? location;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final String waypointsJson;
|
|
final bool isDirty;
|
|
final String? serverId;
|
|
const Mission({
|
|
required this.id,
|
|
required this.name,
|
|
this.location,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.waypointsJson,
|
|
required this.isDirty,
|
|
this.serverId,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['name'] = Variable<String>(name);
|
|
if (!nullToAbsent || location != null) {
|
|
map['location'] = Variable<String>(location);
|
|
}
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
|
map['waypoints_json'] = Variable<String>(waypointsJson);
|
|
map['is_dirty'] = Variable<bool>(isDirty);
|
|
if (!nullToAbsent || serverId != null) {
|
|
map['server_id'] = Variable<String>(serverId);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
MissionsCompanion toCompanion(bool nullToAbsent) {
|
|
return MissionsCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
location: location == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(location),
|
|
createdAt: Value(createdAt),
|
|
updatedAt: Value(updatedAt),
|
|
waypointsJson: Value(waypointsJson),
|
|
isDirty: Value(isDirty),
|
|
serverId: serverId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(serverId),
|
|
);
|
|
}
|
|
|
|
factory Mission.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Mission(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
location: serializer.fromJson<String?>(json['location']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
|
waypointsJson: serializer.fromJson<String>(json['waypointsJson']),
|
|
isDirty: serializer.fromJson<bool>(json['isDirty']),
|
|
serverId: serializer.fromJson<String?>(json['serverId']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'location': serializer.toJson<String?>(location),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
|
'waypointsJson': serializer.toJson<String>(waypointsJson),
|
|
'isDirty': serializer.toJson<bool>(isDirty),
|
|
'serverId': serializer.toJson<String?>(serverId),
|
|
};
|
|
}
|
|
|
|
Mission copyWith({
|
|
int? id,
|
|
String? name,
|
|
Value<String?> location = const Value.absent(),
|
|
DateTime? createdAt,
|
|
DateTime? updatedAt,
|
|
String? waypointsJson,
|
|
bool? isDirty,
|
|
Value<String?> serverId = const Value.absent(),
|
|
}) => Mission(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
location: location.present ? location.value : this.location,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
waypointsJson: waypointsJson ?? this.waypointsJson,
|
|
isDirty: isDirty ?? this.isDirty,
|
|
serverId: serverId.present ? serverId.value : this.serverId,
|
|
);
|
|
Mission copyWithCompanion(MissionsCompanion data) {
|
|
return Mission(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
location: data.location.present ? data.location.value : this.location,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
|
waypointsJson: data.waypointsJson.present
|
|
? data.waypointsJson.value
|
|
: this.waypointsJson,
|
|
isDirty: data.isDirty.present ? data.isDirty.value : this.isDirty,
|
|
serverId: data.serverId.present ? data.serverId.value : this.serverId,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Mission(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('location: $location, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('waypointsJson: $waypointsJson, ')
|
|
..write('isDirty: $isDirty, ')
|
|
..write('serverId: $serverId')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
name,
|
|
location,
|
|
createdAt,
|
|
updatedAt,
|
|
waypointsJson,
|
|
isDirty,
|
|
serverId,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Mission &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.location == this.location &&
|
|
other.createdAt == this.createdAt &&
|
|
other.updatedAt == this.updatedAt &&
|
|
other.waypointsJson == this.waypointsJson &&
|
|
other.isDirty == this.isDirty &&
|
|
other.serverId == this.serverId);
|
|
}
|
|
|
|
class MissionsCompanion extends UpdateCompanion<Mission> {
|
|
final Value<int> id;
|
|
final Value<String> name;
|
|
final Value<String?> location;
|
|
final Value<DateTime> createdAt;
|
|
final Value<DateTime> updatedAt;
|
|
final Value<String> waypointsJson;
|
|
final Value<bool> isDirty;
|
|
final Value<String?> serverId;
|
|
const MissionsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.location = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
this.waypointsJson = const Value.absent(),
|
|
this.isDirty = const Value.absent(),
|
|
this.serverId = const Value.absent(),
|
|
});
|
|
MissionsCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required String name,
|
|
this.location = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.updatedAt = const Value.absent(),
|
|
required String waypointsJson,
|
|
this.isDirty = const Value.absent(),
|
|
this.serverId = const Value.absent(),
|
|
}) : name = Value(name),
|
|
waypointsJson = Value(waypointsJson);
|
|
static Insertable<Mission> custom({
|
|
Expression<int>? id,
|
|
Expression<String>? name,
|
|
Expression<String>? location,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<DateTime>? updatedAt,
|
|
Expression<String>? waypointsJson,
|
|
Expression<bool>? isDirty,
|
|
Expression<String>? serverId,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (location != null) 'location': location,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (updatedAt != null) 'updated_at': updatedAt,
|
|
if (waypointsJson != null) 'waypoints_json': waypointsJson,
|
|
if (isDirty != null) 'is_dirty': isDirty,
|
|
if (serverId != null) 'server_id': serverId,
|
|
});
|
|
}
|
|
|
|
MissionsCompanion copyWith({
|
|
Value<int>? id,
|
|
Value<String>? name,
|
|
Value<String?>? location,
|
|
Value<DateTime>? createdAt,
|
|
Value<DateTime>? updatedAt,
|
|
Value<String>? waypointsJson,
|
|
Value<bool>? isDirty,
|
|
Value<String?>? serverId,
|
|
}) {
|
|
return MissionsCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
location: location ?? this.location,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
updatedAt: updatedAt ?? this.updatedAt,
|
|
waypointsJson: waypointsJson ?? this.waypointsJson,
|
|
isDirty: isDirty ?? this.isDirty,
|
|
serverId: serverId ?? this.serverId,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (location.present) {
|
|
map['location'] = Variable<String>(location.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (updatedAt.present) {
|
|
map['updated_at'] = Variable<DateTime>(updatedAt.value);
|
|
}
|
|
if (waypointsJson.present) {
|
|
map['waypoints_json'] = Variable<String>(waypointsJson.value);
|
|
}
|
|
if (isDirty.present) {
|
|
map['is_dirty'] = Variable<bool>(isDirty.value);
|
|
}
|
|
if (serverId.present) {
|
|
map['server_id'] = Variable<String>(serverId.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('MissionsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('location: $location, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('updatedAt: $updatedAt, ')
|
|
..write('waypointsJson: $waypointsJson, ')
|
|
..write('isDirty: $isDirty, ')
|
|
..write('serverId: $serverId')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $DroneProfilesTable extends DroneProfiles
|
|
with TableInfo<$DroneProfilesTable, DroneProfile> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$DroneProfilesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
hasAutoIncrement: true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'PRIMARY KEY AUTOINCREMENT',
|
|
),
|
|
);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _minSpeedMeta = const VerificationMeta(
|
|
'minSpeed',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> minSpeed = GeneratedColumn<double>(
|
|
'min_speed',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _cruiseSpeedMeta = const VerificationMeta(
|
|
'cruiseSpeed',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> cruiseSpeed = GeneratedColumn<double>(
|
|
'cruise_speed',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _maxSpeedMeta = const VerificationMeta(
|
|
'maxSpeed',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> maxSpeed = GeneratedColumn<double>(
|
|
'max_speed',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _minTurnRadiusMeta = const VerificationMeta(
|
|
'minTurnRadius',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> minTurnRadius = GeneratedColumn<double>(
|
|
'min_turn_radius',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _loiterRadiusMeta = const VerificationMeta(
|
|
'loiterRadius',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> loiterRadius = GeneratedColumn<double>(
|
|
'loiter_radius',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _catchRadiusMeta = const VerificationMeta(
|
|
'catchRadius',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> catchRadius = GeneratedColumn<double>(
|
|
'catch_radius',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _maxClimbRateMeta = const VerificationMeta(
|
|
'maxClimbRate',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> maxClimbRate = GeneratedColumn<double>(
|
|
'max_climb_rate',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _maxDescentRateMeta = const VerificationMeta(
|
|
'maxDescentRate',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> maxDescentRate = GeneratedColumn<double>(
|
|
'max_descent_rate',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _maxRangeMMeta = const VerificationMeta(
|
|
'maxRangeM',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> maxRangeM = GeneratedColumn<double>(
|
|
'max_range_m',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _maxEnduranceMinMeta = const VerificationMeta(
|
|
'maxEnduranceMin',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> maxEnduranceMin = GeneratedColumn<double>(
|
|
'max_endurance_min',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _maxAltitudeMMeta = const VerificationMeta(
|
|
'maxAltitudeM',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<double> maxAltitudeM = GeneratedColumn<double>(
|
|
'max_altitude_m',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
name,
|
|
minSpeed,
|
|
cruiseSpeed,
|
|
maxSpeed,
|
|
minTurnRadius,
|
|
loiterRadius,
|
|
catchRadius,
|
|
maxClimbRate,
|
|
maxDescentRate,
|
|
maxRangeM,
|
|
maxEnduranceMin,
|
|
maxAltitudeM,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'drone_profiles';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<DroneProfile> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('min_speed')) {
|
|
context.handle(
|
|
_minSpeedMeta,
|
|
minSpeed.isAcceptableOrUnknown(data['min_speed']!, _minSpeedMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_minSpeedMeta);
|
|
}
|
|
if (data.containsKey('cruise_speed')) {
|
|
context.handle(
|
|
_cruiseSpeedMeta,
|
|
cruiseSpeed.isAcceptableOrUnknown(
|
|
data['cruise_speed']!,
|
|
_cruiseSpeedMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_cruiseSpeedMeta);
|
|
}
|
|
if (data.containsKey('max_speed')) {
|
|
context.handle(
|
|
_maxSpeedMeta,
|
|
maxSpeed.isAcceptableOrUnknown(data['max_speed']!, _maxSpeedMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_maxSpeedMeta);
|
|
}
|
|
if (data.containsKey('min_turn_radius')) {
|
|
context.handle(
|
|
_minTurnRadiusMeta,
|
|
minTurnRadius.isAcceptableOrUnknown(
|
|
data['min_turn_radius']!,
|
|
_minTurnRadiusMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_minTurnRadiusMeta);
|
|
}
|
|
if (data.containsKey('loiter_radius')) {
|
|
context.handle(
|
|
_loiterRadiusMeta,
|
|
loiterRadius.isAcceptableOrUnknown(
|
|
data['loiter_radius']!,
|
|
_loiterRadiusMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_loiterRadiusMeta);
|
|
}
|
|
if (data.containsKey('catch_radius')) {
|
|
context.handle(
|
|
_catchRadiusMeta,
|
|
catchRadius.isAcceptableOrUnknown(
|
|
data['catch_radius']!,
|
|
_catchRadiusMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_catchRadiusMeta);
|
|
}
|
|
if (data.containsKey('max_climb_rate')) {
|
|
context.handle(
|
|
_maxClimbRateMeta,
|
|
maxClimbRate.isAcceptableOrUnknown(
|
|
data['max_climb_rate']!,
|
|
_maxClimbRateMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_maxClimbRateMeta);
|
|
}
|
|
if (data.containsKey('max_descent_rate')) {
|
|
context.handle(
|
|
_maxDescentRateMeta,
|
|
maxDescentRate.isAcceptableOrUnknown(
|
|
data['max_descent_rate']!,
|
|
_maxDescentRateMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_maxDescentRateMeta);
|
|
}
|
|
if (data.containsKey('max_range_m')) {
|
|
context.handle(
|
|
_maxRangeMMeta,
|
|
maxRangeM.isAcceptableOrUnknown(data['max_range_m']!, _maxRangeMMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_maxRangeMMeta);
|
|
}
|
|
if (data.containsKey('max_endurance_min')) {
|
|
context.handle(
|
|
_maxEnduranceMinMeta,
|
|
maxEnduranceMin.isAcceptableOrUnknown(
|
|
data['max_endurance_min']!,
|
|
_maxEnduranceMinMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_maxEnduranceMinMeta);
|
|
}
|
|
if (data.containsKey('max_altitude_m')) {
|
|
context.handle(
|
|
_maxAltitudeMMeta,
|
|
maxAltitudeM.isAcceptableOrUnknown(
|
|
data['max_altitude_m']!,
|
|
_maxAltitudeMMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_maxAltitudeMMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
DroneProfile map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return DroneProfile(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
minSpeed: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}min_speed'],
|
|
)!,
|
|
cruiseSpeed: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}cruise_speed'],
|
|
)!,
|
|
maxSpeed: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}max_speed'],
|
|
)!,
|
|
minTurnRadius: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}min_turn_radius'],
|
|
)!,
|
|
loiterRadius: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}loiter_radius'],
|
|
)!,
|
|
catchRadius: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}catch_radius'],
|
|
)!,
|
|
maxClimbRate: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}max_climb_rate'],
|
|
)!,
|
|
maxDescentRate: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}max_descent_rate'],
|
|
)!,
|
|
maxRangeM: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}max_range_m'],
|
|
)!,
|
|
maxEnduranceMin: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}max_endurance_min'],
|
|
)!,
|
|
maxAltitudeM: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}max_altitude_m'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$DroneProfilesTable createAlias(String alias) {
|
|
return $DroneProfilesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class DroneProfile extends DataClass implements Insertable<DroneProfile> {
|
|
final int id;
|
|
final String name;
|
|
final double minSpeed;
|
|
final double cruiseSpeed;
|
|
final double maxSpeed;
|
|
final double minTurnRadius;
|
|
final double loiterRadius;
|
|
final double catchRadius;
|
|
final double maxClimbRate;
|
|
final double maxDescentRate;
|
|
final double maxRangeM;
|
|
final double maxEnduranceMin;
|
|
final double maxAltitudeM;
|
|
const DroneProfile({
|
|
required this.id,
|
|
required this.name,
|
|
required this.minSpeed,
|
|
required this.cruiseSpeed,
|
|
required this.maxSpeed,
|
|
required this.minTurnRadius,
|
|
required this.loiterRadius,
|
|
required this.catchRadius,
|
|
required this.maxClimbRate,
|
|
required this.maxDescentRate,
|
|
required this.maxRangeM,
|
|
required this.maxEnduranceMin,
|
|
required this.maxAltitudeM,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
map['name'] = Variable<String>(name);
|
|
map['min_speed'] = Variable<double>(minSpeed);
|
|
map['cruise_speed'] = Variable<double>(cruiseSpeed);
|
|
map['max_speed'] = Variable<double>(maxSpeed);
|
|
map['min_turn_radius'] = Variable<double>(minTurnRadius);
|
|
map['loiter_radius'] = Variable<double>(loiterRadius);
|
|
map['catch_radius'] = Variable<double>(catchRadius);
|
|
map['max_climb_rate'] = Variable<double>(maxClimbRate);
|
|
map['max_descent_rate'] = Variable<double>(maxDescentRate);
|
|
map['max_range_m'] = Variable<double>(maxRangeM);
|
|
map['max_endurance_min'] = Variable<double>(maxEnduranceMin);
|
|
map['max_altitude_m'] = Variable<double>(maxAltitudeM);
|
|
return map;
|
|
}
|
|
|
|
DroneProfilesCompanion toCompanion(bool nullToAbsent) {
|
|
return DroneProfilesCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
minSpeed: Value(minSpeed),
|
|
cruiseSpeed: Value(cruiseSpeed),
|
|
maxSpeed: Value(maxSpeed),
|
|
minTurnRadius: Value(minTurnRadius),
|
|
loiterRadius: Value(loiterRadius),
|
|
catchRadius: Value(catchRadius),
|
|
maxClimbRate: Value(maxClimbRate),
|
|
maxDescentRate: Value(maxDescentRate),
|
|
maxRangeM: Value(maxRangeM),
|
|
maxEnduranceMin: Value(maxEnduranceMin),
|
|
maxAltitudeM: Value(maxAltitudeM),
|
|
);
|
|
}
|
|
|
|
factory DroneProfile.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return DroneProfile(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
minSpeed: serializer.fromJson<double>(json['minSpeed']),
|
|
cruiseSpeed: serializer.fromJson<double>(json['cruiseSpeed']),
|
|
maxSpeed: serializer.fromJson<double>(json['maxSpeed']),
|
|
minTurnRadius: serializer.fromJson<double>(json['minTurnRadius']),
|
|
loiterRadius: serializer.fromJson<double>(json['loiterRadius']),
|
|
catchRadius: serializer.fromJson<double>(json['catchRadius']),
|
|
maxClimbRate: serializer.fromJson<double>(json['maxClimbRate']),
|
|
maxDescentRate: serializer.fromJson<double>(json['maxDescentRate']),
|
|
maxRangeM: serializer.fromJson<double>(json['maxRangeM']),
|
|
maxEnduranceMin: serializer.fromJson<double>(json['maxEnduranceMin']),
|
|
maxAltitudeM: serializer.fromJson<double>(json['maxAltitudeM']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'minSpeed': serializer.toJson<double>(minSpeed),
|
|
'cruiseSpeed': serializer.toJson<double>(cruiseSpeed),
|
|
'maxSpeed': serializer.toJson<double>(maxSpeed),
|
|
'minTurnRadius': serializer.toJson<double>(minTurnRadius),
|
|
'loiterRadius': serializer.toJson<double>(loiterRadius),
|
|
'catchRadius': serializer.toJson<double>(catchRadius),
|
|
'maxClimbRate': serializer.toJson<double>(maxClimbRate),
|
|
'maxDescentRate': serializer.toJson<double>(maxDescentRate),
|
|
'maxRangeM': serializer.toJson<double>(maxRangeM),
|
|
'maxEnduranceMin': serializer.toJson<double>(maxEnduranceMin),
|
|
'maxAltitudeM': serializer.toJson<double>(maxAltitudeM),
|
|
};
|
|
}
|
|
|
|
DroneProfile copyWith({
|
|
int? id,
|
|
String? name,
|
|
double? minSpeed,
|
|
double? cruiseSpeed,
|
|
double? maxSpeed,
|
|
double? minTurnRadius,
|
|
double? loiterRadius,
|
|
double? catchRadius,
|
|
double? maxClimbRate,
|
|
double? maxDescentRate,
|
|
double? maxRangeM,
|
|
double? maxEnduranceMin,
|
|
double? maxAltitudeM,
|
|
}) => DroneProfile(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
minSpeed: minSpeed ?? this.minSpeed,
|
|
cruiseSpeed: cruiseSpeed ?? this.cruiseSpeed,
|
|
maxSpeed: maxSpeed ?? this.maxSpeed,
|
|
minTurnRadius: minTurnRadius ?? this.minTurnRadius,
|
|
loiterRadius: loiterRadius ?? this.loiterRadius,
|
|
catchRadius: catchRadius ?? this.catchRadius,
|
|
maxClimbRate: maxClimbRate ?? this.maxClimbRate,
|
|
maxDescentRate: maxDescentRate ?? this.maxDescentRate,
|
|
maxRangeM: maxRangeM ?? this.maxRangeM,
|
|
maxEnduranceMin: maxEnduranceMin ?? this.maxEnduranceMin,
|
|
maxAltitudeM: maxAltitudeM ?? this.maxAltitudeM,
|
|
);
|
|
DroneProfile copyWithCompanion(DroneProfilesCompanion data) {
|
|
return DroneProfile(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
minSpeed: data.minSpeed.present ? data.minSpeed.value : this.minSpeed,
|
|
cruiseSpeed: data.cruiseSpeed.present
|
|
? data.cruiseSpeed.value
|
|
: this.cruiseSpeed,
|
|
maxSpeed: data.maxSpeed.present ? data.maxSpeed.value : this.maxSpeed,
|
|
minTurnRadius: data.minTurnRadius.present
|
|
? data.minTurnRadius.value
|
|
: this.minTurnRadius,
|
|
loiterRadius: data.loiterRadius.present
|
|
? data.loiterRadius.value
|
|
: this.loiterRadius,
|
|
catchRadius: data.catchRadius.present
|
|
? data.catchRadius.value
|
|
: this.catchRadius,
|
|
maxClimbRate: data.maxClimbRate.present
|
|
? data.maxClimbRate.value
|
|
: this.maxClimbRate,
|
|
maxDescentRate: data.maxDescentRate.present
|
|
? data.maxDescentRate.value
|
|
: this.maxDescentRate,
|
|
maxRangeM: data.maxRangeM.present ? data.maxRangeM.value : this.maxRangeM,
|
|
maxEnduranceMin: data.maxEnduranceMin.present
|
|
? data.maxEnduranceMin.value
|
|
: this.maxEnduranceMin,
|
|
maxAltitudeM: data.maxAltitudeM.present
|
|
? data.maxAltitudeM.value
|
|
: this.maxAltitudeM,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('DroneProfile(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('minSpeed: $minSpeed, ')
|
|
..write('cruiseSpeed: $cruiseSpeed, ')
|
|
..write('maxSpeed: $maxSpeed, ')
|
|
..write('minTurnRadius: $minTurnRadius, ')
|
|
..write('loiterRadius: $loiterRadius, ')
|
|
..write('catchRadius: $catchRadius, ')
|
|
..write('maxClimbRate: $maxClimbRate, ')
|
|
..write('maxDescentRate: $maxDescentRate, ')
|
|
..write('maxRangeM: $maxRangeM, ')
|
|
..write('maxEnduranceMin: $maxEnduranceMin, ')
|
|
..write('maxAltitudeM: $maxAltitudeM')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
name,
|
|
minSpeed,
|
|
cruiseSpeed,
|
|
maxSpeed,
|
|
minTurnRadius,
|
|
loiterRadius,
|
|
catchRadius,
|
|
maxClimbRate,
|
|
maxDescentRate,
|
|
maxRangeM,
|
|
maxEnduranceMin,
|
|
maxAltitudeM,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is DroneProfile &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.minSpeed == this.minSpeed &&
|
|
other.cruiseSpeed == this.cruiseSpeed &&
|
|
other.maxSpeed == this.maxSpeed &&
|
|
other.minTurnRadius == this.minTurnRadius &&
|
|
other.loiterRadius == this.loiterRadius &&
|
|
other.catchRadius == this.catchRadius &&
|
|
other.maxClimbRate == this.maxClimbRate &&
|
|
other.maxDescentRate == this.maxDescentRate &&
|
|
other.maxRangeM == this.maxRangeM &&
|
|
other.maxEnduranceMin == this.maxEnduranceMin &&
|
|
other.maxAltitudeM == this.maxAltitudeM);
|
|
}
|
|
|
|
class DroneProfilesCompanion extends UpdateCompanion<DroneProfile> {
|
|
final Value<int> id;
|
|
final Value<String> name;
|
|
final Value<double> minSpeed;
|
|
final Value<double> cruiseSpeed;
|
|
final Value<double> maxSpeed;
|
|
final Value<double> minTurnRadius;
|
|
final Value<double> loiterRadius;
|
|
final Value<double> catchRadius;
|
|
final Value<double> maxClimbRate;
|
|
final Value<double> maxDescentRate;
|
|
final Value<double> maxRangeM;
|
|
final Value<double> maxEnduranceMin;
|
|
final Value<double> maxAltitudeM;
|
|
const DroneProfilesCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.minSpeed = const Value.absent(),
|
|
this.cruiseSpeed = const Value.absent(),
|
|
this.maxSpeed = const Value.absent(),
|
|
this.minTurnRadius = const Value.absent(),
|
|
this.loiterRadius = const Value.absent(),
|
|
this.catchRadius = const Value.absent(),
|
|
this.maxClimbRate = const Value.absent(),
|
|
this.maxDescentRate = const Value.absent(),
|
|
this.maxRangeM = const Value.absent(),
|
|
this.maxEnduranceMin = const Value.absent(),
|
|
this.maxAltitudeM = const Value.absent(),
|
|
});
|
|
DroneProfilesCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
required String name,
|
|
required double minSpeed,
|
|
required double cruiseSpeed,
|
|
required double maxSpeed,
|
|
required double minTurnRadius,
|
|
required double loiterRadius,
|
|
required double catchRadius,
|
|
required double maxClimbRate,
|
|
required double maxDescentRate,
|
|
required double maxRangeM,
|
|
required double maxEnduranceMin,
|
|
required double maxAltitudeM,
|
|
}) : name = Value(name),
|
|
minSpeed = Value(minSpeed),
|
|
cruiseSpeed = Value(cruiseSpeed),
|
|
maxSpeed = Value(maxSpeed),
|
|
minTurnRadius = Value(minTurnRadius),
|
|
loiterRadius = Value(loiterRadius),
|
|
catchRadius = Value(catchRadius),
|
|
maxClimbRate = Value(maxClimbRate),
|
|
maxDescentRate = Value(maxDescentRate),
|
|
maxRangeM = Value(maxRangeM),
|
|
maxEnduranceMin = Value(maxEnduranceMin),
|
|
maxAltitudeM = Value(maxAltitudeM);
|
|
static Insertable<DroneProfile> custom({
|
|
Expression<int>? id,
|
|
Expression<String>? name,
|
|
Expression<double>? minSpeed,
|
|
Expression<double>? cruiseSpeed,
|
|
Expression<double>? maxSpeed,
|
|
Expression<double>? minTurnRadius,
|
|
Expression<double>? loiterRadius,
|
|
Expression<double>? catchRadius,
|
|
Expression<double>? maxClimbRate,
|
|
Expression<double>? maxDescentRate,
|
|
Expression<double>? maxRangeM,
|
|
Expression<double>? maxEnduranceMin,
|
|
Expression<double>? maxAltitudeM,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (minSpeed != null) 'min_speed': minSpeed,
|
|
if (cruiseSpeed != null) 'cruise_speed': cruiseSpeed,
|
|
if (maxSpeed != null) 'max_speed': maxSpeed,
|
|
if (minTurnRadius != null) 'min_turn_radius': minTurnRadius,
|
|
if (loiterRadius != null) 'loiter_radius': loiterRadius,
|
|
if (catchRadius != null) 'catch_radius': catchRadius,
|
|
if (maxClimbRate != null) 'max_climb_rate': maxClimbRate,
|
|
if (maxDescentRate != null) 'max_descent_rate': maxDescentRate,
|
|
if (maxRangeM != null) 'max_range_m': maxRangeM,
|
|
if (maxEnduranceMin != null) 'max_endurance_min': maxEnduranceMin,
|
|
if (maxAltitudeM != null) 'max_altitude_m': maxAltitudeM,
|
|
});
|
|
}
|
|
|
|
DroneProfilesCompanion copyWith({
|
|
Value<int>? id,
|
|
Value<String>? name,
|
|
Value<double>? minSpeed,
|
|
Value<double>? cruiseSpeed,
|
|
Value<double>? maxSpeed,
|
|
Value<double>? minTurnRadius,
|
|
Value<double>? loiterRadius,
|
|
Value<double>? catchRadius,
|
|
Value<double>? maxClimbRate,
|
|
Value<double>? maxDescentRate,
|
|
Value<double>? maxRangeM,
|
|
Value<double>? maxEnduranceMin,
|
|
Value<double>? maxAltitudeM,
|
|
}) {
|
|
return DroneProfilesCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
minSpeed: minSpeed ?? this.minSpeed,
|
|
cruiseSpeed: cruiseSpeed ?? this.cruiseSpeed,
|
|
maxSpeed: maxSpeed ?? this.maxSpeed,
|
|
minTurnRadius: minTurnRadius ?? this.minTurnRadius,
|
|
loiterRadius: loiterRadius ?? this.loiterRadius,
|
|
catchRadius: catchRadius ?? this.catchRadius,
|
|
maxClimbRate: maxClimbRate ?? this.maxClimbRate,
|
|
maxDescentRate: maxDescentRate ?? this.maxDescentRate,
|
|
maxRangeM: maxRangeM ?? this.maxRangeM,
|
|
maxEnduranceMin: maxEnduranceMin ?? this.maxEnduranceMin,
|
|
maxAltitudeM: maxAltitudeM ?? this.maxAltitudeM,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (minSpeed.present) {
|
|
map['min_speed'] = Variable<double>(minSpeed.value);
|
|
}
|
|
if (cruiseSpeed.present) {
|
|
map['cruise_speed'] = Variable<double>(cruiseSpeed.value);
|
|
}
|
|
if (maxSpeed.present) {
|
|
map['max_speed'] = Variable<double>(maxSpeed.value);
|
|
}
|
|
if (minTurnRadius.present) {
|
|
map['min_turn_radius'] = Variable<double>(minTurnRadius.value);
|
|
}
|
|
if (loiterRadius.present) {
|
|
map['loiter_radius'] = Variable<double>(loiterRadius.value);
|
|
}
|
|
if (catchRadius.present) {
|
|
map['catch_radius'] = Variable<double>(catchRadius.value);
|
|
}
|
|
if (maxClimbRate.present) {
|
|
map['max_climb_rate'] = Variable<double>(maxClimbRate.value);
|
|
}
|
|
if (maxDescentRate.present) {
|
|
map['max_descent_rate'] = Variable<double>(maxDescentRate.value);
|
|
}
|
|
if (maxRangeM.present) {
|
|
map['max_range_m'] = Variable<double>(maxRangeM.value);
|
|
}
|
|
if (maxEnduranceMin.present) {
|
|
map['max_endurance_min'] = Variable<double>(maxEnduranceMin.value);
|
|
}
|
|
if (maxAltitudeM.present) {
|
|
map['max_altitude_m'] = Variable<double>(maxAltitudeM.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('DroneProfilesCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('minSpeed: $minSpeed, ')
|
|
..write('cruiseSpeed: $cruiseSpeed, ')
|
|
..write('maxSpeed: $maxSpeed, ')
|
|
..write('minTurnRadius: $minTurnRadius, ')
|
|
..write('loiterRadius: $loiterRadius, ')
|
|
..write('catchRadius: $catchRadius, ')
|
|
..write('maxClimbRate: $maxClimbRate, ')
|
|
..write('maxDescentRate: $maxDescentRate, ')
|
|
..write('maxRangeM: $maxRangeM, ')
|
|
..write('maxEnduranceMin: $maxEnduranceMin, ')
|
|
..write('maxAltitudeM: $maxAltitudeM')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $AppSettingsTableTable extends AppSettingsTable
|
|
with TableInfo<$AppSettingsTableTable, AppSettingsTableData> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$AppSettingsTableTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<int> id = GeneratedColumn<int>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _activeDroneProfileIdMeta =
|
|
const VerificationMeta('activeDroneProfileId');
|
|
@override
|
|
late final GeneratedColumn<int> activeDroneProfileId = GeneratedColumn<int>(
|
|
'active_drone_profile_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _currentMissionIdMeta = const VerificationMeta(
|
|
'currentMissionId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> currentMissionId = GeneratedColumn<int>(
|
|
'current_mission_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _connectionDeviceAddressMeta =
|
|
const VerificationMeta('connectionDeviceAddress');
|
|
@override
|
|
late final GeneratedColumn<String> connectionDeviceAddress =
|
|
GeneratedColumn<String>(
|
|
'connection_device_address',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _connectionAutoConnectMeta =
|
|
const VerificationMeta('connectionAutoConnect');
|
|
@override
|
|
late final GeneratedColumn<bool> connectionAutoConnect =
|
|
GeneratedColumn<bool>(
|
|
'connection_auto_connect',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("connection_auto_connect" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(true),
|
|
);
|
|
static const VerificationMeta _connectionTypeMeta = const VerificationMeta(
|
|
'connectionType',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> connectionType = GeneratedColumn<String>(
|
|
'connection_type',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('bluetooth'),
|
|
);
|
|
static const VerificationMeta _connectionWifiHostMeta =
|
|
const VerificationMeta('connectionWifiHost');
|
|
@override
|
|
late final GeneratedColumn<String> connectionWifiHost =
|
|
GeneratedColumn<String>(
|
|
'connection_wifi_host',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _connectionWifiPortMeta =
|
|
const VerificationMeta('connectionWifiPort');
|
|
@override
|
|
late final GeneratedColumn<int> connectionWifiPort = GeneratedColumn<int>(
|
|
'connection_wifi_port',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(kDefaultWifiPort),
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
activeDroneProfileId,
|
|
currentMissionId,
|
|
connectionDeviceAddress,
|
|
connectionAutoConnect,
|
|
connectionType,
|
|
connectionWifiHost,
|
|
connectionWifiPort,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'app_settings_table';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<AppSettingsTableData> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
}
|
|
if (data.containsKey('active_drone_profile_id')) {
|
|
context.handle(
|
|
_activeDroneProfileIdMeta,
|
|
activeDroneProfileId.isAcceptableOrUnknown(
|
|
data['active_drone_profile_id']!,
|
|
_activeDroneProfileIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('current_mission_id')) {
|
|
context.handle(
|
|
_currentMissionIdMeta,
|
|
currentMissionId.isAcceptableOrUnknown(
|
|
data['current_mission_id']!,
|
|
_currentMissionIdMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('connection_device_address')) {
|
|
context.handle(
|
|
_connectionDeviceAddressMeta,
|
|
connectionDeviceAddress.isAcceptableOrUnknown(
|
|
data['connection_device_address']!,
|
|
_connectionDeviceAddressMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('connection_auto_connect')) {
|
|
context.handle(
|
|
_connectionAutoConnectMeta,
|
|
connectionAutoConnect.isAcceptableOrUnknown(
|
|
data['connection_auto_connect']!,
|
|
_connectionAutoConnectMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('connection_type')) {
|
|
context.handle(
|
|
_connectionTypeMeta,
|
|
connectionType.isAcceptableOrUnknown(
|
|
data['connection_type']!,
|
|
_connectionTypeMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('connection_wifi_host')) {
|
|
context.handle(
|
|
_connectionWifiHostMeta,
|
|
connectionWifiHost.isAcceptableOrUnknown(
|
|
data['connection_wifi_host']!,
|
|
_connectionWifiHostMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('connection_wifi_port')) {
|
|
context.handle(
|
|
_connectionWifiPortMeta,
|
|
connectionWifiPort.isAcceptableOrUnknown(
|
|
data['connection_wifi_port']!,
|
|
_connectionWifiPortMeta,
|
|
),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
AppSettingsTableData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return AppSettingsTableData(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
activeDroneProfileId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}active_drone_profile_id'],
|
|
),
|
|
currentMissionId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}current_mission_id'],
|
|
),
|
|
connectionDeviceAddress: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}connection_device_address'],
|
|
),
|
|
connectionAutoConnect: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}connection_auto_connect'],
|
|
)!,
|
|
connectionType: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}connection_type'],
|
|
)!,
|
|
connectionWifiHost: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}connection_wifi_host'],
|
|
),
|
|
connectionWifiPort: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}connection_wifi_port'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$AppSettingsTableTable createAlias(String alias) {
|
|
return $AppSettingsTableTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class AppSettingsTableData extends DataClass
|
|
implements Insertable<AppSettingsTableData> {
|
|
final int id;
|
|
final int? activeDroneProfileId;
|
|
final int? currentMissionId;
|
|
|
|
/// Gemerkte MAC-Adresse des Bluetooth-Zielgeraets (Doku Kommunikations-
|
|
/// schicht 3.2a) - entweder manuell gewaehlt oder automatisch anhand des
|
|
/// "mLRS"-Namenspraefix aufgeloest.
|
|
final String? connectionDeviceAddress;
|
|
|
|
/// "Beim Wechsel in Fly automatisch verbinden" (Doku 7), Standard an.
|
|
final bool connectionAutoConnect;
|
|
|
|
/// Gewaehlte Verbindungsart (Doku 7: "Art: WLAN * USB (spaeter)"),
|
|
/// gespeichert als [ConnectionType.name]. Standard bleibt Bluetooth, damit
|
|
/// bestehende Installationen ihr bisheriges Verhalten behalten.
|
|
final String connectionType;
|
|
|
|
/// Vom Nutzer eingetragene Ziel-IP der mLRS-WLAN-Bruecke (Doku 3:
|
|
/// "Zieladresse niemals fest eincodieren") - null, solange keine Vorgabe
|
|
/// gesetzt ist und die Gegenstelle erst aus dem Verkehr gelernt wird.
|
|
final String? connectionWifiHost;
|
|
|
|
/// Lokaler UDP-Port fuer die mLRS-WLAN-Bruecke (Doku 3), Standard 14550.
|
|
final int connectionWifiPort;
|
|
const AppSettingsTableData({
|
|
required this.id,
|
|
this.activeDroneProfileId,
|
|
this.currentMissionId,
|
|
this.connectionDeviceAddress,
|
|
required this.connectionAutoConnect,
|
|
required this.connectionType,
|
|
this.connectionWifiHost,
|
|
required this.connectionWifiPort,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<int>(id);
|
|
if (!nullToAbsent || activeDroneProfileId != null) {
|
|
map['active_drone_profile_id'] = Variable<int>(activeDroneProfileId);
|
|
}
|
|
if (!nullToAbsent || currentMissionId != null) {
|
|
map['current_mission_id'] = Variable<int>(currentMissionId);
|
|
}
|
|
if (!nullToAbsent || connectionDeviceAddress != null) {
|
|
map['connection_device_address'] = Variable<String>(
|
|
connectionDeviceAddress,
|
|
);
|
|
}
|
|
map['connection_auto_connect'] = Variable<bool>(connectionAutoConnect);
|
|
map['connection_type'] = Variable<String>(connectionType);
|
|
if (!nullToAbsent || connectionWifiHost != null) {
|
|
map['connection_wifi_host'] = Variable<String>(connectionWifiHost);
|
|
}
|
|
map['connection_wifi_port'] = Variable<int>(connectionWifiPort);
|
|
return map;
|
|
}
|
|
|
|
AppSettingsTableCompanion toCompanion(bool nullToAbsent) {
|
|
return AppSettingsTableCompanion(
|
|
id: Value(id),
|
|
activeDroneProfileId: activeDroneProfileId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(activeDroneProfileId),
|
|
currentMissionId: currentMissionId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(currentMissionId),
|
|
connectionDeviceAddress: connectionDeviceAddress == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(connectionDeviceAddress),
|
|
connectionAutoConnect: Value(connectionAutoConnect),
|
|
connectionType: Value(connectionType),
|
|
connectionWifiHost: connectionWifiHost == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(connectionWifiHost),
|
|
connectionWifiPort: Value(connectionWifiPort),
|
|
);
|
|
}
|
|
|
|
factory AppSettingsTableData.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return AppSettingsTableData(
|
|
id: serializer.fromJson<int>(json['id']),
|
|
activeDroneProfileId: serializer.fromJson<int?>(
|
|
json['activeDroneProfileId'],
|
|
),
|
|
currentMissionId: serializer.fromJson<int?>(json['currentMissionId']),
|
|
connectionDeviceAddress: serializer.fromJson<String?>(
|
|
json['connectionDeviceAddress'],
|
|
),
|
|
connectionAutoConnect: serializer.fromJson<bool>(
|
|
json['connectionAutoConnect'],
|
|
),
|
|
connectionType: serializer.fromJson<String>(json['connectionType']),
|
|
connectionWifiHost: serializer.fromJson<String?>(
|
|
json['connectionWifiHost'],
|
|
),
|
|
connectionWifiPort: serializer.fromJson<int>(json['connectionWifiPort']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<int>(id),
|
|
'activeDroneProfileId': serializer.toJson<int?>(activeDroneProfileId),
|
|
'currentMissionId': serializer.toJson<int?>(currentMissionId),
|
|
'connectionDeviceAddress': serializer.toJson<String?>(
|
|
connectionDeviceAddress,
|
|
),
|
|
'connectionAutoConnect': serializer.toJson<bool>(connectionAutoConnect),
|
|
'connectionType': serializer.toJson<String>(connectionType),
|
|
'connectionWifiHost': serializer.toJson<String?>(connectionWifiHost),
|
|
'connectionWifiPort': serializer.toJson<int>(connectionWifiPort),
|
|
};
|
|
}
|
|
|
|
AppSettingsTableData copyWith({
|
|
int? id,
|
|
Value<int?> activeDroneProfileId = const Value.absent(),
|
|
Value<int?> currentMissionId = const Value.absent(),
|
|
Value<String?> connectionDeviceAddress = const Value.absent(),
|
|
bool? connectionAutoConnect,
|
|
String? connectionType,
|
|
Value<String?> connectionWifiHost = const Value.absent(),
|
|
int? connectionWifiPort,
|
|
}) => AppSettingsTableData(
|
|
id: id ?? this.id,
|
|
activeDroneProfileId: activeDroneProfileId.present
|
|
? activeDroneProfileId.value
|
|
: this.activeDroneProfileId,
|
|
currentMissionId: currentMissionId.present
|
|
? currentMissionId.value
|
|
: this.currentMissionId,
|
|
connectionDeviceAddress: connectionDeviceAddress.present
|
|
? connectionDeviceAddress.value
|
|
: this.connectionDeviceAddress,
|
|
connectionAutoConnect: connectionAutoConnect ?? this.connectionAutoConnect,
|
|
connectionType: connectionType ?? this.connectionType,
|
|
connectionWifiHost: connectionWifiHost.present
|
|
? connectionWifiHost.value
|
|
: this.connectionWifiHost,
|
|
connectionWifiPort: connectionWifiPort ?? this.connectionWifiPort,
|
|
);
|
|
AppSettingsTableData copyWithCompanion(AppSettingsTableCompanion data) {
|
|
return AppSettingsTableData(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
activeDroneProfileId: data.activeDroneProfileId.present
|
|
? data.activeDroneProfileId.value
|
|
: this.activeDroneProfileId,
|
|
currentMissionId: data.currentMissionId.present
|
|
? data.currentMissionId.value
|
|
: this.currentMissionId,
|
|
connectionDeviceAddress: data.connectionDeviceAddress.present
|
|
? data.connectionDeviceAddress.value
|
|
: this.connectionDeviceAddress,
|
|
connectionAutoConnect: data.connectionAutoConnect.present
|
|
? data.connectionAutoConnect.value
|
|
: this.connectionAutoConnect,
|
|
connectionType: data.connectionType.present
|
|
? data.connectionType.value
|
|
: this.connectionType,
|
|
connectionWifiHost: data.connectionWifiHost.present
|
|
? data.connectionWifiHost.value
|
|
: this.connectionWifiHost,
|
|
connectionWifiPort: data.connectionWifiPort.present
|
|
? data.connectionWifiPort.value
|
|
: this.connectionWifiPort,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('AppSettingsTableData(')
|
|
..write('id: $id, ')
|
|
..write('activeDroneProfileId: $activeDroneProfileId, ')
|
|
..write('currentMissionId: $currentMissionId, ')
|
|
..write('connectionDeviceAddress: $connectionDeviceAddress, ')
|
|
..write('connectionAutoConnect: $connectionAutoConnect, ')
|
|
..write('connectionType: $connectionType, ')
|
|
..write('connectionWifiHost: $connectionWifiHost, ')
|
|
..write('connectionWifiPort: $connectionWifiPort')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
activeDroneProfileId,
|
|
currentMissionId,
|
|
connectionDeviceAddress,
|
|
connectionAutoConnect,
|
|
connectionType,
|
|
connectionWifiHost,
|
|
connectionWifiPort,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is AppSettingsTableData &&
|
|
other.id == this.id &&
|
|
other.activeDroneProfileId == this.activeDroneProfileId &&
|
|
other.currentMissionId == this.currentMissionId &&
|
|
other.connectionDeviceAddress == this.connectionDeviceAddress &&
|
|
other.connectionAutoConnect == this.connectionAutoConnect &&
|
|
other.connectionType == this.connectionType &&
|
|
other.connectionWifiHost == this.connectionWifiHost &&
|
|
other.connectionWifiPort == this.connectionWifiPort);
|
|
}
|
|
|
|
class AppSettingsTableCompanion extends UpdateCompanion<AppSettingsTableData> {
|
|
final Value<int> id;
|
|
final Value<int?> activeDroneProfileId;
|
|
final Value<int?> currentMissionId;
|
|
final Value<String?> connectionDeviceAddress;
|
|
final Value<bool> connectionAutoConnect;
|
|
final Value<String> connectionType;
|
|
final Value<String?> connectionWifiHost;
|
|
final Value<int> connectionWifiPort;
|
|
const AppSettingsTableCompanion({
|
|
this.id = const Value.absent(),
|
|
this.activeDroneProfileId = const Value.absent(),
|
|
this.currentMissionId = const Value.absent(),
|
|
this.connectionDeviceAddress = const Value.absent(),
|
|
this.connectionAutoConnect = const Value.absent(),
|
|
this.connectionType = const Value.absent(),
|
|
this.connectionWifiHost = const Value.absent(),
|
|
this.connectionWifiPort = const Value.absent(),
|
|
});
|
|
AppSettingsTableCompanion.insert({
|
|
this.id = const Value.absent(),
|
|
this.activeDroneProfileId = const Value.absent(),
|
|
this.currentMissionId = const Value.absent(),
|
|
this.connectionDeviceAddress = const Value.absent(),
|
|
this.connectionAutoConnect = const Value.absent(),
|
|
this.connectionType = const Value.absent(),
|
|
this.connectionWifiHost = const Value.absent(),
|
|
this.connectionWifiPort = const Value.absent(),
|
|
});
|
|
static Insertable<AppSettingsTableData> custom({
|
|
Expression<int>? id,
|
|
Expression<int>? activeDroneProfileId,
|
|
Expression<int>? currentMissionId,
|
|
Expression<String>? connectionDeviceAddress,
|
|
Expression<bool>? connectionAutoConnect,
|
|
Expression<String>? connectionType,
|
|
Expression<String>? connectionWifiHost,
|
|
Expression<int>? connectionWifiPort,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (activeDroneProfileId != null)
|
|
'active_drone_profile_id': activeDroneProfileId,
|
|
if (currentMissionId != null) 'current_mission_id': currentMissionId,
|
|
if (connectionDeviceAddress != null)
|
|
'connection_device_address': connectionDeviceAddress,
|
|
if (connectionAutoConnect != null)
|
|
'connection_auto_connect': connectionAutoConnect,
|
|
if (connectionType != null) 'connection_type': connectionType,
|
|
if (connectionWifiHost != null)
|
|
'connection_wifi_host': connectionWifiHost,
|
|
if (connectionWifiPort != null)
|
|
'connection_wifi_port': connectionWifiPort,
|
|
});
|
|
}
|
|
|
|
AppSettingsTableCompanion copyWith({
|
|
Value<int>? id,
|
|
Value<int?>? activeDroneProfileId,
|
|
Value<int?>? currentMissionId,
|
|
Value<String?>? connectionDeviceAddress,
|
|
Value<bool>? connectionAutoConnect,
|
|
Value<String>? connectionType,
|
|
Value<String?>? connectionWifiHost,
|
|
Value<int>? connectionWifiPort,
|
|
}) {
|
|
return AppSettingsTableCompanion(
|
|
id: id ?? this.id,
|
|
activeDroneProfileId: activeDroneProfileId ?? this.activeDroneProfileId,
|
|
currentMissionId: currentMissionId ?? this.currentMissionId,
|
|
connectionDeviceAddress:
|
|
connectionDeviceAddress ?? this.connectionDeviceAddress,
|
|
connectionAutoConnect:
|
|
connectionAutoConnect ?? this.connectionAutoConnect,
|
|
connectionType: connectionType ?? this.connectionType,
|
|
connectionWifiHost: connectionWifiHost ?? this.connectionWifiHost,
|
|
connectionWifiPort: connectionWifiPort ?? this.connectionWifiPort,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<int>(id.value);
|
|
}
|
|
if (activeDroneProfileId.present) {
|
|
map['active_drone_profile_id'] = Variable<int>(
|
|
activeDroneProfileId.value,
|
|
);
|
|
}
|
|
if (currentMissionId.present) {
|
|
map['current_mission_id'] = Variable<int>(currentMissionId.value);
|
|
}
|
|
if (connectionDeviceAddress.present) {
|
|
map['connection_device_address'] = Variable<String>(
|
|
connectionDeviceAddress.value,
|
|
);
|
|
}
|
|
if (connectionAutoConnect.present) {
|
|
map['connection_auto_connect'] = Variable<bool>(
|
|
connectionAutoConnect.value,
|
|
);
|
|
}
|
|
if (connectionType.present) {
|
|
map['connection_type'] = Variable<String>(connectionType.value);
|
|
}
|
|
if (connectionWifiHost.present) {
|
|
map['connection_wifi_host'] = Variable<String>(connectionWifiHost.value);
|
|
}
|
|
if (connectionWifiPort.present) {
|
|
map['connection_wifi_port'] = Variable<int>(connectionWifiPort.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('AppSettingsTableCompanion(')
|
|
..write('id: $id, ')
|
|
..write('activeDroneProfileId: $activeDroneProfileId, ')
|
|
..write('currentMissionId: $currentMissionId, ')
|
|
..write('connectionDeviceAddress: $connectionDeviceAddress, ')
|
|
..write('connectionAutoConnect: $connectionAutoConnect, ')
|
|
..write('connectionType: $connectionType, ')
|
|
..write('connectionWifiHost: $connectionWifiHost, ')
|
|
..write('connectionWifiPort: $connectionWifiPort')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
abstract class _$AppDatabase extends GeneratedDatabase {
|
|
_$AppDatabase(QueryExecutor e) : super(e);
|
|
$AppDatabaseManager get managers => $AppDatabaseManager(this);
|
|
late final $MissionsTable missions = $MissionsTable(this);
|
|
late final $DroneProfilesTable droneProfiles = $DroneProfilesTable(this);
|
|
late final $AppSettingsTableTable appSettingsTable = $AppSettingsTableTable(
|
|
this,
|
|
);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
|
missions,
|
|
droneProfiles,
|
|
appSettingsTable,
|
|
];
|
|
}
|
|
|
|
typedef $$MissionsTableCreateCompanionBuilder =
|
|
MissionsCompanion Function({
|
|
Value<int> id,
|
|
required String name,
|
|
Value<String?> location,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
required String waypointsJson,
|
|
Value<bool> isDirty,
|
|
Value<String?> serverId,
|
|
});
|
|
typedef $$MissionsTableUpdateCompanionBuilder =
|
|
MissionsCompanion Function({
|
|
Value<int> id,
|
|
Value<String> name,
|
|
Value<String?> location,
|
|
Value<DateTime> createdAt,
|
|
Value<DateTime> updatedAt,
|
|
Value<String> waypointsJson,
|
|
Value<bool> isDirty,
|
|
Value<String?> serverId,
|
|
});
|
|
|
|
class $$MissionsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $MissionsTable> {
|
|
$$MissionsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<int> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get location => $composableBuilder(
|
|
column: $table.location,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get waypointsJson => $composableBuilder(
|
|
column: $table.waypointsJson,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get isDirty => $composableBuilder(
|
|
column: $table.isDirty,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get serverId => $composableBuilder(
|
|
column: $table.serverId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$MissionsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $MissionsTable> {
|
|
$$MissionsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<int> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get location => $composableBuilder(
|
|
column: $table.location,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
|
column: $table.updatedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get waypointsJson => $composableBuilder(
|
|
column: $table.waypointsJson,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get isDirty => $composableBuilder(
|
|
column: $table.isDirty,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get serverId => $composableBuilder(
|
|
column: $table.serverId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$MissionsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $MissionsTable> {
|
|
$$MissionsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<int> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get location =>
|
|
$composableBuilder(column: $table.location, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get updatedAt =>
|
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get waypointsJson => $composableBuilder(
|
|
column: $table.waypointsJson,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get isDirty =>
|
|
$composableBuilder(column: $table.isDirty, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get serverId =>
|
|
$composableBuilder(column: $table.serverId, builder: (column) => column);
|
|
}
|
|
|
|
class $$MissionsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$MissionsTable,
|
|
Mission,
|
|
$$MissionsTableFilterComposer,
|
|
$$MissionsTableOrderingComposer,
|
|
$$MissionsTableAnnotationComposer,
|
|
$$MissionsTableCreateCompanionBuilder,
|
|
$$MissionsTableUpdateCompanionBuilder,
|
|
(Mission, BaseReferences<_$AppDatabase, $MissionsTable, Mission>),
|
|
Mission,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$MissionsTableTableManager(_$AppDatabase db, $MissionsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$MissionsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$MissionsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$MissionsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<int> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String?> location = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
Value<String> waypointsJson = const Value.absent(),
|
|
Value<bool> isDirty = const Value.absent(),
|
|
Value<String?> serverId = const Value.absent(),
|
|
}) => MissionsCompanion(
|
|
id: id,
|
|
name: name,
|
|
location: location,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
waypointsJson: waypointsJson,
|
|
isDirty: isDirty,
|
|
serverId: serverId,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
Value<int> id = const Value.absent(),
|
|
required String name,
|
|
Value<String?> location = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<DateTime> updatedAt = const Value.absent(),
|
|
required String waypointsJson,
|
|
Value<bool> isDirty = const Value.absent(),
|
|
Value<String?> serverId = const Value.absent(),
|
|
}) => MissionsCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
location: location,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
waypointsJson: waypointsJson,
|
|
isDirty: isDirty,
|
|
serverId: serverId,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$MissionsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$MissionsTable,
|
|
Mission,
|
|
$$MissionsTableFilterComposer,
|
|
$$MissionsTableOrderingComposer,
|
|
$$MissionsTableAnnotationComposer,
|
|
$$MissionsTableCreateCompanionBuilder,
|
|
$$MissionsTableUpdateCompanionBuilder,
|
|
(Mission, BaseReferences<_$AppDatabase, $MissionsTable, Mission>),
|
|
Mission,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$DroneProfilesTableCreateCompanionBuilder =
|
|
DroneProfilesCompanion Function({
|
|
Value<int> id,
|
|
required String name,
|
|
required double minSpeed,
|
|
required double cruiseSpeed,
|
|
required double maxSpeed,
|
|
required double minTurnRadius,
|
|
required double loiterRadius,
|
|
required double catchRadius,
|
|
required double maxClimbRate,
|
|
required double maxDescentRate,
|
|
required double maxRangeM,
|
|
required double maxEnduranceMin,
|
|
required double maxAltitudeM,
|
|
});
|
|
typedef $$DroneProfilesTableUpdateCompanionBuilder =
|
|
DroneProfilesCompanion Function({
|
|
Value<int> id,
|
|
Value<String> name,
|
|
Value<double> minSpeed,
|
|
Value<double> cruiseSpeed,
|
|
Value<double> maxSpeed,
|
|
Value<double> minTurnRadius,
|
|
Value<double> loiterRadius,
|
|
Value<double> catchRadius,
|
|
Value<double> maxClimbRate,
|
|
Value<double> maxDescentRate,
|
|
Value<double> maxRangeM,
|
|
Value<double> maxEnduranceMin,
|
|
Value<double> maxAltitudeM,
|
|
});
|
|
|
|
class $$DroneProfilesTableFilterComposer
|
|
extends Composer<_$AppDatabase, $DroneProfilesTable> {
|
|
$$DroneProfilesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<int> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get minSpeed => $composableBuilder(
|
|
column: $table.minSpeed,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get cruiseSpeed => $composableBuilder(
|
|
column: $table.cruiseSpeed,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get maxSpeed => $composableBuilder(
|
|
column: $table.maxSpeed,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get minTurnRadius => $composableBuilder(
|
|
column: $table.minTurnRadius,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get loiterRadius => $composableBuilder(
|
|
column: $table.loiterRadius,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get catchRadius => $composableBuilder(
|
|
column: $table.catchRadius,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get maxClimbRate => $composableBuilder(
|
|
column: $table.maxClimbRate,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get maxDescentRate => $composableBuilder(
|
|
column: $table.maxDescentRate,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get maxRangeM => $composableBuilder(
|
|
column: $table.maxRangeM,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get maxEnduranceMin => $composableBuilder(
|
|
column: $table.maxEnduranceMin,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get maxAltitudeM => $composableBuilder(
|
|
column: $table.maxAltitudeM,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$DroneProfilesTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $DroneProfilesTable> {
|
|
$$DroneProfilesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<int> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get minSpeed => $composableBuilder(
|
|
column: $table.minSpeed,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get cruiseSpeed => $composableBuilder(
|
|
column: $table.cruiseSpeed,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get maxSpeed => $composableBuilder(
|
|
column: $table.maxSpeed,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get minTurnRadius => $composableBuilder(
|
|
column: $table.minTurnRadius,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get loiterRadius => $composableBuilder(
|
|
column: $table.loiterRadius,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get catchRadius => $composableBuilder(
|
|
column: $table.catchRadius,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get maxClimbRate => $composableBuilder(
|
|
column: $table.maxClimbRate,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get maxDescentRate => $composableBuilder(
|
|
column: $table.maxDescentRate,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get maxRangeM => $composableBuilder(
|
|
column: $table.maxRangeM,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get maxEnduranceMin => $composableBuilder(
|
|
column: $table.maxEnduranceMin,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get maxAltitudeM => $composableBuilder(
|
|
column: $table.maxAltitudeM,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$DroneProfilesTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $DroneProfilesTable> {
|
|
$$DroneProfilesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<int> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get minSpeed =>
|
|
$composableBuilder(column: $table.minSpeed, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get cruiseSpeed => $composableBuilder(
|
|
column: $table.cruiseSpeed,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get maxSpeed =>
|
|
$composableBuilder(column: $table.maxSpeed, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get minTurnRadius => $composableBuilder(
|
|
column: $table.minTurnRadius,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get loiterRadius => $composableBuilder(
|
|
column: $table.loiterRadius,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get catchRadius => $composableBuilder(
|
|
column: $table.catchRadius,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get maxClimbRate => $composableBuilder(
|
|
column: $table.maxClimbRate,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get maxDescentRate => $composableBuilder(
|
|
column: $table.maxDescentRate,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get maxRangeM =>
|
|
$composableBuilder(column: $table.maxRangeM, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get maxEnduranceMin => $composableBuilder(
|
|
column: $table.maxEnduranceMin,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<double> get maxAltitudeM => $composableBuilder(
|
|
column: $table.maxAltitudeM,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$DroneProfilesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$DroneProfilesTable,
|
|
DroneProfile,
|
|
$$DroneProfilesTableFilterComposer,
|
|
$$DroneProfilesTableOrderingComposer,
|
|
$$DroneProfilesTableAnnotationComposer,
|
|
$$DroneProfilesTableCreateCompanionBuilder,
|
|
$$DroneProfilesTableUpdateCompanionBuilder,
|
|
(
|
|
DroneProfile,
|
|
BaseReferences<_$AppDatabase, $DroneProfilesTable, DroneProfile>,
|
|
),
|
|
DroneProfile,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$DroneProfilesTableTableManager(_$AppDatabase db, $DroneProfilesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$DroneProfilesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$DroneProfilesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$DroneProfilesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<int> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<double> minSpeed = const Value.absent(),
|
|
Value<double> cruiseSpeed = const Value.absent(),
|
|
Value<double> maxSpeed = const Value.absent(),
|
|
Value<double> minTurnRadius = const Value.absent(),
|
|
Value<double> loiterRadius = const Value.absent(),
|
|
Value<double> catchRadius = const Value.absent(),
|
|
Value<double> maxClimbRate = const Value.absent(),
|
|
Value<double> maxDescentRate = const Value.absent(),
|
|
Value<double> maxRangeM = const Value.absent(),
|
|
Value<double> maxEnduranceMin = const Value.absent(),
|
|
Value<double> maxAltitudeM = const Value.absent(),
|
|
}) => DroneProfilesCompanion(
|
|
id: id,
|
|
name: name,
|
|
minSpeed: minSpeed,
|
|
cruiseSpeed: cruiseSpeed,
|
|
maxSpeed: maxSpeed,
|
|
minTurnRadius: minTurnRadius,
|
|
loiterRadius: loiterRadius,
|
|
catchRadius: catchRadius,
|
|
maxClimbRate: maxClimbRate,
|
|
maxDescentRate: maxDescentRate,
|
|
maxRangeM: maxRangeM,
|
|
maxEnduranceMin: maxEnduranceMin,
|
|
maxAltitudeM: maxAltitudeM,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
Value<int> id = const Value.absent(),
|
|
required String name,
|
|
required double minSpeed,
|
|
required double cruiseSpeed,
|
|
required double maxSpeed,
|
|
required double minTurnRadius,
|
|
required double loiterRadius,
|
|
required double catchRadius,
|
|
required double maxClimbRate,
|
|
required double maxDescentRate,
|
|
required double maxRangeM,
|
|
required double maxEnduranceMin,
|
|
required double maxAltitudeM,
|
|
}) => DroneProfilesCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
minSpeed: minSpeed,
|
|
cruiseSpeed: cruiseSpeed,
|
|
maxSpeed: maxSpeed,
|
|
minTurnRadius: minTurnRadius,
|
|
loiterRadius: loiterRadius,
|
|
catchRadius: catchRadius,
|
|
maxClimbRate: maxClimbRate,
|
|
maxDescentRate: maxDescentRate,
|
|
maxRangeM: maxRangeM,
|
|
maxEnduranceMin: maxEnduranceMin,
|
|
maxAltitudeM: maxAltitudeM,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$DroneProfilesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$DroneProfilesTable,
|
|
DroneProfile,
|
|
$$DroneProfilesTableFilterComposer,
|
|
$$DroneProfilesTableOrderingComposer,
|
|
$$DroneProfilesTableAnnotationComposer,
|
|
$$DroneProfilesTableCreateCompanionBuilder,
|
|
$$DroneProfilesTableUpdateCompanionBuilder,
|
|
(
|
|
DroneProfile,
|
|
BaseReferences<_$AppDatabase, $DroneProfilesTable, DroneProfile>,
|
|
),
|
|
DroneProfile,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$AppSettingsTableTableCreateCompanionBuilder =
|
|
AppSettingsTableCompanion Function({
|
|
Value<int> id,
|
|
Value<int?> activeDroneProfileId,
|
|
Value<int?> currentMissionId,
|
|
Value<String?> connectionDeviceAddress,
|
|
Value<bool> connectionAutoConnect,
|
|
Value<String> connectionType,
|
|
Value<String?> connectionWifiHost,
|
|
Value<int> connectionWifiPort,
|
|
});
|
|
typedef $$AppSettingsTableTableUpdateCompanionBuilder =
|
|
AppSettingsTableCompanion Function({
|
|
Value<int> id,
|
|
Value<int?> activeDroneProfileId,
|
|
Value<int?> currentMissionId,
|
|
Value<String?> connectionDeviceAddress,
|
|
Value<bool> connectionAutoConnect,
|
|
Value<String> connectionType,
|
|
Value<String?> connectionWifiHost,
|
|
Value<int> connectionWifiPort,
|
|
});
|
|
|
|
class $$AppSettingsTableTableFilterComposer
|
|
extends Composer<_$AppDatabase, $AppSettingsTableTable> {
|
|
$$AppSettingsTableTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<int> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get activeDroneProfileId => $composableBuilder(
|
|
column: $table.activeDroneProfileId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get currentMissionId => $composableBuilder(
|
|
column: $table.currentMissionId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get connectionDeviceAddress => $composableBuilder(
|
|
column: $table.connectionDeviceAddress,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get connectionAutoConnect => $composableBuilder(
|
|
column: $table.connectionAutoConnect,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get connectionType => $composableBuilder(
|
|
column: $table.connectionType,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get connectionWifiHost => $composableBuilder(
|
|
column: $table.connectionWifiHost,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get connectionWifiPort => $composableBuilder(
|
|
column: $table.connectionWifiPort,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$AppSettingsTableTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $AppSettingsTableTable> {
|
|
$$AppSettingsTableTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<int> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get activeDroneProfileId => $composableBuilder(
|
|
column: $table.activeDroneProfileId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get currentMissionId => $composableBuilder(
|
|
column: $table.currentMissionId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get connectionDeviceAddress => $composableBuilder(
|
|
column: $table.connectionDeviceAddress,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get connectionAutoConnect => $composableBuilder(
|
|
column: $table.connectionAutoConnect,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get connectionType => $composableBuilder(
|
|
column: $table.connectionType,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get connectionWifiHost => $composableBuilder(
|
|
column: $table.connectionWifiHost,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get connectionWifiPort => $composableBuilder(
|
|
column: $table.connectionWifiPort,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$AppSettingsTableTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $AppSettingsTableTable> {
|
|
$$AppSettingsTableTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<int> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get activeDroneProfileId => $composableBuilder(
|
|
column: $table.activeDroneProfileId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get currentMissionId => $composableBuilder(
|
|
column: $table.currentMissionId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get connectionDeviceAddress => $composableBuilder(
|
|
column: $table.connectionDeviceAddress,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get connectionAutoConnect => $composableBuilder(
|
|
column: $table.connectionAutoConnect,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get connectionType => $composableBuilder(
|
|
column: $table.connectionType,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get connectionWifiHost => $composableBuilder(
|
|
column: $table.connectionWifiHost,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get connectionWifiPort => $composableBuilder(
|
|
column: $table.connectionWifiPort,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$AppSettingsTableTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$AppSettingsTableTable,
|
|
AppSettingsTableData,
|
|
$$AppSettingsTableTableFilterComposer,
|
|
$$AppSettingsTableTableOrderingComposer,
|
|
$$AppSettingsTableTableAnnotationComposer,
|
|
$$AppSettingsTableTableCreateCompanionBuilder,
|
|
$$AppSettingsTableTableUpdateCompanionBuilder,
|
|
(
|
|
AppSettingsTableData,
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$AppSettingsTableTable,
|
|
AppSettingsTableData
|
|
>,
|
|
),
|
|
AppSettingsTableData,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$AppSettingsTableTableTableManager(
|
|
_$AppDatabase db,
|
|
$AppSettingsTableTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$AppSettingsTableTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$AppSettingsTableTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$AppSettingsTableTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<int> id = const Value.absent(),
|
|
Value<int?> activeDroneProfileId = const Value.absent(),
|
|
Value<int?> currentMissionId = const Value.absent(),
|
|
Value<String?> connectionDeviceAddress = const Value.absent(),
|
|
Value<bool> connectionAutoConnect = const Value.absent(),
|
|
Value<String> connectionType = const Value.absent(),
|
|
Value<String?> connectionWifiHost = const Value.absent(),
|
|
Value<int> connectionWifiPort = const Value.absent(),
|
|
}) => AppSettingsTableCompanion(
|
|
id: id,
|
|
activeDroneProfileId: activeDroneProfileId,
|
|
currentMissionId: currentMissionId,
|
|
connectionDeviceAddress: connectionDeviceAddress,
|
|
connectionAutoConnect: connectionAutoConnect,
|
|
connectionType: connectionType,
|
|
connectionWifiHost: connectionWifiHost,
|
|
connectionWifiPort: connectionWifiPort,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
Value<int> id = const Value.absent(),
|
|
Value<int?> activeDroneProfileId = const Value.absent(),
|
|
Value<int?> currentMissionId = const Value.absent(),
|
|
Value<String?> connectionDeviceAddress = const Value.absent(),
|
|
Value<bool> connectionAutoConnect = const Value.absent(),
|
|
Value<String> connectionType = const Value.absent(),
|
|
Value<String?> connectionWifiHost = const Value.absent(),
|
|
Value<int> connectionWifiPort = const Value.absent(),
|
|
}) => AppSettingsTableCompanion.insert(
|
|
id: id,
|
|
activeDroneProfileId: activeDroneProfileId,
|
|
currentMissionId: currentMissionId,
|
|
connectionDeviceAddress: connectionDeviceAddress,
|
|
connectionAutoConnect: connectionAutoConnect,
|
|
connectionType: connectionType,
|
|
connectionWifiHost: connectionWifiHost,
|
|
connectionWifiPort: connectionWifiPort,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$AppSettingsTableTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$AppSettingsTableTable,
|
|
AppSettingsTableData,
|
|
$$AppSettingsTableTableFilterComposer,
|
|
$$AppSettingsTableTableOrderingComposer,
|
|
$$AppSettingsTableTableAnnotationComposer,
|
|
$$AppSettingsTableTableCreateCompanionBuilder,
|
|
$$AppSettingsTableTableUpdateCompanionBuilder,
|
|
(
|
|
AppSettingsTableData,
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$AppSettingsTableTable,
|
|
AppSettingsTableData
|
|
>,
|
|
),
|
|
AppSettingsTableData,
|
|
PrefetchHooks Function()
|
|
>;
|
|
|
|
class $AppDatabaseManager {
|
|
final _$AppDatabase _db;
|
|
$AppDatabaseManager(this._db);
|
|
$$MissionsTableTableManager get missions =>
|
|
$$MissionsTableTableManager(_db, _db.missions);
|
|
$$DroneProfilesTableTableManager get droneProfiles =>
|
|
$$DroneProfilesTableTableManager(_db, _db.droneProfiles);
|
|
$$AppSettingsTableTableTableManager get appSettingsTable =>
|
|
$$AppSettingsTableTableTableManager(_db, _db.appSettingsTable);
|
|
}
|