Commit b852834a1f916961610d693199b692c47a704d87
1 parent
c3cfed52
Exists in
master
and in
65 other branches
progress
Showing
12 changed files
with
36 additions
and
22 deletions
Show diff stats
js/app/controllers/PlotModule.js
... | ... | @@ -311,6 +311,7 @@ Ext.define('amdaDesktop.PlotModule', { |
311 | 311 | downloadValues.durationHour = plotValues.durationHour; |
312 | 312 | downloadValues.durationMin = plotValues.durationMin; |
313 | 313 | downloadValues.durationSec = plotValues.durationSec; |
314 | + downloadValues.durationMs = plotValues.durationMs; | |
314 | 315 | if (plotValues.timeTables) |
315 | 316 | downloadValues.timeTables = plotValues.timeTables; |
316 | 317 | downloadValues.list = []; |
... | ... |
js/app/models/AmdaTimeObject.js
... | ... | @@ -40,9 +40,7 @@ Ext.define('amdaModel.AmdaTimeObject', { |
40 | 40 | { name: 'startDate', type: 'date', defaultValue:Ext.Date.add(Ext.Date.clearTime(new Date()),Ext.Date.DAY,-1), |
41 | 41 | convert: function(value,rec) { |
42 | 42 | if (!Ext.isDate(value)) { |
43 | - var valueString = new String(value); | |
44 | - var date = new Date(valueString.replace(/\-/g,'\/').replace(/[T|Z]/g,' ')); | |
45 | - return date; | |
43 | + return new Date(value); | |
46 | 44 | } |
47 | 45 | return value; |
48 | 46 | } |
... | ... | @@ -51,9 +49,7 @@ Ext.define('amdaModel.AmdaTimeObject', { |
51 | 49 | name: 'stopDate', type: 'date', defaultValue: Ext.Date.clearTime (new Date()), persist: false, |
52 | 50 | convert: function(value,rec) { |
53 | 51 | if (!Ext.isDate(value)){ |
54 | - var valueString = new String(value); | |
55 | - var date = new Date(valueString.replace(/\-/g,'\/').replace(/[T|Z]/g,' ')); | |
56 | - return date; | |
52 | + return new Date(value); | |
57 | 53 | } |
58 | 54 | return value; |
59 | 55 | } |
... | ... | @@ -90,7 +86,15 @@ Ext.define('amdaModel.AmdaTimeObject', { |
90 | 86 | |
91 | 87 | return Ext.String.leftPad(Math.floor(diffS), 2, '0'); |
92 | 88 | } |
93 | - }, | |
89 | + }, | |
90 | + { | |
91 | + name: 'durationMs', type: 'int', | |
92 | + convert: function(value, rec) { | |
93 | + var diffS = (rec.get('stopDate') - rec.get('startDate'))%1000; | |
94 | + | |
95 | + return Ext.String.leftPad(Math.floor(diffS), 3, '0'); | |
96 | + } | |
97 | + }, | |
94 | 98 | { name: 'timeTables', defaultValue: null } // array of TTobject |
95 | 99 | ] |
96 | 100 | }); |
... | ... |
js/app/models/Download.js
... | ... | @@ -169,6 +169,7 @@ Ext.define('amdaModel.Download', { |
169 | 169 | myValues.durationHour = this.get('durationHour'); |
170 | 170 | myValues.durationMin = this.get('durationMin'); |
171 | 171 | myValues.durationSec = this.get('durationSec'); |
172 | + myValues.durationMs = this.get('durationMs'); | |
172 | 173 | } |
173 | 174 | |
174 | 175 | // if there's at least one parameter |
... | ... |
js/app/models/DownloadNode.js
... | ... | @@ -79,6 +79,7 @@ Ext.define('amdaModel.DownloadNode', { |
79 | 79 | myValues.durationHour = obj.get('durationHour'); |
80 | 80 | myValues.durationMin = obj.get('durationMin'); |
81 | 81 | myValues.durationSec = obj.get('durationSec'); |
82 | + myValues.durationMs = obj.get('durationMs'); | |
82 | 83 | } |
83 | 84 | |
84 | 85 | myValues.name = obj.get('name'); |
... | ... |
js/app/models/InteractiveNode.js
... | ... | @@ -476,14 +476,14 @@ Ext.define('amdaModel.InteractiveNode', { |
476 | 476 | |
477 | 477 | var startDate = new Date(startString.replace(/\-/g,'\/').replace(/[T|Z]/g,' ')); |
478 | 478 | var stopDate = new Date(stopString.replace(/\-/g,'\/').replace(/[T|Z]/g,' ')); |
479 | - | |
479 | + | |
480 | 480 | if (stopDate - startDate > 86400000 ) { |
481 | 481 | var startTime = Ext.Date.add(stopDate, Ext.Date.DAY, -1); |
482 | 482 | // var timeObj = {start: Ext.Date.format(startTime, 'Y/m/d H:i:s'), stop: Ext.Date.format(stopDate, 'Y/m/d H:i:s')}; |
483 | - var timeObj = {start: Ext.Date.format(startTime, 'Y/m/d'), stop: Ext.Date.format(stopDate, 'Y/m/d')}; | |
483 | + var timeObj = {start: Ext.Date.format(startTime, 'Y/m/d H:i:s.u'), stop: Ext.Date.format(stopDate, 'Y/m/d H:i:s.u')}; | |
484 | 484 | } |
485 | 485 | else { |
486 | - var timeObj = {start: node.get('globalStart'), stop: node.get('globalStop')}; | |
486 | + var timeObj = {start: Ext.Date.format(startTime, 'Y/m/d H:i:s.u'), stop: Ext.Date.format(stopDate, 'Y/m/d H:i:s.u')}; | |
487 | 487 | } |
488 | 488 | return timeObj; |
489 | 489 | }, |
... | ... |
js/app/models/PlotObjects/MultiplotRequestObject.js
... | ... | @@ -132,6 +132,7 @@ Ext.define('amdaPlotObj.MultiplotRequestObject', { |
132 | 132 | requestValues['durationHour'] = this.get('durationHour'); |
133 | 133 | requestValues['durationMin'] = this.get('durationMin'); |
134 | 134 | requestValues['durationSec'] = this.get('durationSec'); |
135 | + requestValues['durationMs'] = this.get('durationMs'); | |
135 | 136 | } |
136 | 137 | |
137 | 138 | requestValues['plots'] = []; |
... | ... |
js/app/models/PlotObjects/PlotRequestObject.js
... | ... | @@ -288,12 +288,13 @@ Ext.define('amdaPlotObj.PlotRequestObject', { |
288 | 288 | } |
289 | 289 | }); |
290 | 290 | } else { |
291 | - requestValues['startDate'] = this.get('startDate'); | |
291 | + requestValues['startDate'] = this.get('startDate'); | |
292 | 292 | requestValues['stopDate'] = this.get('stopDate'); |
293 | 293 | requestValues['durationDay'] = this.get('durationDay'); |
294 | 294 | requestValues['durationHour'] = this.get('durationHour'); |
295 | 295 | requestValues['durationMin'] = this.get('durationMin'); |
296 | 296 | requestValues['durationSec'] = this.get('durationSec'); |
297 | + requestValues['durationMs'] = this.get('durationMs'); | |
297 | 298 | } |
298 | 299 | |
299 | 300 | requestValues['page-layout-type'] = this.get('page-layout-type'); |
... | ... |
js/app/models/Search.js
... | ... | @@ -71,6 +71,7 @@ Ext.define('amdaModel.Search', { |
71 | 71 | myValues.durationHour = this.get('durationHour'); |
72 | 72 | myValues.durationMin = this.get('durationMin'); |
73 | 73 | myValues.durationSec = this.get('durationSec'); |
74 | + myValues.durationMs = this.get('durationMs'); | |
74 | 75 | } |
75 | 76 | |
76 | 77 | myValues.leaf = true; |
... | ... |
js/app/models/Statistic.js
... | ... | @@ -110,6 +110,7 @@ Ext.define('amdaModel.Statistic', { |
110 | 110 | values.durationHour = this.get('durationHour'); |
111 | 111 | values.durationMin = this.get('durationMin'); |
112 | 112 | values.durationSec = this.get('durationSec'); |
113 | + values.durationMs = this.get('durationMs'); | |
113 | 114 | } |
114 | 115 | |
115 | 116 | values.leaf = true; |
... | ... |
js/app/views/IntervalUI.js
... | ... | @@ -140,6 +140,7 @@ Ext.define('amdaUI.IntervalUI', { |
140 | 140 | form.findField('durationHour').setValue(Math.floor(diff/3600000 % 24)); |
141 | 141 | form.findField('durationMin').setValue(Math.floor(diff/60000 % 60)); |
142 | 142 | form.findField('durationSec').setValue(Math.floor(diff/1000 % 60)); |
143 | + form.findField('durationMs').setValue(Math.floor(diff%1000 )); | |
143 | 144 | |
144 | 145 | if (durationDays > this.durationLimit) { |
145 | 146 | form.findField('durationDay').markInvalid('Maximum interval is ' + this.durationLimit + ' days!'); |
... | ... | @@ -149,6 +150,7 @@ Ext.define('amdaUI.IntervalUI', { |
149 | 150 | form.findField('durationHour').setValue(''); |
150 | 151 | form.findField('durationMin').setValue(''); |
151 | 152 | form.findField('durationSec').setValue(''); |
153 | + form.findField('durationMs').setValue(''); | |
152 | 154 | } |
153 | 155 | }, |
154 | 156 | |
... | ... | @@ -158,7 +160,8 @@ Ext.define('amdaUI.IntervalUI', { |
158 | 160 | form.findField('durationDay').isValid() && |
159 | 161 | form.findField('durationHour').isValid() && |
160 | 162 | form.findField('durationMin').isValid() && |
161 | - form.findField('durationSec').isValid() | |
163 | + form.findField('durationSec').isValid() && | |
164 | + form.findField('durationMs').isValid() | |
162 | 165 | ); |
163 | 166 | }, |
164 | 167 | |
... | ... | @@ -185,7 +188,8 @@ Ext.define('amdaUI.IntervalUI', { |
185 | 188 | var h = form.findField('durationHour').getValue(); |
186 | 189 | var m = form.findField('durationMin').getValue(); |
187 | 190 | var s = form.findField('durationSec').getValue(); |
188 | - var duration = (d?d:0)*86400 + (h?h:0)*3600 + (m?m:0)*60 + (s?s:0) | |
191 | + var ms = form.findField('durationMs').getValue(); | |
192 | + var duration = (d?d:0)*86400 + (h?h:0)*3600 + (m?m:0)*60 + (s?s:0) + (ms?ms:0)/1000; | |
189 | 193 | var stop = Ext.Date.add(start, Ext.Date.SECOND, duration); |
190 | 194 | |
191 | 195 | if (Ext.Date.isDST(stop) && !Ext.Date.isDST(start)) |
... | ... | @@ -229,9 +233,9 @@ Ext.define('amdaUI.IntervalUI', { |
229 | 233 | // width : 220, |
230 | 234 | emptyText: 'YYYY/MM/DD hh:mm:ss', |
231 | 235 | tip: 'Date formatted as YYYY/MM/DD hh:mm:ss', |
232 | - format: 'Y/m/d H:i:s', | |
236 | + format: 'Y/m/d H:i:s.u', | |
233 | 237 | enforceMaxLength: true, |
234 | - maxLength: 19, | |
238 | + maxLength: 25, | |
235 | 239 | fieldLabel: fieldText, |
236 | 240 | labelAlign: 'left', |
237 | 241 | labelWidth: 60, |
... | ... | @@ -296,7 +300,8 @@ Ext.define('amdaUI.IntervalUI', { |
296 | 300 | { name: 'durationDay', emptyText: 'Days', tip: 'Days', maxValue: 73000, maxLength: 5, fieldLabel: 'Duration', labelWidth: 60, width: 110}, |
297 | 301 | { name: 'durationHour', emptyText: 'Hrs', tip: 'Hours', maxValue: 23}, |
298 | 302 | { name: 'durationMin', emptyText: 'Mins', tip: 'Minutes', maxValue: 59}, |
299 | - { name: 'durationSec', emptyText: 'Secs', tip: 'Seconds', maxValue: 59} | |
303 | + { name: 'durationSec', emptyText: 'Secs', tip: 'Seconds', maxValue: 59}, | |
304 | + { name: 'durationMs', emptyText: 'MS', tip: 'Milliseconds', maxLength: 3, maxValue: 999} | |
300 | 305 | ] |
301 | 306 | }; |
302 | 307 | }, |
... | ... |
js/app/views/PlotUI.js
... | ... | @@ -140,12 +140,9 @@ Ext.define('amdaUI.PlotUI', { |
140 | 140 | setTimeFromData : function(obj) { |
141 | 141 | if (!obj.start || !obj.stop) |
142 | 142 | return; |
143 | - var dateStart = new Date(obj.start.replace(/[T|Z]/g,' ').replace(/\-/g,'\/')); | |
144 | - var dateStop = new Date(obj.stop.replace(/[T|Z]/g,' ').replace(/\-/g,'\/')); | |
145 | - | |
146 | 143 | var plotTab = this.plotTabs.getCurrentPlotTabContent(); |
147 | 144 | if (plotTab) |
148 | - plotTab.setTime(dateStart, dateStop); | |
145 | + plotTab.setTime(obj.start, obj.stop); | |
149 | 146 | }, |
150 | 147 | |
151 | 148 | savePlotRequest : function() { |
... | ... |
php/classes/RequestMgr.php
... | ... | @@ -94,9 +94,10 @@ class RequestMgr extends AmdaObjectMgr |
94 | 94 | $time = strtotime($obj->startDate); |
95 | 95 | |
96 | 96 | $interval = $obj->durationDay*86400 + |
97 | - $obj->durationHour*3600 + | |
98 | - $obj->durationMin*60 + $obj->durationSec; | |
97 | + $obj->durationHour*3600 + | |
98 | + $obj->durationMin*60 + $obj->durationSec; | |
99 | 99 | $stopTime = gmdate("Y-m-d\TH:i:s", $time+$interval); |
100 | + $stopTime = $stopTime.'.'.$obj->durationMs; | |
100 | 101 | $obj->stopDate = $stopTime; |
101 | 102 | |
102 | 103 | return $obj; |
... | ... |