boundary_stress_Peidian_pane.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ////////////////////////////////////////////////////////////////////////////
  2. // System Pre-define Functions
  3. // 95099372-ef3e-11ea-9c81-bf848405c62e
  4. //Callback of data preparation stage before UI is fully loaded.
  5. function OnInitializeData(reload, preview) {
  6. PUI(()=>{
  7. //you can access the 'ui' namespace in the parent form using the variable 'pui' here.
  8. //The 'pui' variable is valid in all functions of this document.
  9. //For robustness, you'd better use 'PUI(cb);' to access 'pui' variable.
  10. });
  11. }
  12. //Callback after UI is fully loaded and displayed.
  13. function OnReady(reload, preview) {
  14. PUI(()=>{
  15. //you can access the 'ui' namespace in the parent form using the variable 'pui' here.
  16. //The 'pui' variable is valid in all functions of this document.
  17. //For robustness, you'd better use 'PUI(cb);' to access 'pui' variable.
  18. });
  19. }
  20. function OnCloseForm() {
  21. }
  22. function OnException(err) {
  23. //ui.MessageBox('Error', '' + err, MessageBox.Icon.Critical, MessageBox.Button.Ok);
  24. }
  25. //////////////////////////////////////////////////////////////////////////
  26. // Callback Functions.
  27. // 641a254c-ef3e-11ea-bc8a-379bb908bdd7
  28. function OnYes(){
  29. unit.form.mainfrm.OnSend('arrow 1 ' + ui.pb_size.value + " " + ui.pb_x.value + " " + ui.pb_y.value + " " + ui.pb_z.value + " false");
  30. }
  31. function OnCloseArrow(){
  32. ui.stack_pickup.index = 0;
  33. var id = parent.setTimeout(() => {
  34. unit.form.mainfrm.OnSend('0');
  35. }, 100);
  36. unit.form.mainfrm.OnSend('arrowClose');
  37. }
  38. function OnOpenArrow(){
  39. ui.stack_pickup.index = 1;
  40. var id = parent.setTimeout(() => {
  41. unit.form.mainfrm.OnSend('0');
  42. }, 100);
  43. unit.form.mainfrm.OnSend('arrowOpen');
  44. }
  45. //The message corresponding callback executed by the docker pane.
  46. // when calling [side_pane].fireEvent(type,para) in the main form.
  47. function OnParentDockerMessage(type, para) {
  48. }
  49. //////////////////////////////////////////////////////////////////////////
  50. // Utils Functions.
  51. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe
  52. function onDragFile(filepath) {
  53. }
  54. function PUI(cb) {
  55. if(pui){cb();}
  56. }
  57. /*Usage of BLOCK_EVENT
  58. BLOCK_EVENT(()=>{
  59. ui.[name].[var] = ...;
  60. });
  61. */
  62. function BLOCK_EVENT(cb) {
  63. ui.block_event = true;
  64. cb();
  65. ui.block_event = false;
  66. }
  67. //////////////////////////////////////////////////////////////////////////
  68. // template codes for cw callback js.
  69. function CW_DeclareVariable(name, setter, getter) {
  70. if(typeof(__DeclareVariable) === 'function') {
  71. __DeclareVariable(name, setter, getter);
  72. }
  73. }
  74. function CW_DeclareOuterVariable(name) {
  75. if(typeof(__DeclareOuterVariable) === 'function') {
  76. __DeclareOuterVariable(name);
  77. }
  78. }