cancel
Showing results for 
Search instead for 
Did you mean: 

Is this data model safe

shark
Senior

In order to implement my ui component more independently, I design it this way.

// subclass of container

MyComponent::MyComponent()

{

// init some ui

// ...

Application::getInstance()->registerTimerWidget(this);

}

MyComponent::~MyComponent()

{

Application::getInstance()->unregisterTimerWidget(this);

}

void MyComponent::handleTickEvent()

{

if(backend_data_dirty){

backend_data_dirty = 0;

// update some ui

}

}

I have designed some components this way, and can run smoothly. So I avoided use touchgfx's model and presenter completely.

But recently, when more and more ui put together, program always crashed at FrontendApplication.hpp

  virtual void handleTickEvent()

  {

    model.tick();

    FrontendApplicationBase::handleTickEvent();

  }

As no source code suplied, I have no way to debug it.

2 REPLIES 2
shark
Senior

The problems of touchgfx's model and presenter is, it runs at Screen level, not component level.

So if I have 10s or more components in a screen, all these backend data should go through one model/presenter of a screen, It is difficult to maintain later.

And if a same component which needs polling backecd data is used in another screen, I have to do it again.

Hope someone can help to make this component level model work.

Martin KJELDSEN
Chief III

I don't really see this as a "problem". And i'm not really sure what you mean by "i have to do it again".

/Martin