mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[hal, wpilib] Remove analog accumulator and analog gyro (#7697)
The 2 high level classes were temporarily kept to keep the examples compiling. We will remove those when we have the interface into the built in IMU.
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "glass/hardware/AnalogGyro.h"
|
||||
|
||||
#include <wpi/StringExtras.h>
|
||||
|
||||
#include "glass/DataSource.h"
|
||||
#include "glass/other/DeviceTree.h"
|
||||
|
||||
using namespace glass;
|
||||
|
||||
void glass::DisplayAnalogGyroDevice(AnalogGyroModel* model, int index) {
|
||||
char name[32];
|
||||
wpi::format_to_n_c_str(name, sizeof(name), "AnalogGyro[{}]", index);
|
||||
|
||||
if (BeginDevice(name)) {
|
||||
// angle
|
||||
if (auto angleData = model->GetAngleData()) {
|
||||
double value = angleData->GetValue();
|
||||
if (DeviceDouble("Angle", false, &value, angleData)) {
|
||||
model->SetAngle(value);
|
||||
}
|
||||
}
|
||||
|
||||
// rate
|
||||
if (auto rateData = model->GetRateData()) {
|
||||
double value = rateData->GetValue();
|
||||
if (DeviceDouble("Rate", false, &value, rateData)) {
|
||||
model->SetRate(value);
|
||||
}
|
||||
}
|
||||
EndDevice();
|
||||
}
|
||||
}
|
||||
|
||||
void glass::DisplayAnalogGyrosDevice(AnalogGyrosModel* model) {
|
||||
model->ForEachAnalogGyro(
|
||||
[&](AnalogGyroModel& gyro, int i) { DisplayAnalogGyroDevice(&gyro, i); });
|
||||
}
|
||||
@@ -30,11 +30,7 @@ void glass::DisplayAnalogInput(AnalogInputModel* model, int index) {
|
||||
wpi::format_to_n_c_str(label, sizeof(label), "In[{}]###name", index);
|
||||
}
|
||||
|
||||
if (model->IsGyro()) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(96, 96, 96, 255));
|
||||
ImGui::LabelText(label, "AnalogGyro[%d]", index);
|
||||
ImGui::PopStyleColor();
|
||||
} else if (auto simDevice = model->GetSimDevice()) {
|
||||
if (auto simDevice = model->GetSimDevice()) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(96, 96, 96, 255));
|
||||
ImGui::LabelText(label, "%s", simDevice);
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
Reference in New Issue
Block a user