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

Use original oref0 profile script #805

Merged
merged 5 commits into from
Aug 29, 2024

Conversation

thomasvargiu
Copy link
Contributor

Use the original lib/profile/index.js from oref0.

I can't be 100% sure whether there are other changes or not, but this PR handles the errors like the actual bundled one, using the original script.

Changes:

  • changed scripts/webpack.config.js to use original files
  • changed scripts/webpack.config.js to allow another directory for oref0 lib using an env variable
  • changed scripts/webpack.config.js with optimizations flags for sideEffects and comments
  • added package.json to lock webpack dependency

When someone wants to build the oref0 lib, they can:

$ git clone https://github.com/openaps/oref0.git
$ npm install
$ npm run build

@thomasvargiu thomasvargiu changed the title Use original oref0 profile script Draft: Use original oref0 profile script Aug 8, 2024
@thomasvargiu thomasvargiu changed the title Draft: Use original oref0 profile script Use original oref0 profile script Aug 8, 2024
@thomasvargiu thomasvargiu changed the title Use original oref0 profile script Draft: Use original oref0 profile script Aug 10, 2024
@Jon-b-m Jon-b-m self-requested a review August 11, 2024 10:30
@Jon-b-m Jon-b-m self-assigned this Aug 11, 2024
@Jon-b-m
Copy link
Member

Jon-b-m commented Aug 11, 2024

I've tested the for some time now. Everything seems fine. the comment about current dev/main index.js is not accurate (but not very important), as all variables are in fact included here (you can check for yourself with for instance a search in Xcode), however your solution is prettier and highly appreciated as we now can use every files from the public official ore0 repo!

@thomasvargiu
Copy link
Contributor Author

I was thinking to refactor the other files prepare files. It should be better to don't use the workaround to inject custom iAPS variables in the profile. They are not for oref0 and we should get them from the preferences where we need them.

@Jon-b-m
Copy link
Member

Jon-b-m commented Aug 11, 2024

I was thinking to refactor the other files prepare files. It should be better to don't use the workaround to inject custom iAPS variables in the profile. They are not for oref0 and we should get them from the preferences where we need them.

I'm open to this. There are several different ways of refactoring we can make.

@Jon-b-m
Copy link
Member

Jon-b-m commented Aug 21, 2024

This PR is marked as “draft”, do you have additional updates pending?

@thomasvargiu
Copy link
Contributor Author

It's a workaround, but it works...
I would like to change how custom iAPS settings are handled (currently merged in profile.json, even they are not used my oref0), but it will require to change how the middleware works causing a breaking change.
What do you think? Maybe we can merge this and maybe later change how custom preferences are handled?

@Jon-b-m
Copy link
Member

Jon-b-m commented Aug 26, 2024

It's a workaround, but it works... I would like to change how custom iAPS settings are handled (currently merged in profile.json, even they are not used my oref0), but it will require to change how the middleware works causing a breaking change. What do you think? Maybe we can merge this and maybe later change how custom preferences are handled?

Braking changes are not ideal, and should only be introduced when absolutely necessary. What changes to the middleware were you planning?

@thomasvargiu
Copy link
Contributor Author

Braking changes are not ideal, and should only be introduced when absolutely necessary. What changes to the middleware were you planning?

Removing the custom iAPS settings from the profile and move them to preferences and provide them to the middleware.
Another improvement to the middleware should be to use just one argument as an object.

But we can think about these things in the future. I'm removing the draft flag from this PR.

@thomasvargiu thomasvargiu changed the title Draft: Use original oref0 profile script Use original oref0 profile script Aug 26, 2024
@Jon-b-m
Copy link
Member

Jon-b-m commented Aug 28, 2024

Braking changes are not ideal, and should only be introduced when absolutely necessary. What changes to the middleware were you planning?

Removing the custom iAPS settings from the profile and move them to preferences and provide them to the middleware. Another improvement to the middleware should be to use just one argument as an object.

But we can think about these things in the future. I'm removing the draft flag from this PR.

Are you referring to the dynamic ISF settings? These are already in preferences.json. But I agree it would be more structured to move these to freeaps_settings.json instead as these are not used in oref0. We could do this without breaking the middleware for most users, unless for those users trying to read these settings from preferences object in middleware (there is no good reason to as these are part of profile.json).

And yes I think this PR can be merged for now and the other refactoring happening later in a separate PR. I've been testing this PR thoroughly.

