13#include <units/frequency.h>
14#include <units/frequency.h>
15#include <units/time.h>
27 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash,
bool cancelOtherRequests, std::shared_ptr<ControlRequest> &req)
override
29 if (req.get() !=
this)
31 auto const reqCast =
dynamic_cast<MusicTone *
>(req.get());
32 if (reqCast !=
nullptr)
38 req = std::make_shared<MusicTone>(*
this);
123 std::stringstream ss;
124 ss <<
"class: MusicTone" << std::endl;
125 ss <<
"AudioFrequency: " <<
AudioFrequency.to<
double>() << std::endl;
136 std::map<std::string, std::string> controlInfo;
137 std::stringstream ss;
138 controlInfo[
"Name"] =
GetName();
139 ss <<
AudioFrequency.to<
double>(); controlInfo[
"AudioFrequency"] = ss.str(); ss.str(std::string{});
CTREXPORT int c_ctre_phoenix6_RequestControlMusicTone(const char *canbus, uint32_t ecuEncoding, double updateTime, bool cancelOtherRequests, double AudioFrequency)
Abstract Control Request class that other control requests extend for use.
Definition: ControlRequest.hpp:28
std::string const & GetName() const
Definition: ControlRequest.hpp:51
Plays a single tone at the user specified frequency.
Definition: MusicTone.hpp:26
MusicTone & WithAudioFrequency(units::frequency::hertz_t newAudioFrequency)
Modifies this Control Request's AudioFrequency parameter and returns itself for method-chaining and e...
Definition: MusicTone.hpp:92
MusicTone & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the period at which this control will update at.
Definition: MusicTone.hpp:111
units::frequency::hertz_t AudioFrequency
Sound frequency to play.
Definition: MusicTone.hpp:52
MusicTone(units::frequency::hertz_t AudioFrequency)
Plays a single tone at the user specified frequency.
Definition: MusicTone.hpp:76
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
Definition: MusicTone.hpp:134
std::string ToString() const override
Returns a string representation of the object.
Definition: MusicTone.hpp:121
units::frequency::hertz_t UpdateFreqHz
The period at which this control will update at.
Definition: MusicTone.hpp:65
Definition: string_util.hpp:15