My current attempts of refactoring MoveToBeActive #11
Replies: 3 comments 2 replies
-
|
Hi @Someone0nEarth , happy new year and thanks for your help! Of course I would be open to suggestions and accepting changes from other people, for me that was the whole point about keeping it open source. However, we'd just need to make sure that the code improvements don't increase memory and battery usage too much, as well as keeping support for all the watches that I currently do. I'm not a proper software developer and really only wanted to create a watch face for myself that would suit my needs, hence why I decided to learn MonkeyC. I'm sure you'd may be able to find ways to improve the code, however since I'm not sure how much experience you have with MonkeyC and Garmin watches (I'm been maintaining this watch face since Feb/2021), then some things you'd need to keep in mind: Some of paths that I may have chosen to follow on the code could have been triggered by memory limitations on some of the supported watches and/or to improve battery / memory usage. With limited memory devices like Garmin watches, sometimes "worse" code (harder to read) could mean less memory usage. Not all the time, but it can happen. Answering your question regarding the low-memory settings, it's currently being used on Fenix 5 plus watches (all 3 variations of it). The reason is that those watches don't have the capability to display weather-related information, so since the settings menu is a memory hog, I've created a new settings file that is (for now) exclusive to the Fenix 5 and that doesn't have any of the weather-related features. You can check which watch models are using which annotations and source code files within the monkey.jungle file. I'll have a look at your code next week to do some testing and give you some feedback. Thanks once again, help is always very much appreciated. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @fevieira27 ! Just for your information: My first step of refactoring/remastering is done: The settings/configuration stuff Beside introducing a central configuration class, I refactored the whole settings menu (only for the "normal" settings profile at the moment. low- and tinymemory will be done later (if there will still a need for it)) At the moment, the memory usage of the running watchface is even 1.6kb less. Also the memory usage within the main menu is a bit reduced, but has a higher usage in some sub menus (but there is still room for improvement). Also the cpu usage should be already improved, too. My next step will be refactoring the mtba functions file. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @Someone0nEarth, I've had the chance to have a look into the code these past couple of days. Even though it initially took me a while to understand what was happening (lots of changes!), I now understand the purpose of what you're doing and completely agree that it's now much easier to understand from a perspective of someone that's looking at the code first time. It's still going to take me some time to get used to it, but I really appreciate how it looks like now. Can't thank you enough! I have to say that it must not have been easy for you to understand all that was going on with the watch face, but you nailed it so far. Most of the things are working just like they were in the past, apart from a few small things that are likely easy to fix (listed below). From my testing so far, I have 1 major concern (not yet an issue, but could become one), 1 issue that is going to require some logic changes, 2 minor issues, and 1 that is for sure due to WIP status of the code. I'll list them below so that we can have a look at them:
I've now built the watch face and I'm using it on my watch, for testing purposes. Interested to see if I come across any issues (don't think I will) and to see if there's any noticeable change in battery consumption (for better or worse). Will keep you updated on the next couple of weeks on how the real testing looks like so far. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @fevieira27 and a happy New Year!
I really like your Watchface and I appreciate a lot, that your are sharing your work as open source :)
For some personal preferences, I wanted to do some small changes in the code. While doing that, I found a lot of redundancy, magic numbers and another things in the existing code, which make it difficult to understand, maintain and improve it. So I started an incremental refactoring approach to make the code more "clean".
The current progress can be seen here: https://github.com/Someone0nEarth/MoveToBeActive/tree/dev
My goal is (when my refactoring reached some progress), to make a pull request to your repository, if you are up for it :)
So, would you up for it?
Do you like my current refactoring attempts?
Do you have some feedback?
Also one code related question:
It seems, that "AnalogSettingsView.mc" has no significant differences between the normal and the low-memory version? So, there is no need for the extra low-memory file, right?
Best regards,
Nils
Beta Was this translation helpful? Give feedback.
All reactions