2023-07-16 01:26 PM
Hi friends, I have this problem:
static uint16_t txt[10];
2023-07-17 03:17 AM
Okey,i think you must have
TextIndicator.setWildcard(TextIndicatorBuffer);
since in some machine states use setTypedText funtion. Place this setWildcard in the states you use wildcard buffer.
2023-07-17 03:29 AM - edited 2023-07-17 03:31 AM
I tried, but not work, if you see, was in the first comment in the start. Everyting seems work in first attempt I call the machine, but from the second one not work...
this work very well..
I considering to open a touchgfx ticket... really strange issue.
2023-07-17 03:33 AM
Sorry my brains are in holiday:grinning_face_with_sweat:
If you use setTypedText()- function in some machine state, you must return it also to the original single use id. Like this:
TextIndicator.setTypedText(touchgfx::TypedText(T___SINGLEUSE_IGD9));
Open your view-base.cpp and check singleuse ID there.
Maybe easier is to not use setTypedText, but do like this
Unicode::snprintf( TextIndicatorBuffer,TEXTINDICATOR_SIZE,"%s",TypedText(T_STATEPRODUCTMANAGERWC1).getText());
in the TIMING_ANSWER_HOLD, then the correct single-use ID stays.
2023-07-17 03:36 AM
here is better expalanation:rolling_on_the_floor_laughing:
2023-07-17 04:27 AM
Dear JTP1, I tried to change all lines in snprintf not using TextIndicator.setTypedText(blabla)... not work nothing at all! seems that if I use for this wildcard snprintf, after work once, it not will work over on this buffer.
if you look at the TIMING_ANSWER_HOLD, you can see the same for productSelectorCounter... and this work...
It work onli the first called routine in this sequence... after stop .
2023-07-17 04:52 AM
I think it should work just fine. Here is my working example:
float f=0.21;
float Screen1View::functionGetFloat()
{
f+=.15;
return(f);
}
void Screen1View::testButtonClicked()
{
static uint16_t txt[10];
Unicode::snprintfFloat(txt,6U,"%0.2f",functionGetFloat());
//TextIndicator.setWildcard(TextIndicatorBuffer);
TextIndicator.invalidate();
Unicode::snprintf( TextIndicatorBuffer,TEXTINDICATOR_SIZE,"%s %s",TypedText(T_STATEPRODUCTMANAGERWC5).getText(),txt);
TextIndicator.setTypedText(touchgfx::TypedText(T___SINGLEUSE_IGD9));
TextIndicator.resizeToCurrentText();
TextIndicator.invalidate();
}
void Screen1View::testbutton2Clicked()
{
TextIndicator.invalidate();
TextIndicator.setTypedText(TypedText(T_TEST));
TextIndicator.resizeToCurrentText();
TextIndicator.invalidate();
}
Texts:
textarea settings:
Depending on your text lenghts, you might need to invalidate text area also before change content. (if new is shorter than old, and you are changing the ID from typed ID to wildcard ID).
Check all your instances of 'TextIndicator'. If you share your code as code, not picture, and more code, somebody might find your problem :thumbs_up:
2023-07-24 07:01 AM
hi JTP1, I not solved the problem, I don't know why but this not work in my code. for time restrict in the work, by now I changed all in a simple retTypedText