Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Simulator Settings Row to DIY version for pump and CGM simulators #525

Merged
merged 5 commits into from
Feb 19, 2024

Conversation

marionbarker
Copy link
Contributor

@marionbarker marionbarker commented Feb 6, 2024

The simulators for pump and CGM do not have an obvious way to delete them so an actual pump and CGM can be added and the time required for the long press is very long.

Based on conversations from my initial attempt, that commit was reverted with a new approach used.

See later comments for continued conversation.

dthornley pushed a commit to dthornley/LoopKit that referenced this pull request Feb 6, 2024
@marionbarker
Copy link
Contributor Author

Happy to work with you on this. How about something like this instead? (This is from @bjorkert - he and I often work together.)

Alternative-MockCGM-with-Settings-Button-2024-02-06 21 14 57

@LoopKit LoopKit deleted a comment from scifantastic Feb 7, 2024
@LoopKit LoopKit deleted a comment from scifantastic Feb 7, 2024
@ps2
Copy link
Collaborator

ps2 commented Feb 7, 2024

[reposting with correct account]

Thanks! There are a few requirements for this, if you're up for it:

We can add easy access to simulator configuration for DIY, but it needs to be behind a feature flag. Could be something like APP_DEMO_MODE, and when you're in demo mode, the simulator configuration is hard to get to (i.e., how it is in dev now).
I think we can add back a top level "remove simulator" command, but if, and only if, there are other CGM/pump plugins configured.
When in easy access mode (non-demo), I think it'd be more congruent with the design to have the configuration page accessible like other configuration items on devices; like the "Device Details" page, rather than a "Press and hold for more options" text splatted at the top. The title could be "Configure Simulator". Again, this would only be available in non-demo mode. In demo mode, the simulator configuration needs to be near impossible to accidentally activate.

@marionbarker marionbarker changed the title Make pump and cgm simulators user friendly Add Configure Simulator Button to DIY version for pump and CGM Feb 7, 2024
@marionbarker marionbarker marked this pull request as draft February 7, 2024 18:32
@marionbarker marionbarker changed the title Add Configure Simulator Button to DIY version for pump and CGM Add Simulator Settings Row to DIY version for pump and CGM simulators Feb 7, 2024
@marionbarker
Copy link
Contributor Author

In order to get a new Feature Flag into LoopKit, we think we would have to modify the protocol for all pump and cgm managers.

It looks like the existing DEBUG_FEATURES_ENABLED / allowDebugFeatures variables can be used because that is already in the pump and cgm managers. We reviewed the places where it is applied and it looks reasonable to configure the DIY code to have this enabled. If this is incorrect, then guidance is requested for what change should be made.

This updated version builds to the normal, long-press required version of the Simulators unless the DEBUG_FEATURES_ENABLED is uncommented from the LoopConfigOverride.xcconfig file.

loopkit-pr-525

@marionbarker marionbarker marked this pull request as ready for review February 7, 2024 22:06
@marionbarker
Copy link
Contributor Author

marionbarker commented Feb 8, 2024

I searched for places where having DEBUG_FEATURES_ENABLED enabled for DIY would change the app. (Note the user would need to know how to enable this easter egg):

This is only one I found. (Other items are handled by longPress regardless of this flag).

// Opens the debug menu if you rotate the phone 6 times (or back & forth 3 times), each rotation within 2 secs.

This is the view on my test phone:

DebugMenu-after-rotation

I tried all the buttons and they appear to work as expected.

Furthermore - I was able to solve the Critical Log Export problem described in Export Critical Log fails by deleting the Export Folder. I could then Export Critical Logs without a problem.
Edited to add - I was incorrect - it just took longer for the Error to appear when trying to export the critical logs. This is still a problem on a phone that has main built on top of dev, even after returning to dev.

@ps2
Copy link
Collaborator

ps2 commented Feb 19, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants