Tabular_Data1_pane.js 2.5 KB

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