Merged
Conversation
- Reserialization of EM mapping is now supported. Although there will be added bloat for values not originally mentioned, nulls will be ignored. The serializer will also take care to write inherited properties first so that these are set correctly on deserialization. - Fixes the setting of TrigAction in FDActionListItem - it was previously removing the wrong value before setting the new one. - Fixes the setting on OneShot in FDTrigSetup as this was toggling rather than respecting the passed in value. - The Timer value in FDTrigSetup can now be set. - Unit tests for FD updated.
DanzaG
approved these changes
May 14, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#333 EM Serialization
Reserialization of EM mapping is now supported. Although there will be added bloat for values not originally mentioned in the JSON, nulls will be ignored. The serializer will also take care to write inherited properties first so that these are set correctly on deserialization. The
CommentsandEMType/ConditionTypefields will always be first for clarity if scanning through the JSON file.In terms of testing, see https://github.com/lahm86/TREnvironmentEditorTests/blob/main/TREnvironmentEditorTests/RewriteTest.cs. This reads in current EM data, serializes it again and then applies each individual function from the original and "new" JSON on two separate level objects and verifies that the output is identical.
Some trigger issues came to light when the JSON has additional values that we hadn't specified before.
TrigActioninFDActionListItem- it was previously removing the wrong value before setting the new one. The new JSON will have the value defined, previously we only specifiedTrigActionandParameter. So this wasn't a problem before because the value was essentially 0, so the bug in line 34 ofFDActionListItemwasn't kicking in.OneShotinFDTrigSetupas this was toggling rather than respecting the passed in value. This is similar to above, so becauseOneShotis always defined in the JSON, it was in effect toggling it after the value had been set already and so generally was becoming true in all cases.Also:
Timervalue inFDTrigSetupcan now be set.