Languages

Menu
Sites
Language
Unable to change tick rate on watch

I'm trying to change the tick rate using SetTimeTickFrequency(60, TimeTickResolution.TimeTicksPerSecond), but when I test on my Galaxy Watch 3, I see Tick event called only once per second. My code within the Tick event :

 

if (_ViewModel != null)
    		{
				_ViewModel.Time = time.Time.UtcTimestamp;

				if (_LastTickTime == null || _LastTickTime == time)
				{
					_LastTickTime = time;
					_ViewModel.DeltaTime = 0.0;
				}
				else if (_LastTickTime != time)
				{
					_ViewModel.DeltaTime = (time.Time.UtcTimestamp - _LastTickTime.Time.UtcTimestamp).TotalSeconds;
				}
			}

I then take _ViewModel.DeltaTime and use it to move an image around the watchface. The image does move as I expect, but it jumps in time with the clock element I have on the screen as well.

 

Edit: As a test, I switched my watchface to be my test application, and found that when run that way, my image didn't move at all. I then added that code above to the AmbientTick event just to see what would happen, and saw no change in behavior.

 

Are we not able to change the ticks-per-second for watches?

Edited by: Pfhoenix on 27 Jan, 2021
View Selected Answer

Responses

4 Replies
Mark as answer
Hyunho Kang

I am sorry for your inconvenience. For now, our Tizen WatchTime.UtcTimestamp always returns 0 for milliseconds, and it could make you feel like the SetTimeTickFrequency method is not working.
SetTimeTickFrequency is working well, and you can use WatchTime.Millisecond to get millisecond instead of WatchTime.UtcTimestamp. 

We will fix this WatchTime.UtcTimestamp always returns 0 milliseconds bug, but it has not been decided when to apply the patch to devices.

Pfhoenix

That information was very helpful! SetTimeTickFrequency is indeed working. Another question, however :

 

In relation to my edit, I'm seeing some odd behavior. When I run without debug from VS2019, my watchface app loads onto my watch and runs as I expect. When I then stop it, and set my watch's current watchface to my app, I see no animation any more. Is there a Tick() call difference or something?

Hyunho Kang

If I understand correctly, you mean the animation that when you change the clock, the hands of the clock change from 10:8 am to the current time is not applied to your watch application, right? Unfortunately, for now, the Galaxy Watch home application only supports that animation for watches made with Galaxy Watch Designer so, you cannot use the animation for your dotnet watch application.

Pfhoenix

Actually, no. I fixed the problem, but let me explain :

 

My code is attempting to calculate the difference in real time passed between tick calls, DeltaTime. It tried to do this by saving a reference to the last WatchTime object passed in the TickEventArgs parameter passed to OnTick in my FormsWatchFace subclass. What I was seeing was a DeltaTime calculated of 0 every Tick call. When I switched my _LastTickTime from a WatchTime reference to the last calculated time value (time.Seconds + time.Milliseconds / 1000.0), I started seeing the behavior I was expecting. This means there's some really funky object pooling or data persistence happening with WatchTime or TickEventArgs (maybe a memory usage optimization to avoid allocations within the Tizen.Net framework).