solve_menu_pane.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 OnSolveClick(){
  29. unit.form.mainfrm.menu(26);
  30. unit.form.mainfrm.OnSolveShow();
  31. }
  32. function OnSolve(){
  33. unit.form.mainfrm.menu(7);
  34. unit.form.mainfrm.OnChangePicture(4, 1);
  35. //unit.form.mainfrm.OnCueline('<h4 style="font-family:arial;color: Blue;font-size:20px;">请先保存文件后选择进程数并进行求解,模态分析模块点击模态分析进行求解!</h4>');
  36. //unit.form.mainfrm.OnCueline('请先保存文件后选择进程数并进行求解,模态分析模块点击模态分析进行求解!', 'blue');
  37. model.getParallels(cb => {
  38. unit.form.mainfrm.OnCueline(cb, 'blue');
  39. var cores = cb.match(/(\d+)/)[0];
  40. //console.log(cores);
  41. unit.form.mainfrm.setExecs(cores);
  42. });
  43. }
  44. //The message corresponding callback executed by the docker pane.
  45. // when calling [side_pane].fireEvent(type,para) in the main form.
  46. function OnParentDockerMessage(type, para) {
  47. }
  48. //////////////////////////////////////////////////////////////////////////
  49. // Utils Functions.
  50. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe
  51. function onDragFile(filepath) {
  52. }
  53. function PUI(cb) {
  54. if(pui){cb();}
  55. }
  56. /*Usage of BLOCK_EVENT
  57. BLOCK_EVENT(()=>{
  58. ui.[name].[var] = ...;
  59. });
  60. */
  61. function BLOCK_EVENT(cb) {
  62. ui.block_event = true;
  63. cb();
  64. ui.block_event = false;
  65. }
  66. //////////////////////////////////////////////////////////////////////////
  67. // template codes for cw callback js.
  68. function CW_DeclareVariable(name, setter, getter) {
  69. if(typeof(__DeclareVariable) === 'function') {
  70. __DeclareVariable(name, setter, getter);
  71. }
  72. }
  73. function CW_DeclareOuterVariable(name) {
  74. if(typeof(__DeclareOuterVariable) === 'function') {
  75. __DeclareOuterVariable(name);
  76. }
  77. }