result_cutter_pane.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 OnReturnMenu(){
  29. unit.form.mainfrm.menu(8);
  30. }
  31. function OnCutter(){
  32. var id = parent.setTimeout(() => {
  33. unit.form.mainfrm.OnSend('0');
  34. }, 100);
  35. unit.form.mainfrm.OnSend('cutter');
  36. unit.form.mainfrm.OnChangePicture(5, 2);
  37. //unit.form.mainfrm.OnCueline('<h4 style="font-family:arial;color: green;font-size:20px;">模型剖切已打开!</h4>');
  38. unit.form.mainfrm.OnCueline('模型剖切已打开!', 'green');
  39. }
  40. //The message corresponding callback executed by the docker pane.
  41. // when calling [side_pane].fireEvent(type,para) in the main form.
  42. function OnParentDockerMessage(type, para) {
  43. }
  44. //////////////////////////////////////////////////////////////////////////
  45. // Utils Functions.
  46. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe
  47. function onDragFile(filepath) {
  48. }
  49. function PUI(cb) {
  50. if(pui){cb();}
  51. }
  52. /*Usage of BLOCK_EVENT
  53. BLOCK_EVENT(()=>{
  54. ui.[name].[var] = ...;
  55. });
  56. */
  57. function BLOCK_EVENT(cb) {
  58. ui.block_event = true;
  59. cb();
  60. ui.block_event = false;
  61. }
  62. //////////////////////////////////////////////////////////////////////////
  63. // template codes for cw callback js.
  64. function CW_DeclareVariable(name, setter, getter) {
  65. if(typeof(__DeclareVariable) === 'function') {
  66. __DeclareVariable(name, setter, getter);
  67. }
  68. }
  69. function CW_DeclareOuterVariable(name) {
  70. if(typeof(__DeclareOuterVariable) === 'function') {
  71. __DeclareOuterVariable(name);
  72. }
  73. }