Senior III
March 1, 2023
Solved
TouchGFX Wildcards: How to display a blank space
- March 1, 2023
- 2 replies
- 2031 views
Hello,
I am using the TouchGFX application to display data gathered from CANbus communication, which I have verified is working. One feature I wanted to have is the following logic for fault error codes:
If a fault is present, display the error code in hexadecimal (with a user manual to outline the meaning of said error codes) in red.
If no fault is present, then I want NO text to be present. I do not want to show "0x00000000". I just want no text to be there at all.
I've attached a snippet of my code that writes the value into the wildcard currently. This solution does not work.
void Screen1View::UpdateFaults(uint64_t value){
if(value != 0x00000000){
Unicode::snprintf(textFaultSigBuffer, TEXTFAULTSIG_SIZE, "%x", value);
}
else{
Unicode::snprintf(textFaultSigBuffer,TEXTFAULTSIG_SIZE, "%x","" );
}
// Invalidate text area, which will result in it being redrawn in next tick.
textFaultSig.invalidate();
}Instead of displaying a blank space, it shows 8031650 (like in the picture).
Does anyone know how to make it just display no text at all?