functions
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
package org.solovyev.android.calculator;
|
||||
|
||||
import jscl.CustomFunctionCalculationException;
|
||||
import jscl.math.function.CustomFunction;
|
||||
import jscl.math.function.Function;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -52,7 +53,7 @@ public class CalculatorFunctionsMathRegistry extends AbstractCalculatorMathRegis
|
||||
public static void saveFunction(@NotNull CalculatorMathRegistry<Function> registry,
|
||||
@NotNull MathEntityBuilder<? extends Function> builder,
|
||||
@Nullable Function editedInstance,
|
||||
@NotNull Object source, boolean save) {
|
||||
@NotNull Object source, boolean save) throws CustomFunctionCalculationException {
|
||||
final Function addedFunction = registry.add(builder);
|
||||
|
||||
if (save) {
|
||||
|
@@ -411,6 +411,21 @@ public class CalculatorImpl implements Calculator, CalculatorEventListener {
|
||||
onDisplayStateChanged((CalculatorDisplayChangeEventData) data);
|
||||
break;
|
||||
|
||||
case constant_changed:
|
||||
final IConstant newConstant = ((Change<IConstant>)data) .getNewValue();
|
||||
if (!newConstant.getName().equals(CalculatorVarsRegistry.ANS)) {
|
||||
evaluate();
|
||||
}
|
||||
break;
|
||||
|
||||
case constant_added:
|
||||
case constant_removed:
|
||||
case function_added:
|
||||
case function_changed:
|
||||
case function_removed:
|
||||
evaluate();
|
||||
break;
|
||||
|
||||
case engine_preferences_changed:
|
||||
evaluate(calculatorEventData.getSequenceId());
|
||||
break;
|
||||
|
@@ -84,9 +84,6 @@ public enum FunctionCategory {
|
||||
}
|
||||
});
|
||||
|
||||
// todo serso: current solution (as creating functions is not implemented yet)
|
||||
result.remove(my);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user