UNA-Watch Simulatorο
The simulator application works only on Windows OS. The UNA Simulator works with TouchGFX Designer and Visual Studio.
Note: If you move the application to another location, you need to update the relative path to TouchGFX library path.
See: Transfer Application
Getting Startedο
Need Componentsο
Download and install TouchGFX Designer.
If you want to work with UNA Simulator in Visual Studio, then:
Download and install Visual Studio.
In the Installing window, where you select the required packages, go to Workloads β Desktop & Mobile and choose Desktop development with C++.
In Installation Details, for Desktop development with C++ select MSVC v143, then click Install.
Install UNA_SDK variable {#install-una-sdk-variable}ο
Run the PowerShell script export-stm32-tools.ps1, located in:
Utilities\Scripts\export-stm32-tools.ps1This script sets the UNA_SDK environment variable and configures STM32 tools.
Start Simulatorο
TouchGFX Designerο
TouchGFX Designer does not support Debug mode. If you want to debug the project, use Visual Studio.
Open
<name>.touchgfx, located in:
<app_name>\Software\Apps\TouchGFX-GUIWhen opening the project for the first time, click Generate Code (F4). This only needs to be done once.
Click Run Simulator (F5).
Visual Studioο
This step only needs to be done once. Open the application project in TouchGFX Designer and click Generate Code (F4).
Go to:
<app_name>\Software\Apps\TouchGFX-GUI\simulator\msvsOpen the Application.vcxproj file.
Start debugging by pressing F5.
Simulationο
Buzzerο
Buzzer actions are printed in the terminal as log messages. Example:
I- Mock.Buzzer::play::39 : [0] time=150 ms, level=3 I- Mock.Buzzer::play::39 : [1] time=100 ms, level=0 I- Mock.Buzzer::play::39 : [2] time=150 ms, level=3
Explanation:
[] β note array index
time β duration in milliseconds
level β sound level (1β3), 0 means no sound
Backlightο
Backlight actions are printed in the terminal as log messages.
I- Mock.Backlight::on::22 : called, timeout = 5000 I- Mock.Backlight::off::30 : off backlight
There are two types of log messages:
turning the backlight on with a timeout in milliseconds
turning the backlight off
Vibroο
Vibro actions are printed in the terminal as log messages.
I- Mock.Vibro::play::31 : play(melody[1]) I- Mock.Vibro::play::34 : [0] effect=1, loop=0, pause=0
Explanation:
[] β note array index
effect β vibration effect ID
loop β number of repetitions
pause β pause between effects
Sensorsο
In the file ConfigurationSimulator.hpp, you can enable/disable sensor simulation and configure parameters.
Location:
<app-name>\Software\Apps\TouchGFX-GUI\simulator
For examples of sensor integration and data handling, see the Sensors Tutorial.
GPSο
Simulates speed, altitude, and distance.
The simulated user moves around a stadium track.
Includes a timer for satellite acquisition.
Can simulate GPS signal loss.
Adds noise to latitude/longitude.
Configuration options:
enable/disable sensor
minimum and maximum speed
satellite search time
//GPS Sensor
#define GPS_SIM_ENABLE 1 // 0 - Disable
#define GPS_SIM_SPEED_MIN 20 // km/h
#define GPS_SIM_SPEED_BASE 25 // km/h
#define GPS_SIM_SPEED_MAX 30 // km/h
#define GPS_SIM_TIME_SEARCH_SATELLITE 7 // seconds
Heart Rateο
Simulates:
HR (Heart Rate)
AHR (Average Heart Rate)
RHR (Resting Heart Rate)
trust level
Options:
enable/disable sensor
minimum and maximum heart rate
training type (Cycling / Hiking / Running)
//HeartRate Sensor
#define HEART_RATE_SIM_ENABLE 1 // 0 - Disable
#define HEART_RATE_SIM_MIN_HR 50
#define HEART_RATE_SIM_MAX_HR 140
#define HEART_RATE_SIM_TYPE_TRAINING 0 // 0 - Cycling, 1 - Hiking, 2 - Running
Battery Levelο
Simulates battery voltage drop.
Options:
enable/disable sensor
initial value
decrease step
// Battery Level Sensor
#define BATT_LEVEL_SIM_ENABLE 1 // 0 - Disable
#define BATT_LEVEL_SIM_START_VALUE 100 // 10 - 100%
#define BATT_LEVEL_SIM_STEP_VALUE 0.1 //percent
Pressureο
Simulates Presure value.
Options:
enable/disable sensor
set value pressure, which changes in a small range
// Pressure Sensor
#define PRESSURE_SIM_ENABLE 1 // 0 - Disable
#define PRESSURE_SIM_PRESS_VALLUE 1020.2
IMU Wrist Detectionο
Simulates wrist detection.
A wrist detection event activates the backlight for 5 seconds.
Options:
enable/disable sensor
change the key used to trigger the event
To simulate a wrist detection event, press key 5.
// IMU Writs Sensor
#define IMU_WRIST_SIM_ENABLE 1 // 0 - Disable
#define IMU_WRIST_SIM_WRIST_DETECT_KEY 5
IMU Step Counterο
Simulates Step Counter. Step Counter get Speed with the GPS Speed module and convert to steps.
Options:
enable/disable sensor
// IMU StepCounter Sensor
#define IMU_STEP_COUNTER_SIM_ENABLE 1 // 0 - Disable
Include Header & Source fileο
MSVSο
Open Application.vcxproj in a text editor: `<app_name>\Software\Apps\TouchGFX-GUI\simulator\msvs
Add header paths to ClInclude.
Add source file paths to ClCompile.
GCCο
Open MakeFile in text editor:
<app-name>\Software\Apps\TouchGFX-GUI\simulator\gccAdd header paths to ADDITIONAL_INCLUDE_PATHS.
Add source file paths to ADDITIONAL_SOURCES_UNA.
Transfer Application {#transfer-application}ο
If you move the application to another location, you need to update the TouchGFX library path.
Open
<name>.touchgfxin text editor:<app_name>\Software\Apps\TouchGFX-GUIFind βTouchGfxPathβ: and update the relative path to
<una_sdk>/ThirdParty/touchgfx.Example:"SelectedStartupLanguage": "GB", "TouchGfxPath": "touchgfx", "UIPath": ".",
If you move the una_sdk folder, you must update UNA_SDK environment variable. See: Install UNA_SDK variable