From f8dfaec8be3a595d973e3712d44fe3b01501afc7 Mon Sep 17 00:00:00 2001
From: Hacene SI HADJ MOHAND <hacene.si-hadj-mohand@akka.eu>
Date: Tue, 30 Jul 2019 06:06:51 +0200
Subject: [PATCH] rm_6954 in progress

---
 js/app/models/PlotObjects/PlotAxisObject.js     | 32 ++++++++++++++++++--------------
 js/app/views/PlotComponents/PlotBaseAxisForm.js |  5 ++++-
 js/app/views/PlotComponents/PlotStandardForm.js | 15 ++++++++++++++-
 3 files changed, 36 insertions(+), 16 deletions(-)

diff --git a/js/app/models/PlotObjects/PlotAxisObject.js b/js/app/models/PlotObjects/PlotAxisObject.js
index b5572f4..d5e8b26 100644
--- a/js/app/models/PlotObjects/PlotAxisObject.js
+++ b/js/app/models/PlotObjects/PlotAxisObject.js
@@ -26,13 +26,15 @@ Ext.define('amdaPlotObj.PlotAxisObject', {
 	          //axis-type can be : time, y-left, y-right, x, color, epoch
 	          {name: 'axis-type', type: 'string'},
 	          {name: 'axis-reverse', type: 'boolean'},
-              {name: 'axis-scale', type: 'string'},
+                              {name: 'axis-scale', type: 'string'},
 	          {name: 'axis-range-min', type: 'float'},
 	          {name: 'axis-range-max', type: 'float'},
 	          {name: 'axis-range-extend', type: 'boolean'},
 	          {name: 'axis-color', type: 'string'},
 	          {name: 'axis-thickness', type: 'int'},
 	          {name: 'axis-tick-showmarks', type: 'boolean'},
+                              {name: 'axis-grid-spicify-ticks-number', type: 'boolean'},
+                              {name: 'axis-grid-spicify-ticks-spacing', type: 'boolean'},
 	          {name: 'axis-tick-position', type: 'string'},
 	          {name: 'axis-grid-minor', type: 'boolean'},
 	          {name: 'axis-grid-major', type: 'boolean'},
@@ -43,19 +45,19 @@ Ext.define('amdaPlotObj.PlotAxisObject', {
 	          {name: 'axis-legend-activated', type: 'boolean'},
 	          {name: 'axis-legend-text', type: 'string'},
 	          {name: 'axis-legend-color', type: 'string'},
-              {name: 'axis-legend-font-activated', type: 'boolean'},
-              {name: 'axis-legend-font-name', type: 'string'},
-              {name: 'axis-legend-font-size', type: 'int'},
-              {name: 'axis-legend-font-bold', type: 'boolean'},
-              {name: 'axis-legend-font-italic', type: 'boolean'},
-              //only used for time axis
-              {name: 'axis-time-format', type: 'string'},
-              //only used for epoch axis
-              {name: 'axis-epoch-normalized', type: 'boolean'},
-              //only used for color axis
-              {name: 'axis-color-map', type: 'string'},
-              {name: 'axis-color-minval', type: 'string'},
-              {name: 'axis-color-maxval', type: 'string'}
+                              {name: 'axis-legend-font-activated', type: 'boolean'},
+                              {name: 'axis-legend-font-name', type: 'string'},
+                              {name: 'axis-legend-font-size', type: 'int'},
+                              {name: 'axis-legend-font-bold', type: 'boolean'},
+                              {name: 'axis-legend-font-italic', type: 'boolean'},
+                              //only used for time axis
+                              {name: 'axis-time-format', type: 'string'},
+                              //only used for epoch axis
+                              {name: 'axis-epoch-normalized', type: 'boolean'},
+                              //only used for color axis
+                              {name: 'axis-color-map', type: 'string'},
+                              {name: 'axis-color-minval', type: 'string'},
+                              {name: 'axis-color-maxval', type: 'string'}
     ],
     
     associations : [
@@ -98,6 +100,8 @@ Ext.define('amdaPlotObj.PlotAxisObject', {
                     this.set('axis-grid-minor-space',0);
                     this.set('axis-grid-major-space',0);
     	this.set('axis-grid-minor', false);
+                    this.set('axis-grid-spicify-ticks-number', false);
+                    this.set('axis-grid-spicify-ticks-spacing', false);
     	this.set('axis-grid-major', false);
     	this.set('axis-legend-activated', true);
     	this.set('axis-legend-text', '');
diff --git a/js/app/views/PlotComponents/PlotBaseAxisForm.js b/js/app/views/PlotComponents/PlotBaseAxisForm.js
index b5f4853..24f473f 100644
--- a/js/app/views/PlotComponents/PlotBaseAxisForm.js
+++ b/js/app/views/PlotComponents/PlotBaseAxisForm.js
@@ -34,10 +34,13 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', {
                 this.addStandardCheck('axis-tick-showmarks', 'Show tick marks'),
                 this.addStandardCheck('axis-grid-major', 'Show major grid'),
                 this.addStandardCheck('axis-grid-minor', 'Show minor grid'),
+                this.addStandardCheck('axis-grid-spicify-ticks-number', 'spicify ticks number'),
                 this.addStandardInteger('axis-grid-major-number', 'Nb of Major Ticks', 0, Number.MAX_VALUE,true),
                 this.addStandardInteger('axis-grid-minor-number', 'Nb of Minor Ticks', 0, Number.MAX_VALUE,true),
+                this.addStandardCheck('axis-grid-spicify-ticks-spacing', 'spicify ticks spacing'),
+                this.addStandardFloat2('axis-grid-major-space', ' Major Ticks Space', 0, Number.MAX_VALUE,true),
                 this.addStandardFloat2('axis-grid-minor-space', ' Minor Ticks Space', 0, Number.MAX_VALUE,true),
-                this.addStandardFloat2('axis-grid-major-space', ' Major Ticks Space', 0, Number.MAX_VALUE,true)
+                
         ];
 		
 		var axisItems = [];
diff --git a/js/app/views/PlotComponents/PlotStandardForm.js b/js/app/views/PlotComponents/PlotStandardForm.js
index c56c2c8..8787022 100644
--- a/js/app/views/PlotComponents/PlotStandardForm.js
+++ b/js/app/views/PlotComponents/PlotStandardForm.js
@@ -21,6 +21,8 @@ Ext.define('amdaPlotComp.PlotStandardForm', {
     
     //Link to the tree
     crtTree: null,
+    desableTickNumber:true,
+    desableTickSpacing:true,
     
     constructor: function(config) {
 		this.init(config);
@@ -85,6 +87,7 @@ Ext.define('amdaPlotComp.PlotStandardForm', {
 		allowBlank = (typeof allowBlank !== 'undefined') ? allowBlank : false;
 		
 		return {
+                            id:name,
 	        xtype: 'numberfield',
 	        name: name,
 	        fieldLabel: label,
@@ -104,14 +107,16 @@ Ext.define('amdaPlotComp.PlotStandardForm', {
 	    };
 	},
 
-	addStandardFloat2: function(name, label, min, max, allowBlank, onChange) {
+	addStandardFloat2: function(name, label, min, max, allowBlank, onChange,disable) {
 		allowBlank = (typeof allowBlank !== 'undefined') ? allowBlank : false;
 
 		return {
+                                                            id:name,
 			xtype: 'textfield',
 			name: name,
 			fieldLabel: label,
 			regex :  /[-+]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][-+]?\d+)?/,
+                                                            disable:disable,
 			validator: function (val) {
 				var errMsg = null;
 				if (!allowBlank && Ext.isEmpty(val)) {
@@ -170,9 +175,17 @@ Ext.define('amdaPlotComp.PlotStandardForm', {
         	boxLabel: label,
             listeners: {
             	change: function(combo, newValue, oldValue, eOpts) {
+                    
             		this.object.set(name, newValue);
             		if (onChange != null)
             			onChange(name, newValue, oldValue);
+                                        if(name=='axis-grid-spicify-ticks-number'){
+                                            console.log(tyopeof(this));                             
+                                        }else if(name=='axis-grid-spicify-ticks-spacing'){
+                                            this.desableTickSpacing=! this.desableTickSpacing;
+                                            console.log(  this.getDockedComponent('axis-grid-spicify-ticks-spacing'));
+                                            console.log(  this.getDockedComponent(1));
+                                        }
             	},
             	scope: this
             }
--
libgit2 0.21.2