Commit 3c76ec10 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

use dtkCoreParameters alias + update test (wip)

parent 233086de
......@@ -38,7 +38,7 @@ public:
QJsonArray menu;
public:
QHash<QString, dtkCoreParameter *> parameters;
dtkCoreParameters parameters;
};
// ///////////////////////////////////////////////////////////////////
......@@ -146,7 +146,7 @@ void dtkWidgetsParameterMenuBarGenerator::populate(dtkWidgetsMenuBar *menubar)
}
}
QHash<QString, dtkCoreParameter *> dtkWidgetsParameterMenuBarGenerator::parameters(void) const
dtkCoreParameters dtkWidgetsParameterMenuBarGenerator::parameters(void) const
{
return d->parameters;
}
......
......@@ -16,11 +16,12 @@
#include <dtkWidgetsExport>
#include <dtkCore/dtkCoreParameters>
#include <QtCore>
class dtkWidgetsMenuBar;
class dtkCoreParameter;
class dtkWidgetsParameter;
// ///////////////////////////////////////////////////////////////////
// dtkWidgetsParameterMenuBarGenerator declaration
......@@ -36,7 +37,7 @@ public:
void populate(dtkWidgetsMenuBar *menubar);
public:
QHash<QString, dtkCoreParameter *> parameters(void) const;
dtkCoreParameters parameters(void) const;
protected:
class dtkWidgetsParameterMenuBarGeneratorPrivate *d;
......
......@@ -69,11 +69,14 @@ void dtkWidgetsParameterMenuBarGeneratorTestCase::init(void)
void dtkWidgetsParameterMenuBarGeneratorTestCase::testBasic(void)
{
QString nature_file_path = QFINDTESTDATA("../resources/parameters_nature.json");
QString definition_file_path = QFINDTESTDATA("../resources/parameters_definition.json");
QString nature_file_path = QFINDTESTDATA("../resources/new_menu.json");
QString definition_file_path = QFINDTESTDATA("../resources/new_definition.json");
dtkWidgetsParameterMenuBarGenerator menu_bar_generator(nature_file_path, definition_file_path);
dtkCoreParameters params = menu_bar_generator.parameters();
QCOMPARE(params.count() , 79);
}
void dtkWidgetsParameterMenuBarGeneratorTestCase::cleanup(void)
......
{
"contents": {
"vbb_1": {
"label": "Browse Video",
"doc": "Load the video used as input in the simulation.",
"filters": [
"mp4 (*.mp4)"
],
"type": "dtk::d_path"
},
"gbb_1": {
"label": "Browse Graph",
"doc": "Load the graph to be used in the simulation.",
"filters": [
"macular (*.mac)"
],
"type": "dtk::d_path"
},
"run": {
"label": "Run Simulation",
"doc": "Run the simulation. After setting the graph",
"value": "false",
"type": "dtk::d_bool"
},
"reset": {
"label": "Reset Simulation",
"doc": "Reset the simulation.",
"value": "false",
"type": "dtk::d_bool"
},
"model": {
"label": "Model",
"doc": "Choose the model.",
"value": "Virtual Retina",
"values": [
"Virtual Retina",
"Prosthesis"
],
"type": "dtk::d_inliststring"
},
"framerate": {
"label": "Frame Rate",
"doc": "Controls how fast the visualization should be updated.",
"value": "10",
"min": "1",
"max": "60",
"type": "dtk::d_int"
},
"dt": {
"label": "Integration timestep",
"doc": "Controls the integration step of the ODE solver (ms).",
"value": "0.005",
"min": "0.",
"decimals": "6",
"type": "dtk::d_real"
},
"timestep": {
"label": "Temporal timestep",
"doc": "Controls the temporal step of Virtual Retina.",
"value": "1",
"min": "0",
"max": "1000"
},
"save_restore": {
"label": "Save/Restore parameters",
"doc": "Stores the parameters of the cells so they are restored when the application is opened again",
"value": "false",
"type": "dtk::d_bool"
},
"save_frequency": {
"label": "Save frequency",
"doc": "save frequency as a multiple of dt (0 = no save)",
"value": "0",
"min": 0,
"max": 10000,
"type": "dtk::d_int"
},
"vrOn/temporal_step": {
"label": "temporal step",
"doc": "temporal step for vrOn",
"value": 0.005,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/input_luminosity_range": {
"label": "input luminosity range",
"doc": "input luminosity range for vrOn",
"value": 255.0,
"min": 0.0,
"max": 1000.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/pixels_per_degree": {
"label": "pixels per degree",
"doc": "pixels per degree for vrOn",
"value": 2.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/sigmaCenter": {
"label": "sigma Center",
"doc": "sigma Center for vrOn",
"value": 0.4,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/tauCenter": {
"label": "tau Center",
"doc": "tau Center for vrOn",
"value": 0.01,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/nCenter": {
"label": "n Center",
"doc": "n Center for vrOn",
"value": 0.0,
"min": -1.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/sigmaSurround": {
"label": "sigma Surround",
"doc": "sigma Surround for vrOn",
"value": 1.2,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/tauSurround": {
"label": "tau Surround",
"doc": "tau Surround for vrOn",
"value": 0.01,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/wSurround": {
"label": "w Surround",
"doc": "w Surround for vrOn",
"value": 1.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/leakyHeatEq": {
"label": "leaky Heat Eq",
"doc": "leaky Heat Eq for vrOn",
"value": 0.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/relative_ampOPL": {
"label": "relative ampOPL",
"doc": "relative ampOPL for vrOn",
"value": 1.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/FGC_ampFeedback": {
"label": "FGC ampFeedback",
"doc": " for vrOn",
"value": 100.0,
"min": 0.0,
"max": 1000.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/FGC_ampInputCurrent": {
"label": "FGC ampInputCurrent",
"doc": "FGC ampInputCurrent for vrOn",
"value": 150.0,
"min": 0.0,
"max": 1000.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/FGC_gLeak": {
"label": "FGC gLeak",
"doc": "FGC gLeak for vrOn",
"value": 5.0,
"min": 0.0,
"max": 100.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/FGC_sigmaSurround": {
"label": "FGC sigmaSurround",
"doc": "FGC sigmaSurround for vrOn",
"value": 2.5,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOn/FGC_tauSurround": {
"label": "FGC tauSurround",
"doc": "FGC tauSurround for vrOn",
"value": 0.01,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/temporal_step": {
"label": "temporal step",
"doc": "temporal step for vrOff",
"value": 0.005,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/input_luminosity_range": {
"label": "input luminosity range",
"doc": "input luminosity range for vrOff",
"value": 255.0,
"min": 0.0,
"max": 1000.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/pixels_per_degree": {
"label": "pixels per degree",
"doc": "pixels per degree for vrOff",
"value": 2.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/sigmaCenter": {
"label": "sigma Center",
"doc": "sigma Center for vrOff",
"value": 0.4,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/tauCenter": {
"label": "tau Center",
"doc": "tau Center for vrOff",
"value": 0.01,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/nCenter": {
"label": "n Center",
"doc": "n Center for vrOff",
"value": 0.0,
"min": -1.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/sigmaSurround": {
"label": "sigma Surround",
"doc": "sigma Surround for vrOff",
"value": 1.2,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/tauSurround": {
"label": "tau Surround",
"doc": "tau Surround for vrOff",
"value": 0.01,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/wSurround": {
"label": "w Surround",
"doc": "w Surround for vrOff",
"value": 1.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/leakyHeatEq": {
"label": "leaky Heat Eq",
"doc": "leaky Heat Eq for vrOff",
"value": 0.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/relative_ampOPL": {
"label": "relative ampOPL",
"doc": "relative ampOPL for vrOff",
"value": 1.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/FGC_ampFeedback": {
"label": "FGC ampFeedback",
"doc": " for vrOff",
"value": 100.0,
"min": 0.0,
"max": 1000.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/FGC_ampInputCurrent": {
"label": "FGC ampInputCurrent",
"doc": "FGC ampInputCurrent for vrOff",
"value": 150.0,
"min": 0.0,
"max": 1000.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/FGC_gLeak": {
"label": "FGC gLeak",
"doc": "FGC gLeak for vrOff",
"value": 5.0,
"min": 0.0,
"max": 100.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/FGC_sigmaSurround": {
"label": "FGC sigmaSurround",
"doc": "FGC sigmaSurround for vrOff",
"value": 2.5,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vrOff/FGC_tauSurround": {
"label": "FGC tauSurround",
"doc": "FGC tauSurround for vrOff",
"value": 0.01,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/temporal_step": {
"label": "temporal step",
"doc": "temporal step for vRodOn",
"value": 0.005,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/input_luminosity_range": {
"label": "input luminosity range",
"doc": "input luminosity range for vRodOn",
"value": 255.0,
"min": 0.0,
"max": 1000.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/pixels_per_degree": {
"label": "pixels per degree",
"doc": "pixels per degree for vRodOn",
"value": 2.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/sigmaCenter": {
"label": "sigma Center",
"doc": "sigma Center for vRodOn",
"value": 0.4,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/tauCenter": {
"label": "tau Center",
"doc": "tau Center for vRodOn",
"value": 0.01,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/nCenter": {
"label": "n Center",
"doc": "n Center for vRodOn",
"value": 0.0,
"min": -1.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/sigmaSurround": {
"label": "sigma Surround",
"doc": "sigma Surround for vRodOn",
"value": 1.2,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/tauSurround": {
"label": "tau Surround",
"doc": "tau Surround for vRodOn",
"value": 0.01,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/wSurround": {
"label": "w Surround",
"doc": "w Surround for vRodOn",
"value": 1.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/leakyHeatEq": {
"label": "leaky Heat Eq",
"doc": "leaky Heat Eq for vRodOn",
"value": 0.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/relative_ampOPL": {
"label": "relative ampOPL",
"doc": "relative ampOPL for vRodOn",
"value": 1.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/FGC_ampFeedback": {
"label": "FGC ampFeedback",
"doc": " for vRodOn",
"value": 100.0,
"min": 0.0,
"max": 1000.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/FGC_ampInputCurrent": {
"label": "FGC ampInputCurrent",
"doc": "FGC ampInputCurrent for vRodOn",
"value": 150.0,
"min": 0.0,
"max": 1000.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/FGC_gLeak": {
"label": "FGC gLeak",
"doc": "FGC gLeak for vRodOn",
"value": 5.0,
"min": 0.0,
"max": 100.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/FGC_sigmaSurround": {
"label": "FGC sigmaSurround",
"doc": "FGC sigmaSurround for vRodOn",
"value": 2.5,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vRodOn/FGC_tauSurround": {
"label": "FGC tauSurround",
"doc": "FGC tauSurround for vRodOn",
"value": 0.01,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"electrode_number": {
"label": "Number of electrodes per side",
"doc": "Number of electrodes per side is equal to the square root of the total number of electrodes.",
"value": 1,
"min": 1,
"max": 1000,
"type": "dtk::d_int"
},
"electrode_size": {
"label": "Size of electrodes",
"doc": "Size of electrodes in um.",
"value": 30,
"min": 1,
"max": 1000,
"type": "dtk::d_int"
},
"electrode_spacing": {
"label": "Spacing between centres of electrodes",
"doc": "Spacing between the centres of electrodes centres in um, positive or zero.",
"value": 35,
"min": 1,
"max": 1000,
"type": "dtk::d_int"
},
"activation_levels": {
"label": "Activation levels of electrodes",
"doc": "Activation levels of electrodes, between 0 and 1.",
"value": 1.0,
"min": 0.0,
"max": 1.0,
"decimals": 6,
"type": "dtk::d_real"
},
"vert_matrix_size": {
"label": "Vertical size of the retinal plane",
"doc": "Vertical size of the retinal plane",
"value": 400,
"min": 100,
"max": 2000,
"type": "dtk::d_int"
},
"hori_matrix_size": {
"label": "Horizontal size of the retinal plane",
"doc": "Horizontal size of the retinal plane",
"value": 400,
"min": 100,
"max": 2000,
"type": "dtk::d_int"
},
"vert_optic_disc": {
"label": "Vertical position of the optic disc",
"doc": "Vertical position of the optic nerve head.",
"value": 200,
"min": 0,
"max": 2000,
"type": "dtk::d_int"
},
"hori_optic_disc": {
"label": "Horizontal position of the optic disc",
"doc": "Horizontal position of the optic nerve head.",
"value": 200,
"min": 0,
"max": 2000,
"type": "dtk::d_int"
},
"vert_electrode": {
"label": "Vertical position of the optic disc",
"doc": "Activation levels of electrodes, between 0 and 1.",
"value": 200,
"min": 0,
"max": 2000,
"type": "dtk::d_int"
},
"hori_electrode": {
"label": "Horizontal position of the optic disc",
"doc": "Activation levels of electrodes, between 0 and 1.",
"value": 275,
"min": 0,
"max": 2000,
"type": "dtk::d_int"
},
"sigmoid_baseline": {
"label": "Sigmoid baseline",
"doc": "Baseline of the sigmoid.",
"value": 0.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"sigmoid_amplitude": {
"label": "Sigmoid amplitude",
"doc": "Amplitude of the sigmoid.",
"value": 1.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"isotropic_spread_deviation": {
"label": "Isotropic spread",
"doc": "Isotropic spread, represents the current diffusion from the direct activation.",
"value": 1.0,
"min": 0.0,
"max": 10.0,
"decimals": 6,
"type": "dtk::d_real"
},
"anisotropic_spread_deviation": {
"label": "Anisotropic spread",
"doc": "Anisotropic spread, represents the current diffusion in relation to the axons en passant activation.",
"value": 1,
"min": 0,
"max": 10,
"decimals": 6,
"type": "dtk::d_real"
},
"ep_ratio": {
"label": "Axons en passant ratio",
"doc": "Contribution of the activation of the axons en passant.",
"value": 0.5,
"min": 0.0,
"max": 1.0,
"decimals": 6,
"type": "dtk::d_real"
},
"retinal_smoothing_criteria": {
"label": "Retinal smoothing",
"doc": "Smoothing criteria applied to the retinal activation profile.",
"value": 10,
"min": 0,
"max": 50,
"type": "dtk::d_int"
},
"cortical_smoothing_criteria": {
"label": "Cortical smoothing",
"doc": "Smoothing criteria applied to the cortical activation profile.",
"value": 10,
"min": 0,
"max": 50,
"type": "dtk::d_int"
},
"v_magnification_rat_1": {
"label": "Vertical magnification rat 1",
"doc": "First parameter of the vertical magnification (retino-cortical transform of the rat)).",