Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added struct based swerve widget #183

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
12 changes: 12 additions & 0 deletions lib/services/nt_widget_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import 'package:elastic_dashboard/widgets/nt_widgets/multi-topic/profiled_pid_co
import 'package:elastic_dashboard/widgets/nt_widgets/multi-topic/relay_widget.dart';
import 'package:elastic_dashboard/widgets/nt_widgets/multi-topic/robot_preferences.dart';
import 'package:elastic_dashboard/widgets/nt_widgets/multi-topic/split_button_chooser.dart';
import 'package:elastic_dashboard/widgets/nt_widgets/multi-topic/struct_swerve.dart';
import 'package:elastic_dashboard/widgets/nt_widgets/multi-topic/subsystem_widget.dart';
import 'package:elastic_dashboard/widgets/nt_widgets/multi-topic/three_axis_accelerometer.dart';
import 'package:elastic_dashboard/widgets/nt_widgets/multi-topic/ultrasonic.dart';
Expand Down Expand Up @@ -311,6 +312,17 @@ class NTWidgetBuilder {
widget: SplitButtonChooser.new,
fromJson: SplitButtonChooserModel.fromJson);

registerWithAlias(
names: {StructSwerve.widgetType, 'Swerve'},
model: StructSwerveModel.new,
widget: StructSwerve.new,
fromJson: StructSwerveModel.fromJson,
minWidth: _normalSize * 2,
minHeight: _normalSize * 2,
defaultWidth: 2,
defaultHeight: 2,
);

register(
name: SubsystemWidget.widgetType,
model: SubsystemModel.new,
Expand Down
Loading