DIY Data Field

Former Member
Former Member
Application is still pending to be approved, topic is created to be used as a communication hub during and after public beta test.

Do/Design It Yourself Data Field.

Disclaimer:
Application has hundreds of use-cases due to fully user-configurable setup, therefore it is prone to bugs. This project is not sponsored and I'm the only developer working on it in my own free time. Although I'd gladly accept reasonable criticism and improvement suggestions, I do not guarantee that bugs will be fixed and new features added in a timely manner/at all. If this approach is not acceptable for you, then, please, do not leave bad reviews just because I didn't resolve your specific case. Thanks for understanding.

Preface:
There's a lot of things custom activity recorders can do, which native Garmin apps cannot, but sometimes there's no need to invent a bicycle if there's one already itching for a ride. Some capabilities like local watch personal records, structured workouts information and advanced running dynamics will most certainly never be exposed to ConnectIQ API layer, therefore it's sometimes more efficient to use native software, but no one prevents us to use it with a twist. The main idea of this data-field type application is to give user a tool to design his own data field layout in WYSIWYG manner. The web application makes that possible providing cross-platform compatibility at the same time the only requirement being the HTML5 compatible browser. This app is not considered to be an ultimate DF which "replaces them all" as there's always something new and intriguing, which developer may envision, but I hope that this data field will help new and existing users to explore the Garmin ConnectIQ capabilities providing some unique features, which I didn't encounter in existing apps.

First things first: there's a web application, which allows to design data field layout and produces configuration string as a result. This configuration string can only be delivered to data field using standard settings means i.e. you will need either Garmin Express installed on compatible PC or Garmin Connect Mobile on your mobile device. Web app uses HTML5 local storage, changes are saved after each user action, therefore it's safe to leave your work half done and proceed from the same point sometime later. I do not own hardware to test with Apple devices, therefore any problems in that department can be explored and fixed only by sending me detailed explanations and, of course, the configuration string itself. Current version with the default layout setup was tested for several weeks in simulator and for several of my personal runs proving to be rather stable to go live, but of course there's no guarantee that this app will function without hitches on your specific device. Currently, I do not have a reliable hosting for my personal web apps, therefore data field designer will reside on Google Apps Engine servers using free account bandwidth/limitations (as there are almost no server-side computations, I think this will suffice for a while) at least if/until it'll become popular enough for the users to complain about page availability. Current implementation with the default layout setup works on the edge of stability and there was also a price to pay during watch code optimization, which lead to efficient but very unreadable code. This means that for older devices there may be no improvements, only bug fixes. But for modern devices like Forerunner735XT and on we still have additional 10kb of available memory, which can be used for new logic like new data values and/or additional app parameters (e.g. waypoints). Sometimes network latency and/or Google servers accessibility seems to impact resources load time and wrong font may be displayed first time the web app is started, to fix this simply press F5 (refresh page) in browser.

Current settings are 4 lines for definition itself (these should be copy/pasted without changes directly from web app), Target Pace for pacemaker values (should be entered as string in <min>:<sec> format, e.g. "5:40" as in min/km) and Milestones, which are just fixed distances comma separated list, they are expressed in kilometers and may contain fractional values using dot delimiter (e.g. 0.5,1,1.5, etc). It'necessary to enter values in kilometers, but they will be converted before display depending on watch settings.

