Merge branch 'master' into scaling-combobox

This commit is contained in:
Stephanie Anderl 2019-03-05 10:44:09 -08:00 committed by GitHub
commit a32a8b51b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
265 changed files with 491 additions and 449 deletions

View file

@ -27,14 +27,15 @@ assignees: ''
<!--If applicable, add screenshots to help explain your problem.--> <!--If applicable, add screenshots to help explain your problem.-->
**Device and Application Information (please complete the following information):** **Device and Application Information (please complete the following information):**
- OS Build Number: - OS Build:
- Architecture: - Architecture:
- Application Version Number: - Application Version:
<!--Run the following commands in Powershell and copy/paste the output. <!--Run the following commands in Powershell and copy/paste the output.
- OS Build: "$([Environment]::OSVersion.Version)" " - OS Build: $([Environment]::OSVersion.Version)"
- Architecture: "$((Get-AppxPackage -Name Microsoft.WindowsCalculator).Architecture)" " - Architecture: $((Get-AppxPackage -Name Microsoft.WindowsCalculator).Architecture)"
- Application Version: "$((Get-AppxPackage -Name Microsoft.WindowsCalculator).Version)"--> " - Application Version: $((Get-AppxPackage -Name Microsoft.WindowsCalculator).Version)"
-->
**Additional context** **Additional context**
<!--Add any other context about the problem here.--> <!--Add any other context about the problem here.-->

View file

