From 4f728fd90a2988a5aa1c6d83d5411125b80fd55e Mon Sep 17 00:00:00 2001 From: Furkan <furkan.erdogan1205@gmail.com> Date: Mon, 20 Mar 2023 09:08:22 +0000 Subject: [PATCH] For now 2 --- desktop.php | 37 +++++++++++++++++++++++++++++-------- generic_data/defaultValuesConfig.json | 300 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ generic_data/defaultValuesLinks.json | 330 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ js/app/models/DefaultValues.js | 44 -------------------------------------------- js/app/models/DefaultValuesModel.js | 13 ++++++------- js/app/models/PlotObjects/PlotConstantObject.js | 2 +- js/app/models/PlotObjects/PlotFillObject.js | 2 +- js/app/models/PlotObjects/PlotLegendTextObject.js | 2 +- js/app/models/PlotObjects/PlotObjectConfig.js | 304 +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- js/app/models/PlotObjects/PlotPanelObject.js | 2 +- js/app/models/PlotObjects/PlotParamObject.js | 8 ++++---- js/app/models/PlotObjects/PlotRequestObject.js | 6 +++--- js/app/views/CatalogVisuHistogram.js | 2 +- js/app/views/CatalogVisuScatter.js | 2 +- js/app/views/ColorPicker.js | 31 +++++++++++++++++++++++++++++++ js/app/views/DefaultTreeGrid.js | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------- js/app/views/DefaultValuesWindow.js | 10 ---------- js/app/views/PlotComponents/PlotBaseAxisForm.js | 8 ++++---- js/app/views/PlotComponents/PlotBaseSerieForm.js | 14 +++++++------- js/app/views/PlotComponents/PlotColorAxisForm.js | 6 +++--- js/app/views/PlotComponents/PlotConstantForm.js | 2 +- js/app/views/PlotComponents/PlotFillForm.js | 6 +++--- js/app/views/PlotComponents/PlotHistogram2DSerieForm.js | 4 ++-- js/app/views/PlotComponents/PlotInstantSpectroForm.js | 2 +- js/app/views/PlotComponents/PlotIntervalsForm.js | 4 ++-- js/app/views/PlotComponents/PlotLayoutForm.js | 2 +- js/app/views/PlotComponents/PlotLegendSeriesForm.js | 10 +++++----- js/app/views/PlotComponents/PlotLegendTextForm.js | 4 ++-- js/app/views/PlotComponents/PlotOrbitSerieForm.js | 2 +- js/app/views/PlotComponents/PlotOutputForm.js | 8 ++++---- js/app/views/PlotComponents/PlotPageForm.js | 12 ++++++------ js/app/views/PlotComponents/PlotPanelForm.js | 16 ++++++++-------- js/app/views/PlotComponents/PlotSerieForm.js | 4 ++-- js/app/views/PlotComponents/PlotSpectroForm.js | 8 ++++---- js/app/views/PlotComponents/PlotStandardForm.js | 10 +++++----- js/app/views/PlotComponents/PlotStatusBarForm.js | 2 +- js/app/views/PlotComponents/PlotTextForm.js | 6 +++--- js/app/views/PlotComponents/PlotTimeAxisForm.js | 2 +- php/classes/AmdaAction.php | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------- php/config.php | 4 +++- 40 files changed, 939 insertions(+), 585 deletions(-) create mode 100644 generic_data/defaultValuesConfig.json create mode 100644 generic_data/defaultValuesLinks.json delete mode 100644 js/app/models/DefaultValues.js create mode 100644 js/app/views/ColorPicker.js diff --git a/desktop.php b/desktop.php index d4be4a3..c21463a 100644 --- a/desktop.php +++ b/desktop.php @@ -112,6 +112,9 @@ if ($sessionID === FALSE) { var helpDir = 'help/'; var isGuest = sessionID.match('guest'); + var amdaDefaultValues = null; + var amdaDefaultConfigs = null; + var amdaDefaultOptions = null; var max_uploaded_file_size = '<?php echo MAX_UPLOADED_FILESIZE; ?>'; var guestSessionDuration = '<?php echo GuestSessionDuration * 60; ?>'; // in secs @@ -191,14 +194,32 @@ if ($sessionID === FALSE) { stateProvider.on({ scope: this, afterrestore: function(provider) { - amdaDesktop.JobsMgr.getStatus(); - Ext.state.Manager.setProvider(provider); - myDesktopApp = new amdaApp.AmdaApp(); - // global message bus - myDesktopApp.EventManager = new Ext.util.Observable(); - // not needed - for documentation only - myDesktopApp.EventManager.addEvents('refresh'); - loadMask = new AMDAMask(); + AmdaAction.getDefaultValueTree(false, function(defaults){ + amdaDefaultValues=defaults; + + AmdaAction.getDefaultValueConfigs(function(configs){ + amdaDefaultConfigs = configs; + + AmdaAction.getDefaultValueLinks(function(links){ + amdaDefaultOptions = links; + + Ext.Object.each(amdaDefaultOptions, function(parameter, links){ + if(links.store) + links.store = amdaDefaultConfigs[links.store]; + }); + amdaDesktop.JobsMgr.getStatus(); + Ext.state.Manager.setProvider(provider); + myDesktopApp = new amdaApp.AmdaApp(); + // global message bus + myDesktopApp.EventManager = new Ext.util.Observable(); + // not needed - for documentation only + myDesktopApp.EventManager.addEvents('refresh'); + loadMask = new AMDAMask(); + }) ; + }); + }) ; + + } }); diff --git a/generic_data/defaultValuesConfig.json b/generic_data/defaultValuesConfig.json new file mode 100644 index 0000000..22ac7bd --- /dev/null +++ b/generic_data/defaultValuesConfig.json @@ -0,0 +1,300 @@ +{ + "availableFileFormats": [ + { "key": "PNG", "value": "PNG" }, + { "key": "PDF", "value": "PDF" }, + { "key": "PS", "value": "PS" }, + { "key": "SVG", "value": "SVG" } + ], + + "availableFileOutputsForPng": [ + { "key": "INTERACTIVE", "value": "screen" }, + { "key": "TGZ", "value": "tar+gzip archive" }, + { "key": "ZIP", "value": "zip archive" } + ], + + "availableFileOutputsForOtherFormats": [ + { "key": "TGZ", "value": "tar+gzip archive" }, + { "key": "ZIP", "value": "zip archive" } + ], + + "availablePageModes": [ + { "key": "color", "value": "Color" }, + { "key": "grayscale", "value": "Grayscale" } + ], + + "availablePageOrientations": [ + { "key": "landscape", "value": "Landscape" }, + { "key": "portrait", "value": "Portrait" } + ], + + "availablePageDimensions": [ + { "key": "ISO A4", "value": "ISO A4" }, + { "key": "US letter", "value": "US letter" } + ], + + "availablePlotTypes": [ + { "key": "timePlot", "value": "Time Plot" }, + { "key": "xyPlot", "value": "Scatter Plot" }, + { "key": "epochPlot", "value": "Epoch Plot" }, + { "key": "instantPlot", "value": "Instant Plot" }, + { "key": "statusPlot", "value": "Status Plot" }, + { "key": "tickPlot", "value": "Tick Plot" } + ], + + "availableFontNames": [ + { "key": "sans-serif", "value": "sans-serif" }, + { "key": "serif", "value": "serif" }, + { "key": "monospace", "value": "monospace" }, + { "key": "script", "value": "script" } + ], + + "availableTitlePositions": [ + { "key": "top", "value": "Top" }, + { "key": "bottom", "value": "Bottom" } + ], + + "availableTitleAlignments": [ + { "key": "center", "value": "Center" }, + { "key": "left", "value": "Left" }, + { "key": "right", "value": "Right" } + ], + + "availableAxisScales": [ + { "key": "linear", "value": "Linear" }, + { "key": "logarithmic", "value": "Logarithmic" } + ], + + "availableTicksPositions": [ + { "key": "inwards", "value": "Inwards" }, + { "key": "outwards", "value": "Outwards" } + ], + + "availableTimeAxisFormats": [ + { "key": "dd/mm/yy", "value": "dd/mm/yy" }, + { "key": "ddd/yy", "value": "ddd/yy" }, + { "key": "DD/MM/YYYY", "value": "dd/mm/yyyy" }, + { "key": "yyyy/dd/mm", "value": "yyyy/dd/mm" }, + { "key": "yyyy-dd-mm", "value": "yyyy-dd-mm" } + ], + + "availableYAxes": [ + { "key": "y-left", "value": "Left" }, + { "key": "y-right", "value": "Right" } + ], + + "availableResolutions": [ + { "key": 3000, "value": "3000" }, + { "key": 10000, "value": "10000" }, + { "key": 50000, "value": "50000" }, + { "key": 100000, "value": "100000" } + ], + + "availableLinesStyles": [ + { "key": "plain", "value": "Plain" }, + { "key": "dot", "value": "Dot" }, + { "key": "long-spaced-dot", "value": "Long spaced dot" }, + { "key": "long-short-dot", "value": "Long short dot" } + ], + + "availableSymbolsTypes": [ + { "key": "dot", "value": "Dot" }, + { "key": "plus", "value": "Plus" }, + { "key": "wildcard", "value": "Wildcard" }, + { "key": "circle", "value": "Circle" }, + { "key": "crux", "value": "Crux" }, + { "key": "square", "value": "Square" }, + { "key": "triangle", "value": "Triangle" }, + { "key": "crux-in-circle", "value": "Crux in circle" }, + { "key": "dot-in-circle", "value": "Dot in circle" }, + { "key": "diamond", "value": "Diamond" }, + { "key": "star", "value": "Star" }, + { "key": "david-star", "value": "David star" }, + { "key": "full-square", "value": "Full square" }, + { "key": "full-circle", "value": "Full circle" }, + { "key": "full-star", "value": "Full star" } + ], + + "availableColorMaps": [ + { "key": "0", "value": "Blue Red" }, + { "key": "1", "value": "Default" }, + { "key": "2", "value": "Blue Yellow" }, + { "key": "3", "value": "Grayscale" }, + { "key": "4", "value": "AMDA Default" }, + { "key": "5", "value": "GeoWhite" }, + { "key": "6", "value": "GeoBlack" }, + { "key": "7", "value": "Violet Yellow" }, + { "key": "8", "value": "Red Blue 4" } + ], + + "availableColors": [ + { "key": "auto", "color": "auto", "value": "auto" }, + { "key": "[0,0,0]", "color": "#000000", "value": "Black" }, + { "key": "[0,0,255]", "color": "#0000ff", "value": "Blue" }, + { "key": "[255,0,0]", "color": "#ff0000", "value": "Red" }, + { "key": "[0,255,255]", "color": "#00ffff", "value": "Cyan" }, + { "key": "[255,0,255]", "color": "#ff00ff", "value": "Magenta" }, + { "key": "[0,128,0]", "color": "#008000", "value": "Green" }, + { "key": "[128,128,128]", "color": "#808080", "value": "Gray" }, + { "key": "[0,255,0]", "color": "#00ff00", "value": "Lime" }, + { "key": "[128,0,0]", "color": "#800000", "value": "Maroon" }, + { "key": "[0,0,128]", "color": "#000080", "value": "Navy" }, + { "key": "[128,128,0]", "color": "#808000", "value": "Olive" }, + { "key": "[128,0,128]", "color": "#800080", "value": "Purple" }, + { "key": "[192,192,192]", "color": "#c0c0c0", "value": "Silver" }, + { "key": "[0,128,128]", "color": "#008080", "value": "Teal" }, + { "key": "[255,255,0]", "color": "#ffff00", "value": "Yellow" }, + { "key": "[0,64,64]", "color": "#004040", "value": "Cyprus" } + ], + + "availableColorsNew": [ + "#000000", "#0000ff", "#ff0000", "#00ffff", "#ff00ff", "#008000", "#800000", + "#000080", "#808000", "#800080", "#c0c0c0", "#008080", "#ffff00", "#004040", + "#29d8d7", "#6b9842", "#73a9b4", "#1c883d", "#808080", "#4342dd", "#e84130", + "#dee2e6", "#ced4da", "#adb5bd", "#868e96", "#495057", "#343a40", "#212529", + "#ffa8a8", "#ff8787", "#ff6b6b", "#fa5252", "#f03e3e", "#e03131", "#c92a2a", + "#faa2c1", "#f783ac", "#f06595", "#e64980", "#d6336c", "#c2255c", "#a61e4d", + "#e599f7", "#da77f2", "#cc5de8", "#be4bdb", "#ae3ec9", "#9c36b5", "#862e9c", + "#b197fc", "#9775fa", "#845ef7", "#7950f2", "#7048e8", "#6741d9", "#5f3dc4", + "#91a7ff", "#748ffc", "#5c7cfa", "#4c6ef5", "#4263eb", "#3b5bdb", "#364fc7", + "#74c0fc", "#4dabf7", "#339af0", "#228be6", "#1c7ed6", "#1971c2", "#1864ab", + "#66d9e8", "#3bc9db", "#22b8cf", "#15aabf", "#1098ad", "#0c8599", "#0b7285", + "#63e6be", "#38d9a9", "#20c997", "#12b886", "#0ca678", "#099268", "#087f5b", + "#8ce99a", "#69db7c", "#51cf66", "#40c057", "#37b24d", "#2f9e44", "#2b8a3e", + "#c0eb75", "#a9e34b", "#94d82d", "#82c91e", "#74b816", "#66a80f", "#5c940d", + "#ffe066", "#ffd43b", "#fcc419", "#fab005", "#f59f00", "#f08c00", "#e67700", + "#ffc078", "#ffa94d", "#ff922b", "#fd7e14", "#f76707", "#e8590c", "#d9480f" + ], + + "availableBackgroundColors": [ + { "color": "none", "value": "None" }, + { "key": "[0,0,0]", "color": "#000000", "value": "Black" }, + { "key": "[0,0,255]", "color": "#0000FF", "value": "Blue" }, + { "key": "[255,0,0]", "color": "#FF0000", "value": "Red" }, + { "key": "[0,255,255]", "color": "#00FFFF", "value": "Cyan" }, + { "key": "[255,0,255]", "color": "#FF00FF", "value": "Magenta" }, + { "key": "[0,128,0]", "color": "#008000", "value": "Green" }, + { "key": "[128,128,128]", "color": "#808080", "value": "Gray" }, + { "key": "[0,255,0]", "color": "#00FF00", "value": "Lime" }, + { "key": "[128,0,0]", "color": "#800000", "value": "Maroon" }, + { "key": "[0,0,128]", "color": "#000080", "value": "Navy" }, + { "key": "[128,128,0]", "color": "#808000", "value": "Olive" }, + { "key": "[128,0,128]", "color": "#800080", "value": "Purple" }, + { "key": "[192,192,192]", "color": "#C0C0C0", "value": "Silver" }, + { "key": "[0,128,128]", "color": "#008080", "value": "Teal" }, + { "key": "[255,255,0]", "color": "#FFFF00", "value": "Yellow" }, + { "key": "[0,64,64]", "color": "#004040", "value": "Cyprus" } + ], + + "availableStatusBarPositions": [ + { "key": "top", "value": "Top" }, + { "key": "bottom", "value": "Bottom" } + ], + + "availableStatusBarColorMaps": [ + { "key": "0", "value": "0" }, + { "key": "1", "value": "1" }, + { "key": "2", "value": "2" } + ], + + "availablePageLayouts": [ + { "key": "vertical", "value": "Vertical" }, + { "key": "auto", "value": "Auto" }, + { "key": "manual", "value": "Manual" } + ], + + "availableResamplingModes": [ + { "key": "xparam", "value": "X Parameter" }, + { "key": "yparam", "value": "Y Parameter" } + ], + + "availableOrbitSerieProjections": [ + { "key": "XY", "value": "XY" }, + { "key": "XZ", "value": "XZ" }, + { "key": "YZ", "value": "YZ" }, + { "key": "XR", "value": "XR" }, + { "key": "YR", "value": "YR" }, + { "key": "ZR", "value": "ZR" } + ], + + "availableHistogram2DFunctions": [ + { "key": "density", "value": "Density" }, + { "key": "mean", "value": "Mean" }, + { "key": "min", "value": "Minimum" }, + { "key": "max", "value": "Maximum" }, + { "key": "median", "value": "Median" }, + { "key": "stadev", "value": "Standard Deviation" } + ], + + "availableDimsOnXAxis": [ + { "key": "0", "value": "First dimension" }, + { "key": "1", "value": "Second dimension" } + ], + + "availableTimeTickTypes": [ + { "key": "auto", "value": "Auto" }, + { "key": "time-step", "value": "Time step" }, + { "key": "nb-major", "value": "Num. of major symb." } + ], + + "availableIntervalTickModes": [ + { "key": "symbol-only", "value": "Symbol only" }, + { "key": "interval-index", "value": "Interval index" }, + { "key": "start-time", "value": "Start time" }, + { "key": "start-stop-time", "value": "Start/Stop times" } + ], + + "availableErrorBarTypes": [ + { "key": "min-max", "value": "Min./Max. Parameters" }, + { "key": "delta", "value": "Delta parameter" } + ], + + "availableLegendSeriesTypes": [ + { "key": "text-line-symbol", "value": "Text, Line & Symbols" }, + { "key": "text-only", "value": "Text only" } + ], + + "availableLegendSeriesPositions": [ + { "key": "inside", "value": "Inside" }, + { "key": "outside", "value": "Outside" } + ], + + "availableLegendSeriesIntervalInfoTypes": [ + { "key": "index", "value": "Interval Index" }, + { "key": "start-stop", "value": "Interval Start/Stop" } + ], + + "availableLegendTextPositions": [ + { "key": "right", "value": "Right" }, + { "key": "left", "value": "Left" }, + { "key": "top", "value": "Top" }, + { "key": "bottom", "value": "Bottom" } + ], + + "availableConstantAxes": [ + { "key": "x", "value": "X / Time / Epoch" }, + { "key": "y-left", "value": "Y Left" }, + { "key": "y-right", "value": "Y Right" } + ], + + "availableTextAlignments": [ + { "key": "left", "value": "Left" }, + { "key": "center", "value": "Center" }, + { "key": "right", "value": "Right" } + ], + + "availableFillTypes": [ + { "key": "serie-constant", "value": "Serie / Constant" }, + { "key": "serie-serie", "value": "Serie / Serie" } + ], + "availableSpectroNormalization": [ + { "key": "none", "value": "None" }, + { "key": "linear", "value": "Linear" }, + { "key": "log", "value": "Logarithmic" } + ], + + "availableFilteringLevel": [ + { "key": 1, "value": "Weak" }, + { "key": 2, "value": "Intermediate/moderated" }, + { "key": 3, "value": "Strong" } + ] +} \ No newline at end of file diff --git a/generic_data/defaultValuesLinks.json b/generic_data/defaultValuesLinks.json new file mode 100644 index 0000000..699d85e --- /dev/null +++ b/generic_data/defaultValuesLinks.json @@ -0,0 +1,330 @@ +{ + "plot.file.format" : + { + "type":"combobox", + "store":"availableFileFormats" + }, + "plot.file.output" : + { + "type":"combobox", + "store":"availableFileOutputsForPng", + "store2":"availableFileOutputsForOtherFormats" + }, + "plot.page.title.position": + { + "type":"combobox", + "store":"availableTitlePositions" + }, + "plot.page.title.alignment": + { + "type":"combobox", + "store":"availableTitleAlignments" + }, + "plot.page.font.name": + { + "type":"combobox", + "store":"availableFontNames" + }, + "plot.page.layout.type": + { + "type":"combobox", + "store":"availablePageLayouts" + }, + "plot.page.mode": + { + "type":"combobox", + "store":"availablePageModes" + }, + "plot.page.orientation": + { + "type":"combobox", + "store":"availablePageOrientations" + }, + "plot.page.dimension": + { + "type":"combobox", + "store":"availablePageDimensions" + }, + "plot.panel.title.position": + { + "type":"combobox", + "store":"availableTitlePositions" + }, + "plot.panel.title.alignment": + { + "type":"combobox", + "store":"availableTitleAlignments" + }, + "plot.panel.font.name": + { + "type":"combobox", + "store":"availableFontNames" + }, + "plot.panel.status.position": + { + "type":"combobox", + "store":"availableStatusBarPositions" + }, + "plot.panel.status.colorMap": + { + "type":"combobox", + "store":"availableStatusBarColorMaps" + }, + + "plot.panel.plotType": + { + "type":"combobox", + "store":"availablePlotTypes" + }, + "plot.panel.backgroundColor": + { + "type":"colorpicker", + "store":null + }, + "plot.axis.legend.font.name": + { + "type":"combobox", + "store":"availableFontNames" + }, + "plot.axis.scale": + { + "type":"combobox", + "store":"availableAxisScales" + }, + "plot.axis.tickPosition": + { + "type":"combobox", + "store":"availableTicksPositions" + }, + "plot.axis.timeFormat": + { + "type":"combobox", + "store":"availableTimeAxisFormats" + }, + "plot.axis.colorMap": + { + "type":"combobox", + "store":"availableColorMaps" + }, + "plot.serie.lines.style": + { + "type":"combobox", + "store":"availableLinesStyles" + }, + "plot.serie.lines.color": + { + "type":"colorpicker", + "store":null + }, + "plot.serie.symbols.type": + { + "type":"combobox", + "store":"availableSymbolsTypes" + }, + "plot.serie.symbols.color": + { + "type":"colorpicker", + "store":null + }, + "plot.serie.timetick.symbols.type": + { + "type":"combobox", + "store":"availableSymbolsTypes" + }, + "plot.serie.timetick.symbols.color": + { + "type":"colorpicker", + "store":null + }, + "plot.serie.timetick.firstsymbols.type": + { + "type":"combobox", + "store":"availableSymbolsTypes" + }, + "plot.serie.timetick.firstsymbols.color": + { + "type":"colorpicker", + "store":null + }, + "plot.serie.timetick.font.name": + { + "type":"combobox", + "store":"availableFontNames" + }, + "plot.serie.timetick.type": + { + "type":"combobox", + "store":"availableTimeTickTypes" + }, + "plot.serie.intervaltick.symbols.type": + { + "type":"combobox", + "store":"availableSymbolsTypes" + }, + "plot.serie.intervaltick.symbols.color": + { + "type":"colorpicker", + "store":null + }, + "plot.serie.intervaltick.font.name": + { + "type":"combobox", + "store":"availableFontNames" + }, + "plot.serie.intervaltick.mode": + { + "type":"combobox", + "store":"availableIntervalTickModes" + }, + "plot.serie.errorbar.lines.style": + { + "type":"combobox", + "store":"availableLinesStyles" + }, + "plot.serie.errorbar.lines.color": + { + "type":"colorpicker", + "store":null + }, + "plot.serie.errorbar.type": + { + "type":"combobox", + "store":"availableErrorBarTypes" + }, + "plot.serie.yAxis": + { + "type":"combobox", + "store":"availableYAxes" + }, + "plot.serie.resolution": + { + "type":"combobox", + "store":"availableResolutions" + }, + "plot.serie.resamplingMode": + { + "type":"combobox", + "store":"availableResamplingModes" + }, + "plot.serie.projection": + { + "type":"combobox", + "store":"availableOrbitSerieProjections" + }, + "plot.spectro.yAxis": + { + "type":"combobox", + "store":"availableYAxes" + }, + "plot.spectro.resolution": + { + "type":"combobox", + "store":"availableResolutions" + }, + "plot.histogram2D.histo2DFunction": + { + "type":"combobox", + "store":"availableHistogram2DFunctions" + }, + "plot.sauvaud.yAxis": + { + "type":"combobox", + "store":"availableYAxes" + }, + "plot.sauvaud.resolution": + { + "type":"combobox", + "store":"availableResolutions" + }, + + "plot.legends.series.intervalinfo.type": + { + "type":"combobox", + "store":"availableLegendSeriesIntervalInfoTypes" + }, + "plot.legends.series.font.name": + { + "type":"combobox", + "store":"availableFontNames" + }, + "plot.legends.series.type": + { + "type":"combobox", + "store":"availableLegendSeriesTypes" + }, + "plot.legends.series.position": + { + "type":"combobox", + "store":"availableLegendSeriesPositions" + }, + "plot.legends.text.font.name": + { + "type":"combobox", + "store":"availableFontNames" + }, + "plot.legends.text.position": + { + "type":"combobox", + "store":"availableLegendTextPositions" + }, + "plot.constants.line.style": + { + "type":"combobox", + "store":"availableLinesStyles" + }, + "plot.constants.line.color": + { + "type":"colorpicker", + "store":null + }, + "plot.constants.axisId": + { + "type":"combobox", + "store":"availableConstantAxes" + }, + "plot.textObjs.font.name": + { + "type":"combobox", + "store":"availableFontNames" + }, + "plot.textObjs.yAxisId": + { + "type":"combobox", + "store":"availableYAxes" + }, + "plot.textObjs.align": + { + "type":"combobox", + "store":"availableTextAlignments" + }, + "plot.curves.line.style": + { + "type":"combobox", + "store":"availableLinesStyles" + }, + "plot.curves.line.color": + { + "type":"colorpicker", + "store":null + }, + "plot.fills.type": + { + "type":"combobox", + "store":"availableFillTypes" + }, + "plot.fills.greaterColor": + { + "type":"colorpicker", + "store":null + }, + "plot.fills.lessColor": + { + "type":"colorpicker", + "store":null + }, + "plot.filtering.level": + { + "type":"combobox", + "store":"availableFilteringLevel" + } +} \ No newline at end of file diff --git a/js/app/models/DefaultValues.js b/js/app/models/DefaultValues.js deleted file mode 100644 index 2ee6765..0000000 --- a/js/app/models/DefaultValues.js +++ /dev/null @@ -1,44 +0,0 @@ -Ext.define('amdaModel.DefaultValues', { - singleton: true, - type:null, - userValues:'', - - constructor: function() { - this.getDefaultValues(); - }, - - getDefaultValues: function(){ - var me = this; - - Ext.Ajax.request({ - url: 'generic_data/defaultValues.json', - method: 'GET', - success: function(response) { - me.values = Ext.decode(response.responseText); - - // after reading generic default values, we read user defaults. - Ext.Ajax.request({ - url: 'data/'+ sessionID +'/userDefaults.json', - method: 'GET', - success: function(response) { - me.userValues = Ext.decode(response.responseText); - Ext.Object.each(me.userValues, function(key,value){ - var keys = key.split('_'); - var obj = me.values; - for (var i = 0; i < keys.length - 1; i++) { - obj = obj[keys[i]]; - } - obj[keys[keys.length - 1]] = value; - }) - }, - failure:function(){ - // Maybe create the file ? - } - }); - }, - failure: function(response) { - console.error('Failed to load default values', response); - } - }); - }, -}); \ No newline at end of file diff --git a/js/app/models/DefaultValuesModel.js b/js/app/models/DefaultValuesModel.js index b34a222..b132f78 100644 --- a/js/app/models/DefaultValuesModel.js +++ b/js/app/models/DefaultValuesModel.js @@ -1,10 +1,9 @@ Ext.define('amdaModel.DefaultValuesModel', { extend: 'Ext.data.TreeModel', - fields: [{ - name: 'parameter', - type: 'string' - }, { - name: 'value', - type: 'string' - }] + fields: [ + { name: 'parameter', type: 'string'}, + { name: 'value', type: 'string'}, + { name: 'modified', type: 'boolean' }, + { name: 'default'} + ] }); \ No newline at end of file diff --git a/js/app/models/PlotObjects/PlotConstantObject.js b/js/app/models/PlotObjects/PlotConstantObject.js index 17d8ad1..3e38171 100644 --- a/js/app/models/PlotObjects/PlotConstantObject.js +++ b/js/app/models/PlotObjects/PlotConstantObject.js @@ -66,7 +66,7 @@ Ext.define('amdaPlotObj.PlotConstantObject', { getShortInfo : function() { - var axis = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availableConstantAxes, this.get('constant-axis-id')); + var axis = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaDefaultConfigs.availableConstantAxes, this.get('constant-axis-id')); return 'Id : '+this.get('id')+', '+axis; }, diff --git a/js/app/models/PlotObjects/PlotFillObject.js b/js/app/models/PlotObjects/PlotFillObject.js index 802f1d7..4329ef7 100644 --- a/js/app/models/PlotObjects/PlotFillObject.js +++ b/js/app/models/PlotObjects/PlotFillObject.js @@ -57,7 +57,7 @@ Ext.define('amdaPlotObj.PlotFillObject', { getShortInfo : function() { - var type = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availableFillTypes, this.get('fill-type')); + var type = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaDefaultConfigs.availableFillTypes, this.get('fill-type')); return type; }, diff --git a/js/app/models/PlotObjects/PlotLegendTextObject.js b/js/app/models/PlotObjects/PlotLegendTextObject.js index f4724f2..f703b85 100644 --- a/js/app/models/PlotObjects/PlotLegendTextObject.js +++ b/js/app/models/PlotObjects/PlotLegendTextObject.js @@ -61,7 +61,7 @@ Ext.define('amdaPlotObj.PlotLegendTextObject', { getShortInfo : function() { - var position = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availableLegendTextPositions, this.get('legend-text-position')); + var position = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaDefaultConfigs.availableLegendTextPositions, this.get('legend-text-position')); return position; }, diff --git a/js/app/models/PlotObjects/PlotObjectConfig.js b/js/app/models/PlotObjects/PlotObjectConfig.js index 1a9d29d..4868757 100644 --- a/js/app/models/PlotObjects/PlotObjectConfig.js +++ b/js/app/models/PlotObjects/PlotObjectConfig.js @@ -15,13 +15,9 @@ Ext.define('amdaPlotObj.PlotObjectConfig', { singleton: true, - requires:['amdaModel.DefaultValues'], - defaultValues: null, + defaultValues: amdaDefaultValues.plot, - constructor: function(){ - this.defaultValues = amdaModel.DefaultValues.values.plot; - }, getValueByKey: function (dataList, key) { var value = ''; Ext.each(dataList, function (data) { @@ -33,304 +29,6 @@ Ext.define('amdaPlotObj.PlotObjectConfig', { return value; }, - availableFileFormats: [ - { 'key': 'PNG', 'value': 'PNG' }, - { 'key': 'PDF', 'value': 'PDF' }, - { 'key': 'PS', 'value': 'PS' }, - { 'key': 'SVG', 'value': 'SVG' } - ], - - availableFileOutputsForPng: [ - { 'key': 'INTERACTIVE', 'value': 'screen' }, - { 'key': 'TGZ', 'value': 'tar+gzip archive' }, - { 'key': 'ZIP', 'value': 'zip archive' } - ], - - availableFileOutputsForOtherFormats: [ - { 'key': 'TGZ', 'value': 'tar+gzip archive' }, - { 'key': 'ZIP', 'value': 'zip archive' } - ], - - availablePageModes: [ - { 'key': 'color', 'value': 'Color' }, - { 'key': 'grayscale', 'value': 'Grayscale' } - ], - - availablePageOrientations: [ - { 'key': 'landscape', 'value': 'Landscape' }, - { 'key': 'portrait', 'value': 'Portrait' } - ], - - availablePageDimensions: [ - { 'key': 'ISO A4', 'value': 'ISO A4' }, - { 'key': 'US letter', 'value': 'US letter' } - ], - - availablePlotTypes: [ - { 'key': 'timePlot', value: 'Time Plot' }, - { 'key': 'xyPlot', value: 'Scatter Plot' }, - { 'key': 'epochPlot', value: 'Epoch Plot' }, - { 'key': 'instantPlot', value: 'Instant Plot' }, - { 'key': 'statusPlot', value: 'Status Plot' }, - { 'key': 'tickPlot', value: 'Tick Plot' } - ], - - availableFontNames: [ - { 'key': 'sans-serif', 'value': 'sans-serif' }, - { 'key': 'serif', 'value': 'serif' }, - { 'key': 'monospace', 'value': 'monospace' }, - { 'key': 'script', 'value': 'script' } - ], - - availableTitlePositions: [ - { 'key': 'top', 'value': 'Top' }, - { 'key': 'bottom', 'value': 'Bottom' } - ], - - availableTitleAlignments: [ - { 'key': 'center', 'value': 'Center' }, - { 'key': 'left', 'value': 'Left' }, - { 'key': 'right', 'value': 'Right' } - ], - - availableAxisScales: [ - { 'key': 'linear', 'value': 'Linear' }, - { 'key': 'logarithmic', 'value': 'Logarithmic' } - ], - - availableTicksPositions: [ - { 'key': 'inwards', 'value': 'Inwards' }, - { 'key': 'outwards', 'value': 'Outwards' } - ], - - availableTimeAxisFormats: [ - { 'key': 'dd/mm/yy', 'value': 'dd/mm/yy' }, - { 'key': 'ddd/yy', 'value': 'ddd/yy' }, - { 'key': 'DD/MM/YYYY', 'value': 'dd/mm/yyyy' }, - { 'key': 'yyyy/dd/mm', 'value': 'yyyy/dd/mm' }, - { 'key': 'yyyy-dd-mm', 'value': 'yyyy-dd-mm' } - ], - - availableYAxes: [ - { 'key': 'y-left', 'value': 'Left' }, - { 'key': 'y-right', 'value': 'Right' } - ], - - availableResolutions: [ - { 'key': 3000, 'value': '3000' }, - { 'key': 10000, 'value': '10000' }, - { 'key': 50000, 'value': '50000' }, - { 'key': 100000, 'value': '100000' } - ], - - availableLinesStyles: [ - { 'key': 'plain', 'value': 'Plain' }, - { 'key': 'dot', 'value': 'Dot' }, - { 'key': 'long-spaced-dot', 'value': 'Long spaced dot' }, - { 'key': 'long-short-dot', 'value': 'Long short dot' } - ], - - availableSymbolsTypes: [ - { 'key': 'dot', 'value': 'Dot' }, - { 'key': 'plus', 'value': 'Plus' }, - { 'key': 'wildcard', 'value': 'Wildcard' }, - { 'key': 'circle', 'value': 'Circle' }, - { 'key': 'crux', 'value': 'Crux' }, - { 'key': 'square', 'value': 'Square' }, - { 'key': 'triangle', 'value': 'Triangle' }, - { 'key': 'crux-in-circle', 'value': 'Crux in circle' }, - { 'key': 'dot-in-circle', 'value': 'Dot in circle' }, - { 'key': 'diamond', 'value': 'Diamond' }, - { 'key': 'star', 'value': 'Star' }, - { 'key': 'david-star', 'value': 'David star' }, - { 'key': 'full-square', 'value': 'Full square' }, - { 'key': 'full-circle', 'value': 'Full circle' }, - { 'key': 'full-star', 'value': 'Full star' } - ], - - availableColorMaps: [ - { 'key': '0', 'value': 'Blue Red' }, - { 'key': '1', 'value': 'Default' }, - { 'key': '2', 'value': 'Blue Yellow' }, - { 'key': '3', 'value': 'Grayscale' }, - { 'key': '4', 'value': 'AMDA Default' }, - { 'key': '5', 'value': 'GeoWhite' }, - { 'key': '6', 'value': 'GeoBlack' }, - { 'key': '7', 'value': 'Violet Yellow' }, - { 'key': '8', 'value': 'Red Blue 4' } - ], - - availableColors: [ - { 'key': 'auto', 'color': 'auto', 'value': 'auto' }, - { 'key': '[0,0,0]', 'color': '#000000', 'value': 'Black' }, - { 'key': '[0,0,255]', 'color': '#0000ff', 'value': 'Blue' }, - { 'key': '[255,0,0]', 'color': '#ff0000', 'value': 'Red' }, - { 'key': '[0,255,255]', 'color': '#00ffff', 'value': 'Cyan' }, - { 'key': '[255,0,255]', 'color': '#ff00ff', 'value': 'Magenta' }, - { 'key': '[0,128,0]', 'color': '#008000', 'value': 'Green' }, - { 'key': '[128,128,128]', 'color': '#808080', 'value': 'Gray' }, - { 'key': '[0,255,0]', 'color': '#00ff00', 'value': 'Lime' }, - { 'key': '[128,0,0]', 'color': '#800000', 'value': 'Maroon' }, - { 'key': '[0,0,128]', 'color': '#000080', 'value': 'Navy' }, - { 'key': '[128,128,0]', 'color': '#808000', 'value': 'Olive' }, - { 'key': '[128,0,128]', 'color': '#800080', 'value': 'Purple' }, - { 'key': '[192,192,192]', 'color': '#c0c0c0', 'value': 'Silver' }, - { 'key': '[0,128,128]', 'color': '#008080', 'value': 'Teal' }, - { 'key': '[255,255,0]', 'color': '#ffff00', 'value': 'Yellow' }, - { 'key': '[0,64,64]', 'color': '#004040', 'value': 'Cyprus' } - ], - - availableColorsNew: [ - "#000000", "#0000ff", "#ff0000", "#00ffff", "#ff00ff", "#008000", "#800000", - "#000080", "#808000", "#800080", "#c0c0c0", "#008080", "#ffff00", "#004040", - "#29d8d7", "#6b9842", "#73a9b4", "#1c883d", "#808080", "#4342dd", "#e84130", - "#dee2e6", "#ced4da", "#adb5bd", "#868e96", "#495057", "#343a40", "#212529", - "#ffa8a8", "#ff8787", "#ff6b6b", "#fa5252", "#f03e3e", "#e03131", "#c92a2a", - "#faa2c1", "#f783ac", "#f06595", "#e64980", "#d6336c", "#c2255c", "#a61e4d", - "#e599f7", "#da77f2", "#cc5de8", "#be4bdb", "#ae3ec9", "#9c36b5", "#862e9c", - "#b197fc", "#9775fa", "#845ef7", "#7950f2", "#7048e8", "#6741d9", "#5f3dc4", - "#91a7ff", "#748ffc", "#5c7cfa", "#4c6ef5", "#4263eb", "#3b5bdb", "#364fc7", - "#74c0fc", "#4dabf7", "#339af0", "#228be6", "#1c7ed6", "#1971c2", "#1864ab", - "#66d9e8", "#3bc9db", "#22b8cf", "#15aabf", "#1098ad", "#0c8599", "#0b7285", - "#63e6be", "#38d9a9", "#20c997", "#12b886", "#0ca678", "#099268", "#087f5b", - "#8ce99a", "#69db7c", "#51cf66", "#40c057", "#37b24d", "#2f9e44", "#2b8a3e", - "#c0eb75", "#a9e34b", "#94d82d", "#82c91e", "#74b816", "#66a80f", "#5c940d", - "#ffe066", "#ffd43b", "#fcc419", "#fab005", "#f59f00", "#f08c00", "#e67700", - "#ffc078", "#ffa94d", "#ff922b", "#fd7e14", "#f76707", "#e8590c", "#d9480f" - ], - - availableBackgroundColors: [ - { 'color': 'none', 'value': 'None' }, - { 'key': '[0,0,0]', 'color': '#000000', 'value': 'Black' }, - { 'key': '[0,0,255]', 'color': '#0000FF', 'value': 'Blue' }, - { 'key': '[255,0,0]', 'color': '#FF0000', 'value': 'Red' }, - { 'key': '[0,255,255]', 'color': '#00FFFF', 'value': 'Cyan' }, - { 'key': '[255,0,255]', 'color': '#FF00FF', 'value': 'Magenta' }, - { 'key': '[0,128,0]', 'color': '#008000', 'value': 'Green' }, - { 'key': '[128,128,128]', 'color': '#808080', 'value': 'Gray' }, - { 'key': '[0,255,0]', 'color': '#00FF00', 'value': 'Lime' }, - { 'key': '[128,0,0]', 'color': '#800000', 'value': 'Maroon' }, - { 'key': '[0,0,128]', 'color': '#000080', 'value': 'Navy' }, - { 'key': '[128,128,0]', 'color': '#808000', 'value': 'Olive' }, - { 'key': '[128,0,128]', 'color': '#800080', 'value': 'Purple' }, - { 'key': '[192,192,192]', 'color': '#C0C0C0', 'value': 'Silver' }, - { 'key': '[0,128,128]', 'color': '#008080', 'value': 'Teal' }, - { 'key': '[255,255,0]', 'color': '#FFFF00', 'value': 'Yellow' }, - { 'key': '[0,64,64]', 'color': '#004040', 'value': 'Cyprus' } - ], - - availableStatusBarPositions: [ - { 'key': 'top', 'value': 'Top' }, - { 'key': 'bottom', 'value': 'Bottom' } - ], - - availableStatusBarColorMaps: [ - { 'key': '0', 'value': '0' }, - { 'key': '1', 'value': '1' }, - { 'key': '2', 'value': '2' } - ], - - availablePageLayouts: [ - { 'key': 'vertical', 'value': 'Vertical' }, - { 'key': 'auto', 'value': 'Auto' }, - { 'key': 'manual', 'value': 'Manual' } - ], - - availableResamplingModes: [ - { 'key': 'xparam', 'value': 'X Parameter' }, - { 'key': 'yparam', 'value': 'Y Parameter' } - ], - - availableOrbitSerieProjections: [ - { 'key': 'XY', 'value': 'XY' }, - { 'key': 'XZ', 'value': 'XZ' }, - { 'key': 'YZ', 'value': 'YZ' }, - { 'key': 'XR', 'value': 'XR' }, - { 'key': 'YR', 'value': 'YR' }, - { 'key': 'ZR', 'value': 'ZR' } - ], - - availableHistogram2DFunctions: [ - { 'key': 'density', 'value': 'Density' }, - { 'key': 'mean', 'value': 'Mean' }, - { 'key': 'min', 'value': 'Minimum' }, - { 'key': 'max', 'value': 'Maximum' }, - { 'key': 'median', 'value': 'Median' }, - { 'key': 'stadev', 'value': 'Standard Deviation' } - ], - - availableDimsOnXAxis: [ - { 'key': '0', 'value': 'First dimension' }, - { 'key': '1', 'value': 'Second dimension' } - ], - - availableTimeTickTypes: [ - { 'key': 'auto', 'value': 'Auto' }, - { 'key': 'time-step', 'value': 'Time step' }, - { 'key': 'nb-major', 'value': 'Num. of major symb.' } - ], - - availableIntervalTickModes: [ - { 'key': 'symbol-only', 'value': 'Symbol only' }, - { 'key': 'interval-index', 'value': 'Interval index' }, - { 'key': 'start-time', 'value': 'Start time' }, - { 'key': 'start-stop-time', 'value': 'Start/Stop times' } - ], - - availableErrorBarTypes: [ - { 'key': 'min-max', 'value': 'Min./Max. Parameters' }, - { 'key': 'delta', 'value': 'Delta parameter' } - ], - - availableLegendSeriesTypes: [ - { 'key': 'text-line-symbol', 'value': 'Text, Line & Symbols' }, - { 'key': 'text-only', 'value': 'Text only' } - ], - - availableLegendSeriesPositions: [ - { 'key': 'inside', 'value': 'Inside' }, - { 'key': 'outside', 'value': 'Outside' } - ], - - availableLegendSeriesIntervalInfoTypes: [ - { 'key': 'index', 'value': 'Interval Index' }, - { 'key': 'start-stop', 'value': 'Interval Start/Stop' } - ], - - availableLegendTextPositions: [ - { 'key': 'right', 'value': 'Right' }, - { 'key': 'left', 'value': 'Left' }, - { 'key': 'top', 'value': 'Top' }, - { 'key': 'bottom', 'value': 'Bottom' } - ], - - availableConstantAxes: [ - { 'key': 'x', 'value': 'X / Time / Epoch' }, - { 'key': 'y-left', 'value': 'Y Left' }, - { 'key': 'y-right', 'value': 'Y Right' } - ], - - availableTextAlignments: [ - { 'key': 'left', 'value': 'Left' }, - { 'key': 'center', 'value': 'Center' }, - { 'key': 'right', 'value': 'Right' } - ], - - availableFillTypes: [ - { 'key': 'serie-constant', 'value': 'Serie / Constant' }, - { 'key': 'serie-serie', 'value': 'Serie / Serie' } - ], - availableSpectroNormalization: [ - { 'key': 'none', 'value': 'None' }, - { 'key': 'linear', 'value': 'Linear' }, - { 'key': 'log', 'value': 'Logarithmic' } - ], - - availableFilteringLevel: [ - { 'key': 1, 'value': 'Weak' }, - { 'key': 2, 'value': 'Intermediate/moderated' }, - { 'key': 3, 'value': 'Strong' } - ], fieldComboBox: { key: 'key', diff --git a/js/app/models/PlotObjects/PlotPanelObject.js b/js/app/models/PlotObjects/PlotPanelObject.js index 05a1844..29521f4 100644 --- a/js/app/models/PlotObjects/PlotPanelObject.js +++ b/js/app/models/PlotObjects/PlotPanelObject.js @@ -601,7 +601,7 @@ Ext.define('amdaPlotObj.PlotPanelObject', { getPanelShortInfo : function() { - var type = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availablePlotTypes, this.get('panel-plot-type')); + var type = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaDefaultConfigs.availablePlotTypes, this.get('panel-plot-type')); var info = '#'+this.get('panel-index')+', '+type; switch (this.get('panel-plot-type')) { diff --git a/js/app/models/PlotObjects/PlotParamObject.js b/js/app/models/PlotObjects/PlotParamObject.js index 4b57f55..44ddfee 100644 --- a/js/app/models/PlotObjects/PlotParamObject.js +++ b/js/app/models/PlotObjects/PlotParamObject.js @@ -194,7 +194,7 @@ Ext.define('amdaPlotObj.PlotParamObject', { case 'xyPlot' : if (this.get('param-drawing-type') == 'orbit-serie') { - var projection = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availableOrbitSerieProjections, this.get('param-drawing-object').get('serie-projection')); + var projection = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaDefaultConfigs.availableOrbitSerieProjections, this.get('param-drawing-object').get('serie-projection')); info = fullName+', '+projection; } else @@ -212,15 +212,15 @@ Ext.define('amdaPlotObj.PlotParamObject', { switch (this.get('param-drawing-type')) { case 'serie' : - var yAxis = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availableYAxes, this.get('param-drawing-object').get('serie-yaxis')); + var yAxis = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaDefaultConfigs.availableYAxes, this.get('param-drawing-object').get('serie-yaxis')); info += ', Y '+yAxis; break; case 'spectro' : - var yAxis = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availableYAxes, this.get('param-drawing-object').get('spectro-yaxis')); + var yAxis = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaDefaultConfigs.availableYAxes, this.get('param-drawing-object').get('spectro-yaxis')); info += ', Y '+yAxis; break; case 'sauvaud' : - var yAxis = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availableYAxes, this.get('param-drawing-object').get('spectro-yaxis')); + var yAxis = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaDefaultConfigs.availableYAxes, this.get('param-drawing-object').get('spectro-yaxis')); info += ', Y '+yAxis; break; } diff --git a/js/app/models/PlotObjects/PlotRequestObject.js b/js/app/models/PlotObjects/PlotRequestObject.js index a216cd0..8b523e9 100644 --- a/js/app/models/PlotObjects/PlotRequestObject.js +++ b/js/app/models/PlotObjects/PlotRequestObject.js @@ -195,8 +195,8 @@ Ext.define('amdaPlotObj.PlotRequestObject', { getPageShortInfo : function() { - var dimension = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availablePageDimensions, this.get('page-dimension')); - var orientation = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availablePageOrientations, this.get('page-orientation')); + var dimension = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaDefaultConfigs.availablePageDimensions, this.get('page-dimension')); + var orientation = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaDefaultConfigs.availablePageOrientations, this.get('page-orientation')); var info = dimension+', '+orientation; if (this.get('page-superpose-mode')) @@ -206,7 +206,7 @@ Ext.define('amdaPlotObj.PlotRequestObject', { getLayoutShortInfo : function() { - var type = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availablePageLayouts, this.get('page-layout-type')); + var type = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaDefaultConfigs.availablePageLayouts, this.get('page-layout-type')); return type; }, diff --git a/js/app/views/CatalogVisuHistogram.js b/js/app/views/CatalogVisuHistogram.js index 10469f6..2bf9da8 100644 --- a/js/app/views/CatalogVisuHistogram.js +++ b/js/app/views/CatalogVisuHistogram.js @@ -156,7 +156,7 @@ Ext.define('amdaUI.CatalogVisuHistogram', { } ], }; - var colorPicker = this.addColorsPicker('visu-histo-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'standard'); + var colorPicker = this.addColorsPicker('visu-histo-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'standard'); var plotThemeComboConfig = {xtype:'fieldset', id:'visu-hiso-color-fieldset', margin:'5 0 0 0', diff --git a/js/app/views/CatalogVisuScatter.js b/js/app/views/CatalogVisuScatter.js index 474bb03..56e8d1a 100644 --- a/js/app/views/CatalogVisuScatter.js +++ b/js/app/views/CatalogVisuScatter.js @@ -364,7 +364,7 @@ Ext.define('amdaUI.CatalogVisuScatter', { } },scope: this }; - var colorPicker = this.addColorsPicker('visu-scatter-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'standard'); + var colorPicker = this.addColorsPicker('visu-scatter-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'standard'); var plotThemeComboConfig = {xtype:'fieldset', id:'visu-scatter-color-fieldset', margin:'5 0 0 0', diff --git a/js/app/views/ColorPicker.js b/js/app/views/ColorPicker.js new file mode 100644 index 0000000..91e91e7 --- /dev/null +++ b/js/app/views/ColorPicker.js @@ -0,0 +1,31 @@ +Ext.define('amdaUI.ColorPicker', { + extend: 'Ext.form.field.Picker', + alias: 'widget.colorpicker', + toUpper : function(x){ + return x.toUpperCase(); + }, + replaceColor : function(x){ + return x.replace("#",""); + }, + createPicker: function() { + var me = this; + return Ext.create('Ext.picker.Color', { + pickerField: me, + renderTo: Ext.getBody(), + floating: true, + minWidth: 133, + maxWidth: 200, + minHeight: 225, + autoScroll:true, + focusOnShow: true, + colors: amdaDefaultConfigs.availableColorsNew.map(this.replaceColor).map(this.toUpper), + listeners: { + select: function(picker, color) { + me.setValue('#'+color); + me.picker.hide(); + }, + scope: me + } + }); + } +}); \ No newline at end of file diff --git a/js/app/views/DefaultTreeGrid.js b/js/app/views/DefaultTreeGrid.js index e9824c4..2ca250b 100644 --- a/js/app/views/DefaultTreeGrid.js +++ b/js/app/views/DefaultTreeGrid.js @@ -1,53 +1,3 @@ -Ext.define('StatusColorPicker', { - extend: 'Ext.form.field.Picker', - alias: 'widget.statuscolorpicker', - availableColorsNew: [ - "#000000", "#0000ff", "#ff0000", "#00ffff", "#ff00ff", "#008000", "#800000", - "#000080", "#808000", "#800080", "#c0c0c0", "#008080", "#ffff00", "#004040", - "#29d8d7", "#6b9842", "#73a9b4", "#1c883d", "#808080", "#4342dd", "#e84130", - "#dee2e6", "#ced4da", "#adb5bd", "#868e96", "#495057", "#343a40", "#212529", - "#ffa8a8", "#ff8787", "#ff6b6b", "#fa5252", "#f03e3e", "#e03131", "#c92a2a", - "#faa2c1", "#f783ac", "#f06595", "#e64980", "#d6336c", "#c2255c", "#a61e4d", - "#e599f7", "#da77f2", "#cc5de8", "#be4bdb", "#ae3ec9", "#9c36b5", "#862e9c", - "#b197fc", "#9775fa", "#845ef7", "#7950f2", "#7048e8", "#6741d9", "#5f3dc4", - "#91a7ff", "#748ffc", "#5c7cfa", "#4c6ef5", "#4263eb", "#3b5bdb", "#364fc7", - "#74c0fc", "#4dabf7", "#339af0", "#228be6", "#1c7ed6", "#1971c2", "#1864ab", - "#66d9e8", "#3bc9db", "#22b8cf", "#15aabf", "#1098ad", "#0c8599", "#0b7285", - "#63e6be", "#38d9a9", "#20c997", "#12b886", "#0ca678", "#099268", "#087f5b", - "#8ce99a", "#69db7c", "#51cf66", "#40c057", "#37b24d", "#2f9e44", "#2b8a3e", - "#c0eb75", "#a9e34b", "#94d82d", "#82c91e", "#74b816", "#66a80f", "#5c940d", - "#ffe066", "#ffd43b", "#fcc419", "#fab005", "#f59f00", "#f08c00", "#e67700", - "#ffc078", "#ffa94d", "#ff922b", "#fd7e14", "#f76707", "#e8590c", "#d9480f" - ], - toUpper : function(x){ - return x.toUpperCase(); - }, - replaceColor : function(x){ - return x.replace("#",""); - }, - createPicker: function() { - var me = this; - return Ext.create('Ext.picker.Color', { - pickerField: me, - renderTo: Ext.getBody(), - floating: true, - minWidth: 133, - maxWidth: 200, - minHeight: 225, - autoScroll:true, - focusOnShow: true, - colors: this.availableColorsNew.map(this.replaceColor).map(this.toUpper), - listeners: { - select: function(picker, color) { - me.setValue('#'+color); - me.picker.hide(); - }, - scope: me - } - }); - } -}); - Ext.define('amdaUI.DefaultTreeGrid', { extend: 'Ext.tree.Panel', @@ -56,7 +6,7 @@ Ext.define('amdaUI.DefaultTreeGrid', { 'Ext.grid.*', 'Ext.tree.*', 'amdaModel.DefaultValuesModel', - 'StatusColorPicker' + 'amdaUI.ColorPicker' ], xtype: 'tree-grid', @@ -87,7 +37,7 @@ Ext.define('amdaUI.DefaultTreeGrid', { } var value = context.record.get(context.field); if (me.isHexCode(value)) { - var colorPicker = Ext.create('StatusColorPicker', { + var colorPicker = Ext.create('amdaUI.ColorPicker', { pickerField: context.field, value: value, listeners: { @@ -102,90 +52,116 @@ Ext.define('amdaUI.DefaultTreeGrid', { } } }); - - AmdaAction.getDefaultValueTree(function(res,e) { - console.log(res); - }); Ext.apply(this, { store: new Ext.data.TreeStore({ model: amdaModel.DefaultValuesModel, proxy: { type: 'direct', - directFn: AmdaAction.getDefaultValueTree + directFn: AmdaAction.getDefaultValueTree }, folderSort: true }), plugins: [me.cellEditing], - columns: [{ - xtype: 'treecolumn', //this is so we know which column will show the tree - text: 'Parameters', - flex: 2, - sortable: true, - dataIndex: 'parameter' - },{ - xtype: 'gridcolumn', - getEditor: function(record) { - var grid = this.up().grid, - cellediting = grid.findPlugin('cellediting'), - editors = cellediting.editors, - editor = editors.getByKey(this.id), - fieldType; - - if (editor) { - // Do this to avoid memory leaks - editors.remove(editor); - } - value = record.get('value'); - if(me.isHexCode(value)){ - fieldType = 'statuscolorpicker' - } - else if(value === 'true' || value == 'false'){ - fieldType = 'combobox' - } - else{ - fieldType = isNaN(parseFloat(record.get('value'))) ? 'textfield' : 'numberfield'; - } - return { - xtype: fieldType, - store: (fieldType=='combobox') ? [[true, 'true'], [false, 'false']] : null, - editable: false, - value: (fieldType=='combobox') ? value : null, - allowBlank: false - }; - }, - text: 'Values', - flex: 1, - sortable: true, - dataIndex: 'value', - align: 'center', - renderer: function(value, meta) { - if (me.isHexCode(value)){ - value = value.substring(1, 7); - return '<div style="background-color:#' + value + '; margin-left: auto; \ - margin-right: auto;width:15px;height:15px;"></div>'; - } - else{ + columns: [ + { + xtype: 'treecolumn', //this is so we know which column will show the tree + text: 'Parameters', + flex: 2, + sortable: true, + dataIndex: 'parameter', + renderer: function(value, metaData, record) { + if (record.get('modified')) { + return '<b style="color: blue;">'+value+'</b>'; + } return value; } - }, - },{ - text: 'Reset', - width: 55, - menuDisabled: true, - xtype: 'actioncolumn', - tooltip: 'Reset to the default value', - align: 'center', - icon: 'js/resources/images/16x16/arrow_circle_double.png', - handler: function(grid, rowIndex, colIndex, actionItem, event, record, row) { - Ext.Msg.alert('Editing' + record.get('parameter')); - }, - // Only leaf level tasks may be edited - isDisabled: function(view, rowIdx, colIdx, item, record) { - return !record.data.leaf; + },{ + xtype: 'gridcolumn', + getEditor: function(record) { + var grid = this.up().grid, + cellediting = grid.findPlugin('cellediting'), + editors = cellediting.editors, + editor = editors.getByKey(this.id), + fieldType; + + if (editor) { + // Do this to avoid memory leaks + editors.remove(editor); + } + var parentNode = record; + var parameter =""; + while (parentNode.parentNode) { + parentNode = parentNode.parentNode; + if(parentNode.get('parameter')) + parameter = parentNode.get('parameter')+'.'.concat(parameter); + } + option = amdaDefaultOptions[parameter+record.get('parameter')]; + console.log(record.get('default')); + value = record.get('value'); + store = null; + if(me.isHexCode(value)){ + fieldType = 'colorpicker' + } + else if(value === 'true' || value == 'false'){ + fieldType = 'combobox' + store= [[true, 'true'], [false, 'false']]; + } + else{ + fieldType = isNaN(parseFloat(record.get('value'))) ? 'textfield' : 'numberfield'; + } + + if (option && option.type){ + fieldType = option.type; + var myStore = Ext.create('Ext.data.Store', { + fields: ['key', 'value'], + data: option.store + }); + store = myStore; + + } + return { + xtype: fieldType, + store: store, + editable: false, queryMode: 'local', + displayField: 'value', + valueField: 'key', + value: (fieldType=='combobox') ? value : null, + allowBlank: false + }; + }, + text: 'Values', + flex: 1, + sortable: true, + dataIndex: 'value', + align: 'center', + renderer: function(value, meta) { + if (me.isHexCode(value)){ + value = value.substring(1, 7); + return '<div style="background-color:#' + value + '; margin-left: auto; \ + margin-right: auto;width:15px;height:15px;"></div>'; + } + else{ + return value; + } + }, + },{ + text: 'Reset', + width: 55, + menuDisabled: true, + xtype: 'actioncolumn', + tooltip: 'Reset to the default value', + align: 'center', + icon: 'js/resources/images/16x16/arrow_circle_double.png', + handler: function(grid, rowIndex, colIndex, actionItem, event, record, row) { + Ext.Msg.alert('Editing' + record.get('parameter')); + }, + // Only leaf level tasks may be edited + isDisabled: function(view, rowIdx, colIdx, item, record) { + return !record.data.leaf; + } } - } - ] + ], }); } }); diff --git a/js/app/views/DefaultValuesWindow.js b/js/app/views/DefaultValuesWindow.js index 99d29d3..0dbf48e 100644 --- a/js/app/views/DefaultValuesWindow.js +++ b/js/app/views/DefaultValuesWindow.js @@ -69,19 +69,9 @@ Ext.define('amdaUI.DefaultValuesWindow',{ }, }, { - // to reset the form - text: 'Reset', - handler: function() { - // me.statusGrid.clearStore(); - // me.statusGrid.parseStatus(config.status); - } - }, - { // To quit the window text: 'Cancel', handler: function() { - // me.statusGrid.clearStore(); - // me.statusGrid.destroy(); me.close(); } }] diff --git a/js/app/views/PlotComponents/PlotBaseAxisForm.js b/js/app/views/PlotComponents/PlotBaseAxisForm.js index d03a407..a41d04e 100644 --- a/js/app/views/PlotComponents/PlotBaseAxisForm.js +++ b/js/app/views/PlotComponents/PlotBaseAxisForm.js @@ -28,7 +28,7 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { var legendItems = [ this.addStandardText('axis-legend-text', 'Text'), - this.addColorsPicker('axis-legend-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'auto'), + this.addColorsPicker('axis-legend-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'auto'), this.addStandardFont('axis-legend-font') ]; var manageTicksNumber = function (name, newValue, oldValue){ @@ -49,7 +49,7 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { }; var tickGridItems = [ - this.addStandardCombo('axis-tick-position', 'Ticks position', amdaPlotObj.PlotObjectConfig.availableTicksPositions), + this.addStandardCombo('axis-tick-position', 'Ticks position', amdaDefaultConfigs.availableTicksPositions), this.addStandardCheck('axis-tick-showmarks', 'Show tick marks'), this.addStandardCheck('axis-grid-major', 'Show major grid'), this.addStandardCheck('axis-grid-minor', 'Show minor grid')]; @@ -63,9 +63,9 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { var axisItems = []; if (this.showScaleOption) - axisItems.push(this.addStandardCombo('axis-scale', 'Scale', amdaPlotObj.PlotObjectConfig.availableAxisScales)); + axisItems.push(this.addStandardCombo('axis-scale', 'Scale', amdaDefaultConfigs.availableAxisScales)); if (this.showColorOption) { - axisItems.push(this.addColorsPicker('axis-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'auto')); + axisItems.push(this.addColorsPicker('axis-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'auto')); } axisItems.push(this.addStandardFloat('axis-thickness', 'Thickness', 1, 10)); axisItems.push(this.addStandardCheck('axis-reverse', 'Reverse direction')); diff --git a/js/app/views/PlotComponents/PlotBaseSerieForm.js b/js/app/views/PlotComponents/PlotBaseSerieForm.js index 4190d91..9c0c6b9 100644 --- a/js/app/views/PlotComponents/PlotBaseSerieForm.js +++ b/js/app/views/PlotComponents/PlotBaseSerieForm.js @@ -53,13 +53,13 @@ Ext.define('amdaPlotComp.PlotBaseSerieForm', { getTimeTickItems: function() { var me = this; return [ - this.addStandardCombo('serie-timetick-type', 'Type', amdaPlotObj.PlotObjectConfig.availableTimeTickTypes, function(name, value, oldValue) { + this.addStandardCombo('serie-timetick-type', 'Type', amdaDefaultConfigs.availableTimeTickTypes, function(name, value, oldValue) { me.updateOptions(me.crtTree.getSelectedPlotType()); }), this.addStandardFloat('serie-timetick-step', 'Time step (sec.)'), this.addStandardFloat('serie-timetick-nbmajor', 'Number of major ticks'), this.addStandardFloat('serie-timetick-nbminor', 'Number of minor ticks'), - this.addColorsPicker('serie-timetick-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), + this.addColorsPicker('serie-timetick-color', 'Color', amdaDefaultConfigs.availableColorsNew), this.addStandardFieldSet('Symbols', '', this.addStandardSymbolsItems('serie-timetick-symbols')), this.addStandardFieldSet('First symbol', 'serie-timetick-firstsymbols-activated', this.addStandardSymbolsItems('serie-timetick-firstsymbols')), this.addStandardFont('serie-timetick-font') @@ -70,8 +70,8 @@ Ext.define('amdaPlotComp.PlotBaseSerieForm', { var me = this; return [ - this.addStandardCombo('serie-intervaltick-mode', 'Mode', amdaPlotObj.PlotObjectConfig.availableIntervalTickModes), - this.addColorsPicker('serie-intervaltick-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), + this.addStandardCombo('serie-intervaltick-mode', 'Mode', amdaDefaultConfigs.availableIntervalTickModes), + this.addColorsPicker('serie-intervaltick-color', 'Color', amdaDefaultConfigs.availableColorsNew), this.addStandardFieldSet('Symbols', '', this.addStandardSymbolsItems('serie-intervaltick-symbols')), this.addStandardFont('serie-intervaltick-font') ]; @@ -85,7 +85,7 @@ Ext.define('amdaPlotComp.PlotBaseSerieForm', { }, getFilteringItems: function(){ return[ - this.addStandardCombo('filtering-level', 'Level', amdaPlotObj.PlotObjectConfig.availableFilteringLevel) + this.addStandardCombo('filtering-level', 'Level', amdaDefaultConfigs.availableFilteringLevel) ]; }, @@ -93,10 +93,10 @@ Ext.define('amdaPlotComp.PlotBaseSerieForm', { var me = this; return [ - this.addStandardCombo('serie-resolution', 'Points per plot', amdaPlotObj.PlotObjectConfig.availableResolutions, function(name, value, oldValue) { + this.addStandardCombo('serie-resolution', 'Points per plot', amdaDefaultConfigs.availableResolutions, function(name, value, oldValue) { me.object.set('serie-resolution', value); }), - this.addStandardCombo('serie-yaxis', 'Y axis', amdaPlotObj.PlotObjectConfig.availableYAxes, function(name, value, oldValue) { + this.addStandardCombo('serie-yaxis', 'Y axis', amdaDefaultConfigs.availableYAxes, function(name, value, oldValue) { me.object.set('serie-yaxis', value); me.crtTree.refresh(); }), diff --git a/js/app/views/PlotComponents/PlotColorAxisForm.js b/js/app/views/PlotComponents/PlotColorAxisForm.js index 6ae5457..0b23f65 100644 --- a/js/app/views/PlotComponents/PlotColorAxisForm.js +++ b/js/app/views/PlotComponents/PlotColorAxisForm.js @@ -16,9 +16,9 @@ Ext.define('amdaPlotComp.PlotColorAxisForm', { getFormItems: function() { var timeItems = [ - this.addStandardCombo('axis-color-map', 'Color Map', amdaPlotObj.PlotObjectConfig.availableColorMaps), - this.addColorsPicker('axis-color-minval', 'Min. Val. Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none'), - this.addColorsPicker('axis-color-maxval', 'Max. Val. Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none') + this.addStandardCombo('axis-color-map', 'Color Map', amdaDefaultConfigs.availableColorMaps), + this.addColorsPicker('axis-color-minval', 'Min. Val. Color', amdaDefaultConfigs.availableColorsNew, 'none'), + this.addColorsPicker('axis-color-maxval', 'Max. Val. Color', amdaDefaultConfigs.availableColorsNew, 'none') ]; return Ext.Array.merge(timeItems, this.callParent()); diff --git a/js/app/views/PlotComponents/PlotConstantForm.js b/js/app/views/PlotComponents/PlotConstantForm.js index e34969e..28a19b5 100644 --- a/js/app/views/PlotComponents/PlotConstantForm.js +++ b/js/app/views/PlotComponents/PlotConstantForm.js @@ -29,7 +29,7 @@ Ext.define('amdaPlotComp.PlotConstantForm', { getFormItems: function() { var me = this; return [ - this.addStandardCombo('constant-axis-id', 'Axis attachment', amdaPlotObj.PlotObjectConfig.availableConstantAxes, function (name, value, oldValue) { + this.addStandardCombo('constant-axis-id', 'Axis attachment', amdaDefaultConfigs.availableConstantAxes, function (name, value, oldValue) { if (me.object.get('constant-axis-id') != value) { me.updateOptions(value, me.crtTree.getSelectedPlotType()); diff --git a/js/app/views/PlotComponents/PlotFillForm.js b/js/app/views/PlotComponents/PlotFillForm.js index 4b41ad9..c190b2b 100644 --- a/js/app/views/PlotComponents/PlotFillForm.js +++ b/js/app/views/PlotComponents/PlotFillForm.js @@ -77,7 +77,7 @@ Ext.define('amdaPlotComp.PlotFillForm', { return [ - this.addStandardCombo('fill-type', 'Fill type', amdaPlotObj.PlotObjectConfig.availableFillTypes, function(name, value, oldValue) { + this.addStandardCombo('fill-type', 'Fill type', amdaDefaultConfigs.availableFillTypes, function(name, value, oldValue) { if (me.object.get('fill-type') != value) { me.updateOptions(); @@ -88,8 +88,8 @@ Ext.define('amdaPlotComp.PlotFillForm', { this.addStandardCombo('fill-firstserie-id', 'First serie Id', []), this.addStandardCombo('fill-secondserie-id', 'Second serie Id', []), this.addStandardCombo('fill-constant-id', 'Constant Id', []), - this.addColorsPicker('fill-greater-color', 'Greater Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none'), - this.addColorsPicker('fill-less-color', 'Less Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none') + this.addColorsPicker('fill-greater-color', 'Greater Color', amdaDefaultConfigs.availableColorsNew, 'none'), + this.addColorsPicker('fill-less-color', 'Less Color', amdaDefaultConfigs.availableColorsNew, 'none') ]; } }); diff --git a/js/app/views/PlotComponents/PlotHistogram2DSerieForm.js b/js/app/views/PlotComponents/PlotHistogram2DSerieForm.js index 184f69d..a0b9788 100644 --- a/js/app/views/PlotComponents/PlotHistogram2DSerieForm.js +++ b/js/app/views/PlotComponents/PlotHistogram2DSerieForm.js @@ -93,8 +93,8 @@ Ext.define('amdaPlotComp.PlotHistogram2DSerieForm', { me.crtTree.refresh(); }), me.getRangeForms(), - this.addStandardCombo('serie-resampling-mode', 'Reference parameter for resampling', amdaPlotObj.PlotObjectConfig.availableResamplingModes), - this.addStandardCombo('histo2d-function', 'Function to apply', amdaPlotObj.PlotObjectConfig.availableHistogram2DFunctions, function(name, value, oldValue) { + this.addStandardCombo('serie-resampling-mode', 'Reference parameter for resampling', amdaDefaultConfigs.availableResamplingModes), + this.addStandardCombo('histo2d-function', 'Function to apply', amdaDefaultConfigs.availableHistogram2DFunctions, function(name, value, oldValue) { me.object.set('histo2d-function', value); me.updateOptions(value); }), diff --git a/js/app/views/PlotComponents/PlotInstantSpectroForm.js b/js/app/views/PlotComponents/PlotInstantSpectroForm.js index 0e423f8..41c198b 100644 --- a/js/app/views/PlotComponents/PlotInstantSpectroForm.js +++ b/js/app/views/PlotComponents/PlotInstantSpectroForm.js @@ -18,7 +18,7 @@ Ext.define('amdaPlotComp.PlotInstantSpectroForm', { getFormItems: function() { return [ - this.addStandardCombo('ispectro-dimonxaxis', 'Dim. on X axis', amdaPlotObj.PlotObjectConfig.availableDimsOnXAxis) + this.addStandardCombo('ispectro-dimonxaxis', 'Dim. on X axis', amdaDefaultConfigs.availableDimsOnXAxis) ]; } }); \ No newline at end of file diff --git a/js/app/views/PlotComponents/PlotIntervalsForm.js b/js/app/views/PlotComponents/PlotIntervalsForm.js index 40129ad..f23f030 100644 --- a/js/app/views/PlotComponents/PlotIntervalsForm.js +++ b/js/app/views/PlotComponents/PlotIntervalsForm.js @@ -19,11 +19,11 @@ Ext.define('amdaPlotComp.PlotIntervalsForm', { getFormItems: function() { var legendItems = [ this.addStandardText('legend-text-value', 'Text'), - this.addStandardCombo('legend-text-position', 'Position', amdaPlotObj.PlotObjectConfig.availableLegendTextPositions), + this.addStandardCombo('legend-text-position', 'Position', amdaDefaultConfigs.availableLegendTextPositions), this.addStandardFont('legend-text-font')] return [ - this.addColorsPicker('intervals-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none'), + this.addColorsPicker('intervals-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'none'), this.addStandardFieldSet('Legend', 'legend-text-activated', legendItems) ]; } diff --git a/js/app/views/PlotComponents/PlotLayoutForm.js b/js/app/views/PlotComponents/PlotLayoutForm.js index 819a709..f2879ca 100644 --- a/js/app/views/PlotComponents/PlotLayoutForm.js +++ b/js/app/views/PlotComponents/PlotLayoutForm.js @@ -89,7 +89,7 @@ Ext.define('amdaPlotComp.PlotLayoutForm', { }); return [ - this.addStandardCombo('page-layout-type', 'Layout type', amdaPlotObj.PlotObjectConfig.availablePageLayouts, function(name, value, oldValue) { + this.addStandardCombo('page-layout-type', 'Layout type', amdaDefaultConfigs.availablePageLayouts, function(name, value, oldValue) { if (me.object.get('page-layout-type') != value) { me.updateLayoutOptions(); diff --git a/js/app/views/PlotComponents/PlotLegendSeriesForm.js b/js/app/views/PlotComponents/PlotLegendSeriesForm.js index 59211e6..15f2cbd 100644 --- a/js/app/views/PlotComponents/PlotLegendSeriesForm.js +++ b/js/app/views/PlotComponents/PlotLegendSeriesForm.js @@ -22,17 +22,17 @@ Ext.define('amdaPlotComp.PlotLegendSeriesForm', { getFormItems: function() { var borderItems = [ - this.addColorsPicker('legend-series-border-color', 'Border Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none') + this.addColorsPicker('legend-series-border-color', 'Border Color', amdaDefaultConfigs.availableColorsNew, 'none') ]; var intervalInfoItems = [ - this.addStandardCombo('legend-series-intervalinfo-type', 'Type', amdaPlotObj.PlotObjectConfig.availableLegendSeriesIntervalInfoTypes) + this.addStandardCombo('legend-series-intervalinfo-type', 'Type', amdaDefaultConfigs.availableLegendSeriesIntervalInfoTypes) ]; var legendItems = [ - this.addStandardCombo('legend-series-type', 'Type', amdaPlotObj.PlotObjectConfig.availableLegendSeriesTypes), - this.addStandardCombo('legend-series-position', 'Position', amdaPlotObj.PlotObjectConfig.availableLegendSeriesPositions), - this.addColorsPicker('legend-series-defaulttextcolor', 'Default Text Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), + this.addStandardCombo('legend-series-type', 'Type', amdaDefaultConfigs.availableLegendSeriesTypes), + this.addStandardCombo('legend-series-position', 'Position', amdaDefaultConfigs.availableLegendSeriesPositions), + this.addColorsPicker('legend-series-defaulttextcolor', 'Default Text Color', amdaDefaultConfigs.availableColorsNew), this.addStandardCheck('legend-series-showparaminfo', 'Show Param Info'), this.addStandardFieldSet('Show Interval Info', 'legend-series-intervalinfo-activated', intervalInfoItems), this.addStandardFieldSet('Border', 'legend-series-border-activated', borderItems), diff --git a/js/app/views/PlotComponents/PlotLegendTextForm.js b/js/app/views/PlotComponents/PlotLegendTextForm.js index 7c3cafa..ea4ca6e 100644 --- a/js/app/views/PlotComponents/PlotLegendTextForm.js +++ b/js/app/views/PlotComponents/PlotLegendTextForm.js @@ -22,8 +22,8 @@ Ext.define('amdaPlotComp.PlotLegendTextForm', { return [ this.addStandardText('legend-text-value', 'Text'), - this.addColorsPicker('legend-text-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), - this.addStandardCombo('legend-text-position', 'Position', amdaPlotObj.PlotObjectConfig.availableLegendTextPositions, function(name, value, oldValue) { + this.addColorsPicker('legend-text-color', 'Color', amdaDefaultConfigs.availableColorsNew), + this.addStandardCombo('legend-text-position', 'Position', amdaDefaultConfigs.availableLegendTextPositions, function(name, value, oldValue) { me.object.set('legend-text-position', value); me.crtTree.refresh(); }), diff --git a/js/app/views/PlotComponents/PlotOrbitSerieForm.js b/js/app/views/PlotComponents/PlotOrbitSerieForm.js index c022525..72c0f72 100644 --- a/js/app/views/PlotComponents/PlotOrbitSerieForm.js +++ b/js/app/views/PlotComponents/PlotOrbitSerieForm.js @@ -17,7 +17,7 @@ Ext.define('amdaPlotComp.PlotOrbitSerieForm', { var baseSerieItems = this.callParent(arguments); var orbitSerieItems = [ - this.addStandardCombo('serie-projection', 'Projection', amdaPlotObj.PlotObjectConfig.availableOrbitSerieProjections, function(name, value, oldValue) { + this.addStandardCombo('serie-projection', 'Projection', amdaDefaultConfigs.availableOrbitSerieProjections, function(name, value, oldValue) { me.object.set('serie-projection', value); me.crtTree.refresh(); }), diff --git a/js/app/views/PlotComponents/PlotOutputForm.js b/js/app/views/PlotComponents/PlotOutputForm.js index 9ca1191..c0d6002 100644 --- a/js/app/views/PlotComponents/PlotOutputForm.js +++ b/js/app/views/PlotComponents/PlotOutputForm.js @@ -41,7 +41,7 @@ Ext.define('amdaPlotComp.PlotOutputForm', { if(format == 'PNG') { - outputField.getStore().loadData(amdaPlotObj.PlotObjectConfig.availableFileOutputsForPng); + outputField.getStore().loadData(amdaDefaultConfigs.availableFileOutputsForPng); if(!output) { if(!outputValue) @@ -56,7 +56,7 @@ Ext.define('amdaPlotComp.PlotOutputForm', { } else { - outputField.getStore().loadData(amdaPlotObj.PlotObjectConfig.availableFileOutputsForOtherFormats); + outputField.getStore().loadData(amdaDefaultConfigs.availableFileOutputsForOtherFormats); if(!output) { if(outputValue =='INTERACTIVE' || !outputValue) @@ -75,14 +75,14 @@ Ext.define('amdaPlotComp.PlotOutputForm', { var me = this; return [ - this.addStandardCombo('file-format', 'File format', amdaPlotObj.PlotObjectConfig.availableFileFormats, function(name, value, oldValue) { + this.addStandardCombo('file-format', 'File format', amdaDefaultConfigs.availableFileFormats, function(name, value, oldValue) { if (me.object.get('file-format') != value) { me.updateOutputOption(value); me.updateOneFilePerIntOption(value); } }), - this.addStandardCombo('file-output', 'File output', amdaPlotObj.PlotObjectConfig.availableFileOutputs, function(name, value, oldValue) { + this.addStandardCombo('file-output', 'File output', amdaDefaultConfigs.availableFileOutputs, function(name, value, oldValue) { if (me.object.get('file-output') != value) me.updateFilePrefixOption(value); }), diff --git a/js/app/views/PlotComponents/PlotPageForm.js b/js/app/views/PlotComponents/PlotPageForm.js index ba6d3b5..132a597 100644 --- a/js/app/views/PlotComponents/PlotPageForm.js +++ b/js/app/views/PlotComponents/PlotPageForm.js @@ -14,9 +14,9 @@ Ext.define('amdaPlotComp.PlotPageForm', { getFormItems: function() { var titleItems = [ this.addStandardText('page-title-text', 'Text'), - this.addColorsPicker('page-title-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), - this.addStandardCombo('page-title-position', 'Position', amdaPlotObj.PlotObjectConfig.availableTitlePositions), - this.addStandardCombo('page-title-alignment', 'Alignment', amdaPlotObj.PlotObjectConfig.availableTitleAlignments), + this.addColorsPicker('page-title-color', 'Color', amdaDefaultConfigs.availableColorsNew), + this.addStandardCombo('page-title-position', 'Position', amdaDefaultConfigs.availableTitlePositions), + this.addStandardCombo('page-title-alignment', 'Alignment', amdaDefaultConfigs.availableTitleAlignments), this.addStandardFont('page-title-font') ]; @@ -27,12 +27,12 @@ Ext.define('amdaPlotComp.PlotPageForm', { var me = this; return [ - //this.addStandardCombo('page-mode', 'Mode', amdaPlotObj.PlotObjectConfig.availablePageModes), - this.addStandardCombo('page-orientation', 'Orientation', amdaPlotObj.PlotObjectConfig.availablePageOrientations, function(name, value, oldValue) { + //this.addStandardCombo('page-mode', 'Mode', amdaDefaultOptions['plot.page.mode'].store), + this.addStandardCombo('page-orientation', 'Orientation', amdaDefaultConfigs.availablePageOrientations, function(name, value, oldValue) { me.object.set('page-orientation', value); me.crtTree.refresh(); }), - this.addStandardCombo('page-dimension', 'Dimension', amdaPlotObj.PlotObjectConfig.availablePageDimensions, function(name, value, oldValue) { + this.addStandardCombo('page-dimension', 'Dimension', amdaDefaultConfigs.availablePageDimensions, function(name, value, oldValue) { me.object.set('page-dimension', value); me.crtTree.refresh(); }), diff --git a/js/app/views/PlotComponents/PlotPanelForm.js b/js/app/views/PlotComponents/PlotPanelForm.js index 5492f77..f0e599d 100644 --- a/js/app/views/PlotComponents/PlotPanelForm.js +++ b/js/app/views/PlotComponents/PlotPanelForm.js @@ -101,15 +101,15 @@ Ext.define('amdaPlotComp.PlotPanelForm', { var titleItems = [ this.addStandardText('panel-title-text', 'Text'), - this.addColorsPicker('panel-title-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), - this.addStandardCombo('panel-title-position', 'Position', amdaPlotObj.PlotObjectConfig.availableTitlePositions), - this.addStandardCombo('panel-title-alignment', 'Alignment', amdaPlotObj.PlotObjectConfig.availableTitleAlignments), + this.addColorsPicker('panel-title-color', 'Color', amdaDefaultConfigs.availableColorsNew), + this.addStandardCombo('panel-title-position', 'Position', amdaDefaultConfigs.availableTitlePositions), + this.addStandardCombo('panel-title-alignment', 'Alignment', amdaDefaultConfigs.availableTitleAlignments), this.addStandardFont('panel-title-font') ]; var statusItems = [ - this.addStandardCombo('panel-status-position', 'Position', amdaPlotObj.PlotObjectConfig.availableStatusBarPositions), - this.addStandardCombo('panel-status-colormap', 'Color Map', amdaPlotObj.PlotObjectConfig.availableStatusBarColorMaps) + this.addStandardCombo('panel-status-position', 'Position', amdaDefaultConfigs.availableStatusBarPositions), + this.addStandardCombo('panel-status-colormap', 'Color Map', amdaDefaultConfigs.availableStatusBarColorMaps) ]; var tickItems = [ @@ -120,7 +120,7 @@ Ext.define('amdaPlotComp.PlotPanelForm', { var me = this; return [ - this.addStandardCombo('panel-plot-type', 'Plot type', amdaPlotObj.PlotObjectConfig.availablePlotTypes, function(name, value, oldValue) { + this.addStandardCombo('panel-plot-type', 'Plot type', amdaDefaultConfigs.availablePlotTypes, function(name, value, oldValue) { if (value != me.object.get('panel-plot-type')) { me.object.changePlotType(value); @@ -146,8 +146,8 @@ Ext.define('amdaPlotComp.PlotPanelForm', { me.object.set('panel-instant-time', value); me.crtTree.refresh(); }), - this.addColorsPicker('panel-background-color', 'Background Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none'), - this.addColorsPicker('panel-plotareabackground-color', 'Plot Area Background Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none'), + this.addColorsPicker('panel-background-color', 'Background Color', amdaDefaultConfigs.availableColorsNew, 'none'), + this.addColorsPicker('panel-plotareabackground-color', 'Plot Area Background Color', amdaDefaultConfigs.availableColorsNew, 'none'), this.addStandardFieldSet('Manual Bounds', '', boundsItems), this.addStandardFieldSet('Manual Margins', '', marginItems), this.addStandardFieldSet('Preferred Dimensions', '', preferedDimItems), diff --git a/js/app/views/PlotComponents/PlotSerieForm.js b/js/app/views/PlotComponents/PlotSerieForm.js index 4d428c0..334fbf0 100644 --- a/js/app/views/PlotComponents/PlotSerieForm.js +++ b/js/app/views/PlotComponents/PlotSerieForm.js @@ -46,7 +46,7 @@ Ext.define('amdaPlotComp.PlotSerieForm', { var me = this; return [ - this.addStandardCombo('serie-errorbar-type', 'Type', amdaPlotObj.PlotObjectConfig.availableErrorBarTypes, function(name, value, oldValue) { + this.addStandardCombo('serie-errorbar-type', 'Type', amdaDefaultConfigs.availableErrorBarTypes, function(name, value, oldValue) { me.updateOptions(me.crtTree.getSelectedPlotType()); }), this.addStandardParamDropTarget('serie-errorbar-minparam', 'Min. Parameter'), @@ -74,7 +74,7 @@ Ext.define('amdaPlotComp.PlotSerieForm', { me.crtTree.refresh(); }), this.addStandardFieldSet('X Values range', '', this.getXValuesRangeItems()), - this.addStandardCombo('serie-resampling-mode', 'Reference parameter for resampling', amdaPlotObj.PlotObjectConfig.availableResamplingModes) + this.addStandardCombo('serie-resampling-mode', 'Reference parameter for resampling', amdaDefaultConfigs.availableResamplingModes) ]; Ext.each(baseSerieItems, function(item) { diff --git a/js/app/views/PlotComponents/PlotSpectroForm.js b/js/app/views/PlotComponents/PlotSpectroForm.js index 801e225..e1b3e04 100644 --- a/js/app/views/PlotComponents/PlotSpectroForm.js +++ b/js/app/views/PlotComponents/PlotSpectroForm.js @@ -29,7 +29,7 @@ Ext.define('amdaPlotComp.PlotSpectroForm', { }, getFilteringItems: function () { return [ - this.addStandardCombo('filtering-level', 'Level', amdaPlotObj.PlotObjectConfig.availableFilteringLevel) + this.addStandardCombo('filtering-level', 'Level', amdaDefaultConfigs.availableFilteringLevel) ]; }, @@ -267,10 +267,10 @@ Ext.define('amdaPlotComp.PlotSpectroForm', { }); return [ - this.addStandardCombo('spectro-resolution', 'Points per plot', amdaPlotObj.PlotObjectConfig.availableResolutions, function (name, value, oldValue) { + this.addStandardCombo('spectro-resolution', 'Points per plot', amdaDefaultConfigs.availableResolutions, function (name, value, oldValue) { ref.object.set('spectro-resolution', value); }), - this.addStandardCombo('spectro-yaxis', 'Y axis', amdaPlotObj.PlotObjectConfig.availableYAxes, function (name, value, oldValue) { + this.addStandardCombo('spectro-yaxis', 'Y axis', amdaDefaultConfigs.availableYAxes, function (name, value, oldValue) { ref.object.set('spectro-yaxis', value); ref.crtTree.refresh(); }), @@ -279,7 +279,7 @@ Ext.define('amdaPlotComp.PlotSpectroForm', { this.addStandardCheck('spectro-log0-as-min', 'Show 0 values as Min Values in log scale', function (name, value, oldValue) { ref.object.set('spectro-log0-as-min', value); }), - this.addStandardCombo('spectro-normalization', 'Normalization', amdaPlotObj.PlotObjectConfig.availableSpectroNormalization, function (name, value, oldValue) { + this.addStandardCombo('spectro-normalization', 'Normalization', amdaDefaultConfigs.availableSpectroNormalization, function (name, value, oldValue) { if (ref.object.get('spectro-normalization') != value) { ref.object.set('spectro-normalization', value); } diff --git a/js/app/views/PlotComponents/PlotStandardForm.js b/js/app/views/PlotComponents/PlotStandardForm.js index 8fe5037..f00fe22 100644 --- a/js/app/views/PlotComponents/PlotStandardForm.js +++ b/js/app/views/PlotComponents/PlotStandardForm.js @@ -237,7 +237,7 @@ Ext.define('amdaPlotComp.PlotStandardForm', { addStandardFont: function (namePrefix) { var fontItems = [ - this.addStandardCombo(namePrefix + '-name', 'Name', amdaPlotObj.PlotObjectConfig.availableFontNames), + this.addStandardCombo(namePrefix + '-name', 'Name', amdaDefaultConfigs.availableFontNames), { xtype: 'toolbar', bodyStyle: { background: '#dfe8f6' }, @@ -411,17 +411,17 @@ Ext.define('amdaPlotComp.PlotStandardForm', { addStandardLineItems: function (namePrefix) { return [ - this.addStandardCombo(namePrefix + '-style', 'Style', amdaPlotObj.PlotObjectConfig.availableLinesStyles), + this.addStandardCombo(namePrefix + '-style', 'Style', amdaDefaultConfigs.availableLinesStyles), this.addStandardFloat(namePrefix + '-width', 'Width', 1, 10), - this.addColorsPicker(namePrefix + '-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'auto') + this.addColorsPicker(namePrefix + '-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'auto') ]; }, addStandardSymbolsItems: function (namePrefix) { return [ - this.addStandardCombo(namePrefix + '-type', 'Type', amdaPlotObj.PlotObjectConfig.availableSymbolsTypes), + this.addStandardCombo(namePrefix + '-type', 'Type', amdaDefaultConfigs.availableSymbolsTypes), this.addStandardFloat(namePrefix + '-size', 'Size', 1, 10), - this.addColorsPicker(namePrefix + '-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'auto') + this.addColorsPicker(namePrefix + '-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'auto') ]; }, diff --git a/js/app/views/PlotComponents/PlotStatusBarForm.js b/js/app/views/PlotComponents/PlotStatusBarForm.js index 96922d8..83d1ba2 100644 --- a/js/app/views/PlotComponents/PlotStatusBarForm.js +++ b/js/app/views/PlotComponents/PlotStatusBarForm.js @@ -17,7 +17,7 @@ Ext.define('amdaPlotComp.PlotStatusBarForm', { }, getFormItems: function() { - return [this.addColorsPicker('statusbar-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew, 'none') + return [this.addColorsPicker('statusbar-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'none') ]; } }); \ No newline at end of file diff --git a/js/app/views/PlotComponents/PlotTextForm.js b/js/app/views/PlotComponents/PlotTextForm.js index b55705e..c9abae0 100644 --- a/js/app/views/PlotComponents/PlotTextForm.js +++ b/js/app/views/PlotComponents/PlotTextForm.js @@ -62,8 +62,8 @@ Ext.define('amdaPlotComp.PlotTextForm', { var me = this; return [ this.addStandardText('text-value', 'Text'), - this.addColorsPicker('text-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColorsNew), - this.addStandardCombo('text-align', 'Alignment', amdaPlotObj.PlotObjectConfig.availableTextAlignments), + this.addColorsPicker('text-color', 'Color', amdaDefaultConfigs.availableColorsNew), + this.addStandardCombo('text-align', 'Alignment', amdaDefaultConfigs.availableTextAlignments), this.addStandardCheck('text-x-relative', 'Relative X Position', function(name, value, oldValue) { me.updateOptions(me.crtTree.getSelectedPlotType()); }), @@ -72,7 +72,7 @@ Ext.define('amdaPlotComp.PlotTextForm', { this.addStandardCheck('text-y-relative', 'Relative Y Position', function(name, value, oldValue) { me.updateOptions(me.crtTree.getSelectedPlotType()); }), - this.addStandardCombo('text-y-axis', 'Y Axis attachment', amdaPlotObj.PlotObjectConfig.availableYAxes), + this.addStandardCombo('text-y-axis', 'Y Axis attachment', amdaDefaultConfigs.availableYAxes), this.addStandardFloat('text-y-value', 'Y Position', 0, 1), this.addStandardFloat('text-angle', 'Rotation Angle', 0, 360), this.addStandardFont('text-font') diff --git a/js/app/views/PlotComponents/PlotTimeAxisForm.js b/js/app/views/PlotComponents/PlotTimeAxisForm.js index dabf02d..79e4525 100644 --- a/js/app/views/PlotComponents/PlotTimeAxisForm.js +++ b/js/app/views/PlotComponents/PlotTimeAxisForm.js @@ -17,7 +17,7 @@ Ext.define('amdaPlotComp.PlotTimeAxisForm', { getFormItems: function() { var timeItems = [ - this.addStandardCombo('axis-time-format', 'Time Format', amdaPlotObj.PlotObjectConfig.availableTimeAxisFormats) + this.addStandardCombo('axis-time-format', 'Time Format', amdaDefaultConfigs.availableTimeAxisFormats) ]; return Ext.Array.merge(timeItems, this.callParent()); diff --git a/php/classes/AmdaAction.php b/php/classes/AmdaAction.php index d6bfb76..a40184e 100644 --- a/php/classes/AmdaAction.php +++ b/php/classes/AmdaAction.php @@ -1697,9 +1697,8 @@ class AmdaAction public function getNodeValues($data,&$transformed){ $iconCls = "task-folder"; - $expanded = true; foreach ($data as $parameter => $value) { - if(is_array($value)){ + if(is_array($value) && !$value['modified']){ $child = [ "parameter" => $parameter, "value" => "", @@ -1707,23 +1706,49 @@ class AmdaAction "expanded" => false, "children" => [] ]; + $this->getNodeValues($value,$child['children']); $transformed[] = $child; } + else if (is_array($value) && $value['modified']){ + $child =[ + "parameter" => $parameter, + "value" => $value["value"], + "iconCls" => "task", + "leaf" => true, + "modified" => $value["modified"], + "default" => $value["defaultValue"] + ]; + $transformed[] = $child; + } else{ $child =[ "parameter" => $parameter, "value" => $value, "iconCls" => "task", - "leaf" => true + "leaf" => true, + "modified" => false, + "default" =>$value ]; - $transformed[] = $child; } } } + public function getDefaultValueConfigs(){ + if (file_exists(DATAPATH.'defaultValuesConfig.json')) + return json_decode(file_get_contents(DATAPATH.'defaultValuesConfig.json'), true); + else + return array(); + } + + public function getDefaultValueLinks(){ + if (file_exists(DATAPATH.'defaultValuesLinks.json')) + return json_decode(file_get_contents(DATAPATH.'defaultValuesLinks.json'), true); + else + return array(); + } - public function getDefaultValueTree(){ + public function getDefaultValueTree($isTree=TRUE){ $childrenToReturn = array(); $children = []; if (file_exists(DATAPATH.'defaultValues.json')) { @@ -1732,11 +1757,37 @@ class AmdaAction $childrenToReturn = array(); } else { - $this->getNodeValues($json_o,$children); - $childrenToReturn = [ - "text" => ".", - "children" => $children - ]; + if (file_exists(USERDIR.'userDefaults.json')) { + $json_user = json_decode(file_get_contents(USERDIR.'userDefaults.json'), true); + foreach($json_user as $key => $value){ + $keys = explode(".", $key); + $results = &$json_o; // Use a reference to update the original array + foreach($keys as $parameter){ + $results = &$results[$parameter]; + } + $results = array("value" => $value, "modified" => true, "defaultValue" => $results); + + // if(is_string($value) || is_numeric($value)) + // $results = "*".$value; + // if(is_bool($value)){ + // $results = $value ? "true":"false"; + // $results = "*".$results; + // } + } + } + + if($isTree){ + + $this->getNodeValues($json_o,$children); + + $childrenToReturn = [ + "text" => ".", + "children" => $children + ]; + } + else { + $childrenToReturn = $json_o; + } } } else { diff --git a/php/config.php b/php/config.php index 86736f5..fd4d30d 100644 --- a/php/config.php +++ b/php/config.php @@ -207,7 +207,9 @@ $API = array( 'getCatColumnInfo' => array('len' => 1), 'editColumn' => array('len' => 5), // Default Values options - 'getDefaultValueTree' => array('len'=>0) + 'getDefaultValueLinks' => array('len' => 0), + 'getDefaultValueTree' => array('len'=>1), + 'getDefaultValueConfigs' => array('len' => 0) ) ) ); -- libgit2 0.21.2