829 views
in Embedded Wizard Studio by

Like the this project:   https://ask.embedded-wizard.de/9206/a-specific-gui-use-case

      At my project have 2 page: MainPage and DoubleFingerSlidePage.  MainPage will been default show when screen power ON, DoubleFingerSlidePage have 2 list that been control by 2 finger slide. When double finger slide at MainPage, EW will PresentDialog the DoubleFingerSlidePage

      MainPage is been divided to left area and right area,   if SlideTouchHandler.HittingPos at left area,  DoubleFingerSlidePage will show List1. if SlideTouchHandler.HittingPos at right area,  DoubleFingerSlidePage will show List2.

      I have many widgets such as buttons and sliders( use SimpleTouchHandler ) integrated into the MainDialog. So if two fingers touch the screen one after another, it will often come to the case that the first finger touches a widget, and the second touches elsewhere, which may be MainPage or another widget. In this case, recognition of 2 finger slide is also required.

       To overcome the difficulty,  I introduced a signal counting the finger number on the screen from the touch driver. My idea was to have the event that the finger number increases from 1 to 2  trigger Presenting the Dialog.

       For this way, when two finger touch at MainPage,  the DoubleFingerSlidePage will been PresenDialog Immediately. But if One of the two finger touch a widget, the widget function will been trigger before PresenDialog DoubleFingerSlidePage.  The widget function been trigger isn't we want to see.

       How to Avoid The widget function been trigger?

 

2 Answers

0 votes
by

To Avoid The widget function been trigger, I set all the SimpleTouchHandler property LimitToFinger = 0. When the screen check more than 1 finger touch, forbid the SimpleTouchHandler trigger it's function.

We release this test fucntion to our customer , our customer find a new problem:

1. When one finger touch at MainPage,  other widget can't use at the same time

0 votes
by

Hello ke007,

I have many widgets such as buttons and sliders( use SimpleTouchHandler ) integrated into the MainDialog. So if two fingers touch the screen one after another, it will often come to the case that the first finger touches a widget, and the second touches elsewhere, which may be MainPage or another widget. In this case, recognition of 2 finger slide is also required.

...

The widget function been trigger isn't we want to see.

Have you tested out the example I have prepared for you in the thread grab cycle and touch influence with another touch. It demonstrates how this is done.

To Avoid The widget function been trigger, I set all the SimpleTouchHandler property LimitToFinger = 0. When the screen check more than 1 finger touch, forbid the SimpleTouchHandler trigger it's function.

This will have the effect of the handler reacting only on the first finger (finger with number 0).

When one finger touch at MainPage,  other widget can't use at the same time

I'm not sure what behavior is your customer expecting. But from your description it seems to be contradictory. You can processes either two fingers as a composed 2-finger gesture or you process the touches as individual interactions. The UI can't deduce your intention what to do when the user touches the screen with two fingers.

Best regards

Paul Banach

by

Hello Paul:

Follow The  grab cycle and touch influence with another touch answer, I Have try this way:

Step 1: The SlideTouchHandler in MainPage component has to lie in front of the Push Button.

Step 2: The SlideTouchHandler in MainPage component has to be configured with the property NoOfFingers=2.

Step 3: Connect a slot method to SlideTouchHandler 's OnPress property. In the implementation of the slot method present the DoubleFinger dialog.

Step 4: The SlideTouchHandler in Basic component has to be configured with the property RetargetCondition=Core::RetargetReason[WipeDown, WipeLeft, WipeRight, WipeUp].

 

But this case will happen:

Two finger tap one after another (within 50ms), if the fisrt finger is tap a blank area, and the last finger touch a HorizontalValueBar, then slide 2 finger,

we can see that: HorizontalValueBar function is trigger,  the slot to present the DoubleFingerDialog can't been trigger

this case we don't want happen.

by

Hello ke007,

are you sure it is a Horizontal Value Bar? I'm asking that because this widget does not contain any touch handler. For the touch event processing it is thus 'transparent'.

Nevertheless, to work correctly this application case requires that the Simple Touch Handler overlays all other widgets. In other words, it has to fill the entire screen and lie in front of all other widgets. Have you tested it? If you have doubts, the simplest could be to upload here a simple example of your application case demonstrating the issue. In such case please add instructions what to do in order to provoke the error. I will then analyze it.

