mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared] Templatize FloatParameterController to handle float/double
parameters. Fix bug: when entering "e^234" as a parameter of a model keeping floats, the FloatParameterController would accept the number (because e^234 is defined in double) and store an undefined value in the model (because e^234 is undefined in float).
This commit is contained in:
@@ -137,11 +137,11 @@ int ParametersController::reusableParameterCellCount(int type) {
|
||||
return m_distribution->numberOfParameter();
|
||||
}
|
||||
|
||||
double ParametersController::parameterAtIndex(int index) {
|
||||
float ParametersController::parameterAtIndex(int index) {
|
||||
return m_distribution->parameterValueAtIndex(index);
|
||||
}
|
||||
|
||||
bool ParametersController::setParameterAtIndex(int parameterIndex, double f) {
|
||||
bool ParametersController::setParameterAtIndex(int parameterIndex, float f) {
|
||||
if (!m_distribution->authorizedValueAtIndex(f, parameterIndex)) {
|
||||
Container::activeApp()->displayWarning(I18n::Message::ForbiddenValue);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user