Default setup is considered to be a "component showcase" and consists of basic building blocks:
- Data values, which are simply text representation of corresponding activity information bits like time or speed, for data values it's possible to change screen coordinates, font, color, number of samples to smooth the value over specified amount of seconds and add optional outline for data to become more readable or dynamically colored on less contrast backgrounds; if text font is selected, then it's also possible to append data value with custom text, e.g. create label with value for another data block;
- Data graphs, these are just rolling data value charts, which represent one selected data value over a set period of time, minimum and maximum graph values are adjusted automatically, number of samples is calculated automatically based on width of graph area and graph bar, all of the other options are similar to data values;
- Graphics elements, these are basic graphical primitives, which allow to customize the layout, add visibility to some values etc; parameters for these elements are mostly self explanatory except for two specific elements of type Arc. These may not only serve as a static view elements, but also can be used to represent a dynamic data value in a manner of a progress bar. For this to happen you need to tick the "Variable" option and select base Data value (currently there's only a limited selection, but this may be a subject to change) accompanied by min and max initial values, these range values are indeed initial as when the underlying data value falls outside of this range, then range is adjusted automatically. For example in bundled layout this feature is used to display the progress to the next kilometer: Elapsed distance is selected as a base value, initial range is specified as 0 to 100 (in this case 100 means 1000m, as the distance values are displayed as 00.00), which means that this arc will grow from start angle to the maximum width angle as the elapsed distance increases during activity acting as a progress bar to the next kilometer. When elapsed distance will become greater than 1000 meters, then ranges will be readjusted using the same range difference as before, in this case minimum value will become 1000m while maximum one will increase to 2000m. Here's a little demo of what you can make using variable value arc (this config is created for semi-round devices, copy/paste this configuration string into import window of web app).
AGUAJA[HIWaVFAJNATXDEAODZQVELEUA[HIWaVFAODU]`DEAOEOQVEVE_A[HIWaVFAABG`[DEAOFDQWE`FHA[HIWaVFAABHGRDEAOF[QWFIFRA[HIWaVFAJNA\ODEAOGQQVFSF\A[HIWaVFAOE]CPCWAODZTMELF\A[HIWaVFAAAAAACWAPDWTMELF\ASADILDAPOE]CPFEABAVDVENQAPQAAAFDJCFACB

Selected element options can be adjusted using the properties panel to the right of the designer canvas. In addition to pixel-by-pixel adjustments, designer canvas allows to drag currently selected element. To drag data value it's not necessary to start drag at any specific point, but for graphs and graphical elements the drag point will be determined based on mouse pointer coordinates: e.g. to resize graph area or rectangle click and drag somewhere around the lower right corner, to adjust the radius of circles and direction arrow start drag outside of the outer radius, to change coordinates - click somewhere near the circle center. For the arcs it's currently possible to change start angle and arc width by activating drag-and-drop near the corresponding arc vertex. Touch support for mobile devices is implemented.

There are still some limitations like direction arrow points only to north or some data values available only on high-end devices like power are not yet implemented etc, but as I already mentioned above, this app is subject to improve especially for the newer devices, where there's a lot of memory available even for the data field type of app. The web app is also meant to be improved especially in a direction to provide the nearest possible WYSIWYG snapshot of what you'll actually see on device, but there are also some limitations like, for example, font, which is used as numeric font in the latest Fenix5/FR935 models is not and won't be publicly available (confirmed by Garmin officials explicitly) and I used nearest lookalike, therefore there still may be some couple of pixel differences here and there between device and web app. For these kinds of problems I can only test and fix using the user-provided layouts in specific device simulator as I'm a simple FR230 owner for real testing and I'm afraid this won't change in the nearest year unless generous users will help me to upgrade.

Web app may eventually become mobile application based on the user feedback (but not for the Apple devices, Android only).
  • My first layout, a bit of a Frankenstein! Sorry but I can't figure out how to display the screen grabs I've put on dropbox, so follow these links
    https://www.dropbox.com/s/tycwunmz5r38yax/DIY_datafield_PF.png?dl=0
    https://www.dropbox.com/s/rjymcp73a7gyde8/76H13251.png?dl=0

    Cadence text is dynamic colour and HR background rectangle is dynamic colour (based on HR). Values that change slowly are in smaller font (time, distance and ave pace). Values I check often are in largest font (HR and lap pace). Note lap pace is not implemented yet, so it is actually current pace averaged over 90 seconds (max samples allowed!). Once lap pace is implemented, I will change it.

    I use 3 pace fields: average pace I care about for the total run time, I use instantaneous (current) pace to adjust my lap pace. Anyway, it works for me.

    In creating this, I noticed that there are about 1 pixel difference between straight lines in the designer to the actual rendering on the watch, but these can be accounted for with trial and error. Same with the fonts. But you can get the result you want with not too much effort.

    I've posted both a grab from the web designer, and a screen grab direct from the watch!

    Loving this data field - thank you @easuvorov (don't know your name)!!
  • Average pace bug

    I did my first real test today, I found a possible bug: The "Average Pace" was showing "00:00" - I was walking the dog so quite slow. I also have FlexiRunner app going at the same time and it continued to display average pace ok (it was about 12:00 min/km). Please note that both other pace fields were ok, "current pace" and "current pace" with 90 points average.

    The odd thing was that a while later it started working, but I'm not sure what I did. I will test again and see if I can reproduce it. Perhaps you could check your code around average pace?
  • I just noticed your update to 0.3 - lap data!! Great! Unfortunately lap pace not working properly. Will test more tomorrow. When you stop, after a few seconds, pace goes to 00.00, even if you have gone quite some distance into the current lap. The number should just get larger and larger.

    Also average pace issue, it reports 00.00 when pace is too low, it should really be reported as "--.--" like other apps do. I think your pace algorithm must display zero below a certain value.
  • Former Member
    Former Member over 8 years ago
    Thanks for the info, never used this data field for walking though: when I warm up my pace is around 8:30, when I run - it's generally somewhere around 5:20, in this scenario I never encountered such a bug. For the average pace I use native garmin value reported in activity info, unfortunately I do not have control over the moment when this value starts to report value above zero (and I have experience that right after activity starts it's actually reported as null, which gave me crashes in one of my previous apps). I do have some threshold under which I do not display value, that's true, maybe I'll try to record very slow walking activity and then check it's behavior in simulator to see whether I'll be able to find this bug.

    P.S. I played with simulator a bit and was unable to find the problem with decreasing lap pace, as logic to calculate it is very simple: lap pace is an average of min and max paces per current lap, initially min = 1000, max = -1000, each compute iteration if current instant pace is greater than zero I check whether the current pace is greater than max and replace it with current if it is, same thing for the min, on first iteration current pace replaces both values, then each successive pace value may replace one of the min/max values, resulting lap pace is (min + max) / 2, if lap event is triggered, I just reset min and max to 1000 and -1000 respectively. Running simulator with emulated and my own data I see expected behavior. If I'm wrong in my math, then, please, correct me. The only thing I can think of there is that contrary to average lap HR and cadence lap pace should be calculated as lap distance divided by lap time?

    As for the average pace - in simulator it starts to have nonzero value in a couple of seconds after activity is started. But again in simulator it continues to update (decrease by small value with each iteration) if I stop the data feed without stopping activity (in my opinion this approach mimics GPS signal loss). Whether it's a simulator only bug or also presents in some firmwares I don't know, also I'm not aware of the math, which is used for the average pace in Flexirunner, maybe the developer implemented some kind of the workaround for such specific situations.

    Instant pace with samples stays constant after values becomes too low and the lap pace should behave in the same way. I'll still try to record some walk with varying paces and check in simulator, but currently I do not see any logical flaws in my implementation, therefore, if you want this case resolved, then we'll need to have more details on test case, ideally - your fit file which will show those bugs.

    What I actually changed in my implementation is the threshold speed value, which I check to convert speed to pace: now I'll process speed values of 0.28 m/s and greater as this will result in approximately 59:31 pace (value under hour per km). This change will become available in the next update.

    P.P.S. Tried several of my own activities in simulator and found out that average pace is reported strange indeed, but this seems to be simulator bug as if I try to emulate data then average pace is reported with normal values.
  • The only thing I can think of there is that contrary to average lap HR and cadence lap pace should be calculated as lap distance divided by lap time?


    Definitely this is how lap pace should be calculated (not average of max and min)

    which is used for the average pace in Flexirunner, maybe the developer implemented some kind of the workaround for such specific situations.

    Flexirunner source code is on GitHub, you might want to see how he calculates lap pace and average pace.

    Instant pace with samples stays constant after values becomes too low and the lap pace should behave in the same way.

    This isn't correct. If pace (speed) is too low, then replace with "--.--". Pace should never show a constant value.

    What I actually changed in my implementation is the threshold speed value, which I check to convert speed to pace: now I'll process speed values of 0.28 m/s and greater as this will result in approximately 59:31 pace (value under hour per km). This change will become available in the next update.

    But this should fix the problem!!

    Thanks for trying to fix. I will also keep testing. Happy to give you a FIT file which shows the problem. I will start running regularly again later this week so will have lots of testing opportunities.
  • Former Member
    Former Member over 8 years ago
    Thanks for trying to fix. I will also keep testing. Happy to give you a FIT file which shows the problem.

    Thank you for testing and providing valuable info. I've published an update, please report whether this resolves lap/average pace issues.
    Personally, I do not like zero pace to be displayed as "--:--" but I made this change in 26kb version since other popular data fields do that indeed. If other users will object, then I'll try to make this an option in output expression.
    It seems that there's no need for the FIT files though, as in most cases simulator doesn't update distance (and therefore any values based on it) when playing FIT file, I tried with dated and recent files of my own activities.
  • Thanks, I will test in next day or two. Another thing for your to-do list:
    - update layout settings from GC mobile does not work (maybe not your fault?). I can only make changes with GC for PC and USB cable!

    And a question:
    I want to show a small arc on the right hand side which increases (counter clockwise) in angle (size of arc) according to current heart rate. I've figured out the radius, starting angle and arc width, but what do I set the following to? I used:
    - "variable" = tick
    - "value type" = current heart rate
    - "variable min" = 120 (so the arc size will be zero [at the starting angle] when heart rate is 120 or below)
    - "variable max" = 200 (so the arc size will be max [at the arc width] when heart rate is 200 or above)
    - "Auto adjust ranges" = ?? what does this do?

    Is this correct usage? Thank you.
  • Former Member
    Former Member over 8 years ago
    update layout settings from GC mobile does not work

    Strange thing with GCM, it should work the same as Express, but as different Garmin teams are working on these applications many strange things can happen... What mobile platform are you on: Android or IOS? Will settings be updated if you send them from GCM and then reboot watch?

    Your variable arc definition is correct. Option to "Auto adjust ranges" should be used if you want to display progress for the constantly increasing values like time or distance, in this case you define initial progress interval, e.g. 10 minutes or 1 kilometer, then you set range values as 0 - 600 (time value is checked in seconds) or 0 - 100 (distance is referred to in hundreds of meters the same as it is displayed) and when value reaches upper value of this initial rage, ranges will be readjusted using the same difference as before: in the example with minutes new range values will become 600 - 1200, with distance 100 - 200 respectively. This kind of variable arc definition is used in default layout to display progress to next kilometer.
  • Former Member
    Former Member over 8 years ago
    Thank you for developing this great app.

    I would like to request,

    Gradient (%) in both data value and data graph.
    Milestone ETA (Estimated Time and Estimated Clock Time).
    Display the next milestone like Runner HUD.
    Current LAP Pace.

    I am a big fan of your apps, I would be glad to donate if there is anyway to do that.

    Thank you.
  • Strange thing with GCM, it should work the same as Express, but as different Garmin teams are working on these applications many strange things can happen... What mobile platform are you on: Android or IOS? Will settings be updated if you send them from GCM and then reboot watch?


    I am on iOS. Unfortunately reboot watch didn't help :( It is quite tedious to copy and paste on mobile, I save the text strings from PC to a text file on dropbox, then open text file in iOS dropbox, copy, switch apps to GC, paste first string, rinse and repeat for other 3 strings.

    Your variable arc definition is correct. Option to "Auto adjust ranges" should be used if you want to display progress for the constantly increasing values like time or distance, in this case you define initial progress interval, e.g. 10 minutes or 1 kilometer, then you set range values as 0 - 600 (time value is checked in seconds) or 0 - 100 (distance is referred to in hundreds of meters the same as it is displayed) and when value reaches upper value of this initial rage, ranges will be readjusted using the same difference as before: in the example with minutes new range values will become 600 - 1200, with distance 100 - 200 respectively. This kind of variable arc definition is used in default layout to display progress to next kilometer.


    Excellent, thanks!