Suunto app Forum Suunto Community Forum
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    [Question] No stupid questions - ask anything here

    Scheduled Pinned Locked Moved Suunto Plus Development
    125 Posts 33 Posters 9.3k Views 31 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Thibault B.T Offline
      Thibault B. Bronze Member @SuuntoPartnerTeam
      last edited by Thibault B.

      Update: it works since new watch update (option to enable touch screen during activity).

      @SuuntoPartnerTeam

      I’m having trouble getting this to work on my device 😕. I then found this comment to see if I can figure it out but no.
      It works fine in the simulator, but not on my Suunto Race S.

      Here’s the relevant part of my code:
      <uiViewSet id=“prevIntSet” onTap=“$.put(‘/Zapp/{zapp_index}/Event’, 2, null, ‘int32’)”>

      In my JavaScript, I handle event ID 2 and update a variable that switches between different uiViewSet views. However, it seems like the tap interaction isn’t triggering anything on the watch.

      I also checked the settings on my Race S but couldn’t find anything that might be blocking this behavior.
      One thing I noticed: when the screen dims, tapping doesn’t seem to do anything at all—except on the map screen, where it wakes the display. This makes me wonder if there’s a setting or limitation that completely disables tap events in a SuuntoPlus app.

      Has anyone encountered this or knows if there’s a specific setting I might be missing?

      Thanks in advance!

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        SuuntoPartnerTeam @surfboomerang
        last edited by

        @surfboomerang No comment on getting the runtime token working outside of <eval>, but in case it’s of any help, an alternative, more standard solution might be:

        function getUserInterface() {
          output.index = ??? // here or somewhere else'
          return { 
            template: "t"
           };
        }
        
        

        and

        <uiView onLoad="
          function change(idx) {
            navigate('#uiViewSet1', idx)
          }
          $.get('Zapp/{zapp_index}/Output/index', change);
        ">
        
        1 Reply Last reply Reply Quote 1
        • S Offline
          SuuntoPartnerTeam @Thibault B.
          last edited by

          @Thibault-B. Are you absolutely sure you have touch enabled? Sounds like you are doing an exercise which has the touch options ‘Map Only’, ‘On’ or ‘Off’ and yours is on ‘Map Only’. You can switch it to ‘On’ either via ‘Exercise options’ before starting the exercise or by holding the down button during the exercise to open the control panel.

          And just for clarity, this works on the original Race:

          <uiViewSet id="uiViewSet1" onTap="$.put('/Zapp/{zapp_index}/Event', 2, null, 'int32')"
               style="top: 50%; left: 50%; width: 150px; height: 150px; background-color: red;">
                <div>lol</div>
                <div>lel</div>
              </uiViewSet>
          
          function onEvent(_inp, _out, event) {
            if (event == 2) {
              next("#uiViewSet1", event);
            }
          }
          

          As an aside, this is also why using touch events is a bit problematic, since they often aren’t ‘On’ for many watch users.

          Thibault B.T 1 Reply Last reply Reply Quote 0
          • U Offline
            Unpaired8373
            last edited by

            @suuntopartnerteam I am working with a sprite map currently and have two approaches where I would need some guidance on:

            Is it better to have a bigger sprite map with different permutations of individual elements or is it better to have a smaller map with each element as individual sprite but more <img> tags in the HTML?

            1 Reply Last reply Reply Quote 0
            • Thibault B.T Offline
              Thibault B. Bronze Member @SuuntoPartnerTeam
              last edited by Thibault B.

              Update: it works since new watch update (option to enable touch screen during activity).

              @SuuntoPartnerTeam Thanks for your reply.

              I tested your code in a fresh default project created from scratch. It works correctly in the simulator, but still not on my Suunto Race S.

              I also reviewed the watch settings. The only options that seem potentially related to the touchscreen are “Do Not Disturb” and display settings (AOD, full wake-up), and both are configured correctly.

              In my case, the touch event is not critical—it’s mainly a nice-to-have feature used to manually cycle through data, which already rotates automatically every few seconds.

              1 Reply Last reply Reply Quote 0
              • Raimo JärviR Offline
                Raimo Järvi @surfboomerang
                last edited by

                @surfboomerang said in [Question] No stupid questions - ask anything here:

                I’m trying to pass the default index of a uiViewSet like this:

                main.js

                function getUserInterface(input) {
                  return { 
                    template: "t",
                    uiViewSet:{index: input}
                   };
                }
                

                This is assigning all input resource values (i.e an array) to index, perhaps that’s not what you’re looking for? You could use an individual input or output value, e.g.:

                function getUserInterface(_input, output) {
                  return { 
                    template: "t",
                    uiViewSet: { index: output.index }
                  };
                }
                

                There also seems to be some string case conversion going on, I only get it to work if I use all lowercase {zapp_uiviewset_index} in HTML.

                Perhaps the more standard solution in the previous answer is better, but using input or output values is also possible.

                Also, if you return uiViewSet:{index: input}, the minified JavaScript code will be: return{template:'t',uiViewSet:{index:input}}. This seems incorrect, because input variable doesn’t exist in the minified code. Maybe there’s no use case for this, but looks like a JavaScript conversion / minifier bug anyway.

                Pragmatic Programmer

                surfboomerangS 1 Reply Last reply Reply Quote 1
                • surfboomerangS Offline
                  surfboomerang @Raimo Järvi
                  last edited by

                  @Raimo-Järvi Nice find! Thanks for diving into this as well.
                  In the mean time I had to change some other code and the issue became obsolete, but I will definitly remember this in future projects.

                  Suunto Vertical Titanium Solar
                  OnePlus Nord 4

                  1 Reply Last reply Reply Quote 0
                  • C Offline
                    chus1962
                    last edited by chus1962

                    Hi.

                    Is there a way to obtain the GPS position using a input resource other than

                    /Navigation/Gps/Coordinates/{Filter}

                    which requires enabling navigation on the watch at the start of the exercise, something that’s not desirable for the app I’m developing?

                    Thanks.

                    Edit: That service provides the coordinates even if navigation is disabled. It’s possible that if navigation is disabled, it takes a few seconds to provide them, which is why my code failed as initially written.

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      assaf1007 @Tomas5
                      last edited by

                      @Tomas5 the only diff is see between us is the stroke color. maybe default is black so you don’t see it?
                      b88f3a44-84e8-423c-a620-e67333f40c38-image.png

                      Tomas5T 1 Reply Last reply Reply Quote 1
                      • A Offline
                        assaf1007
                        last edited by

                        2 questions regarding Settings

                        • How can a user approach my app’s seetings if i bypass the suuntoplus app? (i deploy directly…)

                        • and another settings question:

                        on vsCode i wish to keep a setting value for the next time, so , as a test to see if it works i do:

                        var loadSettings = function(input, output) {
                        settings = localStorage.getObject(“appSettings”);
                        settings.active++;
                        if (settings == null) {
                        settings = {
                        maxPace: 12,
                        timelapse: 123,
                        active: 0
                        }
                        }
                        localStorage.setObject(“appVariables”, settings); //save
                        }

                        so i’m advancing ++ and saving.

                        • on vsCode indeed it works (i added debug on UI to view value), but on my watch it stays 1…
                          ideas?
                        surfboomerangS S 2 Replies Last reply Reply Quote 0
                        • surfboomerangS Offline
                          surfboomerang @assaf1007
                          last edited by

                          @assaf1007

                          @assaf1007 said in [Question] No stupid questions - ask anything here:

                          How can a user approach my app’s seetings if i bypass the suuntoplus app? (i deploy directly…)

                          You can use a “data.json” file to enter the settings. Is that what you’re looking for?

                          Suunto Vertical Titanium Solar
                          OnePlus Nord 4

                          A 1 Reply Last reply Reply Quote 0
                          • Tomas5T Offline
                            Tomas5 Gold Members @assaf1007
                            last edited by

                            @assaf1007 thanks it helped, in simulator line is always blue regardless storke color, but in watch it needs defined stroke-color to work properly.

                            Suunto Ambit 2 > Suunto 5 > Suunto Race 2

                            1 Reply Last reply Reply Quote 1
                            • A Offline
                              assaf1007 @surfboomerang
                              last edited by

                              @surfboomerang i’m using data.json and may use its values inside the .js file
                              but i wish to be able to set values at the watch itself (if possible), not at vsCode or suuntoplus app.
                              imagine a co2 table (for freedive practice) where user must set specific personal values.

                              • in such case, i need (= user need) some kind of a preliminary UI (before app starts) to be able to update settings…
                              1 Reply Last reply Reply Quote 0
                              • brechtvbB Offline
                                brechtvb Bronze Member @Dimitrios Kanellopoulos
                                last edited by

                                @Dimitrios-Kanellopoulos Hello, should the BLE-connection system in the SDK also work in the simulator on windows?

                                Nikolai SimonovN 1 Reply Last reply Reply Quote 0
                                • Nikolai SimonovN Offline
                                  Nikolai Simonov @brechtvb
                                  last edited by

                                  @brechtvb no BLE works only on the physical wacth

                                  Suunto Race 2 Ti
                                  Suunto Race
                                  Suunto 9 Baro

                                  Suunto Aqua
                                  Suunto Wings

                                  1 Reply Last reply Reply Quote 0
                                  • Thibault B.T Offline
                                    Thibault B. Bronze Member
                                    last edited by Thibault B.

                                    @suuntopartnerteam or others, I have a few questions:

                                    1. type=“subscribe-when-shown” in an eval.
                                      – Is it more efficient when the related subscribed information is not displayed?

                                    2. I do not find the setting to enable touch screen on Suunto Race S. It is also disabled in menu to select end of workout. -> Solved since new watch update which provides this setting.

                                    Thanks.

                                    1 Reply Last reply Reply Quote 0
                                    • K Offline
                                      Kriete
                                      last edited by

                                      Hi, I tried to get offline maps data from some Caribbean islands but I cannot get them from the maps download. I was looking for st. Maarten or Saba for example. Can these maps be added to download please? They are visible on the maps itself, but not as offline map.

                                      1 Reply Last reply Reply Quote 0
                                      • Tomas5T Offline
                                        Tomas5 Gold Members
                                        last edited by

                                        Does anyone tried to display array of values in <graph> element? I tried output array as variable and show it in graph using get compilation type but i am not suceasfull yet.

                                        Suunto Ambit 2 > Suunto 5 > Suunto Race 2

                                        1 Reply Last reply Reply Quote 0
                                        • surfboomerangS Offline
                                          surfboomerang
                                          last edited by

                                          @suuntopartnerteam

                                          I try to get thedistance, bearing and coordinates of a POI

                                          For the distance I use “/Navigation/Poi/Active/Distance” which indeed returns the distance.

                                          For coordinates I try to use “/Navigation/Targetlocation/Coordinates”. This works in the simulator but no results on the watch
                                          For bearing I use “/Navigation/Targetlocation/Bearing” which is undocumented, but suggested by the intellisense. This one also doesn’t report any values.

                                          Is it possible to get the bearing and coordinates of a selected POI?

                                          Suunto Vertical Titanium Solar
                                          OnePlus Nord 4

                                          1 Reply Last reply Reply Quote 0
                                          • S Offline
                                            SuuntoPartnerTeam @assaf1007
                                            last edited by SuuntoPartnerTeam

                                            @assaf1007 You are using two different strings for getObject and setObject.

                                            This should be a minimal working example which pushes settings.active up by 1 whenever you start an exercise:

                                            var settings = null;
                                            function onLoad(input, output) {
                                              settings = {
                                                maxPace: 12,
                                                timelapse: 123,
                                                active: 0,
                                              };
                                              loadSettings()
                                            }
                                            
                                            var loadSettings = function () {
                                              var loaded = localStorage.getObject("appSettings");
                                              if (loaded != null) settings = loaded;
                                              // else localStorage.setObject("appSettings", settings);
                                            
                                              settings.active++;
                                              localStorage.setObject("appSettings", settings);
                                            };
                                            
                                            function evaluate(_inp, _out) {
                                              setText("#active", String(settings.active))
                                            }
                                            
                                            function getUserInterface() {
                                              return {
                                                template: 't'
                                              };
                                            }
                                            

                                            and the html:

                                            <uiView>
                                              <div>
                                                <div id="active" class="p-m">
                                                  0
                                                </div>
                                              </div>
                                            </uiView>
                                            

                                            So:

                                            but i wish to be able to set values at the watch itself (if possible) … in such case, i need (= user need) some kind of a preliminary UI (before app starts) to be able to update settings…

                                            Possible indeed! The ‘tennis score pro’ application has a start screen which saves the settings for the next time.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Suunto Terms | Privacy Policy