Best regards

Paul Banach

by
Sorry Paul:
       I describe wrong,the Horizontal Value Bar is control by a SimpleTouchHandler,which two widget have the same size and SimpleTouchHandler lie in front of the HorizontalValueBar . HorizontalValueBar value change follow the position that been touch/slide on  SimpleTouchHandler.
       I makesure that the SlideTouchHandler is in front of all other widget. when 2-finger-slide in the screen,   about 70% can trigger SlideTouchHandler to present the DoubleFinger dialog,
about 30% trigger SimpleTouchHandler to control HorizontalValueBar change.
by

Hello paul:

     I have another question,at PC simulation environment,How to trigger the 2-finger-slide event on SlideTouchHandler? It need some External input device?

     Because at my project debug process,i and my project member found some bug:the function is very well when it's run on simulation environment,but when it's run  at Board can find some abnormal bug.

    for 2 example:

    1. EW Simulation show different with Board screen show - Ask Embedded Wizard (embedded-wizard.de),For your team's help we find the memory set limit when show the screen

    2. Last week we add a variable change at the slot that is Connect with SlideTouchHandler 's OnPress property. The variable is declare at Device part(global variable). we change the variable at SlideTouchHandler 's slot (just change variable at this slot), and use it at DoubleFingerDialog panel to limit some signal send out fucntion.  

      We find when it's run at simulation environment like expect. But happen some bug when it's work at board.  

      For my debug process and run with breakpoint,At board environment  we find that slot is run and change the variable value  when  DoubleFingerDialog panle have been present.  We add FindCurrentDialog() method to limit the slot change the variable value,but it's not work. But this bug not happen on simulation environment.

   

   So, i want to know for this problem "2 finger SlideTouchHandler intervene with SimpleTouchHandler", it's have some possible different when it run in simulation or board?

   Because i can't run 2-finger-slide function at simulation,so i want to have a try.

   At PC simulation environment, How to trigger the 2-finger-slide event on SlideTouchHandler? It need some External input device?

by
For the bug example-2 problem, we add another global variable to forbidden it happen, and the bug is been resolve.
by
There find a bug on the board. the SimpleTouchHandler that control the HorizontalValueBar, LimitToFinger = 0, NoOfFingers = 1, RetargetCondition not select anything.

But when 2-finger-slide on  SimpleTouchHandler area, the SlideTouchHandler (that check 2-finger-slide to present  DoubleFinger dialog panel) can't check 2-finger-slide, instead SimpleTouchHandler check 2-finger-slide and control HorizontalValueBar change. The bug Probability about 90% happen.

when 2 finger distance is too small,How to distinguish it's 1 finger or 2 finger?

Add test for this bug, use the same distance and direction, slide on blank area or on SimpleTouchHandler area. When slide on blank area,can normally present DoubleFinger dialog panel. When slide SlideTouchHandler area,can't normally present DoubleFinger dialog panel, instead to trigger SimpleTouchHandler control HorizontalValueBar change.
by

Hello ke007,

I makesure that the SlideTouchHandler is in front of all other widget. when 2-finger-slide in the screen,   about 70% can trigger SlideTouchHandler to present the DoubleFinger dialog,
about 30% trigger SimpleTouchHandler to control HorizontalValueBar change.

Are you sure, you are using a Slide Touch Handler to detect the two finger tap gesture which presents the DoubleFinger dialog? Please see once more my answer and the example project. It uses Simple Touch Handler.

Nevertheless, the description that some events are recognized correctly and some not can be related to the mentioned issue. Because of the dependencies I could prepare a patch for you for the version 12 or 13. The version 11 is too old. Is it ok.? If yes, please contact us via support@embedded-wizard.de.

I have another question,at PC simulation environment,How to trigger the 2-finger-slide event on SlideTouchHandler? It need some External input device?

No it is not necessary. Please see my answer commented which I repeat here:

You can test the correct detection and handling of single/multi-touch events in Prototyper. See the section Touch screen inputs.

