cancel
Showing results for 
Search instead for 
Did you mean: 

Old content/screen when updating information on screen.

Marco.R
Senior

Hello

I'm using TouchGFX 4.10 with a custom board (STM32F767) and I have a problem, where old value/content will be displayed when updating another value on screen.

Procedure in which the problem occurs:

  • I have two textareas on screen (e.g. TextA and TextB)
  • The initial values are: TextA: "ABC" / TextB: "DEF"
  • In General: The values will be updated through Model->Presenter->View / Touch is not used
  • (Step1) Updating TextA to "123" and invalidating TextA
    • Text on Screen -> TextA: "123" / TextB: "DEF"
  • (Step 2) Updating TextB to "456" and invalidating TextB
    • Text on Screen -> TextA: "ABC" / TextB: "456"
    • TextA is wrong!
  • (Step3) Updating TextB to "789" and invalidating TextB
    • Text on Screen -> TextA "123" / TextB: "789"
    • TextA and TextB are correct
  • When I repeat Step 2 then I have the wrong values again

I don't know where the problem is, but I assume it has something to do with the doublebuffering. When I invalidate both values in every steps, it works correctly.

But this can/should not be the solution, because this happens not only with texts also with bitmaps and other widgets.

Has anyone an idea what is wrong?

Thanks

Best regards

Marco

13 REPLIES 13

A few side notes:

  • When you enter a screen and set an initial text on your text area that text will be displayed in the first complete rendering of that screen.
  • If you resize a text area to be smaller than it was previously, you must also invalidate the parts of the text area that are now "missing". E.g. if your text is originally "ABCD" and you update it to be "ABC", call resizeToCurrentText(), invalidate the newly resized text area, you will still see "ABCD" because "D" is still in the framebuffer. That part of the text area was not asked to be updated.

To your side notes:

- After entering the screen, everthing is displayed correctly

- I use fixed size for the text. This is easier to handle, with our design requirements.

Unfortunately it is not allowed to me to share the project on a forum. If you provide me your e-mail address I could send you the project (only the touchgfx parts of it).

With the simulator it works fine. So I don't think it is an issue with the simulator, too. Interestingly, both texts are updated in the simulator, even if only one text changes (seen with F2 option is active in the simulator)

I also tried to reproduce it with a simple example on an Eval-board. It's no problem either. The behaviour of the DMA is the same.

So I tried to find out the difference between the example and our code. The only thing I see is that we are updating the screen outside the tick method of the model. Could this be the problem? I'll try tomorrow, if it works better when I update the screens only in the tick method.

​Hi @Martin KJELDSEN​ 

I refactored the code (from previous post) like this:

void Model::tick()
{
    if (modelListener != 0)
    {
        if (m_valueAChanged)
        {
            modelListener->updateValueA(m_valueA);
            m_valueAChanged = false;
        }
        if (m_valueBChanged)
        {
            modelListener->updateValueB(m_valueB);
            m_valueBChanged = false;
        }
    }
}
 
void Model::updateValueA(const uint32_t newValue)
{
    m_valueA = newValue; 
    m_valueAChanged = true;
}
 
void Model::updateValueB(const uint32_t newValue)
{
    m_valueB = newValue;
    m_valueBChanged = true;
}

Now everything works as expected. It looks like it is very important that the screen updates has to be done within the tick method.

Thank you for your help

Best regards

Marco

Hi Marco,

Glad you got it working. Yes, tick() is the heart of your application. Whether it be from Model::tick() and then through a modelListener or otherwise, or through the tick method in your view.

/Martin