Skip to content

Commit

Permalink
Upgrade to burt_network: 2.1.0 (#190)
Browse files Browse the repository at this point in the history
Co-authored-by: Levi Lesches <[email protected]>
  • Loading branch information
Gold872 and Levi-Lesches authored Nov 28, 2024
1 parent bd8dc5f commit 906dab3
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 22 deletions.
2 changes: 1 addition & 1 deletion lib/src/data/metrics/arm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ArmMetrics extends Metrics<ArmData> {
MetricLine(" Limit? ${motor.isLimitSwitchPressed.displayName}", severity: motor.isLimitSwitchPressed.toBool() ? Severity.warning : null),
MetricLine(" Direction: ${motor.direction.humanName}"),
MetricLine(" Steps: ${motor.currentStep} --> ${motor.targetStep}"),
MetricLine(" Angle: ${motor.angle.toDegrees()} degrees"),
MetricLine(" Angle: ${motor.currentAngle.toDegrees()} degrees"),
];

@override
Expand Down
2 changes: 1 addition & 1 deletion lib/src/data/metrics/gripper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class GripperMetrics extends Metrics<GripperData> {
MetricLine(" Limit? ${motor.isLimitSwitchPressed.displayName}", severity: motor.isLimitSwitchPressed.toBool() ? Severity.warning : null),
MetricLine(" Direction: ${motor.direction.humanName}"),
MetricLine(" Steps: ${motor.currentStep} --> ${motor.targetStep}"),
MetricLine(" Angle: ${motor.angle.toDegrees() % 360} degrees"),
MetricLine(" Angle: ${motor.currentAngle.toDegrees() % 360} degrees"),
];

@override
Expand Down
13 changes: 2 additions & 11 deletions lib/src/data/protobuf.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "dart:math";

import "package:protobuf/protobuf.dart";
import "package:rover_dashboard/data.dart";

export "package:protobuf/protobuf.dart" show GeneratedMessageGenericExtensions;
Expand Down Expand Up @@ -28,16 +27,6 @@ String getDataName(Device device) => switch (device) {
_ => "Unknown",
};

/// Utilities for a list of Protobuf enums.
extension UndefinedFilter<T extends ProtobufEnum> on List<T> {
/// Filters out `_UNDEFINED` values from the list.
List<T> get filtered => [
for (final value in this)
if (value.value != 0)
value,
];
}

/// Utilities for [Timestamp]s.
extension TimestampUtils on Timestamp {
/// The [Timestamp] version of [DateTime.now].
Expand Down Expand Up @@ -145,6 +134,8 @@ extension DeviceUtils on Device {
case Device.GRIPPER: return "Gripper";
case Device.SCIENCE: return "Science";
case Device.DRIVE: return "Drive";
case Device.BASE_STATION: return "Base Station";
case Device.ANTENNA: return "Antenna";
}
// Do not use default or else you'll lose exhaustiveness checking.
throw ArgumentError("Unrecognized device: $this");
Expand Down
6 changes: 3 additions & 3 deletions lib/src/models/view/arm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class ArmModel with ChangeNotifier {

/// The angles of the arm.
ArmAngles get angles => (
shoulder: arm.shoulder.angle,
elbow: arm.elbow.angle,
lift: gripper.lift.angle,
shoulder: arm.shoulder.currentAngle,
elbow: arm.elbow.currentAngle,
lift: gripper.lift.currentAngle,
);

/// The position of the mouse, if it's in the box.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/pages/arm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class ArmPage extends ReactiveWidget<ArmModel> {
elevation: 16,
color: context.colorScheme.surfaceContainerHighest,
child: CustomPaint(
painter: ArmPainterTop(swivelAngle: model.arm.base.angle),
painter: ArmPainterTop(swivelAngle: model.arm.base.currentAngle),
),
),
),
Expand Down
8 changes: 4 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ packages:
dependency: "direct main"
description:
path: "."
ref: HEAD
resolved-ref: ceeb9602a332d612bd9392d2b865403eea76b465
ref: "2.1.0"
resolved-ref: "61c1952afe2210099ccde59220356db647dc79ae"
url: "https://github.com/BinghamtonRover/Networking.git"
source: git
version: "2.0.0"
version: "2.1.0"
characters:
dependency: transitive
description:
Expand Down Expand Up @@ -205,7 +205,7 @@ packages:
description:
path: "."
ref: set-children-public
resolved-ref: ee68851d5db330a47451dccff601ba4d0feb4896
resolved-ref: cf2f237653a48389a99081dbb5086c1acce03f7f
url: "https://github.com/Levi-Lesches/flutter_resizable_container"
source: git
version: "3.0.0"
Expand Down
4 changes: 3 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ dependencies:
flutter:
sdk: flutter
burt_network:
git: https://github.com/BinghamtonRover/Networking.git
git:
url: https://github.com/BinghamtonRover/Networking.git
ref: 2.1.0
file_picker: ^8.0.0+1
fl_chart: ^0.69.0
flutter_libserialport: ^0.4.0
Expand Down

0 comments on commit 906dab3

Please sign in to comment.