Update Calc Engine for new functions needed for keyboard refresh (#662)

* Update Calc Engine to Support New Functionality

* Address PR comments

* Address PR comments
This commit is contained in:
Pepe Rivera
2019-09-30 14:04:20 -07:00
committed by GitHub
parent d9bf57ff99
commit 9cb0932eaa
22 changed files with 849 additions and 176 deletions

View File

@@ -75,6 +75,11 @@ namespace CalculationManager
m_displayCallback->MemoryItemChanged(indexOfMemory);
}
void CalculatorManager::InputChanged()
{
m_displayCallback->InputChanged();
}
/// <summary>
/// Call the callback function using passed in IDisplayHelper.
/// Used to set the expression display value on ViewModel
@@ -240,6 +245,7 @@ namespace CalculationManager
m_savedCommands.push_back(MapCommandForSerialize(command));
}
m_savedDegreeMode = m_currentDegreeMode;
InputChanged();
return;
}
@@ -283,6 +289,30 @@ namespace CalculationManager
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandTANH));
break;
case Command::CommandASEC:
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandSEC));
break;
case Command::CommandACSC:
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandCSC));
break;
case Command::CommandACOT:
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandCOT));
break;
case Command::CommandASECH:
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandSECH));
break;
case Command::CommandACSCH:
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandCSCH));
break;
case Command::CommandACOTH:
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandINV));
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(Command::CommandCOTH));
break;
case Command::CommandFE:
m_isExponentialFormat = !m_isExponentialFormat;
[[fallthrough]];
@@ -290,6 +320,8 @@ namespace CalculationManager
m_currentCalculatorEngine->ProcessCommand(static_cast<OpCode>(command));
break;
}
InputChanged();
}
/// <summary>
@@ -330,6 +362,7 @@ namespace CalculationManager
{
m_currentCalculatorEngine->PersistedMemObject(m_persistedPrimaryValue);
m_currentCalculatorEngine->ProcessCommand(IDC_RECALL);
InputChanged();
}
/// <summary>
@@ -376,6 +409,7 @@ namespace CalculationManager
this->MemorizedNumberSelect(indexOfMemory);
m_currentCalculatorEngine->ProcessCommand(IDC_RECALL);
InputChanged();
}
/// <summary>
@@ -638,6 +672,11 @@ namespace CalculationManager
return m_currentCalculatorEngine->FInRecordingState() ? true : false;
}
bool CalculatorManager::IsInputEmpty()
{
return m_currentCalculatorEngine->IsInputEmpty();
}
void CalculatorManager::SetInHistoryItemLoadMode(_In_ bool isHistoryItemLoadMode)
{
m_inHistoryItemLoadMode = isHistoryItemLoadMode;