mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -39,7 +39,7 @@
|
||||
#include "wpi/glass/support/EnumSetting.hpp"
|
||||
#include "wpi/glass/support/ExtraGuiWidgets.hpp"
|
||||
|
||||
using namespace glass;
|
||||
using namespace wpi::glass;
|
||||
|
||||
static constexpr int kAxisCount = 3;
|
||||
|
||||
@@ -89,8 +89,8 @@ class PlotSeries {
|
||||
// source linkage
|
||||
DataSource* m_source = nullptr;
|
||||
bool m_digitalSource = false;
|
||||
wpi::sig::ScopedConnection m_sourceCreatedConn;
|
||||
wpi::sig::ScopedConnection m_newValueConn;
|
||||
wpi::util::sig::ScopedConnection m_sourceCreatedConn;
|
||||
wpi::util::sig::ScopedConnection m_newValueConn;
|
||||
std::string& m_id;
|
||||
|
||||
// user settings
|
||||
@@ -292,7 +292,7 @@ void PlotSeries::SetSource(DataSource* source) {
|
||||
}
|
||||
|
||||
void PlotSeries::AppendValue(double value, int64_t timeUs) {
|
||||
double time = (timeUs != 0 ? timeUs : wpi::Now()) * 1.0e-6;
|
||||
double time = (timeUs != 0 ? timeUs : wpi::util::Now()) * 1.0e-6;
|
||||
if (IsDigital()) {
|
||||
if (m_size < kMaxSize) {
|
||||
m_data[m_size] = ImPlotPoint{time, value};
|
||||
@@ -350,7 +350,7 @@ PlotSeries::Action PlotSeries::EmitPlot(PlotView& view, double now, size_t i,
|
||||
CheckSource();
|
||||
|
||||
char label[128];
|
||||
wpi::format_to_n_c_str(label, sizeof(label), "{}###name{}_{}", GetName(),
|
||||
wpi::util::format_to_n_c_str(label, sizeof(label), "{}###name{}_{}", GetName(),
|
||||
static_cast<int>(i), static_cast<int>(plotIndex));
|
||||
|
||||
int size = m_size;
|
||||
@@ -618,7 +618,7 @@ void Plot::EmitPlot(PlotView& view, double now, bool paused, size_t i) {
|
||||
}
|
||||
|
||||
char label[128];
|
||||
wpi::format_to_n_c_str(label, sizeof(label), "{}###plot{}", m_name,
|
||||
wpi::util::format_to_n_c_str(label, sizeof(label), "{}###plot{}", m_name,
|
||||
static_cast<int>(i));
|
||||
|
||||
ImPlotFlags plotFlags = (m_legend ? 0 : ImPlotFlags_NoLegend) |
|
||||
@@ -865,7 +865,7 @@ void PlotView::Display() {
|
||||
}
|
||||
}
|
||||
|
||||
double now = wpi::Now() * 1.0e-6;
|
||||
double now = wpi::util::Now() * 1.0e-6;
|
||||
for (size_t i = 0; i < m_plots.size(); ++i) {
|
||||
ImGui::PushID(i);
|
||||
m_plots[i]->EmitPlot(*this, now, m_provider->IsPaused(), i);
|
||||
@@ -976,14 +976,14 @@ void PlotView::Settings() {
|
||||
|
||||
char name[64];
|
||||
if (!plot->GetName().empty()) {
|
||||
wpi::format_to_n_c_str(name, sizeof(name), "{}", plot->GetName().c_str());
|
||||
wpi::util::format_to_n_c_str(name, sizeof(name), "{}", plot->GetName().c_str());
|
||||
} else {
|
||||
wpi::format_to_n_c_str(name, sizeof(name), "Plot {}",
|
||||
wpi::util::format_to_n_c_str(name, sizeof(name), "Plot {}",
|
||||
static_cast<int>(i));
|
||||
}
|
||||
|
||||
char label[90];
|
||||
wpi::format_to_n_c_str(label, sizeof(label), "{}###header{}", name,
|
||||
wpi::util::format_to_n_c_str(label, sizeof(label), "{}###header{}", name,
|
||||
static_cast<int>(i));
|
||||
|
||||
bool open = ImGui::CollapsingHeader(label);
|
||||
@@ -1053,7 +1053,7 @@ void PlotProvider::DisplayMenu() {
|
||||
char id[32];
|
||||
size_t numWindows = m_windows.size();
|
||||
for (size_t i = 0; i <= numWindows; ++i) {
|
||||
wpi::format_to_n_c_str(id, sizeof(id), "Plot <{}>", static_cast<int>(i));
|
||||
wpi::util::format_to_n_c_str(id, sizeof(id), "Plot <{}>", static_cast<int>(i));
|
||||
|
||||
bool match = false;
|
||||
for (size_t j = 0; j < numWindows; ++j) {
|
||||
|
||||
Reference in New Issue
Block a user