From b87dc10effc0f09e9d9bcc91ac890a83ea5e80f0 Mon Sep 17 00:00:00 2001
From: Erdogan Furkan <furkan.erdogan1205@gmail.com>
Date: Thu, 28 Jul 2022 07:30:34 +0000
Subject: [PATCH] Modifications for fillValue case

---
 js/app/models/Parameter.js      |  4 ++++
 js/app/views/ParameterUI.js     | 12 +++++++++++-
 php/classes/DerivedParamMgr.php |  2 +-
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/js/app/models/Parameter.js b/js/app/models/Parameter.js
index 06af5e9..746d779 100644
--- a/js/app/models/Parameter.js
+++ b/js/app/models/Parameter.js
@@ -24,6 +24,7 @@ Ext.define('amdaModel.Parameter', {
 	    {name: 'buildchain', type: 'string'},
 	    {name: 'description', type: 'string'},
 	    {name: 'ytitle', type: 'string'},
+        { name: 'fill_value', type: 'string' },
             {name: 'dim_1', type: 'number'},
             {name: 'dim_2', type: 'number'},
 	    {name: 'last_update', type: 'int', defaultValue: 0},
@@ -48,6 +49,9 @@ Ext.define('amdaModel.Parameter', {
         if (this.get('ytitle').match(/[a-z,0-9]/gi) != null) {
             myValues.ytitle = this.get('ytitle');
         }
+        if (this.get('fill_value').match(/[0-9]/gi) != null) {
+            myValues.fill_value = this.get('fill_value');
+        }
         if (this.get('description').match(/[a-z,0-9]/gi) != null) {
             myValues.description = this.get('description');
         }
diff --git a/js/app/views/ParameterUI.js b/js/app/views/ParameterUI.js
index a4541eb..3e082fe 100755
--- a/js/app/views/ParameterUI.js
+++ b/js/app/views/ParameterUI.js
@@ -136,7 +136,8 @@ Ext.define('amdaUI.ParameterUI',
 				buildchain: this.object.get('buildchain'),
 				timestep: this.object.get('timestep'),
 				reference_param: this.object.get('reference_param'),
-				sampling_mode: this.object.get('sampling_mode')
+				sampling_mode: this.object.get('sampling_mode'),
+				fill_value: this.object.get('fill_value')
 			};
 			loadMask.show();
 			AmdaAction.generateParamInfo(obj, function (result, e) {
@@ -580,6 +581,15 @@ Ext.define('amdaUI.ParameterUI',
 								width: 150
 							},
 							{
+								itemId: 'formParamFillValue',
+								fieldLabel: 'Fill Value',
+								name: 'fill_value',
+								width: 150
+							},
+							{
+								xtype: 'component', width: 20
+							},
+							{
 								itemId: 'formParamDescription',
 								name: 'description',
 								xtype: 'textarea', fieldLabel: 'Description',
diff --git a/php/classes/DerivedParamMgr.php b/php/classes/DerivedParamMgr.php
index 3bcb1da..4b0f002 100644
--- a/php/classes/DerivedParamMgr.php
+++ b/php/classes/DerivedParamMgr.php
@@ -21,7 +21,7 @@ class DerivedParamMgr extends AmdaObjectMgr
 			//node attributes  and object XML tags 
 			$this->attributes = array('name' => '', 'buildchain' => '', 'timestep' => '', 'dim_1' => '1', 'dim_2' => '1', 'units'=>'undefined', 'sampling_mode'=>'', 'reference_param'=>'');
 			// + tags in object XML
-			$this->optionalAttributes = array('description' => 'undefined', 'ytitle' => 'undefined');
+			$this->optionalAttributes = array('description' => 'undefined', 'ytitle' => 'undefined', 'fill_value' => '');
 			$this->objTagName = 'param';
 			$this->id_prefix = 'ws_';
 		}
--
libgit2 0.21.2