2019-11-12 04:28 AM
I'm trying to use the Graph Widget in a Swipe Container, so that when I to another screen, I have another plot running. On touching the container this causes a hard fault, from which I can't find out what is causing it.
The Fault Analyzer in the IDE shows a Precise data access violation with BFAR: 0x4404ea68, so it seems like there is a memory overflow, but I can't pinpoint the place it happens. Is there any way I can narrow it down?
2019-11-12 05:23 AM
Let me just ask.
Could you break inside this function and inspect invalidatedArea? (width, height, x, y) - It's come to my attention that there may be an issue with this "example graph" code that's floating around where the width of the rect can become negative if the graph is not static but having its data heavily manipulated and perhaps when animating.
bool GraphLine::drawCanvasWidget(const Rect& invalidatedArea) const
/Martin
2019-11-12 05:31 AM
How would I get there right before the crash? I tried to set breakpoints in the swipeContainer.cpp files, to get a break right when I touch the screen, but that doesn't seem to work.
2019-11-12 06:42 AM
Write a piece of code in ::drawCanvasWidget where you check if the width of rect is negative. You should never hit this. If you do, you may hardfault.
/Martin
2019-11-13 12:11 AM
So it seems there wasn't a problem with the Graph Widget itself, but with adding an additional swipePage. I tried to do this in the my View.cpp after there was already a generated swipeContainer. Is it possble to add swipe pages after the generated container has already been added in the ViewBase.cpp?
2019-11-15 05:52 AM
Yes, you can add it with SwipeContainer.add(newPage), but if the page(container) is created in and added to the canvas in the designer, you have to remove it from the view before adding it to the Swipe Container with the function remove(newPage).
2021-03-03 02:43 AM
I noticed that if the graph isn't inside a swipe control and that the user swipe on left the graph, it causes an hard fault
2021-03-11 01:00 PM
I think this was fixed in a recent touchgfx release, however what I did was I placed an empty container on top of the graph and set it as a clicklistener in the designer. That way any clicks or swipes would get "eaten" by the container and none would pass on towards the graph.