geometry_menu_revolve_pane.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 OnRevZ(){
  29. if(ui.pb_z.value <= 0){
  30. unit.form.mainfrm.OnChangePicture(1, 3);
  31. unit.form.mainfrm.OnCueline('您输入的参数不符合常理,请您重新输入!!!', 'red');
  32. }
  33. if(ui.pb_z.value > 0){
  34. unit.form.mainfrm.OnChangePicture(1, 1);
  35. unit.form.mainfrm.OnCueline('您输入了正确的数据!', 'green');
  36. }
  37. }
  38. function OnRevY(){
  39. if(ui.pb_y.value <= 0){
  40. unit.form.mainfrm.OnChangePicture(1, 3);
  41. unit.form.mainfrm.OnCueline('您输入的参数不符合常理,请您重新输入!!!', 'red');
  42. }
  43. if(ui.pb_y.value > 0){
  44. unit.form.mainfrm.OnChangePicture(1, 1);
  45. unit.form.mainfrm.OnCueline('您输入了正确的数据!', 'green');
  46. }
  47. }
  48. function OnRevX(){
  49. if(ui.pb_x.value <= 0){
  50. unit.form.mainfrm.OnChangePicture(1, 3);
  51. unit.form.mainfrm.OnCueline('您输入的参数不符合常理,请您重新输入!!!', 'red');
  52. }
  53. if(ui.pb_x.value > 0){
  54. unit.form.mainfrm.OnChangePicture(1, 1);
  55. unit.form.mainfrm.OnCueline('您输入了正确的数据!', 'green');
  56. }
  57. }
  58. function OnDetermine(){
  59. unit.form.mainfrm.OnSend('roratePosition ' + ui.pb_x.value + ' ' + ui.pb_y.value + ' ' + ui.pb_z.value);
  60. //unit.form.mainfrm.OnCueline('第一个参数为空', 'red');
  61. unit.form.mainfrm.OnChangePicture(1, 2);
  62. }
  63. function OnReturn(){
  64. unit.form.mainfrm.menu(0);
  65. }
  66. //The message corresponding callback executed by the docker pane.
  67. // when calling [side_pane].fireEvent(type,para) in the main form.
  68. function OnParentDockerMessage(type, para) {
  69. }
  70. //////////////////////////////////////////////////////////////////////////
  71. // Utils Functions.
  72. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe
  73. function onDragFile(filepath) {
  74. }
  75. function PUI(cb) {
  76. if(pui){cb();}
  77. }
  78. /*Usage of BLOCK_EVENT
  79. BLOCK_EVENT(()=>{
  80. ui.[name].[var] = ...;
  81. });
  82. */
  83. function BLOCK_EVENT(cb) {
  84. ui.block_event = true;
  85. cb();
  86. ui.block_event = false;
  87. }
  88. //////////////////////////////////////////////////////////////////////////
  89. // template codes for cw callback js.
  90. function CW_DeclareVariable(name, setter, getter) {
  91. if(typeof(__DeclareVariable) === 'function') {
  92. __DeclareVariable(name, setter, getter);
  93. }
  94. }
  95. function CW_DeclareOuterVariable(name) {
  96. if(typeof(__DeclareOuterVariable) === 'function') {
  97. __DeclareOuterVariable(name);
  98. }
  99. }