Skip to content

ViSi-Genie: onChanging and onChanged Events

Details

Number 4D-AN-00002
Difficulty Easy
Supported Processors PICASO, PIABLO-16, PIXXI-44, PIXXI-28
Supported Environments ViSi-Genie

Description

This Application Note explains the two events raised by an object, onChanging and onChanged.

Document Project File - DIABLO-16 Project File - PICASO

Prerequisites

Application Overview

In this application note, the project consists of two objects:

  • A track bar for input.
  • A meter for output.

track bar and Meter

The track bar sends the value to the meter.

Events

Setup Procedure

This application note comes with a zip file which contains two ViSi-Genie projects.

ViSi-Genie: projects

For instructions on how to launch Workshop4, how to open a ViSi-Genie project, and how to change the target display, kindly refer to the section Setup Procedure of the application notes:

Simulation Procedure

Let's consider the track bar. Touching the track bar contains three different moments:

  1. Touch is pressed down,
  2. Touch is maintained down and moved,
  3. Touch is released.

Trackbar

onChanging

The onChanging event is set to Meter0Set.

Meter0Set

The Trackbar0 object sends message continuously as long as the touch is maintained and every time the touch position changes.

Trackbar0

This corresponds to the 2nd moment. Many values are sent from 80 down to 20. The meter is updated continuously.

onChanged

The onChanged event is set to Meter0Set.

Meter0Set

The Trackbar0 object sends a message only when touch is released, so only at the 3rd moment.

Trackbar0

Only one value is sent, 20. The meter is only changed once, when the touch is released.

Combining Both

Both events can be combined.

Let's add a third object, a LED Digits, called LedDigits0 with 3 digits and no decimal.

LED Digits

Let's define for the track bar two events:

  • OnChanged: update the LedDigits0,
  • OnChanging, update the Meter0.

LedDigits0

The meter is going to be updated continuously while the LED digits are going changed only when the touch is released, with 20.

Trackbar 1 Trackbar 2

Build and Upload the Project

For instructions on how to build and upload a ViSi-Genie project to the target display, please refer to the section Build and Upload the Project of the following application notes:

The uLCD-32PTU and/or the uLCD-35DT display modules are commonly used as examples, but the procedure is the same for other displays.

Debugger Output

Setting the handler to Message sends the values to the debugger, Genie Test Executor or GTX.

Launch the Debugger

To launch the Genie Test Executor or GTX, select the Tools menu.

Genie Test Executor

and then click on the GTX button.

GTX

A new screen appears, with the form and objects we have defined previously:

Forms and Objects

onChanging

Object Inspector

onChanging sends all the values:

Trackbar Change 11:49:37.359 [07 05 00 00 01 03]
Trackbar Change 11:49:37.389 [07 05 00 00 02 00]
Trackbar Change 11:49:37.420 [07 05 00 00 03 01]
Trackbar Change 11:49:37.450 [07 05 00 00 05 07]
Trackbar Change 11:49:37.482 [07 05 00 00 07 05]
Trackbar Change 11:49:37.513 [07 05 00 00 08 0A]
Trackbar Change 11:49:37.516 [07 05 00 00 09 0B]
Trackbar Change 11:49:38.433 [07 05 00 00 5A 58]
Trackbar Change 11:49:38.468 [07 05 00 00 5C 5E]
Trackbar Change 11:49:38.494 [07 05 00 00 5E 5C]
Trackbar Change 11:49:38.526 [07 05 00 00 60 62]
Trackbar Change 11:49:38.529 [07 05 00 00 61 63]
Trackbar Change 11:49:38.560 [07 05 00 00 62 60]
Trackbar Change 11:49:38.588 [07 05 00 00 63 61]
Trackbar Change 11:49:38.620 [07 05 00 00 64 66]

onChanged

Report Message

While onChanged sends only the last value:

Trackbar Change 11:49:38.620 [07 05 00 00 64 66]