# HG changeset patch # User Tess Snider # Date 2021-07-26 09:20:37 # Node ID 365cbd130bf25ced53524f5b95d1dc297f13fb84 # Parent 8ee5f618b07c9da846f30fa391d11aafa5b5baa7 Now correctly clearing buffer reagent selections when doing a test Clear. Also, marking inert now immediately saves, because a verification step is not necessary or useful, in this case. diff --git a/Models/ReactionTest.cs b/Models/ReactionTest.cs --- a/Models/ReactionTest.cs +++ b/Models/ReactionTest.cs @@ -279,6 +279,7 @@ namespace DesertPaintCodex.Models { Reaction = new Reaction(0, 0, 0); State = TestState.GoodResult; + SaveReaction(); } public void ClearReaction() @@ -291,11 +292,15 @@ namespace DesertPaintCodex.Models { profile.Save(); } + + BufferReagentFirst = null; + BufferReagentLast = null; Reaction = null; BadReaction = null; Clipped = ClipType.None; State = TestState.Untested; + UpdateRecipe(); } diff --git a/ViewModels/ExperimentLogViewModel.cs b/ViewModels/ExperimentLogViewModel.cs --- a/ViewModels/ExperimentLogViewModel.cs +++ b/ViewModels/ExperimentLogViewModel.cs @@ -61,6 +61,7 @@ namespace DesertPaintCodex.ViewModels TestView.SaveReaction.Subscribe(_ => OnSaveReaction()); TestView.ClearReaction.Subscribe(_ => OnClearReaction()); TestView.FinalizeTestResults.Subscribe(_ => OnReactionResults()); + TestView.MarkInert.Subscribe(_ => OnSaveReaction()); } private ReactionTest GetSelectedReactionTest() diff --git a/ViewModels/ReactionTestViewModel.cs b/ViewModels/ReactionTestViewModel.cs --- a/ViewModels/ReactionTestViewModel.cs +++ b/ViewModels/ReactionTestViewModel.cs @@ -46,6 +46,7 @@ namespace DesertPaintCodex.ViewModels ShowScreenSettingsDialog = new Interaction(); SaveReaction = ReactiveCommand.Create(() => ReactionTest.SaveReaction()); ClearReaction = ReactiveCommand.Create(() => ReactionTest.ClearReaction()); + MarkInert = ReactiveCommand.Create(() => ReactionTest.MarkInert()); FinalizeTestResults = ReactiveCommand.Create(Test); } @@ -109,11 +110,6 @@ namespace DesertPaintCodex.ViewModels } } - public void MarkInert() - { - ReactionTest.MarkInert(); - } - public void CancelScan() { ReactionTest.CancelScan(); @@ -148,6 +144,9 @@ namespace DesertPaintCodex.ViewModels public ReactiveCommand ClearReaction { get; } public ReactiveCommand SaveReaction { get; } + + public ReactiveCommand MarkInert { get; } + public ReactiveCommand FinalizeTestResults { get; } } } \ No newline at end of file