Skip to content

Commit 7a3059b

Browse files
committed
load_installation should store the loaded installation file in the response
1 parent dda39a0 commit 7a3059b

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

include/ur_client_library/ur/dashboard_client_implementation.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ class DashboardClientImpl
153153
/*!
154154
* \brief Send Load installation command
155155
*
156+
* Stores the following entries in the data field:
157+
*
158+
* - 'installation_name': std::string
159+
*
156160
* \param installation_file_name The installation file name with the installation extension
157161
*/
158162
virtual DashboardResponse commandLoadInstallation(const std::string& installation_file_name) = 0;

src/ur/dashboard_client_implementation_g5.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ DashboardResponse DashboardClientImplG5::commandLoadInstallation(const std::stri
507507
response.message =
508508
sendRequestString("load installation", "(?:Loading installation: ).*(?:" + installation_file_name + ").*",
509509
installation_file_name);
510+
response.data["installation_name"] = installation_file_name;
510511
response.ok = true;
511512
}
512513
catch (const UnexpectedResponse& e)

tests/test_dashboard_client_g5.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ TEST_F(DashboardClientTestG5, load_installation)
136136
ASSERT_EQ(std::get<std::string>(response.data["installation_name"]), "default.installation");
137137
}
138138

139+
TEST_F(DashboardClientTestG5, load_program)
140+
{
141+
EXPECT_TRUE(dashboard_client_->connect());
142+
DashboardResponse response = dashboard_client_->commandLoadProgram("wait_program.urp");
143+
ASSERT_TRUE(response.ok);
144+
ASSERT_EQ(std::get<std::string>(response.data["program_name"]), "wait_program.urp");
145+
}
146+
139147
TEST_F(DashboardClientTestG5, not_connected)
140148
{
141149
EXPECT_THROW(dashboard_client_->commandPowerOff(), UrException);
@@ -619,4 +627,4 @@ int main(int argc, char* argv[])
619627
}
620628

621629
return RUN_ALL_TESTS();
622-
}
630+
}

0 commit comments

Comments
 (0)