result_attribute_pane.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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 OnStress(){
  29. unit.form.mainfrm.OnSend('Stress ' + model.getCurrentDirectory() + 'data');
  30. unit.form.mainfrm.OnChangePicture(5, 2);
  31. //unit.form.mainfrm.OnCueline('<h4 style="font-family:arial;color: green;font-size:20px;">恭喜您已完成压力云图的切换!</h4>');
  32. unit.form.mainfrm.OnCueline('您已完成压力云图的切换!', 'green');
  33. }
  34. function OnMaxMin(){
  35. var id = parent.setTimeout(() => {
  36. unit.form.mainfrm.OnSend('0');
  37. }, 100);
  38. unit.form.mainfrm.OnSend('minmax');
  39. }
  40. function OnPointCloud(){
  41. var id = parent.setTimeout(() => {
  42. unit.form.mainfrm.OnSend('0');
  43. }, 100);
  44. unit.form.mainfrm.OnSend('pointCloud');
  45. }
  46. var tubiao = false;
  47. function OnTuBiao(){
  48. tubiao = !tubiao;
  49. if(tubiao === true){
  50. unit.form.mainfrm.OnPostBar(parseInt(ui.attribute.index) + 1, 1);
  51. }else{
  52. unit.form.mainfrm.OnPostBar(parseInt(ui.attribute.index) + 1, 0);
  53. }
  54. unit.form.mainfrm.OnChangePicture(5, 2);
  55. unit.form.mainfrm.OnCueline('您完成颜色条的开闭!', 'green');
  56. }
  57. function OnReset(){
  58. var id = parent.setTimeout(() => {
  59. unit.form.mainfrm.OnSend('0');
  60. }, 100);
  61. unit.form.mainfrm.OnSend('reset');
  62. }
  63. function OnChangeAttribute(){
  64. unit.form.mainfrm.OnSetChangePost(parseInt(ui.attribute.index) + 1);
  65. unit.form.mainfrm.OnChangePicture(5, 2);
  66. unit.form.mainfrm.OnCueline('您已完成位移云图的切换!', 'green');
  67. }
  68. function OnReturnMenu(){
  69. unit.form.mainfrm.menu(8);
  70. }
  71. function OnLoad(){
  72. unit.form.mainfrm.OnClear();
  73. unit.form.mainfrm.OnRenders(model.getCurrentDirectory(), 1);
  74. unit.form.mainfrm.OnChangePicture(5, 2);
  75. unit.form.mainfrm.OnCueline('ok!', 'green');
  76. }
  77. //The message corresponding callback executed by the docker pane.
  78. // when calling [side_pane].fireEvent(type,para) in the main form.
  79. function OnParentDockerMessage(type, para) {
  80. }
  81. //////////////////////////////////////////////////////////////////////////
  82. // Utils Functions.
  83. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe
  84. function onDragFile(filepath) {
  85. }
  86. function PUI(cb) {
  87. if(pui){cb();}
  88. }
  89. /*Usage of BLOCK_EVENT
  90. BLOCK_EVENT(()=>{
  91. ui.[name].[var] = ...;
  92. });
  93. */
  94. function BLOCK_EVENT(cb) {
  95. ui.block_event = true;
  96. cb();
  97. ui.block_event = false;
  98. }
  99. //////////////////////////////////////////////////////////////////////////
  100. // template codes for cw callback js.
  101. function CW_DeclareVariable(name, setter, getter) {
  102. if(typeof(__DeclareVariable) === 'function') {
  103. __DeclareVariable(name, setter, getter);
  104. }
  105. }
  106. function CW_DeclareOuterVariable(name) {
  107. if(typeof(__DeclareOuterVariable) === 'function') {
  108. __DeclareOuterVariable(name);
  109. }
  110. }