2024-10-24 02:10 AM
Hello! First post on this forum.
I need to run automated testing of a TouchGFX application in an isolated environment.
The application takes screen snapshots and stores them to files.
It should not need a display to run if it can just render images to the display buffer and capture the result.
It runs on windows, and the framework I have uses docker containers, so it would be nice to
run headless, while still taking snapshots, in a windows build.
Is it possible to produce that kind of headless build? Would it run in a Windows Nano server container?
Best regards
/M
Solved! Go to Solution.
2024-11-04 07:11 AM
Hello @maste ,
First, welcome to TouchGFX community :).
We don't have this functionality out-of-the box, but it may be possible with few modifications :
1) In main.cpp add the line :
static_cast<touchgfx::HALSDL2 &>(hal).setWindowVisible(false, false)
before
setupSimulator(argc, argv, hal);
2) Then the capture the framebuffer, you need to call :
uint16_t* fb = touchgfx::HAL::getInstance()->lockFrameBuffer()
dont forget to unlock it with unlockFrameBuffer() when you are done.
You can draw inspiration from the Lens demo where framebuffer operations are performed.
I hope it helps,
BR,
2024-11-04 07:11 AM
Hello @maste ,
First, welcome to TouchGFX community :).
We don't have this functionality out-of-the box, but it may be possible with few modifications :
1) In main.cpp add the line :
static_cast<touchgfx::HALSDL2 &>(hal).setWindowVisible(false, false)
before
setupSimulator(argc, argv, hal);
2) Then the capture the framebuffer, you need to call :
uint16_t* fb = touchgfx::HAL::getInstance()->lockFrameBuffer()
dont forget to unlock it with unlockFrameBuffer() when you are done.
You can draw inspiration from the Lens demo where framebuffer operations are performed.
I hope it helps,
BR,
2024-11-04 07:30 AM
2024-11-15 02:45 AM
I did not try myself but I got a message from the application developers, and they were
able to do it in approximately this way. I do not know any details, but it is a great relief for me
to know that this is not a showstopper. Thank you very much!
2024-11-18 07:08 AM
"Lens demo"
In 4.24.1, it called the "Custom Widget Example".
Thanks for the suggestion Louis.