Tabular_Data2_pane.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. ui.list.table = [["Time[s]", "Minimum[MPa]", "Maximum[MPa]", "Average[MPa]"],
  12. ["1.", "7.2343e-008", "0.20545", "1.0209e-002"]];
  13. }
  14. //Callback after UI is fully loaded and displayed.
  15. function OnReady(reload, preview) {
  16. PUI(()=>{
  17. //you can access the 'ui' namespace in the parent form using the variable 'pui' here.
  18. //The 'pui' variable is valid in all functions of this document.
  19. //For robustness, you'd better use 'PUI(cb);' to access 'pui' variable.
  20. });
  21. }
  22. function OnCloseForm() {
  23. }
  24. function OnException(err) {
  25. //ui.MessageBox('Error', '' + err, MessageBox.Icon.Critical, MessageBox.Button.Ok);
  26. }
  27. //////////////////////////////////////////////////////////////////////////
  28. // Callback Functions.
  29. // 641a254c-ef3e-11ea-bc8a-379bb908bdd7
  30. //The message corresponding callback executed by the docker pane.
  31. // when calling [side_pane].fireEvent(type,para) in the main form.
  32. function OnParentDockerMessage(type, para) {
  33. }
  34. //////////////////////////////////////////////////////////////////////////
  35. // Utils Functions.
  36. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe
  37. function onDragFile(filepath) {
  38. }
  39. function PUI(cb) {
  40. if(pui){cb();}
  41. }
  42. /*Usage of BLOCK_EVENT
  43. BLOCK_EVENT(()=>{
  44. ui.[name].[var] = ...;
  45. });
  46. */
  47. function BLOCK_EVENT(cb) {
  48. ui.block_event = true;
  49. cb();
  50. ui.block_event = false;
  51. }
  52. //////////////////////////////////////////////////////////////////////////
  53. // template codes for cw callback js.
  54. function CW_DeclareVariable(name, setter, getter) {
  55. if(typeof(__DeclareVariable) === 'function') {
  56. __DeclareVariable(name, setter, getter);
  57. }
  58. }
  59. function CW_DeclareOuterVariable(name) {
  60. if(typeof(__DeclareOuterVariable) === 'function') {
  61. __DeclareOuterVariable(name);
  62. }
  63. }