From 17f5cbc50aa1e7adea6a8aae029fba55b9c5c969 Mon Sep 17 00:00:00 2001 From: samuel-cavalcanti Date: Fri, 20 Oct 2023 14:52:12 -0300 Subject: [PATCH] fix crate new name --- examples/get_simulation_time.rs | 6 ++++-- examples/low_level_call.rs | 11 ++++++----- examples/p_controller.rs | 4 +++- examples/send_ik_movement_sequence_mov.rs | 6 ++++-- examples/send_ik_movement_sequence_pts.rs | 6 ++++-- examples/sim_ik_example.rs | 8 ++++---- examples/simple_test.rs | 6 ++++-- examples/synchronous_image_transmission.rs | 4 +++- src/lib.rs | 4 ++-- src/remote_api_client/client.rs | 4 ++-- 10 files changed, 36 insertions(+), 23 deletions(-) diff --git a/examples/get_simulation_time.rs b/examples/get_simulation_time.rs index b354424..b2f46d3 100644 --- a/examples/get_simulation_time.rs +++ b/examples/get_simulation_time.rs @@ -1,4 +1,6 @@ -use zmq_remote_api::{sim::Sim, RemoteAPIError, RemoteApiClientParams}; +use coppeliasim_zmq_remote_api::{ + sim::Sim, RemoteAPIError, RemoteApiClient, RemoteApiClientParams, +}; /* Example based on Example.cpp @@ -8,7 +10,7 @@ fn main() -> Result<(), RemoteAPIError> { // use the env variable RUST_LOG="trace" or RUST_LOG="debug" to observe the zmq communication env_logger::init(); - let client = zmq_remote_api::RemoteApiClient::new(RemoteApiClientParams { + let client = RemoteApiClient::new(RemoteApiClientParams { host: "localhost".to_string(), ..RemoteApiClientParams::default() })?; diff --git a/examples/low_level_call.rs b/examples/low_level_call.rs index 0ac9326..b0d61e6 100644 --- a/examples/low_level_call.rs +++ b/examples/low_level_call.rs @@ -1,5 +1,6 @@ -use zmq_remote_api::{ - RawRequest, RemoteAPIError, RemoteApiClientInterface, RemoteApiClientParams, ZmqRequest, +use coppeliasim_zmq_remote_api::{ + RawRequest, RemoteAPIError, RemoteApiClient, RemoteApiClientInterface, RemoteApiClientParams, + ZmqRequest, }; use ciborium::cbor; @@ -8,7 +9,7 @@ fn main() -> Result<(), RemoteAPIError> { // use the env variable RUST_LOG="trace" or RUST_LOG="debug" to observe the zmq communication env_logger::init(); - let client = zmq_remote_api::RemoteApiClient::new(RemoteApiClientParams { + let client = RemoteApiClient::new(RemoteApiClientParams { host: "localhost".to_string(), ..RemoteApiClientParams::default() })?; @@ -17,8 +18,8 @@ fn main() -> Result<(), RemoteAPIError> { uuid: client.get_uuid(), func: "sim.getStringSignal".to_string(), args: vec![cbor!("testSignal").unwrap()], - ver: zmq_remote_api::VERSION, - lang: zmq_remote_api::LANG.into(), + ver: coppeliasim_zmq_remote_api::VERSION, + lang: coppeliasim_zmq_remote_api::LANG.into(), args_l: 1, }; diff --git a/examples/p_controller.rs b/examples/p_controller.rs index 2ce20c3..f211676 100644 --- a/examples/p_controller.rs +++ b/examples/p_controller.rs @@ -1,6 +1,8 @@ use std::f64::consts::PI; -use zmq_remote_api::{sim::Sim, RemoteAPIError, RemoteApiClient, RemoteApiClientParams}; +use coppeliasim_zmq_remote_api::{ + sim::Sim, RemoteAPIError, RemoteApiClient, RemoteApiClientParams, +}; /* diff --git a/examples/send_ik_movement_sequence_mov.rs b/examples/send_ik_movement_sequence_mov.rs index a35e3ae..f4facf6 100644 --- a/examples/send_ik_movement_sequence_mov.rs +++ b/examples/send_ik_movement_sequence_mov.rs @@ -1,5 +1,7 @@ -use zmq_remote_api::serde_json::json; -use zmq_remote_api::{sim, sim::Sim, RemoteAPIError, RemoteApiClient, RemoteApiClientParams}; +use coppeliasim_zmq_remote_api::serde_json::json; +use coppeliasim_zmq_remote_api::{ + sim, sim::Sim, RemoteAPIError, RemoteApiClient, RemoteApiClientParams, +}; /* Example based on sendIkMovementSequence-mov.py diff --git a/examples/send_ik_movement_sequence_pts.rs b/examples/send_ik_movement_sequence_pts.rs index 4aeb3e0..bbb5987 100644 --- a/examples/send_ik_movement_sequence_pts.rs +++ b/examples/send_ik_movement_sequence_pts.rs @@ -1,5 +1,7 @@ -use zmq_remote_api::serde_json::json; -use zmq_remote_api::{sim, sim::Sim, RemoteAPIError, RemoteApiClient, RemoteApiClientParams}; +use coppeliasim_zmq_remote_api::serde_json::json; +use coppeliasim_zmq_remote_api::{ + sim, sim::Sim, RemoteAPIError, RemoteApiClient, RemoteApiClientParams, +}; /* Example based on sendIkMovementSequence-pts.py diff --git a/examples/sim_ik_example.rs b/examples/sim_ik_example.rs index 36df03e..855fd1d 100644 --- a/examples/sim_ik_example.rs +++ b/examples/sim_ik_example.rs @@ -1,9 +1,9 @@ -use serde_json::json; -use zmq_remote_api::{ +use coppeliasim_zmq_remote_api::{ sim, sim::{Sim, SimIK}, - RemoteAPIError, RemoteApiClientInterface, RemoteApiClientParams, + RemoteAPIError, RemoteApiClient, RemoteApiClientInterface, RemoteApiClientParams, }; +use serde_json::json; /* # @@ -21,7 +21,7 @@ fn main() -> Result<(), RemoteAPIError> { println!("Program started"); - let client = zmq_remote_api::RemoteApiClient::new(RemoteApiClientParams { + let client = RemoteApiClient::new(RemoteApiClientParams { host: "localhost".to_string(), ..RemoteApiClientParams::default() })?; diff --git a/examples/simple_test.rs b/examples/simple_test.rs index 4809230..f4f2e96 100644 --- a/examples/simple_test.rs +++ b/examples/simple_test.rs @@ -1,4 +1,6 @@ -use zmq_remote_api::{sim, sim::Sim, RemoteAPIError, RemoteApiClientParams}; +use coppeliasim_zmq_remote_api::{ + sim, sim::Sim, RemoteAPIError, RemoteApiClient, RemoteApiClientParams, +}; /* Example based on SimpleTest.py @@ -21,7 +23,7 @@ fn main() -> Result<(), RemoteAPIError> { println!("Program started"); - let mut client = zmq_remote_api::RemoteApiClient::new(RemoteApiClientParams { + let mut client = RemoteApiClient::new(RemoteApiClientParams { host: "localhost".to_string(), ..RemoteApiClientParams::default() })?; diff --git a/examples/synchronous_image_transmission.rs b/examples/synchronous_image_transmission.rs index a36cb7b..1831ea1 100644 --- a/examples/synchronous_image_transmission.rs +++ b/examples/synchronous_image_transmission.rs @@ -1,4 +1,6 @@ -use zmq_remote_api::{sim::Sim, RemoteAPIError, RemoteApiClient, RemoteApiClientParams}; +use coppeliasim_zmq_remote_api::{ + sim::Sim, RemoteAPIError, RemoteApiClient, RemoteApiClientParams, +}; /* Based on synchronousImageTransmission.cpp example * diff --git a/src/lib.rs b/src/lib.rs index f25f983..cfe9a45 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,10 +11,10 @@ //! ## Get started //! //! ``` -//! use zmq_remote_api::{sim, sim::Sim, RemoteAPIError, RemoteApiClientParams}; +//! use coppeliasim_zmq_remote_api::{sim, sim::Sim, RemoteAPIError, RemoteApiClientParams,RemoteApiClient}; //! //! fn main() -> Result<(), RemoteAPIError> { -//! let client = zmq_remote_api::RemoteApiClient::new(RemoteApiClientParams::default())?; +//! let client = RemoteApiClient::new(RemoteApiClientParams::default())?; //! //! Ok(()) //! } diff --git a/src/remote_api_client/client.rs b/src/remote_api_client/client.rs index 3a4fa4a..c42668d 100644 --- a/src/remote_api_client/client.rs +++ b/src/remote_api_client/client.rs @@ -16,7 +16,7 @@ const ZMQ_RECV_FLAG_NONE: i32 = 0; /// BY default port:23000 /// # Example: /// ``` -/// use zmq_remote_api::{RemoteApiClient,RemoteApiClientParams}; +/// use coppeliasim_zmq_remote_api::{RemoteApiClient,RemoteApiClientParams}; /// let client = RemoteApiClient::new(RemoteApiClientParams::default()).unwrap(); /// ``` pub struct RemoteApiClient { @@ -34,7 +34,7 @@ impl RemoteApiClient { port = params.rpc_port ); - log::debug!("connecting on rpc_address: {} ", rpc_address,); + log::debug!("connecting on rpc_address: {rpc_address} "); let context = zmq::Context::new();