2020-02-05 03:43 AM
I am new to TouchGFX. I am working on STM32 controller based project. In that TFT LCD screen is one of the peripherals. I want to create screens using TouchGFX so that i can set value on screen and run timer according to the value entered on screen, during this complete duration my led will be ON
2020-09-16 04:48 AM
If it's a custom container then you just implement your setter/getter functions in the Custom Container that you will call from your screenView and do the model presenter scheme.
You can do whatever you want in your custom container. It's a custom container so that's all yours.
/Alexandre
2020-09-16 04:51 AM
Thanks @Alexandre RENOUX .
I am able to do that functionality via what you have said.
I just don't find any items or functions for displaying date like digital clock?
2020-09-16 05:01 AM
If you don't want to use the digital clock you can simply create your own Text Area where the time is incremented every second. Usually it's better to create a Custom Container for that. There's no function or item to do so, except the digital clock. But it is fairly easy to implement.
Otherwise, sorry but I don't understand your question. Could you be more precise ?
/Alexandre
2020-09-16 05:05 AM
Okay. I am currently trying with TextArea only.
Basically I want to display Date also with current time. So for displaying date I will use TextArea with wildcraft.
2021-07-29 07:52 AM
Hi,
I've included into every screen a custom container ( called "TopBar" ) that is in charge to show the time and other system icons .
The new custom container has the handleTickEvent() enabled, call every second a HAL_RTC_GetTime function and update some text field.
Also should update all the system icons and other filed commons to all your screens menus.
To enable the handleTickEvent() function You have to initialize it manually into the main initialize() function
void TopBar::initialize()
{
TopBarBase::initialize();
Application::getInstance()->registerTimerWidget(this);
}
void TopBar::handleTickEvent()
{
if(HAL_GetTick()-tick_global>1000)
{
Update_date_and_time();
update_icons();
show_alarm();
}
}
regards.
2022-07-15 06:34 AM
@ChintanParmar @Alexandre RENOUX
Thank you already for the code provided. I'm trying to do the exact same thing but unlike Chintan, I didn't manage to make the functionality work (model/presenter/custom container passing of values). I have the values in the screen but I can't pass it to my digital clock + at the ending of the screen, return the values to the screen (from screen to model at the teardown I get it). And if I try to update my value of the clock in the screen, it doesn't want me to because it's protected (normal).
Do you still have the code you used to manage that Chintan?
Thanks in advance.