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).
  • Former Member
    Former Member over 8 years ago
    Looking forward to the potential of ETA at next milestone (basically a predicted finish time) and also the possibility of other graphics if memory allows. I'm thinking a variable size line similar to arc so that I can have a straight HR gauge and bar charts based on time in each zone (probably the same thing really).

    Not sure if you are able to extract LTHR from the watch but if so would it be possible to show current HR as a % of LTHR?

    Here are all of the values given to connectIQ apps, if value is not there, then I'll have to calculate that and sometimes this requires access to the whole activity data, which is also not possible. I've already implemented most of the variables, which have numeric values. Basically, only persistent content (course points data), swim specific fields and derailleur data are left out of scope.

    altitude &#8658; Float
    The altitude in meters.
    averageCadence &#8658; Number
    The average cadence in revolutions per minute.
    averageDistance &#8658; Float
    The swim stroke average distance in meters from the previous interval.
    averageHeartRate &#8658; Number
    The average heart rate in beats per minute.
    averagePower &#8658; Number
    The average power in watts.
    averageSpeed &#8658; Float
    The average speed in meters per second.
    bearing &#8658; Float
    bearing is the direction from your current location or position to the destination of navigation in radians.
    bearingFromStart &#8658; Float
    bearingFromStart is the direction of desired track from start of navigation to destination in radians.
    calories &#8658; Number
    The current calories burned during the current activity being recorded in kcal.
    currentCadence &#8658; Number
    The current cadence in revolutions per minute.
    currentHeading &#8658; Float
    The current true north referenced heading in radians.
    currentHeartRate &#8658; Number
    The current heart rate in beats per minute.
    currentLocation &#8658; Location
    The current location.
    currentLocationAccuracy &#8658; Number
    GPS Accuracy (See the accuracy member of the Info object in the Position module for more information).
    currentPower &#8658; Number
    The current power in watts.
    currentSpeed &#8658; Float
    The current speed in meters per second.
    distanceToDestination &#8658; Float
    Distance to the destination in meters.
    distanceToNextPoint &#8658; Float
    Distance to the next point in meters.
    elapsedDistance &#8658; Float
    Distance in meters.
    elapsedTime &#8658; Number
    Elapsed time of the activity in milliseconds.
    elevationAtDestination &#8658; Float
    Elevation at the destination in meters.
    elevationAtNextPoint &#8658; Float
    Elevation at the next point in meters.
    energyExpenditure &#8658; Float
    Momentary energy expenditure in kcals/min (www.firstbeat.com/consumers/analyzed-by-firstbeat-features#4).
    frontDerailleurIndex &#8658; Number
    Index of the Front Bicycle Derailleur.
    frontDerailleurMax &#8658; Number
    Max index on the Front Bicycle Derailleur.
    frontDerailleurSize &#8658; Number
    Gear size on the Front Bicycle Derailleur.
    maxCadence &#8658; Number
    The maximum cadence in revolutions per minute.
    maxHeartRate &#8658; Number
    The maximum heart rate in beats per minute.
    maxPower &#8658; Number
    The maximum power in watts.
    maxSpeed &#8658; Float
    The maximum speed recorded during the timed activity, in meters per second.
    nameOfDestination &#8658; String
    Name of the destination.
    nameOfNextPoint &#8658; String
    Name of the next point.
    offCourseDistance &#8658; Float
    Distance to the nearest point on course in meters.
    rearDerailleurIndex &#8658; Number
    Index of the Rear Bicycle Derailleur.
    rearDerailleurMax &#8658; Number
    Max index on the Rear Bicycle Derailleur.
    rearDerailleurSize &#8658; Number
    Gear size on the Rear Bicycle Derailleur.
    startLocation &#8658; Location
    The starting location of the activity.
    startTime &#8658; Moment
    The starting time of the activity.
    swimStrokeType &#8658; Number
    The swim stroke type from the previous length.
    swimSwolf &#8658; Number
    The swimming SWOLF score from the previous length.
    timerState &#8658; Number
    The recording timer state.
    timerTime &#8658; Number
    Timer time in milliseconds.
    totalAscent &#8658; Float
    The total ascent in meters.
    totalDescent &#8658; Float
    The total descent in meters.
    track &#8658; Float
    track is the direction of travel or track in radians.
    trainingEffect &#8658; Float
    Training Effect: The activity's level of effect on aerobic fitness.


    What I actually planned after lap pace is fixed in priority sequence is:
    - bugfixes for new functionality blocks after each iteration,
    - gradient % because I think I understand how this should be implemented,
    - rectangle variable sizes similar to variable arc width;
    - estimated clock time arrival to next milestone because it just extends existing value,
    - custom dynamic colors (user defined pairs of range value and color, e.g. for power zones or bike cadence, as currently only running cadence values are hard-coded),
    - temperature (simple readings from Sensor module, not a dedicated logic to connect to Tempe)
    - VO2 Max because I can find formulas to compute this value although still not decided which one to use.

    I can consider other things like direction to the waypoint from list, custom font based icons, data values based on relatively simple calculation technique which does not require access to the data volume in tens of minutes, but only if there'll still be enough free memory, because as I already mentioned: the more code I write, the less space is left for data itself.
  • I tested lap pace during drive to work this morning with your latest update. Unfortunately still not working. I see same behaviour as others have reported.

    Exact problem report: Start timer and lap pace is stuck on 2:32 min/km. After first auto lap at 1km, lap pace changes to 5:05 min/km which is my target pace. Thereafter, it stays constant at 5:05 no matter how many laps. Also instead of auto lap, I see same behaviour if I manually press lap button.

    So maybe it is your flow control, or array offset? I take it you cannot test on a real device as you only have Forerunner 230?

    By the way, the low pace issue is definitely fixed now in my opinion.
  • Also, I'd like to suggest the following layout for these tests (values placed in a table-like manner in two adjacent columns): timer time - lap time, average pace - lap pace, elapsed distance - lap distance. This way it'll be easier to analyze whether the lap pace is at least on par with native average pace value within one data field.


    Can you please post a local layout string for this and I will test tonight
  • Former Member
    Former Member over 8 years ago
    I tested lap pace during drive to work this morning with your latest update. Unfortunately still not working. I see same behaviour as others have reported.

    Exact problem report: Start timer and lap pace is stuck on 2:32 min/km. After first auto lap at 1km, lap pace changes to 5:05 min/km which is my target pace. Thereafter, it stays constant at 5:05 no matter how many laps. Also instead of auto lap, I see same behaviour if I manually press lap button.

    So maybe it is your flow control, or array offset? I take it you cannot test on a real device as you only have Forerunner 230?

    Thank you for testing, but have you noticed Fabio's comment about how he changed definition and lap pace started to work more predictably? I think that problem was not in removing white background and related memory issues, but as he cleared browser cache beforehand sending updated definition to watch therefore making sure he uses latest definition string format. Can you try to do the same? I mean, please, clear you browser cache, make some slight change to layout for the definition string to update and then send settings to watch once again.

    I do have only FR230, that's right, but I will try to sideload a temporary solution with bundled lap pace layout since I won't be able to use settings for this one. What puzzles me most is that I've never seen this behavior in simulator starting from the initial release...

    For lap values testing I meant something like this:
    ACPAIA[ADRU[CDOE]CPACABActivityASADRV\ACOE]CPFCABASADRW[AHOE]CPFCABASADRXZAMOE]CPFCABAVAKGV^CDOE]CPACABLapASOPBZNACOE]CPFCABASOPB[MAGOE]CPFCACASOPB\LAMOE]CPFCAB
  • I threw one together also, includes timer time and elapsed time as I want to make sure I understand that difference too.

    And yes, i will clear browser cache (CTRL-F5 for Chrome!)

    AE_ARAWAGORFCDJOHXVDAABTimeASAGSKGACJOHXVFAABAYAGOSYCDOE]CPDAABE TimeASAGSLYADOE]CPFAABAZAGOUKCDJOHXVDAABAv PaceASAGSNKAHJOHXVFAABAXAGOV_CDOE]CPDAABEDistASAGSO`AMOE]CPFAABAUHJIXRABJNATXDVADHJAVAHW^YCDOEH]LEEABLapAUHJZWYABOEH]LFYABBWAYAHCINCDOE]CPDEABL TimeASOL_LZACOE]CPFEABAYAHCJaCDJOHXVDEABL PaceASOL_NLAGJOHXVFEACAXAHCLTCDOE]CPDEABLDistAVOL_OaAMOE]CPFEAB%fG
  • Lap pace is fixed! It was refresh web designer cache that did it. Congrats it wasn't your code!!!

    Onward and upwards for your other improvements!
  • Sorry, I spoke too soon :( I made some changes to the layout, and old behaviour is back exactly as before. No time for more testing tonight...
  • Sorry, I spoke too soon :( I made some changes to the layout, and old behaviour is back exactly as before. No time for more testing tonight...


    I&#8217;ve been able to reproduce the issue with the &#8218;frozen&#8216; lap pace at 02:50 and 5:40. I&#8217;ve build from scratch a new design with black background and Lap pace works fine, after that I&#8217;ve added a white circle filled element as background, changed text color to black and the lap pace started to freeze again.
    Removing the the filled circle and replaced with a rectangular one it did also result in a frozen lap pace.
    After removing the white background and turning the text to white again lap pace worked again&#8230; I've repeated this several times, always with the same result.

    The interesting part is, that if I add a filled black circle with as a background than lab pace still works. So either does the white background or the change in text color from white to black influence the frozen lap pace behavior... very strange... any ideas?

    does this help somehow?
  • Former Member
    Former Member over 8 years ago
    2 PatFelstead, orofab
    With Fabio's test-case I was able to locate the bug: it was related to the colors indeed but not in a way you might have thought.
    In my compute section I execute two pass cycle: one is to get actual display values and another is for dynamic color base values. Recently one of the users pointed me out that pacemaker target pace (internal field id == 0) was not displayed and I fixed that by changing check "value type > 0" to "value type >= 0" this resulted in additional calculation pass for all of the fields (as internal field id == 0 for the color base values means that specific color is selected for this value) and if there were some lap values on the way, then their first additional value was replaced with pacemaker target pace. This is fixed now and I hope we are finally through this one, v0.33 is out. Thank you for your help once again.
  • Lab pace is working now, thank you.

    However the values still differs a bit to the native Garmin field. Anyway... it's working and will test my DYI data field during an intensive session. ;)