diff --git a/include/utils/Pair.hpp b/include/utils/Pair.hpp deleted file mode 100644 index 284a988..0000000 --- a/include/utils/Pair.hpp +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef __PAIR_HPP__ -#define __PAIR_HPP__ - -#define ZMQ_BUILD_DRAFT_API 1 -#include - -#include - -namespace rtt::net::utils { -template -struct PairReceiver { - zmqpp::context context; - zmqpp::socket socket; - - PairReceiver() : socket{context, zmqpp::socket_type::pair} { - socket.connect("tcp://127.0.0.1:" + std::to_string(port)); - // The AI should read every tick, this is the only socket that will still have a - // background thread running for reading. - } - - template - stx::Result read_next(bool dont_block = true) { - zmqpp::message msg; - std::string data{}; - if (!socket.receive(msg, dont_block)) { - return stx::Err(std::move(data)); - } - msg >> data; - T object; - auto succ = object.ParseFromString(data); - if (succ) { - return stx::Ok(std::move(object)); - } - return stx::Err(std::move(data)); - } - - template - void write(T const& s, const bool dont_block = false) { - std::string out; - s.SerializeToString(&out); - socket.send(out, dont_block); - } - - bool is_ok() { return static_cast(socket); } -}; -} // namespace rtt::net::utils - -#endif \ No newline at end of file diff --git a/proto/CMakeLists.txt b/proto/CMakeLists.txt index cab0748..632ce09 100644 --- a/proto/CMakeLists.txt +++ b/proto/CMakeLists.txt @@ -18,8 +18,6 @@ protobuf_generate_cpp(NET_PROTO_SRCS NET_PROTO_HDRS "WorldRobot.proto" "Setting.proto" "RobotParameters.proto" - "Handshake.proto" - "UiOptions.proto" "AICommand.proto" ) diff --git a/proto/State.proto b/proto/State.proto index f199852..ff07626 100644 --- a/proto/State.proto +++ b/proto/State.proto @@ -6,8 +6,6 @@ import "RobotParameters.proto"; import "messages_robocup_ssl_wrapper.proto"; import "messages_robocup_ssl_referee.proto"; import "messages_robocup_ssl_geometry.proto"; -import "Handshake.proto"; -import "UiOptions.proto"; package proto; @@ -21,17 +19,4 @@ message State { SSL_Referee referee = 7; //TODO: later change to a custom referee type repeated SSL_WrapperPacket processed_vision_packets = 10; repeated SSL_Referee processed_referee_packets = 11; -} - -message SystemState{ - State state = 1; - UiSettings ui_settings = 2; -} - -message HandshakeState { - State state = 1; -} -message ModuleState { - SystemState system_state = 1; - repeated Handshake handshakes = 2; } \ No newline at end of file diff --git a/proto/UiOptions.proto b/proto/UiOptions.proto deleted file mode 100644 index a062d35..0000000 --- a/proto/UiOptions.proto +++ /dev/null @@ -1,56 +0,0 @@ -syntax = "proto3"; - -package proto; - -message Slider { - string text = 1; - float min = 2; - float max = 3; - float interval = 4; - float default = 5; -} - -message Checkbox { - string text = 1; - bool default = 2; -} - -message Dropdown { - string text = 1; - int64 default = 2; - repeated string options = 3; -} - -message RadioButton { - int64 default = 1; - repeated string options = 2; -} - -message TextField { - string text = 1; -} - -message UiOption { - string name = 1; - oneof ui_elements { - Slider slider = 2; - Checkbox checkbox = 3; - Dropdown dropdown = 4; - RadioButton radiobutton = 5; - TextField textfield = 6; - } -} - -message PossibleUiValue { - oneof ui_value { - float float_value = 1; - bool bool_value = 2; - int64 integer_value = 3; - string text_value = 4; - } -} - -message UiSettings { - // maps UiOption::name to the value it currently contains. - map ui_values = 1; -} \ No newline at end of file