Skip to content
Merged
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
89 changes: 82 additions & 7 deletions include/ur_client_library/ur/dashboard_client_implementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ class DashboardClientImpl
* - 'installation_name': std::string
*
* \param installation_file_name The installation file name with the installation extension
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandLoadInstallation(const std::string& installation_file_name) = 0;

Expand Down Expand Up @@ -226,11 +228,15 @@ class DashboardClientImpl

/*!
* \brief Send Close popup command
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandClosePopup() = 0;

/*!
* \brief Send Close safety popup command
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandCloseSafetyPopup() = 0;

Expand All @@ -246,6 +252,8 @@ class DashboardClientImpl

/*!
* \brief Send Shutdown command
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandShutdown() = 0;

Expand All @@ -260,6 +268,8 @@ class DashboardClientImpl
* Stores the following entries in the data field:
*
* - 'running': bool
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandRunning() = 0;

Expand All @@ -269,6 +279,8 @@ class DashboardClientImpl
* Stores the following entries in the data field:
*
* - 'saved': bool
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandIsProgramSaved() = 0;

Expand All @@ -279,21 +291,25 @@ class DashboardClientImpl
*
* - 'remote_control': bool
*
* \throws an UrException when called on CB3 robots
* \throws an NotImplementedException when called on CB3 robots or PolyScope versions lower than 10.12.0
*/
virtual DashboardResponse commandIsInRemoteControl() = 0;

/*!
* \brief Send popup command
*
* \param popup_text The text to be shown in the popup
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandPopup(const std::string& popup_text) = 0;

/*!
* \brief Send text to log
*
* \param log_text The text to be sent to the log
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandAddToLog(const std::string& log_text) = 0;

Expand All @@ -303,6 +319,8 @@ class DashboardClientImpl
* Stores the following entries in the data field:
*
* - 'polyscope_version': std::string
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandPolyscopeVersion() = 0;

Expand All @@ -312,6 +330,8 @@ class DashboardClientImpl
* Stores the following entries in the data field:
*
* - 'robot_model': std::string
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandGetRobotModel() = 0;

Expand All @@ -321,6 +341,8 @@ class DashboardClientImpl
* Stores the following entries in the data field:
*
* - 'serial_number': std::string
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandGetSerialNumber() = 0;

Expand All @@ -330,6 +352,8 @@ class DashboardClientImpl
* Stores the following entries in the data field:
*
* - 'robot_mode': std::string
*
* \throws an NotImplementedException when called on PolyScope X versions lower than 10.12.0
*/
virtual DashboardResponse commandRobotMode() = 0;

Expand All @@ -339,6 +363,8 @@ class DashboardClientImpl
* Stores the following entries in the data field:
*
* - 'program_name': std::string
*
* \throws an NotImplementedException when called on PolyScope X versions lower than 10.12.0
*/
virtual DashboardResponse commandGetLoadedProgram() = 0;

Expand All @@ -348,6 +374,8 @@ class DashboardClientImpl
* Stores the following entries in the data field:
*
* - 'safety_mode': std::string
*
* \throws an NotImplementedException when called on PolyScope X versions lower than 10.12.0
*/
virtual DashboardResponse commandSafetyMode() = 0;

Expand All @@ -357,6 +385,8 @@ class DashboardClientImpl
* Stores the following entries in the data field:
*
* - 'safety_status': std::string
*
* \throws an NotImplementedException when called on Polyscope X robots
*/
virtual DashboardResponse commandSafetyStatus() = 0;

Expand All @@ -377,7 +407,7 @@ class DashboardClientImpl
*
* - 'operational_mode': std::string
*
* \throws an UrException when called on CB3 robots
* \throws an NotImplementedException when called on CB3 robots or a Polyscope X version lower than 10.12.0
*/
virtual DashboardResponse commandGetOperationalMode() = 0;

Expand All @@ -386,14 +416,14 @@ class DashboardClientImpl
*
* \param operational_mode The operational mode to set on the robot
*
* \throws an UrException when called on CB3 robots
* \throws an NotImplementedException when called on CB3 robots and Polyscope X robots
*/
virtual DashboardResponse commandSetOperationalMode(const std::string& operational_mode) = 0;

/*!
* \brief Send Clear operational mode command
*
* \throws an UrException when called on CB3 robots
* \throws an NotImplementedException when called on CB3 and Polyscope X robots
*/
virtual DashboardResponse commandClearOperationalMode() = 0;

Expand All @@ -402,22 +432,24 @@ class DashboardClientImpl
*
* \param user_role The user role to set on the robot
*
* \throws an UrException when called on e-series robots
* \throws an NotImplementedException when called on e-series robots
*/
virtual DashboardResponse commandSetUserRole(const std::string& user_role) = 0;

/*!
* \brief Send Get user role command (Only available for CB3)
*
*
* \throws an UrException when called on e-series robots
* \throws an NotImplementedException when called on e-series robots
*/
virtual DashboardResponse commandGetUserRole() = 0;

/*!
* \brief Send Generate flight report command
*
* \param report_type The report type to set for the flight report
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandGenerateFlightReport(const std::string& report_type) = 0;

Expand All @@ -426,22 +458,65 @@ class DashboardClientImpl
*
* \param dir_path The path to the directory of an already existing directory location inside the programs directory,
* where the support file is saved
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandGenerateSupportFile(const std::string& dir_path) = 0;

/*!
* \brief Flush the polyscope log to the log_history.txt file
*
* \throws an NotImplementedException when called on PolyScope X robots
*/
virtual DashboardResponse commandSaveLog() = 0;

/*!
* \brief Get a list of the programs available on the robot
*
* Stores the following entries in the data field:
*
* - 'programs': std::vector<urcl::ProgramInformation>
*
* \throws an NotImplementedException when called on versions lower than PolyScope 10.12.0
*/
virtual DashboardResponse commandGetProgramList() = 0;

/*!
* \brief Upload a new program to the robot. Will return an error if a program with the same name already exists
*
* Stores the following entries in the data field:
*
* - 'program_name': std::string
*
* \param file_path The path to the program file on the user's computer
*
* \throws an NotImplementedException when called on versions lower than PolyScope 10.12.0
*/
virtual DashboardResponse commandUploadProgram(const std::string& file_path) = 0;

/*!
* \brief Update an existing program. Will return an error if no program exists with the same name
*
* \param file_path The path to the program file on the user's computer
*
* \throws an NotImplementedException when called on versions lower than PolyScope 10.12.0
*/
virtual DashboardResponse commandUpdateProgram(const std::string& file_path) = 0;

virtual DashboardResponse commandDownloadProgram(const std::string& filename, const std::string& save_path) = 0;
/*!
* \brief Download a program from the robot
*
* \param program_name The name of the program that is to be downloaded
*
* \param save_path Filepath where the downloaded program should be saved on the user's computer
*
* \throws an NotImplementedException when called on versions lower than PolyScope 10.12.0
*/
virtual DashboardResponse commandDownloadProgram(const std::string& program_name, const std::string& save_path) = 0;

/*!
* \brief Get the PolyScope version running on the robot
*/
const VersionInformation& getPolyscopeVersion() const
{
return polyscope_version_;
Expand Down
Loading