diff --git a/include/maliput/drake/systems/framework/system_html.h b/include/maliput/drake/systems/framework/system_html.h deleted file mode 100644 index 4c7148e..0000000 --- a/include/maliput/drake/systems/framework/system_html.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include - -#include "maliput/drake/systems/framework/system.h" - -namespace maliput::drake { -namespace systems { - -/** Generates an html string to "render" the @p system, with collapsible -diagrams. Use @p initial_depth to set the depth to which the subdiagrams are -expanded by default (0 for all collapsed, +∞ for all expanded). - -@warning The implementation of GenerateHtml has been temporarily removed from -Drake due to licensing restrictions. This function will return valid HTML, -but will not produce any useful rendering. - -@ingroup systems -*/ -std::string GenerateHtml(const System& system, int initial_depth = 1); - -} // namespace systems -} // namespace maliput::drake diff --git a/src/systems/framework/CMakeLists.txt b/src/systems/framework/CMakeLists.txt index a0f4f8c..dfa76b1 100644 --- a/src/systems/framework/CMakeLists.txt +++ b/src/systems/framework/CMakeLists.txt @@ -29,7 +29,6 @@ add_library(framework system_base.cc system.cc system_constraint.cc - system_html.cc system_output.cc system_scalar_converter.cc system_symbolic_inspector.cc diff --git a/src/systems/framework/system_html.cc b/src/systems/framework/system_html.cc deleted file mode 100644 index 4a86353..0000000 --- a/src/systems/framework/system_html.cc +++ /dev/null @@ -1,270 +0,0 @@ -#include "maliput/drake/systems/framework/system_html.h" - -#include "maliput/drake/systems/framework/system.h" -#include "maliput/drake/systems/framework/system_visitor.h" - -namespace maliput::drake { -namespace systems { - -namespace { - -// Writes the descriptions of each system as nodes in the block diagram graph. -class NodeWriter : public SystemVisitor { - public: - NodeWriter(const std::string parent, std::stringstream* html, int depth) - : parent_(parent), html_(html), depth_(depth) {} - - void VisitSystem(const System& system) final { - *html_ << "{ "; - *html_ << "key: \"" << system.get_name() << "\", "; - *html_ << "group: \"" << parent_ << "\", "; - *html_ << "input_ports: [ "; - for (int i = 0; i < system.num_input_ports(); ++i) { - *html_ << "{ name: \"" << system.get_input_port(i).get_name() - << "\", id: \"u" << i << "\" }, "; - } - *html_ << "],\n"; - *html_ << "output_ports: [ "; - for (int i = 0; i < system.num_output_ports(); ++i) { - *html_ << "{ name: \"" << system.get_output_port(i).get_name() - << "\", id: \"y" << i << "\" }, "; - } - *html_ << "],\n"; - *html_ << "},\n"; - } - - private: - const std::string parent_; - std::stringstream* html_; - const int depth_; -}; - -// Extra visitor class to handle connections *from* either diagram input ports -// or the output of a subsystem. -class FromPortTokenWriter : public SystemVisitor { - public: - FromPortTokenWriter(int port_index, std::stringstream* html) - : port_index_(port_index), html_(html) {} - - void VisitSystem(const System& system) final { - *html_ << "from: \"" << system.get_name() << "\", "; - *html_ << "fromPort: \"y" << port_index_ << "\", "; - } - - // void VisitDiagram(const Diagram& diagram) final { - // *html_ << "from: \"" << diagram.get_name() << "_y" << port_index_ << "\", "; - // } - - private: - const int port_index_; - std::stringstream* html_; -}; - -// Extra visitor class to handle connections *to* either diagram output ports or -// the input of a subsystem. -class ToPortTokenWriter : public SystemVisitor { - public: - ToPortTokenWriter(int port_index, std::stringstream* html) - : port_index_(port_index), html_(html) {} - - void VisitSystem(const System& system) final { - *html_ << "to: \"" << system.get_name() << "\", "; - *html_ << "toPort: \"u" << port_index_ << "\", "; - } - - // void VisitDiagram(const Diagram& diagram) final { - // *html_ << "to: \"" << diagram.get_name() << "_u" << port_index_ << "\", "; - // } - - private: - const int port_index_; - std::stringstream* html_; -}; - -// Writes the connections between systems as edges in the block diagram graph. -class LinkWriter : public SystemVisitor { - public: - explicit LinkWriter(std::stringstream* html) : html_(html) {} - - void VisitSystem(const System& system) final { - // No links to write. - unused(system); - } - - private: - std::stringstream* html_; -}; - -} // namespace - -std::string GenerateHtml(const System& system, int initial_depth) { - std::stringstream html; - html << R"""( -
-The implementation of GenerateHtml has been temporarily removed from Drake due -to licensing restrictions. -
- -)"""; - return html.str(); -} - -} // namespace systems -} // namespace maliput::drake