geometry_linepoint_pane.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. 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 OnRet(){
  29. unit.form.mainfrm.menu(0);
  30. }
  31. function OnDetermin(){
  32. unit.form.mainfrm.OnSend('addLinePoints ' + ui.x1.value + ' ' + ui.y1.value + ' ' + ui.z1.value + ' '+ ui.x2.value + ' '+ ui.y2.value + ' '+ ui.z2.value + ' '+ ui.pb_s.value);
  33. //unit.form.mainfrm.OnCueline('第一个参数为空', 'red');
  34. //unit.form.mainfrm.OnChangePicture(1, 2);
  35. }
  36. function OnReturn(){
  37. unit.form.mainfrm.menu(0);
  38. }
  39. function OnDetermine(){
  40. unit.form.mainfrm.OnSend('addLinePoints2 ' + + ui.x1_1.value + ' ' + ui.y1_1.value + ' ' + ui.z1_1.value + ' '+ ui.x2_2.value + ' '+ ui.y2_2.value + ' '+ ui.z2_2.value + ' '+ ui.pb_n.value);
  41. //unit.form.mainfrm.OnCueline('第一个参数为空', 'red');
  42. //unit.form.mainfrm.OnChangePicture(1, 2);
  43. }
  44. function OnNode(){
  45. ui.select_stk.index = 1;
  46. }
  47. function OnSegment(){
  48. ui.select_stk.index = 0;
  49. }
  50. //The message corresponding callback executed by the docker pane.
  51. // when calling [side_pane].fireEvent(type,para) in the main form.
  52. function OnParentDockerMessage(type, para) {
  53. }
  54. //////////////////////////////////////////////////////////////////////////
  55. // Utils Functions.
  56. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe
  57. function onDragFile(filepath) {
  58. }
  59. function PUI(cb) {
  60. if(pui){cb();}
  61. }
  62. /*Usage of BLOCK_EVENT
  63. BLOCK_EVENT(()=>{
  64. ui.[name].[var] = ...;
  65. });
  66. */
  67. function BLOCK_EVENT(cb) {
  68. ui.block_event = true;
  69. cb();
  70. ui.block_event = false;
  71. }
  72. //////////////////////////////////////////////////////////////////////////
  73. // template codes for cw callback js.
  74. function CW_DeclareVariable(name, setter, getter) {
  75. if(typeof(__DeclareVariable) === 'function') {
  76. __DeclareVariable(name, setter, getter);
  77. }
  78. }
  79. function CW_DeclareOuterVariable(name) {
  80. if(typeof(__DeclareOuterVariable) === 'function') {
  81. __DeclareOuterVariable(name);
  82. }
  83. }