mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[glass] Add drive class widgets (#2975)
This adds widgets for DifferentialDrive and MecanumDrive.
This commit is contained in:
committed by
GitHub
parent
00fa91d0d6
commit
ee7114a58c
@@ -4,11 +4,13 @@
|
||||
|
||||
#include "glass/networktables/NTCommandScheduler.h"
|
||||
#include "glass/networktables/NTCommandSelector.h"
|
||||
#include "glass/networktables/NTDifferentialDrive.h"
|
||||
#include "glass/networktables/NTDigitalInput.h"
|
||||
#include "glass/networktables/NTDigitalOutput.h"
|
||||
#include "glass/networktables/NTFMS.h"
|
||||
#include "glass/networktables/NTField2D.h"
|
||||
#include "glass/networktables/NTGyro.h"
|
||||
#include "glass/networktables/NTMecanumDrive.h"
|
||||
#include "glass/networktables/NTPIDController.h"
|
||||
#include "glass/networktables/NTSpeedController.h"
|
||||
#include "glass/networktables/NTStringChooser.h"
|
||||
@@ -40,6 +42,17 @@ void glass::AddStandardNetworkTablesViews(NetworkTablesProvider& provider) {
|
||||
DisplayCommandSelector(static_cast<NTCommandSelectorModel*>(model));
|
||||
});
|
||||
});
|
||||
provider.Register(
|
||||
NTDifferentialDriveModel::kType,
|
||||
[](NT_Inst inst, const char* path) {
|
||||
return std::make_unique<NTDifferentialDriveModel>(inst, path);
|
||||
},
|
||||
[](Window* win, Model* model, const char*) {
|
||||
win->SetDefaultSize(300, 350);
|
||||
return MakeFunctionView([=] {
|
||||
DisplayDrive(static_cast<NTDifferentialDriveModel*>(model));
|
||||
});
|
||||
});
|
||||
provider.Register(
|
||||
NTFMSModel::kType,
|
||||
[](NT_Inst inst, const char* path) {
|
||||
@@ -94,6 +107,16 @@ void glass::AddStandardNetworkTablesViews(NetworkTablesProvider& provider) {
|
||||
return MakeFunctionView(
|
||||
[=] { DisplayGyro(static_cast<NTGyroModel*>(model)); });
|
||||
});
|
||||
provider.Register(
|
||||
NTMecanumDriveModel::kType,
|
||||
[](NT_Inst inst, const char* path) {
|
||||
return std::make_unique<NTMecanumDriveModel>(inst, path);
|
||||
},
|
||||
[](Window* win, Model* model, const char*) {
|
||||
win->SetDefaultSize(300, 350);
|
||||
return MakeFunctionView(
|
||||
[=] { DisplayDrive(static_cast<NTMecanumDriveModel*>(model)); });
|
||||
});
|
||||
provider.Register(
|
||||
NTPIDControllerModel::kType,
|
||||
[](NT_Inst inst, const char* path) {
|
||||
|
||||
Reference in New Issue
Block a user