|
| 1 | +pragma Singleton |
| 2 | + |
| 3 | +import QtQuick |
| 4 | + |
| 5 | +QtObject { |
| 6 | + readonly property var minimizersAvailable: ['minimizer_1', 'minimizer_2', 'minimizer_3'] |
| 7 | + readonly property int minimizerCurrentIndex: 0 |
| 8 | + |
| 9 | + readonly property var calculatorsAvailable: ['calculator_1', 'calculator_2', 'calculator_3'] |
| 10 | + readonly property int calculatorCurrentIndex: 1 |
| 11 | + |
| 12 | + readonly property var experimentsAvailable: ['experiment_1', 'experiment_2', 'experiment_3'] |
| 13 | + readonly property int experimentCurrentIndex: 2 |
| 14 | + |
| 15 | + // Minimizer |
| 16 | + readonly property double minimizerTolerance: 1.0 |
| 17 | + readonly property int minimizerMaxIterations: 2 |
| 18 | + |
| 19 | + // Fitting |
| 20 | + readonly property string fittingStatus: ''//undefined //'Success' |
| 21 | + readonly property bool isFitFinished: true |
| 22 | + readonly property bool fittingRunning: false |
| 23 | + |
| 24 | + // Parameters |
| 25 | + property int currentParameterIndex: 0 |
| 26 | + readonly property int modelParametersCount: 10 |
| 27 | + readonly property int experimentParametersCount: 20 |
| 28 | + readonly property int freeParametersCount: 100 |
| 29 | + readonly property int fixedParametersCount: 200 |
| 30 | + readonly property var fitableParameters: [ |
| 31 | + { |
| 32 | + 'name': 'name 1', |
| 33 | + 'value': 1.0, |
| 34 | + 'error': -1.23456, |
| 35 | + 'max': 100.0, |
| 36 | + 'min': -100.0, |
| 37 | + 'units': 'u1', |
| 38 | + 'fit': true, |
| 39 | + 'from': -10.0, |
| 40 | + 'to': 10.0, |
| 41 | + }, |
| 42 | + { |
| 43 | + 'name': 'name 2', |
| 44 | + 'value': 2.0, |
| 45 | + 'error': -2.34567, |
| 46 | + 'max': 200.0, |
| 47 | + 'min': -200.0, |
| 48 | + 'units': 'u2', |
| 49 | + 'fit': false, |
| 50 | + 'from': -20.0, |
| 51 | + 'to': 20.0, |
| 52 | + }, |
| 53 | + { |
| 54 | + 'name': 'name 3', |
| 55 | + 'value': 3.0, |
| 56 | + 'error': -3.45678, |
| 57 | + 'max': 300.0, |
| 58 | + 'min': -300.0, |
| 59 | + 'units': 'u3', |
| 60 | + 'fit': true, |
| 61 | + 'from': -30.0, |
| 62 | + 'to': 30.0, |
| 63 | + }, |
| 64 | + ] |
| 65 | + function setCurrentParameterMin(value) { |
| 66 | + console.debug(`setCurrentParameterMin ${value}`) |
| 67 | + } |
| 68 | + function setCurrentParameterMax(value) { |
| 69 | + console.debug(`setCurrentParameterMax ${value}`) |
| 70 | + } |
| 71 | + function setCurrentParameterValue(value) { |
| 72 | + console.debug(`setCurrentParameterValue ${value}`) |
| 73 | + } |
| 74 | + function setCurrentParameterFit(value) { |
| 75 | + console.debug(`setCurrentParameterFit ${value}`) |
| 76 | + } |
| 77 | + |
| 78 | + // Setters |
| 79 | + function setCurrentParameterIndex(value) { |
| 80 | + currentParameterIndex = value |
| 81 | + console.debug(`setCurrentParameterIndex ${value}`) |
| 82 | + } |
| 83 | + function setCalculatorCurrentIndex(value) { |
| 84 | + console.debug(`setCalculatorCurrentIndex ${value}`) |
| 85 | + } |
| 86 | + function setExperimentCurrentIndex(value) { |
| 87 | + console.debug(`setExperimentCurrentIndex ${value}`) |
| 88 | + } |
| 89 | + function setMinimizerCurrentIndex(value) { |
| 90 | + console.debug(`setMinimizer ${value}`) |
| 91 | + } |
| 92 | + function setMinimizerTolerance(value) { |
| 93 | + console.debug(`setMinimizerTolerance ${value}`) |
| 94 | + } |
| 95 | + function setMinimizerMaxIterations(value) { |
| 96 | + console.debug(`setMinimizerMaxIterations ${value}`) |
| 97 | + } |
| 98 | + |
| 99 | + //Actions |
| 100 | + function fittingStartStop() { |
| 101 | + console.debug('fittingStartStop') |
| 102 | + } |
| 103 | +} |
0 commit comments