Support contract parameter preview#63
Draft
periodically-makes-puns wants to merge 1 commit intomockingbirdnest:masterfrom
Draft
Support contract parameter preview#63periodically-makes-puns wants to merge 1 commit intomockingbirdnest:masterfrom
periodically-makes-puns wants to merge 1 commit intomockingbirdnest:masterfrom
Conversation
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.
Intended to resolve #52. This converts both contract parameters currently implemented over to
ContractConfiguratorParameters so we can support preview. It also changes to usingSetStatecalls to avoid the deprecated SetComplete etc. functions.Each contract will first attempt to grab connection and station information from the Network. If they haven't been loaded yet, it will grab info from the definitions. It then generates a preview string based on the information needed to fill out the full contract parameter title, minus current status and availability. The preview string formats are generally identical to their non-preview counterparts, though point to multipoint parameters list all of their receivers directly rather than through subparameters.
To support generating the preview string, Network now supports caching station and connection definitions. It was already looping through every single definition every time to find a single station/connection definition, it just saves previous work now. This cache is not saved in any way - is this an issue?
I did not want to touch the current contract behaviour at all outside of supporting preview. This means the stations and connection still don't actually exist until the contract becomes offered for the first time.
This has minimal to zero effect on Mission Control load times on a fresh save. (Before caching the load times were really bad, but caching has dropped it to zero.)
(Why is this a draft? Because I have other fixes I'm working on, and this will clean up my Git state and mental notes a bit if I separate this out. This is kind of unimportant, and I don't know if this is the clean or intended way to handle this.)
Examples of it working:

