Home Reference Source

cables_dev/cables_ui/src/ui/components/tabs/tab_debugtimeline.js

  1. import Tab from "../../elements/tabpanel/tab.js";
  2. import { gui } from "../../gui.js";
  3. export default class GlTimelineDebugTab
  4. {
  5. constructor(tabs)
  6. {
  7. this._count = 0;
  8. this._timeout = null;
  9. this._tab = new Tab("timelinedebug", { "icon": "clock", "singleton": true, "infotext": "tab_profiler", "padding": true });
  10. tabs.addTab(this._tab, true);
  11. this.show();
  12. }
  13. show()
  14. {
  15. this._count++;
  16. let html = "<div class=\"tabContentScrollContainer\">";
  17. const tl = gui.glTimeline;
  18. html = "<table>";
  19. const keys = tl.getSelectedKeys();
  20. for (let i = 0; i < keys.length; i++)
  21. {
  22. html += "<tr>";
  23. html += "<td>" + keys[i].time + "</td>";
  24. html += "<td>" + keys[i].value + "</td>";
  25. html += "<td>" + keys[i].rect.absY + "</td>";
  26. html += "</tr>";
  27. }
  28. html += "</table>";
  29. html += "</div>";
  30. this._tab.html(html);
  31. clearTimeout(this._timeout);
  32. this._timeout = setTimeout(this.show.bind(this), 300);
  33. }
  34. }