3457F / 3303F-Off-Season-FR

0 stars 0 forks source link

Class-ify Tuning CLI #3

Open CodeMyGame1 opened 3 months ago

CodeMyGame1 commented 3 months ago

Problem: Partly an extension of gh-2, the CLI tuning code, while still in the works in cli-tune, is currently a large function being called in opcontrol(); this makes the functionality of the program a bit dubious at first glance. It also pollutes main.cpp with utility functions like split() and makeLowerCase(). Thirdly, since most of this code is in main.cpp, it also exposes a lot of low-level interactions that make the functioning of main.cpp appear even more murky. Significance: If a lot of the functionality of CLI-tune is moved to a different file, this will significantly improve the readability of main.cpp, in addition to allowing the CLI function(s) to interact with other classes, such as the Robot class mentioned in gh-2 (that is, it can interface with the Robot class to, say, set PID constants or modify slew values). Solution: I propose that a new class, CLITuner (preliminary name—can be changed!), be made (in a separate file), that essentially has most of the functions in the current CLI-tuning collection, but allows them (and their corresponding state variables) to be accessed by other classes!