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

Decoupled from Okapi #4

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 18 additions & 52 deletions compile_commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"-fno-ms-extensions",
"-fno-ms-compatibility",
"-fno-delayed-template-parsing",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1/arm-none-eabi/thumb/v7-a+simd/softfp",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1/backward",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/include",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/include-fixed",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include",
"-isystemc:\\program files\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1",
"-isystemc:\\program files\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1/arm-none-eabi/thumb/v7-a+simd/softfp",
"-isystemc:\\program files\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1/backward",
"-isystemc:\\program files\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/include",
"-isystemc:\\program files\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/include-fixed",
"-isystemc:\\program files\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include",
"-iquote./include",
"-iquote./include/okapi/squiggles",
"-iquote./include/Graphy/",
Expand All @@ -24,6 +24,8 @@
"-g",
"-D_POSIX_THREADS",
"-D_UNIX98_THREAD_MUTEX_ATTRIBUTES",
"-D_POSIX_TIMERS",
"-D_POSIX_MONOTONIC_CLOCK",
"-Wno-psabi",
"-ffunction-sections",
"-fdata-sections",
Expand All @@ -34,7 +36,7 @@
"bin/Graphy/Grapher.cpp.o",
"src\\Graphy\\Grapher.cpp"
],
"directory": "C:\\Users\\24jasonz\\Desktop\\Vex\\Current-Code\\EZGraphLib_v2",
"directory": "C:\\Users\\Mavericks\\Desktop\\Graphy",
"file": "src\\Graphy\\Grapher.cpp"
},
{
Expand All @@ -46,50 +48,12 @@
"-fno-ms-extensions",
"-fno-ms-compatibility",
"-fno-delayed-template-parsing",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1/arm-none-eabi/thumb/v7-a+simd/softfp",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1/backward",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/include",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/include-fixed",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include",
"-iquote./include",
"-iquote./include/okapi/squiggles",
"-iquote./include/./",
"-mcpu=cortex-a9",
"-mfpu=neon-fp16",
"-mfloat-abi=softfp",
"-Os",
"-g",
"-D_POSIX_THREADS",
"-D_UNIX98_THREAD_MUTEX_ATTRIBUTES",
"-Wno-psabi",
"-ffunction-sections",
"-fdata-sections",
"-fdiagnostics-color",
"-funwind-tables",
"--std=gnu++17",
"-o",
"bin/main.cpp.o",
"src\\main.cpp"
],
"directory": "C:\\Users\\24jasonz\\Desktop\\Vex\\Current-Code\\EZGraphLib_v2",
"file": "src\\main.cpp"
},
{
"arguments": [
"clang++",
"-c",
"-target",
"armv7ar-none-none-eabi",
"-fno-ms-extensions",
"-fno-ms-compatibility",
"-fno-delayed-template-parsing",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1/arm-none-eabi/thumb/v7-a+simd/softfp",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1/backward",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/include",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/include-fixed",
"-isystemc:\\users\\24jasonz\\appdata\\local\\programs\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include",
"-isystemc:\\program files\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1",
"-isystemc:\\program files\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1/arm-none-eabi/thumb/v7-a+simd/softfp",
"-isystemc:\\program files\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include/c++/10.2.1/backward",
"-isystemc:\\program files\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/include",
"-isystemc:\\program files\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/include-fixed",
"-isystemc:\\program files\\pros\\toolchain\\usr\\bin\\../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/include",
"-iquote./include",
"-iquote./include/okapi/squiggles",
"-iquote./include/Graphy/",
Expand All @@ -100,6 +64,8 @@
"-g",
"-D_POSIX_THREADS",
"-D_UNIX98_THREAD_MUTEX_ATTRIBUTES",
"-D_POSIX_TIMERS",
"-D_POSIX_MONOTONIC_CLOCK",
"-Wno-psabi",
"-ffunction-sections",
"-fdata-sections",
Expand All @@ -110,7 +76,7 @@
"bin/Graphy/TaskWrapper.cpp.o",
"src\\Graphy\\TaskWrapper.cpp"
],
"directory": "C:\\Users\\24jasonz\\Desktop\\Vex\\Current-Code\\EZGraphLib_v2",
"directory": "C:\\Users\\Mavericks\\Desktop\\Graphy",
"file": "src\\Graphy\\TaskWrapper.cpp"
}
]
9 changes: 4 additions & 5 deletions include/Graphy/Grapher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <string>

#include "TaskWrapper.hpp"
#include "okapi/api/units/QTime.hpp"
#include "pros/screen.hpp"


Expand All @@ -22,7 +21,7 @@ class AsyncGrapher : public TaskWrapper {
std::map<std::string, std::vector<double>> container;
std::map<std::string, uint32_t> colors;
std::string title;
okapi::QTime refreshRate;
uint refreshRate;
int cnt;

public:
Expand All @@ -32,7 +31,7 @@ class AsyncGrapher : public TaskWrapper {
* @param title graph title
* @param rate refresh rate
*/
AsyncGrapher(const std::string &title, const okapi::QTime &rate = 10 * okapi::millisecond);
AsyncGrapher(const std::string &title, const uint rate = 10);

/**
* @brief Add new graph data type
Expand All @@ -55,14 +54,14 @@ class AsyncGrapher : public TaskWrapper {
*
* @param rate refresh rate
*/
void setRefreshRate(const okapi::QTime &rate);
void setRefreshRate(const uint rate);

/**
* @brief Get the current refresh rate
*
* @return refresh rate
*/
okapi::QTime getRefreshRate();
uint getRefreshRate();

protected:
void loop() override;
Expand Down
8 changes: 4 additions & 4 deletions src/Graphy/Grapher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace graphy {

AsyncGrapher::AsyncGrapher(const std::string &title, const okapi::QTime &rate) {
AsyncGrapher::AsyncGrapher(const std::string &title, const uint rate) {
this->title = title;
this->refreshRate = rate;
cnt = 0;
Expand All @@ -25,11 +25,11 @@ void AsyncGrapher::update(const std::string &name, double val) {
}
}

void AsyncGrapher::setRefreshRate(const okapi::QTime &rate) {
void AsyncGrapher::setRefreshRate(const uint rate) {
this->refreshRate = rate;
}

okapi::QTime AsyncGrapher::getRefreshRate() {
uint AsyncGrapher::getRefreshRate() {
return this->refreshRate;
}

Expand Down Expand Up @@ -60,7 +60,7 @@ void AsyncGrapher::loop() {
}
}

pros::delay(refreshRate.convert(okapi::millisecond));
pros::delay(refreshRate);
}
}

Expand Down
Loading