/*----------------------------------------------------------------------------*/ /* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ #pragma once #include #include "frc/simulation/CallbackStore.h" namespace frc { namespace sim { /** * Class to control a simulated RoboRIO. */ class RoboRioSim { public: static std::unique_ptr RegisterFPGAButtonCallback( NotifyCallback callback, bool initialNotify); static bool GetFPGAButton(); static void SetFPGAButton(bool fPGAButton); static std::unique_ptr RegisterVInVoltageCallback( NotifyCallback callback, bool initialNotify); static double GetVInVoltage(); static void SetVInVoltage(double vInVoltage); static std::unique_ptr RegisterVInCurrentCallback( NotifyCallback callback, bool initialNotify); static double GetVInCurrent(); static void SetVInCurrent(double vInCurrent); static std::unique_ptr RegisterUserVoltage6VCallback( NotifyCallback callback, bool initialNotify); static double GetUserVoltage6V(); static void SetUserVoltage6V(double userVoltage6V); static std::unique_ptr RegisterUserCurrent6VCallback( NotifyCallback callback, bool initialNotify); static double GetUserCurrent6V(); static void SetUserCurrent6V(double userCurrent6V); static std::unique_ptr RegisterUserActive6VCallback( NotifyCallback callback, bool initialNotify); static bool GetUserActive6V(); static void SetUserActive6V(bool userActive6V); static std::unique_ptr RegisterUserVoltage5VCallback( NotifyCallback callback, bool initialNotify); static double GetUserVoltage5V(); static void SetUserVoltage5V(double userVoltage5V); static std::unique_ptr RegisterUserCurrent5VCallback( NotifyCallback callback, bool initialNotify); static double GetUserCurrent5V(); static void SetUserCurrent5V(double userCurrent5V); static std::unique_ptr RegisterUserActive5VCallback( NotifyCallback callback, bool initialNotify); static bool GetUserActive5V(); static void SetUserActive5V(bool userActive5V); static std::unique_ptr RegisterUserVoltage3V3Callback( NotifyCallback callback, bool initialNotify); static double GetUserVoltage3V3(); static void SetUserVoltage3V3(double userVoltage3V3); static std::unique_ptr RegisterUserCurrent3V3Callback( NotifyCallback callback, bool initialNotify); static double GetUserCurrent3V3(); static void SetUserCurrent3V3(double userCurrent3V3); static std::unique_ptr RegisterUserActive3V3Callback( NotifyCallback callback, bool initialNotify); static bool GetUserActive3V3(); static void SetUserActive3V3(bool userActive3V3); static std::unique_ptr RegisterUserFaults6VCallback( NotifyCallback callback, bool initialNotify); static int GetUserFaults6V(); static void SetUserFaults6V(int userFaults6V); static std::unique_ptr RegisterUserFaults5VCallback( NotifyCallback callback, bool initialNotify); static int GetUserFaults5V(); static void SetUserFaults5V(int userFaults5V); static std::unique_ptr RegisterUserFaults3V3Callback( NotifyCallback callback, bool initialNotify); static int GetUserFaults3V3(); static void SetUserFaults3V3(int userFaults3V3); static void ResetData(); }; } // namespace sim } // namespace frc