For the bug example-2 problem, we add another global variable to forbidden it happen, and the bug is been resolve.
We find when it's run at simulation environment like expect. But happen some bug when it's work at board. 
We add FindCurrentDialog() method to limit the slot change the variable value,but it's not work. But this bug not happen on simulation environment.

Based on the provided information it is difficult to narrow down the issue. To avoid that we mix different problems, please open a separate thread and explain the issue or provide an example project.

Possible reason: if the variable resides inside an autoobject (e.g. belongs to a Device Class), the autoobject my be released if it is not in use. Then the content of the variable is lost. This behavior, if not desired, can't be prevented by creating a strong reference to the autoobject. See also Lifetime of an autoobject.

So, i want to know for this problem "2 finger SlideTouchHandler intervene with SimpleTouchHandler", it's have some possible different when it run in simulation or board?

I don't expect this. It is exact the same code base running during prototyping and in the target system. The unique difference is the frequency how often garbage collection runs and thus how often unused autoobjects are released. On the target system it starts usually after each screen update. During prototyping the garbage collection may be delayed for several seconds prolonging so the existence of the autoobject even if that object is not in use actually.

when 2 finger distance is too small,How to distinguish it's 1 finger or 2 finger?

Embedded Wizard does not calculate with the distance in order to distinguish the fingers. From Embedded Wizard point of view the system expects the underlying touch driver to track up to 10 fingers. The driver has to detect the press, drag and release events for each finger individually. This information has to be relayed 1:1 to the Embedded Wizard GUI application. 

I suppose your question refers the implementation in the touch driver? If yes, this is a detail of the touch driver and its software. What driver are you using? Or are you developing this driver by yourself?

Add test for this bug, use the same distance and direction, slide on blank area or on SimpleTouchHandler area. When slide on blank area,can normally present DoubleFinger dialog panel. When slide SlideTouchHandler area,can't normally present DoubleFinger dialog panel, instead to trigger SimpleTouchHandler control HorizontalValueBar change.

I have the impression that you fight with many different issues. I would recommend to isolate the issues and treat them separately. If you observe a problem with the touch driver, please open a new thread and hopefully one of my colleagues can help you. However, please note that touch driver development is not our task.

I hope it helps you.

Best regards

Paul Banach

by

Are you sure, you are using a Slide Touch Handler to detect the two finger tap gesture which presents the DoubleFinger dialog? Please see once more my answer and the example project. It uses Simple Touch Handler.

I not very sure for this problem, now i am out of office, because at the DoubleFingerDialog  use SlideTouchHandler control the list Scrollofset, maybe i am confuse with it.

Nevertheless, the description that some events are recognized correctly and some not can be related to the mentioned issue. Because of the dependencies I could prepare a patch for you for the version 12 or 13. The version 11 is too old. Is it ok.? If yes, please contact us via support@embedded-wizard.de.

Thank you for your help, but the project will end, and the project is too big to use in car. Maybe my leader unwilling to change EW version, because the working too big to use more time, maybe can't release the software to customer at target time.

I will try move my project to version 12.

when 2 finger distance is too small,How to distinguish it's 1 finger or 2 finger?

For this question,i just curiously about it. With the test result, i think it's no a important problem.

But follow your answer, i will check this problem for our basic driver software engineer.

 

by

The most important problem i want to say is that :

There find a bug on the board. the SimpleTouchHandler that control the HorizontalValueBar, LimitToFinger = 0, NoOfFingers = 1, RetargetCondition not select anything.

But when 2-finger-slide on  SimpleTouchHandler area, the SimpleTouchHandler2(that check 2-finger-slide to present  DoubleFinger dialog panel) can't check 2-finger-slide, instead SimpleTouchHandler check 2-finger-slide and control HorizontalValueBar change. The bug Probability about 90% happen.

Can you give me some idea to resolve this problem?

Or the only way to resolve this problem is to use Version 12/13 EW? 

by

Hello ke007,

Can you give me some idea to resolve this problem?

Or the only way to resolve this problem is to use Version 12/13 EW? 

frankly speaking the problem is still not clear to me. I do not really know how or where to help you further. What do you mean with 'there find a bug on the board'? May the bug be related to the touch issue? Does the touch handler behave correctly when the application run in the Prototyping environment? If you could reduce the issue to an example and provide it to us, we were able to analyze it.

One idea: why have you set LimitToFinger=0 of the Touch Handler controlling the Horizontal Value Bar? Try to set LimitToFinger=-1. This will ensure that the handler is not restricted to the first finger. Combined with the property NoOfFingers=1 the handler will still react on single finger interactions only but now it does not matter which finger it was.

Are you sure the touch driver/screen does provide correct touch events? As mentioned in one of my comments above, the GUI application depends on a correctly provided touch events. The touch driver has to identify and track the fingers touching actually the screen. When new finger touches the screen, the corresponding DOWN event should be send to the GUI application. When the finger is left, UP event should be sent. In the meantime, the driver should send MOVE events when the finger changes the position. Each event has to be associated to a finger number, which are counter starting with 0 for the first finger, 1 for the second, ... See also Step 4: Processing Cursor or Touch Screen Events.

 Best regards

Paul Banach

by

Hello paul:
      Thank you for your help.
      I add 2-finger-slide present DialogPanel function at the example project WashingMachine

      WashingMachine_change

     2-finger slide on the Washer panel, one finger touch TempList, another finger touch SpinList.  When 2-finger slide on the Washer panel, DialogPanel been present immediately , we can find two problem at the same time:

1. the TempList and SpinList move at the same time

2. the first time 2-finger slide, the test list on the DialogPanel can't move, when 2-finger slide again, the test list can move.

by

2. the first time 2-finger slide, the test list on the DialogPanel can't move, when 2-finger slide again, the test list can move.

this problem also happen on my preject, now it's have been resolved by a coincide way, but i don't know the right way to resolve this problem.

The same time, i  hope you try to resolve the problem1 first:

1. the TempList and SpinList move at the same time

by
About the idea to move our project to a EW Version 12,  it's have too many work to do, and need too many time. My leader reject this way.
by

I run this   WashingMachine_change project on EW version 12,Find this 2 problem on it:

1. the TempList and SpinList move at the same time

2. the first time 2-finger slide, the test list on the DialogPanel can't move, when 2-finger slide again, the test list can move.

by
Hello ke007,

as mentioned already, I don't really know how to help you. Your problem seems to be very unique and diffus. Is it a problem related to the hardware, touch driver, EW software, some misunderstanding, misconfiguration, .. ? I don't know. It could eventually help me when you at least answers my question which I repeat once more:

1. Have you tested the example I have prepared for you?

2. Have you tested this example also in the Prototyper?

3. Do the problems appear during Prototyping or/and in the target system?

4. If you have a concrete suspect error case, can you create a minimal example demonstrating it and upload it here for further investigation?

Trying to test the problem using Washing Maschine example is from my point of few less effective. It is a complex example. It is difficult to deduce what happens when you just add new touch handler to this application. Therefore:

5. Does Washing Maschine behave correctly when running the original example?

Best regards

Paul Banach
by

Is it a problem related to the hardware, touch driver, EW software, some misunderstanding, misconfiguration, .. ?

So i creat a demonstrating. For the simple demonstrating the interval is not happen, but on Washing Maschine example WashingMachine_change is happen.

I think for this test, we can focus on the EW software, the Washing Maschine example run normal before add 2-finger-slide present DialogPanel function, this is the only change at the example project. 

I have try to reproduction the interval problem on a sample demonstrate, but unlucky it's failed.  Maybe the interval problem just happen on complex project, at the same time my project also a complex project.

On the Washing Maschine example, I use the simplest way and least change to reproduction the interval problem, i have pay more time on this problem and try too many way to resolve this problem or makesure the reasons. It's very lucky to reproduction  on a example,i need your help!!!

 

by

Hello ke007,

i need your help!!!

How am I supposed to help you if you leave my questions unanswered and ignore my suggestions?

Maybe the interval problem just happen on complex project, at the same time my project also a complex project.

As mentioned in my answer above, the Washing Maschine is a complex example. It consists of several touch handlers stacked one above another. Additionally the handlers enable/disable other handlers during interactions. Adding new handlers to this application may produce results which are unexpected at first glance.

