mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[solver] Prevent adding an expression which is not an equation by
displaying a pop-up (if the input is too long, the automatically added "=0" will fail)
This commit is contained in:
committed by
LeaNumworks
parent
b7ec225088
commit
34198945f2
@@ -4,6 +4,7 @@ AddEquation = "Gleichung hinzuzufügen"
|
||||
ResolveEquation = "Lösen der Gleichung"
|
||||
ResolveSystem = "Lösen des Gleichungssystems"
|
||||
UseEquationModel = "Verwenden Sie einen Gleichungsmodell"
|
||||
RequireEquation = "Die Eingabe muss eine Gleichung sein"
|
||||
UndefinedEquation = "Undefinierte Gleichung"
|
||||
TooManyVariables = "Es gibt zu viele Unbekannte"
|
||||
NonLinearSystem = "Das System ist nicht linear"
|
||||
|
||||
@@ -4,6 +4,7 @@ AddEquation = "Add equation"
|
||||
ResolveEquation = "Solve the equation"
|
||||
ResolveSystem = "Solve the system"
|
||||
UseEquationModel = "Use an equation template"
|
||||
RequireEquation = "The input must be an equation"
|
||||
UndefinedEquation = "Undefined equation"
|
||||
TooManyVariables = "There are too many unknowns"
|
||||
NonLinearSystem = "The system is not linear"
|
||||
|
||||
@@ -4,6 +4,7 @@ AddEquation = "Agregar una ecuación"
|
||||
ResolveEquation = "Resolver la ecuación"
|
||||
ResolveSystem = "Resolver el sistema"
|
||||
UseEquationModel = "Usar un modelo de ecuación"
|
||||
RequireEquation = "La entrada debe ser una ecuación"
|
||||
UndefinedEquation = "Ecuación indefinida"
|
||||
TooManyVariables = "Hay demasiadas incógnitas"
|
||||
NonLinearSystem = "El sistema no es lineal"
|
||||
|
||||
@@ -4,6 +4,7 @@ AddEquation = "Ajouter une équation"
|
||||
ResolveEquation = "Résoudre l'équation"
|
||||
ResolveSystem = "Résoudre le système"
|
||||
UseEquationModel = "Utiliser un modèle d'équation"
|
||||
RequireEquation = "L'entrée doit être une équation"
|
||||
UndefinedEquation = "Une equation est indéfinie"
|
||||
TooManyVariables = "Le nombre d'inconnues est trop grand"
|
||||
NonLinearSystem = "Le système n'est pas linéaire"
|
||||
|
||||
@@ -4,6 +4,7 @@ AddEquation = "Adicione uma equação"
|
||||
ResolveEquation = "Resolver a equação"
|
||||
ResolveSystem = "Resolver o sistema"
|
||||
UseEquationModel = "Usar um modelo de equação"
|
||||
RequireEquation = "A entrada deve ser uma equação"
|
||||
UndefinedEquation = "Equação indefinida"
|
||||
TooManyVariables = "Existem muitas incógnitas"
|
||||
NonLinearSystem = "O sistema não é linear"
|
||||
|
||||
@@ -117,6 +117,10 @@ bool ListController::textFieldDidReceiveEvent(TextField * textField, Ion::Events
|
||||
if (!textRepresentsAnEquality(textField->text())) {
|
||||
textField->handleEvent(Ion::Events::ShiftRight);
|
||||
textField->handleEventWithText("=0");
|
||||
if (!textRepresentsAnEquality(textField->text())) {
|
||||
app()->displayWarning(I18n::Message::RequireEquation);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Shared::TextFieldDelegate::textFieldDidReceiveEvent(textField, event)) {
|
||||
@@ -132,6 +136,11 @@ bool ListController::expressionLayoutFieldDidReceiveEvent(ExpressionLayoutField
|
||||
if (!textRepresentsAnEquality(buffer)) {
|
||||
expressionLayoutField->handleEvent(Ion::Events::ShiftRight);
|
||||
expressionLayoutField->handleEventWithText("=0");
|
||||
expressionLayoutField->writeTextInBuffer(buffer, TextField::maxBufferSize());
|
||||
if (!textRepresentsAnEquality(buffer)) {
|
||||
app()->displayWarning(I18n::Message::RequireEquation);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Shared::ExpressionLayoutFieldDelegate::expressionLayoutFieldDidReceiveEvent(expressionLayoutField, event)) {
|
||||
|
||||
Reference in New Issue
Block a user