@Jon-b-m Jon-b-m merged commit e6633ef into Artificial-Pancreas:dev Aug 29, 2024
Jon-b-m added a commit that referenced this pull request Sep 3, 2024
1.  Hypo treatments (#801)
Activate a hypo treatment override preset when selecting Hypo Treatment in the meals View. The activated override: 45 min, SMBs off, 90%, 6.5 mmol/l target.
This will also skip the Bolus View.
Make the necessary updates to update the override/s in Nightscout.
Those who never records any hypo treatments in iAPS can disable this option in UI/UX settings.

2. Don't run TDD twice (dd5cc61)
An add some more printing to console to see time of each oref0 module.

3. Expand iAPS  Live Activity (#808).  Display Last loop, IOB, COB and eventual glucose prediction. Add support for both open loop mode and closed loop mode.
#808

4. Move max carbs (#811). Some users don't know about this new setting. It has now been moved to a more intuitive location. 

5.  Resolve Calender issue introdced in commit af1acf9 (#821)

6. Resolve issue #804

7. Refactor (#823)

8.  Fix the  rounding in small TIR chart. Every group together now always end up with 100 %.

9. Hide the COB chart when lacking carb entries. Hide the IOB chart when lacking insulin data.
#824

10. Add Glucose drop to Header View
Display rotating glucose drop.
Current Glucose, loop minutes ago and glucose delta is now in highest contrast.
The glucose delta is now an option in UI/UX settings (default is off). I recommend having “Always color glucose value” off in UI/UX settings, as this will make sure you’ll always get the glucose in highest contrast (black/white).
https://discord.com/channels/1120154740857245808/1123065808130691124/1277393884053504072

11. Add pump shadows..

12. Localize Header
Clean up.

13. Fix default glucose delta setting
* Display + in delta.
Round manual glucose values separately.

14. Move infoPanel to be a more integral part of the header View
Update animation duration.

15. Add label to the iAPS pill

16. Use original oref0 profile script (#805), by @bastiaanv https://discord.com/channels/1120154740857245808/1123065808130691124/1278662542511575041

17.  Edit "Error" to "Status" (#761)

18 Bring back display of before and after the dynamic adjustment in iAPS pill.
Bring back correct colour of Insulin 24h. Include CR.

19. New localizations and Crowdin translations. Thank you translators: Aleksandr Van-Zaam, Mirko Trierenberg, Typ1er, Mykola Yroslavadudko, Nicole van Elst - van den Hoek, Hung Nguyen, Salem Allebdi, aboeinas, Abdulrahman Alfantokh, 244877227, Alessandro Fogliani for new translations. We now have some Arabic translations.
@Jon-b-m Jon-b-m mentioned this pull request Sep 3, 2024
Jon-b-m added a commit that referenced this pull request Sep 3, 2024
* Release 5.0.0

1.  Hypo treatments (#801)
Activate a hypo treatment override preset when selecting Hypo Treatment in the meals View. The activated override: 45 min, SMBs off, 90%, 6.5 mmol/l target.
This will also skip the Bolus View.
Make the necessary updates to update the override/s in Nightscout.
Those who never records any hypo treatments in iAPS can disable this option in UI/UX settings.

2. Don't run TDD twice (dd5cc61)
An add some more printing to console to see time of each oref0 module.

3. Expand iAPS  Live Activity (#808).  Display Last loop, IOB, COB and eventual glucose prediction. Add support for both open loop mode and closed loop mode.
#808

4. Move max carbs (#811). Some users don't know about this new setting. It has now been moved to a more intuitive location. 

5.  Resolve Calender issue introdced in commit af1acf9 (#821)

6. Resolve issue #804

7. Refactor (#823)

8.  Fix the  rounding in small TIR chart. Every group together now always end up with 100 %.

9. Hide the COB chart when lacking carb entries. Hide the IOB chart when lacking insulin data.
#824

10. Add Glucose drop to Header View
Display rotating glucose drop.
Current Glucose, loop minutes ago and glucose delta is now in highest contrast.
The glucose delta is now an option in UI/UX settings (default is off). I recommend having “Always color glucose value” off in UI/UX settings, as this will make sure you’ll always get the glucose in highest contrast (black/white).
https://discord.com/channels/1120154740857245808/1123065808130691124/1277393884053504072

11. Add pump shadows..

12. Localize Header
Clean up.

13. Fix default glucose delta setting
* Display + in delta.
Round manual glucose values separately.

14. Move infoPanel to be a more integral part of the header View
Update animation duration.

15. Add label to the iAPS pill

16. Use original oref0 profile script (#805), by @bastiaanv https://discord.com/channels/1120154740857245808/1123065808130691124/1278662542511575041

17.  Edit "Error" to "Status" (#761)

18 Bring back display of before and after the dynamic adjustment in iAPS pill.
Bring back correct colour of Insulin 24h. Include CR.

19. New localizations and Crowdin translations. Thank you translators: Aleksandr Van-Zaam, Mirko Trierenberg, Typ1er, Mykola Yroslavadudko, Nicole van Elst - van den Hoek, Hung Nguyen, Salem Allebdi, aboeinas, Abdulrahman Alfantokh, 244877227, Alessandro Fogliani for new translations. We now have some Arabic translations.
Rig22 pushed a commit to Rig22/iAPS that referenced this pull request Sep 14, 2024
Rig22 pushed a commit to Rig22/iAPS that referenced this pull request Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants