Dear developers,
I want to develop a data field that estimates power (with nothing but speed and elevation data), and shows the average of that for the current lap, for all the poor souls (like me) out there who can't afford power meters. The data field is supposed to run on edge 130 minimum (I would like to use my creation ;). I have quite a bit of experience in coding, but this is my first time developing a garmin data field. To put it in other words: I have no clue what I'm doing. And, like most of the time (sadly), the giant pile of information contained in the documentation is not exactly helpful for new developers trying to get a grip. So, I'd be very pleased if some of you would be so kind to take some time and help me on my journey. Also, please forgive me, if some of these questions might be incredibly stupid. Here they are anyway:
1. How do I access lap average speed?
As stated, I want to show lap estimated average power. Since power estimation relies heavily on (surprise!) velocity, the easieast way to estimate average power over a lap is to simply take the average speed of that lap. There would be another way, which leads me to point 2:
2. How do I get the data of the trackpoint at the start of a lap (how do I detect a new lap)?
The easiest way for this would certainly be to simply store the data of the point the "lap" button is pressed. But, if my research is correct: Data Fields don't have access to the information of buttons pressed, do they? So basically the question is, whether there is any other way to figure that out, like by referencing the current lap duration etc... For anyone interested in background, I would use this information the following way: Another factor power estimation relies heavily on, is (another surprise!) gradient; which can be determined by distance and elevation difference from start to end of set distance. The elevation difference I could simply determine by taking the current elevation and the elevation at which the lap started. Same goes for, if needed, speed and distance, if these can't be accessed directly (question 1).
3. How do I use trigonometric functions in Monkey C?
Yes, trigonometric functions are used in power estimation (at least in what I found on the internet). In i.e. Java, you can simply import a "Math"-class which contains these functions (and a lot more), something similar is true for python. But is there something like this in Monkey C? I haven't worked with this language ever and all import-like statements I have seen so far in code samples, it just references API-thingies giving information about the device status the program is running on. There has to be something and I just didn't dig deep enough yet.
Now lastly, and probably most importantly ;) :
4. How do I change the text color in eclipse for Monkey C developing?
Seriously. This is an issue. I use eclipse in dark mode, yet, when opening my first sample project, the primary text color was BLACK. Meaning, I can barely see anything. First of all, it's hard for me to understand how this even can happen, given, that the text color should be dictated by eclipse's theme setting, secondly, I am appearantly to stupid to change it. My solution was to temporarily simply use eclipse in light mode until I am finished with my project, but that just can't be a long-term solution.
If anyone, judging based on what is written here, has any other advice apart from what my questions cover: Please leave them here, there's no such thing as "too much support".
Thanks already for reading through all this and, in advance, for helping me out :)
Sincerely, a cyclist