Skip to content

Commit

Permalink
Added differential drive widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Oct 15, 2023
1 parent 462fae0 commit a4aadfe
Show file tree
Hide file tree
Showing 3 changed files with 453 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:elastic_dashboard/widgets/draggable_containers/draggable_widget_
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/camera_stream.dart';
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/command_scheduler.dart';
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/command_widget.dart';
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/differential_drive.dart';
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/field_widget.dart';
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/fms_info.dart';
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/gyro.dart';
Expand Down Expand Up @@ -349,6 +350,11 @@ class DraggableNT4WidgetContainer extends DraggableWidgetContainer {
key: UniqueKey(),
jsonData: jsonData['properties'],
);
case 'DifferentialDrive':
return DifferentialDrive.fromJson(
key: UniqueKey(),
jsonData: jsonData['properties'],
);
case 'ComboBox Chooser':
return ComboBoxChooser.fromJson(
key: UniqueKey(),
Expand Down
6 changes: 6 additions & 0 deletions lib/widgets/network_tree/tree_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:elastic_dashboard/widgets/draggable_containers/draggable_widget_
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/camera_stream.dart';
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/command_scheduler.dart';
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/command_widget.dart';
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/differential_drive.dart';
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/field_widget.dart';
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/fms_info.dart';
import 'package:elastic_dashboard/widgets/nt4_widgets/multi-topic/gyro.dart';
Expand Down Expand Up @@ -155,6 +156,8 @@ class TreeRow {
return PowerDistribution(key: UniqueKey(), topic: topic);
case 'PIDController':
return PIDControllerWidget(key: UniqueKey(), topic: topic);
case 'DifferentialDrive':
return DifferentialDrive(key: UniqueKey(), topic: topic);
case 'String Chooser':
return ComboBoxChooser(key: UniqueKey(), topic: topic);
case 'Subsystem':
Expand Down Expand Up @@ -196,6 +199,9 @@ class TreeRow {
} else if (primary is PIDControllerWidget) {
width = normalGridSize * 2;
height = normalGridSize * 3;
} else if (primary is DifferentialDrive) {
width = normalGridSize * 3;
height = normalGridSize * 2;
} else if (primary is SubsystemWidget) {
width = normalGridSize * 2;
} else if (primary is CommandWidget) {
Expand Down
Loading

0 comments on commit a4aadfe

Please sign in to comment.