Is there a specific reason you're focusing on this example?

Please try to reproduce the issue using a simple application with similar functionality to your product.

Best regards

Paul Banach

by

Another attempt but I have no idea if it will help you as I still don't understand the problem you are struggling with.

As you remember, I have mentioned a possibility to provide you a patch for version 12 or 13 to fix an error we have detected some time ago. You are working with version 11.

With following modification in the file Core.ewu in version 11 you could add a part of the patch. Search the file for the same lines and replace the numbers. Left is the old, right the new version:

by

Hello Paul:

    Thank you for your help.

     I have try to follow your suggestions, but i can't reproduce the issue using a simple application. 

     when two finger touch at MainPage,  the DoubleFingerSlidePage will been PresenDialog Immediately. But if One of the two finger touch a widget, the widget function will been trigger before PresenDialog DoubleFingerSlidePage

     My project have more Widgets and the problem is easily happen when 2-finger-slide touch on the SipmleTouchHandler which control List or ValueBar.  This is the reason i use the Washing Maschine example.  

by

Hello ke007,

I was able to reproduce your application case. When analyzing the behavior note following two aspects:

1. When you present a dialog via PresentDialog(), the corresponding dialog appears with a small delay of at least one screen update. This delay may become longer if the dialog is presented with an animation. This is expected behavior.

2. When you present the dialog inside a component, widgets existing inside this component continue reacting to user inputs. This is an expected behavior too (for details see Take a closer look at the Dialog functionality).

Now let us analyze the application case:

3. Let's assume there is a component containing a Simple Touch Handler configured to react on 2-finger taps.

4. Furthermore let's assume the Simple Touch Handler is configured to redirect the touch events to other handler when the user performed a wipe gesture.

5. Finally let's assume behind the Simple Touch Handler is found a widget e.g. Push Button.

6. Now the user touches the screen with two fingers.

7. The Simple Touch Handler responds to this event. A signal is sent to a slot method associated to its OnPress property.

8. In the slot method you present a dialog.

9. The dialog is presented in context of the component containing the Simple Touch Handler (it was the case in your version of Washing Maschine).

10. The dialog appears after a short delay (see 1 above)

11. Now the user drags the fingers.

12. The Simple Touch Handler detects this gestures and asks which GUI component is willing to take over the interaction.

13. Since the dialog is already visible (note 10), the touch handler existing in the dialog is able to take over the interaction.

This was the good scenario with a delay between the 2-finger tap and the finger movement large enough to present the dialog. Now let focus on a first bad scenario:

3-9. are the same as above.

14. Still before the dialog appeared the user dragged the finger.

15. The Simple Touch Handler detects this gestures and asks which GUI component is willing to take over the interaction.

16. The dialog is not yet visible. It can't take over the interaction. This is because of the aspect 1 above.

17. Therefore the widget in the background takes over.

18. Your widget is activated.

A second bad scenario:

3-9. are the same as above.

19. The dialog appears after a short delay (see 1 above)

20. Now the user drags the fingers.

21. The screen position where the user touched does not lie inside the Touch Handler in the dialog.

22. The Touch Handler in the dialog thus can't take over the interaction.

23. Therefore the widget in the background takes over. This is true even if the dialog is already presented (visible). This is because of aspect 2 above.

24. Your widget is activated.

Now please open my example I have prepared for you some weeks ago. This example is implemented to correctly handle the aspects 1 and 2:

25. The first important detail is, the component containing the Simple Touch Handler intended to detect the 2-finger gestures and present the DoubleFinger dialog is also a dialog. This Basic dialog is presented at the startup time of the application. This is a condition to avoid aspect 1. Why? Even if DoubleFinger dialog will appear with a small delay, the fact that it was scheduled for the presentation may revoke the active state of the Basic dialog immediately. See in the example the code to present the Basic dialog:

26. Both the Basic and DoubleFinger dialogs are presented in context of the same owner, in this example in context of the Application component (root object). This is the a condition to avoid aspect 2. Note the usage of GetRoot() when the DoubleFinger dialog is presented:

Well I hope it clarifies the behavior.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...