Commit 808613458d09112ab8f809352e8647f01061ab06
Exists in
master
and in
72 other branches
Merge branch 'develop' into amdadev
Showing
3 changed files
with
52 additions
and
14 deletions
Show diff stats
generic_data/Functions/functions.xml
... | ... | @@ -114,6 +114,11 @@ |
114 | 114 | <info_brief>Remove Spikes: filter(param, factor,nPoints)</info_brief> |
115 | 115 | <new_kernel>#filter</new_kernel> |
116 | 116 | </function> |
117 | + <function name="BCain(,)" args="2" kind="model" group="space"> | |
118 | + <default_args>"",mag</default_args> | |
119 | + <info_brief>Cain model for Mars Magnetic Field</info_brief> | |
120 | + <new_kernel>#bcain</new_kernel> | |
121 | + </function> | |
117 | 122 | <function name="vAlfven(,)" args="2" kind="physics" group="space"> |
118 | 123 | <prompt_param>density[cm^⁻3], b_magnitude[nT]</prompt_param> |
119 | 124 | <info_brief>Alfven velocity Valfven(density[cm^⁻3], b_magnitude[nT])</info_brief> | ... | ... |
js/app/views/CatalogUI.js
... | ... | @@ -409,7 +409,7 @@ Ext.define('amdaUI.CatalogUI', { |
409 | 409 | hidden: true, |
410 | 410 | id: amdaUI.CatalogUI.COL_TO_HIDE_DURATION + '1', |
411 | 411 | renderer: function (value) { |
412 | - return Ext.util.Format.number(value, '0.00'); | |
412 | + return this.dateToString(value); | |
413 | 413 | }, |
414 | 414 | listeners: { |
415 | 415 | beforeshow: function () { |
... | ... | @@ -429,7 +429,7 @@ Ext.define('amdaUI.CatalogUI', { |
429 | 429 | hidden: true, |
430 | 430 | id: amdaUI.CatalogUI.COL_TO_HIDE_DURATION + '2', |
431 | 431 | renderer: function (value) { |
432 | - return Ext.util.Format.number(value, '0.00'); | |
432 | + return this.dateToString(value); | |
433 | 433 | }, |
434 | 434 | listeners: { |
435 | 435 | beforeshow: function () { |
... | ... | @@ -449,7 +449,7 @@ Ext.define('amdaUI.CatalogUI', { |
449 | 449 | hidden: false, |
450 | 450 | id: amdaUI.CatalogUI.COL_TO_HIDE_DURATION + '3', |
451 | 451 | renderer: function (value) { |
452 | - return Ext.util.Format.number(value, '0.00'); | |
452 | + return this.dateToString(value); | |
453 | 453 | }, |
454 | 454 | listeners: { |
455 | 455 | beforeshow: function () { |
... | ... | @@ -469,7 +469,7 @@ Ext.define('amdaUI.CatalogUI', { |
469 | 469 | hidden: true, |
470 | 470 | id: amdaUI.CatalogUI.COL_TO_HIDE_DURATION + '4', |
471 | 471 | renderer: function (value) { |
472 | - return Ext.util.Format.number(value, '0.00'); | |
472 | + return Ext.util.Format.number(value, '0.000'); | |
473 | 473 | }, |
474 | 474 | listeners: { |
475 | 475 | beforeshow: function () { |
... | ... | @@ -939,6 +939,24 @@ Ext.define('amdaUI.CatalogUI', { |
939 | 939 | frame: true, |
940 | 940 | columnLines: true, |
941 | 941 | selModel: {pruneRemoved: false}, |
942 | + | |
943 | + countDecimals: function (value) { | |
944 | + if (Math.floor(value) === value) | |
945 | + return 0; | |
946 | + return value.toString().split(".")[1].length || 0; | |
947 | + }, | |
948 | + | |
949 | + dateToString: function (value) { | |
950 | + ndegits = this.countDecimals(value); | |
951 | + if (ndegits <= 3) { | |
952 | + return Ext.util.Format.number(value, '0.000'); | |
953 | + } else if (value < 0.1) { | |
954 | + return value.toExponential(3); | |
955 | + } else { | |
956 | + return Ext.util.Format.number(value, '0.000000'); | |
957 | + } | |
958 | + }, | |
959 | + | |
942 | 960 | // selType: 'cellmodel', |
943 | 961 | plugins: [cellEditing, {ptype: 'bufferedrenderer'}], |
944 | 962 | listeners: { | ... | ... |
js/app/views/TimeTableUI.js
... | ... | @@ -383,8 +383,8 @@ Ext.define('amdaUI.TimeTableUI', { |
383 | 383 | convertUTCDateToLocalDate: function (date) { |
384 | 384 | if (date == null) { |
385 | 385 | return date; |
386 | - } | |
387 | - ; | |
386 | + }; | |
387 | + | |
388 | 388 | var newDate = new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000); |
389 | 389 | |
390 | 390 | var offset = date.getTimezoneOffset() / 60; |
... | ... | @@ -514,7 +514,6 @@ Ext.define('amdaUI.TimeTableUI', { |
514 | 514 | {type: 'date', dataIndex: 'stop', dateFormat: 'Y-m-d'} |
515 | 515 | ] |
516 | 516 | }; |
517 | - | |
518 | 517 | var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', { |
519 | 518 | onEditComplete: function (ed, value, startValue) { |
520 | 519 | var me = this, |
... | ... | @@ -580,6 +579,23 @@ Ext.define('amdaUI.TimeTableUI', { |
580 | 579 | features: [filters], |
581 | 580 | columnLines: true, |
582 | 581 | selModel: {pruneRemoved: false}, |
582 | + | |
583 | + countDecimals: function (value) { | |
584 | + if (Math.floor(value) === value) | |
585 | + return 0; | |
586 | + return value.toString().split(".")[1].length || 0; | |
587 | + }, | |
588 | + | |
589 | + dateToString: function (value) { | |
590 | + ndegits = this.countDecimals(value); | |
591 | + if (ndegits <= 3) { | |
592 | + return Ext.util.Format.number(value, '0.000'); | |
593 | + } else if (value < 0.1) { | |
594 | + return value.toExponential(3); | |
595 | + } else { | |
596 | + return Ext.util.Format.number(value, '0.000000'); | |
597 | + } | |
598 | + }, | |
583 | 599 | columns: [ |
584 | 600 | { |
585 | 601 | xtype: 'rownumberer', |
... | ... | @@ -624,13 +640,12 @@ Ext.define('amdaUI.TimeTableUI', { |
624 | 640 | } |
625 | 641 | } |
626 | 642 | }, |
627 | - { | |
643 | + { | |
628 | 644 | header: 'Duration (day)', width: 120, dataIndex: 'durationDay', |
629 | 645 | id: amdaUI.TimeTableUI.COL_TO_HIDE + '1', |
630 | 646 | hidden: true, |
631 | 647 | renderer: function (value) { |
632 | - | |
633 | - return Ext.util.Format.number(value, '0.00'); | |
648 | + return this.dateToString(value); | |
634 | 649 | }, |
635 | 650 | listeners: { |
636 | 651 | beforeshow: function () { |
... | ... | @@ -652,7 +667,7 @@ Ext.define('amdaUI.TimeTableUI', { |
652 | 667 | id: amdaUI.TimeTableUI.COL_TO_HIDE + '2', |
653 | 668 | hidden: true, |
654 | 669 | renderer: function (value) { |
655 | - return Ext.util.Format.number(value, '0.00'); | |
670 | + return this.dateToString(value); | |
656 | 671 | }, |
657 | 672 | listeners: { |
658 | 673 | beforeshow: function () { |
... | ... | @@ -673,7 +688,7 @@ Ext.define('amdaUI.TimeTableUI', { |
673 | 688 | header: 'Duration (min)', width: 120, dataIndex: 'durationMin', |
674 | 689 | id: amdaUI.TimeTableUI.COL_TO_HIDE + '3', |
675 | 690 | renderer: function (value) { |
676 | - return Ext.util.Format.number(value, '0.00'); | |
691 | + return this.dateToString(value); | |
677 | 692 | }, |
678 | 693 | listeners: { |
679 | 694 | beforeshow: function () { |
... | ... | @@ -695,7 +710,7 @@ Ext.define('amdaUI.TimeTableUI', { |
695 | 710 | id: amdaUI.TimeTableUI.COL_TO_HIDE + '4', |
696 | 711 | hidden: true, |
697 | 712 | renderer: function (value) { |
698 | - return Ext.util.Format.number(value, '0.00'); | |
713 | + return Ext.util.Format.number(value, '0.000'); | |
699 | 714 | }, |
700 | 715 | listeners: { |
701 | 716 | beforeshow: function () { |
... | ... | @@ -786,7 +801,7 @@ Ext.define('amdaUI.TimeTableUI', { |
786 | 801 | this.fireEvent("refresh"); |
787 | 802 | } |
788 | 803 | } |
789 | - | |
804 | + | |
790 | 805 | } |
791 | 806 | }); |
792 | 807 | ... | ... |