[apps/calculation] additional_outputs: TrigonometryListController set

the right angle model to the view
This commit is contained in:
Émilie Feral
2020-01-07 11:27:51 +01:00
committed by Léa Saviot
parent 6f3bf2f570
commit bd7d5f14dd

View File

@@ -7,13 +7,16 @@ namespace Calculation {
void TrigonometryListController::setExpression(Poincare::Expression e) {
IllustratedListController::setExpression(e.childAtIndex(0));
//TODO
//m_model.setAngle(std::complex<float>(1.2f,2.3f));
// Fill calculation store
Poincare::Context * context = App::app()->localContext();
m_calculationStore.push("sin(θ)", context);
m_calculationStore.push("cos(θ)", context);
m_calculationStore.push("θ", context);
// Set trigonometry illustration
float angle = Shared::PoincareHelpers::ApproximateToScalar<float>(m_calculationStore.calculationAtIndex(0)->approximateOutput(context), context);
m_model.setAngle(angle);
}
}