@ -11,7 +11,7 @@ pr:
- master - master
- servicing/* - servicing/*
name: 0.$(Date:yyMM).$(Date:dd)$(Rev:rr).0 name: 0.$(Date:yyMM).$(DayOfMonth)$(Rev:rr).0
jobs: jobs:
- template: ./templates/build-app-public.yaml - template: ./templates/build-app-public.yaml
@ -36,9 +36,15 @@ jobs:
- template: ./templates/run-unit-tests.yaml - template: ./templates/run-unit-tests.yaml
parameters: parameters:
platform: x64 platform: x64
reimageServiceConnection: essential-experiences-interactive-reimage
reimageSubscriptionId: a8f5eb47-e59c-44b4-8e42-e70811a047b5
reimageResourceGroup: EETestPublic
- template: ./templates/run-unit-tests.yaml - template: ./templates/run-unit-tests.yaml
parameters: parameters:
platform: x86 platform: x86
reimageServiceConnection: essential-experiences-interactive-reimage
reimageSubscriptionId: a8f5eb47-e59c-44b4-8e42-e70811a047b5
reimageResourceGroup: EETestPublic
- template: ./templates/package-appxbundle.yaml - template: ./templates/package-appxbundle.yaml

View file

@ -38,10 +38,16 @@ jobs:
- template: ./templates/run-unit-tests.yaml - template: ./templates/run-unit-tests.yaml
parameters: parameters:
platform: x64 platform: x64
reimageServiceConnection: macool-sandbox-interactiveDesktopRS5
reimageSubscriptionId: 012a8008-c00f-45b3-9828-41ebba30141d
reimageResourceGroup: interactiveDesktopRS5
- template: ./templates/run-unit-tests.yaml - template: ./templates/run-unit-tests.yaml
parameters: parameters:
platform: x86 platform: x86
reimageServiceConnection: macool-sandbox-interactiveDesktopRS5
reimageSubscriptionId: 012a8008-c00f-45b3-9828-41ebba30141d
reimageResourceGroup: interactiveDesktopRS5
- template: ./templates/package-appxbundle.yaml - template: ./templates/package-appxbundle.yaml

View file

@ -2,6 +2,9 @@
parameters: parameters:
platform: '' platform: ''
reimageServiceConnection: ''
reimageSubscriptionId: ''
reimageResourceGroup: ''
jobs: jobs:
- job: UnitTests${{ parameters.platform }} - job: UnitTests${{ parameters.platform }}
@ -49,6 +52,6 @@ jobs:
displayName: Reimage test machine displayName: Reimage test machine
inputs: inputs:
connectionType: connectedServiceNameARM connectionType: connectedServiceNameARM
azureServiceConnection: macool-sandbox-interactiveDesktopRS5 azureServiceConnection: ${{ parameters.reimageServiceConnection }}
urlSuffix: subscriptions/012a8008-c00f-45b3-9828-41ebba30141d/resourceGroups/interactiveDesktopRS5/providers/Microsoft.Compute/virtualMachineScaleSets/essential/reimage?api-version=2018-10-01 urlSuffix: subscriptions/${{ parameters.reimageSubscriptionId }}/resourceGroups/${{ parameters.reimageResourceGroup }}/providers/Microsoft.Compute/virtualMachineScaleSets/essential/reimage?api-version=2018-10-01
body: '{ "instanceIds": ["$(agentInstanceId)"] }' body: '{ "instanceIds": ["$(agentInstanceId)"] }'

View file

@ -69,7 +69,7 @@ StandardCalculatorViewModel::StandardCalculatorViewModel() :
m_HexDisplayValue(L"0"), m_HexDisplayValue(L"0"),
m_BinaryDisplayValue(L"0"), m_BinaryDisplayValue(L"0"),
m_OctalDisplayValue(L"0"), m_OctalDisplayValue(L"0"),
m_standardCalculatorManager(make_unique<CalculatorManager>(&m_calculatorDisplay, &m_resourceProvider)), m_standardCalculatorManager(&m_calculatorDisplay, &m_resourceProvider),
m_MemorizedNumbers(ref new Vector<MemoryItemViewModel^>()), m_MemorizedNumbers(ref new Vector<MemoryItemViewModel^>()),
m_IsMemoryEmpty(true), m_IsMemoryEmpty(true),
m_IsFToEChecked(false), m_IsFToEChecked(false),
@ -110,7 +110,7 @@ StandardCalculatorViewModel::StandardCalculatorViewModel() :
CalculationExpressionAutomationName = GetLocalizedStringFormat(m_expressionAutomationNameFormat, L""); CalculationExpressionAutomationName = GetLocalizedStringFormat(m_expressionAutomationNameFormat, L"");
// Initialize history view model // Initialize history view model
m_HistoryVM = ref new HistoryViewModel(m_standardCalculatorManager.get()); m_HistoryVM = ref new HistoryViewModel(&m_standardCalculatorManager);
m_HistoryVM->SetCalculatorDisplay(m_calculatorDisplay); m_HistoryVM->SetCalculatorDisplay(m_calculatorDisplay);
m_decimalSeparator = LocalizationSettings::GetInstance().GetDecimalSeparator(); m_decimalSeparator = LocalizationSettings::GetInstance().GetDecimalSeparator();
@ -215,7 +215,7 @@ void StandardCalculatorViewModel::SetPrimaryDisplay(_In_ wstring const &displayS
void StandardCalculatorViewModel::DisplayPasteError() void StandardCalculatorViewModel::DisplayPasteError()
{ {
m_standardCalculatorManager->DisplayPasteError(); m_standardCalculatorManager.DisplayPasteError();
} }
void StandardCalculatorViewModel::SetParenthesisCount(_In_ const wstring& parenthesisCount) void StandardCalculatorViewModel::SetParenthesisCount(_In_ const wstring& parenthesisCount)
@ -285,9 +285,9 @@ void StandardCalculatorViewModel::SetHistoryExpressionDisplay(_Inout_ shared_ptr
IsEditingEnabled = false; IsEditingEnabled = false;
// Setting the History Item Load Mode so that UI does not get updated with recalculation of every token // Setting the History Item Load Mode so that UI does not get updated with recalculation of every token
m_standardCalculatorManager->SetInHistoryItemLoadMode(true); m_standardCalculatorManager.SetInHistoryItemLoadMode(true);
Recalculate(true); Recalculate(true);
m_standardCalculatorManager->SetInHistoryItemLoadMode(false); m_standardCalculatorManager.SetInHistoryItemLoadMode(false);
m_isLastOperationHistoryLoad = true; m_isLastOperationHistoryLoad = true;
} }
@ -573,7 +573,7 @@ void StandardCalculatorViewModel::OnButtonPressed(Object^ parameter)
if (IsInError) if (IsInError)
{ {
m_standardCalculatorManager->SendCommand(Command::CommandCLEAR); m_standardCalculatorManager.SendCommand(Command::CommandCLEAR);
if (!IsRecoverableCommand((int)numOpEnum)) if (!IsRecoverableCommand((int)numOpEnum))
{ {
@ -643,7 +643,7 @@ void StandardCalculatorViewModel::OnButtonPressed(Object^ parameter)
m_isLastOperationHistoryLoad = false; m_isLastOperationHistoryLoad = false;
} }
m_standardCalculatorManager->SendCommand(cmdenum); m_standardCalculatorManager.SendCommand(cmdenum);
} }
} }
} }
@ -746,7 +746,7 @@ void StandardCalculatorViewModel::OnPaste(String^ pastedString, ViewMode mode)
TraceLogger::GetInstance().LogValidInputPasted(mode); TraceLogger::GetInstance().LogValidInputPasted(mode);
bool isFirstLegalChar = true; bool isFirstLegalChar = true;
m_standardCalculatorManager->SendCommand(Command::CommandCENTR); m_standardCalculatorManager.SendCommand(Command::CommandCENTR);
bool sendNegate = false; bool sendNegate = false;
bool processedExp = false; bool processedExp = false;
bool processedDigit = false; bool processedDigit = false;
@ -836,7 +836,7 @@ void StandardCalculatorViewModel::OnPaste(String^ pastedString, ViewMode mode)
{ {
sentEquals = (mappedNumOp == NumbersAndOperatorsEnum::Equals); sentEquals = (mappedNumOp == NumbersAndOperatorsEnum::Equals);
Command cmdenum = ConvertToOperatorsEnum(mappedNumOp); Command cmdenum = ConvertToOperatorsEnum(mappedNumOp);
m_standardCalculatorManager->SendCommand(cmdenum); m_standardCalculatorManager.SendCommand(cmdenum);
// The CalcEngine state machine won't allow the negate command to be sent before any // The CalcEngine state machine won't allow the negate command to be sent before any
// other digits, so instead a flag is set and the command is sent after the first appropriate // other digits, so instead a flag is set and the command is sent after the first appropriate
@ -846,7 +846,7 @@ void StandardCalculatorViewModel::OnPaste(String^ pastedString, ViewMode mode)
if (canSendNegate) if (canSendNegate)
{ {
Command cmdNegate = ConvertToOperatorsEnum(NumbersAndOperatorsEnum::Negate); Command cmdNegate = ConvertToOperatorsEnum(NumbersAndOperatorsEnum::Negate);
m_standardCalculatorManager->SendCommand(cmdNegate); m_standardCalculatorManager.SendCommand(cmdNegate);
} }
// Can't send negate on a leading zero, so wait until the appropriate time to send it. // Can't send negate on a leading zero, so wait until the appropriate time to send it.
@ -865,7 +865,7 @@ void StandardCalculatorViewModel::OnPaste(String^ pastedString, ViewMode mode)
if (!(MapCharacterToButtonId(*it, canSendNegate) == NumbersAndOperatorsEnum::Add)) if (!(MapCharacterToButtonId(*it, canSendNegate) == NumbersAndOperatorsEnum::Add))
{ {
Command cmdNegate = ConvertToOperatorsEnum(NumbersAndOperatorsEnum::Negate); Command cmdNegate = ConvertToOperatorsEnum(NumbersAndOperatorsEnum::Negate);
m_standardCalculatorManager->SendCommand(cmdNegate); m_standardCalculatorManager.SendCommand(cmdNegate);
} }
} }
@ -876,7 +876,7 @@ void StandardCalculatorViewModel::OnPaste(String^ pastedString, ViewMode mode)
void StandardCalculatorViewModel::OnClearMemoryCommand( void StandardCalculatorViewModel::OnClearMemoryCommand(
Object^ parameter) Object^ parameter)
{ {
m_standardCalculatorManager->MemorizedNumberClearAll(); m_standardCalculatorManager.MemorizedNumberClearAll();
int windowId = Utils::GetWindowId(); int windowId = Utils::GetWindowId();
TraceLogger::GetInstance().LogMemoryClearAll(windowId); TraceLogger::GetInstance().LogMemoryClearAll(windowId);
@ -1013,7 +1013,7 @@ NumbersAndOperatorsEnum StandardCalculatorViewModel::MapCharacterToButtonId(
void StandardCalculatorViewModel::OnMemoryButtonPressed() void StandardCalculatorViewModel::OnMemoryButtonPressed()
{ {
m_standardCalculatorManager->MemorizeNumber(); m_standardCalculatorManager.MemorizeNumber();
int windowId = Utils::GetWindowId(); int windowId = Utils::GetWindowId();
TraceLogger::GetInstance().InsertIntoMemoryMap(windowId, IsStandard, IsScientific, IsProgrammer); TraceLogger::GetInstance().InsertIntoMemoryMap(windowId, IsStandard, IsScientific, IsProgrammer);
@ -1051,7 +1051,7 @@ void StandardCalculatorViewModel::OnMemoryItemPressed(Object^ memoryItemPosition
if (MemorizedNumbers && MemorizedNumbers->Size > 0) if (MemorizedNumbers && MemorizedNumbers->Size > 0)
{ {
auto boxedPosition = safe_cast<Box<int>^>(memoryItemPosition); auto boxedPosition = safe_cast<Box<int>^>(memoryItemPosition);
m_standardCalculatorManager->MemorizedNumberLoad(boxedPosition->Value); m_standardCalculatorManager.MemorizedNumberLoad(boxedPosition->Value);
HideMemoryClicked(); HideMemoryClicked();
int windowId = Utils::GetWindowId(); int windowId = Utils::GetWindowId();
TraceLogger::GetInstance().LogMemoryUsed(windowId, boxedPosition->Value, IsStandard, IsScientific, IsProgrammer, MemorizedNumbers->Size); TraceLogger::GetInstance().LogMemoryUsed(windowId, boxedPosition->Value, IsStandard, IsScientific, IsProgrammer, MemorizedNumbers->Size);
@ -1075,7 +1075,7 @@ void StandardCalculatorViewModel::OnMemoryAdd(Object^ memoryItemPosition)
{ {
TraceLogger::GetInstance().InsertIntoMemoryMap(windowId, IsStandard, IsScientific, IsProgrammer); TraceLogger::GetInstance().InsertIntoMemoryMap(windowId, IsStandard, IsScientific, IsProgrammer);
} }
m_standardCalculatorManager->MemorizedNumberAdd(boxedPosition->Value); m_standardCalculatorManager.MemorizedNumberAdd(boxedPosition->Value);
} }
} }
@ -1096,7 +1096,7 @@ void StandardCalculatorViewModel::OnMemorySubtract(Object^ memoryItemPosition)
{ {
TraceLogger::GetInstance().InsertIntoMemoryMap(windowId, IsStandard, IsScientific, IsProgrammer); TraceLogger::GetInstance().InsertIntoMemoryMap(windowId, IsStandard, IsScientific, IsProgrammer);
} }
m_standardCalculatorManager->MemorizedNumberSubtract(boxedPosition->Value); m_standardCalculatorManager.MemorizedNumberSubtract(boxedPosition->Value);
} }
} }
@ -1110,7 +1110,7 @@ void StandardCalculatorViewModel::OnMemoryClear(_In_ Object^ memoryItemPosition)
if (boxedPosition->Value >= 0) if (boxedPosition->Value >= 0)
{ {
unsigned int unsignedPosition = safe_cast<unsigned int>(boxedPosition->Value); unsigned int unsignedPosition = safe_cast<unsigned int>(boxedPosition->Value);
m_standardCalculatorManager->MemorizedNumberClear(unsignedPosition); m_standardCalculatorManager.MemorizedNumberClear(unsignedPosition);
MemorizedNumbers->RemoveAt(unsignedPosition); MemorizedNumbers->RemoveAt(unsignedPosition);
for (unsigned int i = 0; i < MemorizedNumbers->Size; i++) for (unsigned int i = 0; i < MemorizedNumbers->Size; i++)
@ -1145,11 +1145,11 @@ Array<unsigned char>^ StandardCalculatorViewModel::Serialize()
writer->WriteUInt32(static_cast<UINT32>(m_CurrentAngleType)); writer->WriteUInt32(static_cast<UINT32>(m_CurrentAngleType));
writer->WriteBoolean(IsFToEChecked); writer->WriteBoolean(IsFToEChecked);
writer->WriteBoolean(IsCurrentViewPinned); writer->WriteBoolean(IsCurrentViewPinned);
writer->WriteUInt32(static_cast<UINT32>(m_standardCalculatorManager->SerializeSavedDegreeMode())); writer->WriteUInt32(static_cast<UINT32>(m_standardCalculatorManager.SerializeSavedDegreeMode()));
// Serialize Memory // Serialize Memory
vector<long> serializedMemory; vector<long> serializedMemory;
serializedMemory = m_standardCalculatorManager->GetSerializedMemory(); serializedMemory = m_standardCalculatorManager.GetSerializedMemory();
size_t lengthOfSerializedMemory = serializedMemory.size(); size_t lengthOfSerializedMemory = serializedMemory.size();
writer->WriteUInt32(static_cast<UINT32>(lengthOfSerializedMemory)); writer->WriteUInt32(static_cast<UINT32>(lengthOfSerializedMemory));
for (auto data : serializedMemory) for (auto data : serializedMemory)
@ -1158,7 +1158,7 @@ Array<unsigned char>^ StandardCalculatorViewModel::Serialize()
} }
// Serialize Primary Display // Serialize Primary Display
vector<long> serializedPrimaryDisplay = m_standardCalculatorManager->GetSerializedPrimaryDisplay(); vector<long> serializedPrimaryDisplay = m_standardCalculatorManager.GetSerializedPrimaryDisplay();
writer->WriteUInt32(static_cast<UINT32>(serializedPrimaryDisplay.size())); writer->WriteUInt32(static_cast<UINT32>(serializedPrimaryDisplay.size()));
for (auto data : serializedPrimaryDisplay) for (auto data : serializedPrimaryDisplay)
{ {
@ -1169,7 +1169,7 @@ Array<unsigned char>^ StandardCalculatorViewModel::Serialize()
writer->WriteUInt32(static_cast<UINT32>(CurrentRadixType)); writer->WriteUInt32(static_cast<UINT32>(CurrentRadixType));
//Serialize commands of calculator manager //Serialize commands of calculator manager
vector<unsigned char> serializedCommand = m_standardCalculatorManager->SerializeCommands(); vector<unsigned char> serializedCommand = m_standardCalculatorManager.SerializeCommands();
writer->WriteUInt32(static_cast<UINT32>(serializedCommand.size())); writer->WriteUInt32(static_cast<UINT32>(serializedCommand.size()));
writer->WriteBytes(ref new Array<unsigned char>(serializedCommand.data(), static_cast<unsigned int>(serializedCommand.size()))); writer->WriteBytes(ref new Array<unsigned char>(serializedCommand.data(), static_cast<unsigned int>(serializedCommand.size())));
@ -1205,7 +1205,7 @@ void StandardCalculatorViewModel::Deserialize(Array<unsigned char>^ state)
IsCurrentViewPinned = reader->ReadBoolean(); IsCurrentViewPinned = reader->ReadBoolean();
Command serializedDegreeMode = static_cast<Command>(reader->ReadUInt32()); Command serializedDegreeMode = static_cast<Command>(reader->ReadUInt32());
m_standardCalculatorManager->SendCommand(serializedDegreeMode); m_standardCalculatorManager.SendCommand(serializedDegreeMode);
// Deserialize Memory // Deserialize Memory
UINT32 memoryDataLength = reader->ReadUInt32(); UINT32 memoryDataLength = reader->ReadUInt32();
@ -1214,7 +1214,7 @@ void StandardCalculatorViewModel::Deserialize(Array<unsigned char>^ state)
{ {
serializedMemory.push_back(reader->ReadInt32()); serializedMemory.push_back(reader->ReadInt32());
} }
m_standardCalculatorManager->DeSerializeMemory(serializedMemory); m_standardCalculatorManager.DeSerializeMemory(serializedMemory);
// Serialize Primary Display // Serialize Primary Display
UINT32 serializedPrimaryDisplayLength = reader->ReadUInt32(); UINT32 serializedPrimaryDisplayLength = reader->ReadUInt32();
@ -1223,14 +1223,14 @@ void StandardCalculatorViewModel::Deserialize(Array<unsigned char>^ state)
{ {
serializedPrimaryDisplay.push_back(reader->ReadInt32()); serializedPrimaryDisplay.push_back(reader->ReadInt32());
} }
m_standardCalculatorManager->DeSerializePrimaryDisplay(serializedPrimaryDisplay); m_standardCalculatorManager.DeSerializePrimaryDisplay(serializedPrimaryDisplay);
CurrentRadixType = reader->ReadUInt32(); CurrentRadixType = reader->ReadUInt32();
//Read command data and Deserialize //Read command data and Deserialize
UINT32 modeldatalength = reader->ReadUInt32(); UINT32 modeldatalength = reader->ReadUInt32();
Array<unsigned char>^ modelDataAsBytes = ref new Array<unsigned char>(modeldatalength); Array<unsigned char>^ modelDataAsBytes = ref new Array<unsigned char>(modeldatalength);
reader->ReadBytes(modelDataAsBytes); reader->ReadBytes(modelDataAsBytes);
m_standardCalculatorManager->DeSerializeCommands(vector<unsigned char>(modelDataAsBytes->begin(), modelDataAsBytes->end())); m_standardCalculatorManager.DeSerializeCommands(vector<unsigned char>(modelDataAsBytes->begin(), modelDataAsBytes->end()));
// After recalculation. If there is an error then // After recalculation. If there is an error then
// IsInError should be set synchronously. // IsInError should be set synchronously.
@ -1326,31 +1326,31 @@ void StandardCalculatorViewModel::ResetDisplay()
{ {
AreHEXButtonsEnabled = false; AreHEXButtonsEnabled = false;
CurrentRadixType = (int)RADIX_TYPE::DEC_RADIX; CurrentRadixType = (int)RADIX_TYPE::DEC_RADIX;
m_standardCalculatorManager->SetRadix(DEC_RADIX); m_standardCalculatorManager.SetRadix(DEC_RADIX);
ProgModeRadixChange(); ProgModeRadixChange();
} }
void StandardCalculatorViewModel::SetPrecision(int32_t precision) void StandardCalculatorViewModel::SetPrecision(int32_t precision)
{ {
m_standardCalculatorManager->SetPrecision(precision); m_standardCalculatorManager.SetPrecision(precision);
} }
void StandardCalculatorViewModel::SwitchProgrammerModeBase(RADIX_TYPE radixType) void StandardCalculatorViewModel::SwitchProgrammerModeBase(RADIX_TYPE radixType)
{ {
if (IsInError) if (IsInError)
{ {
m_standardCalculatorManager->SendCommand(Command::CommandCLEAR); m_standardCalculatorManager.SendCommand(Command::CommandCLEAR);
} }
AreHEXButtonsEnabled = (radixType == RADIX_TYPE::HEX_RADIX); AreHEXButtonsEnabled = (radixType == RADIX_TYPE::HEX_RADIX);
CurrentRadixType = (int)radixType; CurrentRadixType = (int)radixType;
m_standardCalculatorManager->SetRadix(radixType); m_standardCalculatorManager.SetRadix(radixType);
ProgModeRadixChange(); ProgModeRadixChange();
} }
void StandardCalculatorViewModel::SetMemorizedNumbersString() void StandardCalculatorViewModel::SetMemorizedNumbersString()
{ {
m_standardCalculatorManager->SetMemorizedNumbersString(); m_standardCalculatorManager.SetMemorizedNumbersString();
} }
ANGLE_TYPE GetAngleTypeFromCommand(Command command) ANGLE_TYPE GetAngleTypeFromCommand(Command command)
@ -1384,7 +1384,7 @@ void StandardCalculatorViewModel::SaveEditedCommand(_In_ unsigned int tokenPosit
if (IsUnaryOp(nOpCode) && command != Command::CommandSIGN) if (IsUnaryOp(nOpCode) && command != Command::CommandSIGN)
{ {
int angleCmd = static_cast<int>(m_standardCalculatorManager->GetCurrentDegreeMode()); int angleCmd = static_cast<int>(m_standardCalculatorManager.GetCurrentDegreeMode());
ANGLE_TYPE angleType = GetAngleTypeFromCommand(static_cast<Command>(angleCmd)); ANGLE_TYPE angleType = GetAngleTypeFromCommand(static_cast<Command>(angleCmd));
if (IsTrigOp(nOpCode)) if (IsTrigOp(nOpCode))
@ -1452,7 +1452,7 @@ void StandardCalculatorViewModel::SaveEditedCommand(_In_ unsigned int tokenPosit
{ {
shared_ptr<IOpndCommand> spOpndCommand = dynamic_pointer_cast<IOpndCommand>(tokenCommand); shared_ptr<IOpndCommand> spOpndCommand = dynamic_pointer_cast<IOpndCommand>(tokenCommand);
spOpndCommand->ToggleSign(); spOpndCommand->ToggleSign();
updatedToken = spOpndCommand->GetToken(m_standardCalculatorManager->DecimalSeparator()); updatedToken = spOpndCommand->GetToken(m_standardCalculatorManager.DecimalSeparator());
} }
IsOperandUpdatedUsingViewModel = true; IsOperandUpdatedUsingViewModel = true;
} }
@ -1481,7 +1481,7 @@ void StandardCalculatorViewModel::SaveEditedCommand(_In_ unsigned int tokenPosit
void StandardCalculatorViewModel::Recalculate(bool fromHistory) void StandardCalculatorViewModel::Recalculate(bool fromHistory)
{ {
// Recalculate // Recalculate
Command currentDegreeMode = m_standardCalculatorManager->GetCurrentDegreeMode(); Command currentDegreeMode = m_standardCalculatorManager.GetCurrentDegreeMode();
shared_ptr <CalculatorVector<shared_ptr<IExpressionCommand>>> savedCommands = make_shared <CalculatorVector<shared_ptr<IExpressionCommand>>>(); shared_ptr <CalculatorVector<shared_ptr<IExpressionCommand>>> savedCommands = make_shared <CalculatorVector<shared_ptr<IExpressionCommand>>>();
vector<int> currentCommands; vector<int> currentCommands;
@ -1556,29 +1556,29 @@ void StandardCalculatorViewModel::Recalculate(bool fromHistory)
savedTokens->Append(currentToken); savedTokens->Append(currentToken);
} }
m_standardCalculatorManager->Reset(false); m_standardCalculatorManager.Reset(false);
if (IsScientific) if (IsScientific)
{ {
m_standardCalculatorManager->SendCommand(Command::ModeScientific); m_standardCalculatorManager.SendCommand(Command::ModeScientific);
} }
if (IsFToEChecked) if (IsFToEChecked)
{ {
m_standardCalculatorManager->SendCommand(Command::CommandFE); m_standardCalculatorManager.SendCommand(Command::CommandFE);
} }
m_standardCalculatorManager->SendCommand(currentDegreeMode); m_standardCalculatorManager.SendCommand(currentDegreeMode);
size_t currentCommandsSize = currentCommands.size(); size_t currentCommandsSize = currentCommands.size();
for (size_t i = 0; i < currentCommandsSize; i++) for (size_t i = 0; i < currentCommandsSize; i++)
{ {
m_standardCalculatorManager->SendCommand(static_cast<CalculationManager::Command>(currentCommands[i])); m_standardCalculatorManager.SendCommand(static_cast<CalculationManager::Command>(currentCommands[i]));
} }
if (fromHistory) // This is for the cases where the expression is loaded from history if (fromHistory) // This is for the cases where the expression is loaded from history
{ {
// To maintain F-E state of the engine, as the last operand hasn't reached engine by now // To maintain F-E state of the engine, as the last operand hasn't reached engine by now
m_standardCalculatorManager->SendCommand(Command::CommandFE); m_standardCalculatorManager.SendCommand(Command::CommandFE);
m_standardCalculatorManager->SendCommand(Command::CommandFE); m_standardCalculatorManager.SendCommand(Command::CommandFE);
} }
// After recalculation. If there is an error then // After recalculation. If there is an error then
@ -1785,7 +1785,7 @@ void StandardCalculatorViewModel::UpdateProgrammerPanelDisplay()
{ {
// we want the precision to be set to maximum value so that the autoconversions result as desired // we want the precision to be set to maximum value so that the autoconversions result as desired
int32_t precision = 64; int32_t precision = 64;
if (m_standardCalculatorManager->GetResultForRadix(16, precision) == L"") if (m_standardCalculatorManager.GetResultForRadix(16, precision) == L"")
{ {
hexDisplayString = DisplayValue->Data(); hexDisplayString = DisplayValue->Data();
decimalDisplayString = DisplayValue->Data(); decimalDisplayString = DisplayValue->Data();
@ -1794,10 +1794,10 @@ void StandardCalculatorViewModel::UpdateProgrammerPanelDisplay()
} }
else else
{ {
hexDisplayString = m_standardCalculatorManager->GetResultForRadix(16, precision); hexDisplayString = m_standardCalculatorManager.GetResultForRadix(16, precision);
decimalDisplayString = m_standardCalculatorManager->GetResultForRadix(10, precision); decimalDisplayString = m_standardCalculatorManager.GetResultForRadix(10, precision);
octalDisplayString = m_standardCalculatorManager->GetResultForRadix(8, precision); octalDisplayString = m_standardCalculatorManager.GetResultForRadix(8, precision);
binaryDisplayString = m_standardCalculatorManager->GetResultForRadix(2, precision); binaryDisplayString = m_standardCalculatorManager.GetResultForRadix(2, precision);
} }
} }
const auto& localizer = LocalizationSettings::GetInstance(); const auto& localizer = LocalizationSettings::GetInstance();
@ -1909,7 +1909,7 @@ void StandardCalculatorViewModel::UpdateOperand(int pos, String^ text)
void StandardCalculatorViewModel::UpdatecommandsInRecordingMode() void StandardCalculatorViewModel::UpdatecommandsInRecordingMode()
{ {
vector<unsigned char> savedCommands = m_standardCalculatorManager->GetSavedCommands(); vector<unsigned char> savedCommands = m_standardCalculatorManager.GetSavedCommands();
shared_ptr<CalculatorVector<int>> commands = make_shared<CalculatorVector<int>>(); shared_ptr<CalculatorVector<int>> commands = make_shared<CalculatorVector<int>>();
bool isDecimal = false; bool isDecimal = false;
bool isNegative = false; bool isNegative = false;

View file

@ -214,7 +214,7 @@ namespace CalculatorApp
} }
property bool IsEngineRecording { property bool IsEngineRecording {
bool get() { return m_standardCalculatorManager->IsEngineRecording(); } bool get() { return m_standardCalculatorManager.IsEngineRecording(); }
} }
property bool IsOperandEnabled { property bool IsOperandEnabled {
@ -311,7 +311,7 @@ namespace CalculatorApp
void ResetDisplay(); void ResetDisplay();
RADIX_TYPE GetCurrentRadixType() { return (RADIX_TYPE)m_CurrentRadixType; } RADIX_TYPE GetCurrentRadixType() { return (RADIX_TYPE)m_CurrentRadixType; }
void SetPrecision(int32_t precision); void SetPrecision(int32_t precision);
void UpdateMaxIntDigits() { m_standardCalculatorManager->UpdateMaxIntDigits(); } void UpdateMaxIntDigits() { m_standardCalculatorManager.UpdateMaxIntDigits(); }
NumbersAndOperatorsEnum GetCurrentAngleType() { return m_CurrentAngleType; } NumbersAndOperatorsEnum GetCurrentAngleType() { return m_CurrentAngleType; }
private: private:
@ -323,7 +323,7 @@ namespace CalculatorApp
wchar_t m_decimalSeparator; wchar_t m_decimalSeparator;
CalculatorDisplay m_calculatorDisplay; CalculatorDisplay m_calculatorDisplay;
CalculatorApp::EngineResourceProvider m_resourceProvider; CalculatorApp::EngineResourceProvider m_resourceProvider;
std::unique_ptr<CalculationManager::CalculatorManager> m_standardCalculatorManager; CalculationManager::CalculatorManager m_standardCalculatorManager;
Platform::String^ m_expressionAutomationNameFormat; Platform::String^ m_expressionAutomationNameFormat;
Platform::String^ m_localizedCalculationResultAutomationFormat; Platform::String^ m_localizedCalculationResultAutomationFormat;
Platform::String^ m_localizedCalculationResultDecimalAutomationFormat; Platform::String^ m_localizedCalculationResultDecimalAutomationFormat;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

After

Width:  |  Height:  |  Size: 299 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 333 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 391 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 513 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 806 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 185 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

After

Width:  |  Height:  |  Size: 198 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 677 B

After

Width:  |  Height:  |  Size: 235 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 B

After

Width:  |  Height:  |  Size: 267 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

After

Width:  |  Height:  |  Size: 288 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 B

After

Width:  |  Height:  |  Size: 309 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 891 B

After

Width:  |  Height:  |  Size: 314 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 370 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 456 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 487 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 532 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 557 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 683 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 977 B

After

Width:  |  Height:  |  Size: 485 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 524 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 577 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 690 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 996 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

After

Width:  |  Height:  |  Size: 371 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 384 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

After

Width:  |  Height:  |  Size: 421 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 922 B

After

Width:  |  Height:  |  Size: 453 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 900 B

After

Width:  |  Height:  |  Size: 474 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 973 B

After

Width:  |  Height:  |  Size: 491 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 505 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 558 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 630 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 665 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 707 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 737 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 867 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 185 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 185 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

After

Width:  |  Height:  |  Size: 371 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

After

Width:  |  Height:  |  Size: 371 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 185 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 185 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

After

Width:  |  Height:  |  Size: 371 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

After

Width:  |  Height:  |  Size: 198 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

After

Width:  |  Height:  |  Size: 198 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 384 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 384 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

After

Width:  |  Height:  |  Size: 198 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

After

Width:  |  Height:  |  Size: 198 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 384 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 677 B

After

Width:  |  Height:  |  Size: 235 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 677 B

After

Width:  |  Height:  |  Size: 235 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

After

Width:  |  Height:  |  Size: 421 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

After

Width:  |  Height:  |  Size: 421 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 677 B

After

Width:  |  Height:  |  Size: 235 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 677 B

After

Width:  |  Height:  |  Size: 235 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

After

Width:  |  Height:  |  Size: 421 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 B

After

Width:  |  Height:  |  Size: 267 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 B

After

Width:  |  Height:  |  Size: 267 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 922 B

After

Width:  |  Height:  |  Size: 453 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 922 B

After

Width:  |  Height:  |  Size: 453 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 B

After

Width:  |  Height:  |  Size: 267 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 B

After

Width:  |  Height:  |  Size: 267 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 922 B

After

Width:  |  Height:  |  Size: 453 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

After

Width:  |  Height:  |  Size: 288 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

After

Width:  |  Height:  |  Size: 288 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 900 B

After

Width:  |  Height:  |  Size: 474 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 900 B

After

Width:  |  Height:  |  Size: 474 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

After

Width:  |  Height:  |  Size: 288 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

After

Width:  |  Height:  |  Size: 288 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 900 B

After

Width:  |  Height:  |  Size: 474 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 B

After

Width:  |  Height:  |  Size: 309 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 B

After

Width:  |  Height:  |  Size: 309 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 973 B

After

Width:  |  Height:  |  Size: 491 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 973 B

After

Width:  |  Height:  |  Size: 491 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 B

After

Width:  |  Height:  |  Size: 309 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 B

After

Width:  |  Height:  |  Size: 309 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 973 B

After

Width:  |  Height:  |  Size: 491 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 891 B

After

Width:  |  Height:  |  Size: 314 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 891 B

After

Width:  |  Height:  |  Size: 314 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 505 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 505 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 891 B

After

Width:  |  Height:  |  Size: 314 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 891 B

After

Width:  |  Height:  |  Size: 314 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 505 B

Before After
Before After

Some files were not shown because too many files have changed in this diff Show more