appui.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. function createApp() {
  2. let self = this
  3. function createCameraButton(camNum) {
  4. let label = "Camera " + camNum;
  5. let camID = "/multicam/camera"+ camNum + "/cam";
  6. let camOffsetID = "/multicam/camera"+ camNum + "/cam/viewoffset";
  7. return {
  8. $cell: true,
  9. $type: "button",
  10. class: "mdc-button mdc-button--raised",
  11. $text: label,
  12. onclick: function (e) {
  13. let nodeID = vwf.find("",camID)[0];
  14. let offsetCompID = vwf.find("",camOffsetID)[0];
  15. let avatarID = vwf.moniker_;
  16. vwf_view.kernel.callMethod(offsetCompID, "setParams", []);
  17. vwf_view.kernel.callMethod(nodeID, "setCameraToActive", [avatarID]);
  18. }
  19. }
  20. }
  21. return {
  22. $cell: true,
  23. $type: "div",
  24. class: "propGrid max-width mdc-layout-grid mdc-layout-grid--align-left",
  25. $components: [
  26. {
  27. $cell: true,
  28. $type: "div",
  29. class: "mdc-layout-grid__inner",
  30. $components: [
  31. {
  32. $cell: true,
  33. $type: "div",
  34. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  35. $components: [
  36. createCameraButton("1"),
  37. createCameraButton("2")
  38. ]
  39. }
  40. ]
  41. }
  42. ]
  43. }
  44. }