physics_menu_pane.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 OnAnalysisClick(){
  29. //unit.form.form.Show();
  30. unit.form.mainfrm.menu(25);
  31. unit.form.mainfrm.OnAnalysisShow();
  32. }
  33. function OnCreatAnsys(){
  34. unit.form.createAnsys.Show();
  35. unit.form.mainfrm.OnChangePicture(2, 1);
  36. unit.form.mainfrm.OnCueline('模态分析材料设置', 'blue');
  37. }
  38. function OnControl(){
  39. unit.form.mainfrm.menu(3);
  40. unit.form.mainfrm.OnChangePicture(2, 1);
  41. unit.form.mainfrm.OnCueline('结构静力学材料设置', 'blue');
  42. }
  43. function OnApproximate(){
  44. unit.form.mainfrm.menu(4);
  45. unit.form.mainfrm.OnChangePicture(2, 1);
  46. }
  47. function OnMaterial(){
  48. unit.form.physicsCreate2.Show();
  49. unit.form.mainfrm.OnChangePicture(2, 1);
  50. unit.form.mainfrm.OnCueline('模态分析步参数设置', 'blue');
  51. //unit.form.mainfrm.menu(3);
  52. }
  53. //The message corresponding callback executed by the docker pane.
  54. // when calling [side_pane].fireEvent(type,para) in the main form.
  55. function OnParentDockerMessage(type, para) {
  56. }
  57. //////////////////////////////////////////////////////////////////////////
  58. // Utils Functions.
  59. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe
  60. function onDragFile(filepath) {
  61. }
  62. function PUI(cb) {
  63. if(pui){cb();}
  64. }
  65. /*Usage of BLOCK_EVENT
  66. BLOCK_EVENT(()=>{
  67. ui.[name].[var] = ...;
  68. });
  69. */
  70. function BLOCK_EVENT(cb) {
  71. ui.block_event = true;
  72. cb();
  73. ui.block_event = false;
  74. }
  75. //////////////////////////////////////////////////////////////////////////
  76. // template codes for cw callback js.
  77. function CW_DeclareVariable(name, setter, getter) {
  78. if(typeof(__DeclareVariable) === 'function') {
  79. __DeclareVariable(name, setter, getter);
  80. }
  81. }
  82. function CW_DeclareOuterVariable(name) {
  83. if(typeof(__DeclareOuterVariable) === 'function') {
  84. __DeclareOuterVariable(name);
  85. }
  86. }