GUI Guider (LVGL v9 simulator) FreeMASTER binding: Meter with Image Needle disappears GG_METER h

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GUI Guider (LVGL v9 simulator) FreeMASTER binding: Meter with Image Needle disappears GG_METER h

155 Views
ryan_hong_wtmec
Contributor I

Hi all,
I’d like to share an issue and workaround for GUI Guider + LVGL v9 simulator with FreeMASTER binding.

Environment: GUI Guider 9.2 / 1.10.0 GA, LVGL v9 simulator (lvgl-simulator or lv_web_emscripten),
FreeMASTER JSON-RPC WebSocket (ws://localhost:41000), Windows 10/11.

Problem: When a FreeMASTER variable is bound to a Meter/Scale widget using an Image Needle,
the needle disappears or does not update correctly. The same variable bound to a Label updates
normally (e.g., 40–60), so the incoming value is valid.

Workaround/Fix: Patch the simulator code (or the template) here:
C:\nxp\GUI-Guider-1.10.0-GA\environment\template\project\v9\lvgl-simulator\gg_external_data\freemaster\freemaster_client.c

Update the GG_METER case to safely handle image needles vs line needles (and add NULL guards):

case GG_METER:
{
for (int i = 0; i < user_parm->arrayLen; i++)
{
meter_needle *nd = (meter_needle *)user_parm->childObjArray[i];
int v = atoi(dataArray[i]);

if (nd && nd->needle_obj)
{
if (lv_obj_check_type(nd->needle_obj, &lv_image_class))
lv_scale_set_image_needle_value(user_parm->parentObj, nd->needle_obj, v);
else
lv_scale_set_line_needle_value(user_parm->parentObj, nd->needle_obj, nd->needle_length, v);
}
}
break;
}


Question: Is this a known issue? If not, could this fix be integrated into future GUI Guider releases/templates?

Thanks.

0 Kudos
Reply
1 Reply

130 Views
Celeste_Liu
NXP Employee
NXP Employee

Hello @ryan_hong_wtmec ,

Thank you for sharing. I will report this to the internal team and wait for their further confirmation.

Thank you for again your contribution in the NXP community.

BR

Celeste

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2267842%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EGUI%20Guider%20(LVGL%20v9%20simulator)%20FreeMASTER%20binding%3A%20Meter%20with%20Image%20Needle%20disappears%20%20GG_METER%20h%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2267842%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20all%2C%3CBR%20%2F%3EI%E2%80%99d%20like%20to%20share%20an%20issue%20and%20workaround%20for%20GUI%20Guider%20%2B%20LVGL%20v9%20simulator%20with%20FreeMASTER%20binding.%3C%2FP%3E%3CP%3EEnvironment%3A%20GUI%20Guider%209.2%20%2F%201.10.0%20GA%2C%20LVGL%20v9%20simulator%20(lvgl-simulator%20or%20lv_web_emscripten)%2C%3CBR%20%2F%3EFreeMASTER%20JSON-RPC%20WebSocket%20(ws%3A%2F%2Flocalhost%3A41000)%2C%20Windows%2010%2F11.%3C%2FP%3E%3CP%3EProblem%3A%20When%20a%20FreeMASTER%20variable%20is%20bound%20to%20a%20Meter%2FScale%20widget%20using%20an%20Image%20Needle%2C%3CBR%20%2F%3Ethe%20needle%20disappears%20or%20does%20not%20update%20correctly.%20The%20same%20variable%20bound%20to%20a%20Label%20updates%3CBR%20%2F%3Enormally%20(e.g.%2C%2040%E2%80%9360)%2C%20so%20the%20incoming%20value%20is%20valid.%3C%2FP%3E%3CP%3EWorkaround%2FFix%3A%20Patch%20the%20simulator%20code%20(or%20the%20template)%20here%3A%3CBR%20%2F%3EC%3A%5Cnxp%5CGUI-Guider-1.10.0-GA%5Cenvironment%5Ctemplate%5Cproject%5Cv9%5Clvgl-simulator%5Cgg_external_data%5Cfreemaster%5Cfreemaster_client.c%3C%2FP%3E%3CP%3EUpdate%20the%20GG_METER%20case%20to%20safely%20handle%20image%20needles%20vs%20line%20needles%20(and%20add%20NULL%20guards)%3A%3C%2FP%3E%3CP%3Ecase%20GG_METER%3A%3CBR%20%2F%3E%7B%3CBR%20%2F%3Efor%20(int%20i%20%3D%200%3B%20i%20%26lt%3B%20user_parm-%26gt%3BarrayLen%3B%20i%2B%2B)%3CBR%20%2F%3E%7B%3CBR%20%2F%3Emeter_needle%20*nd%20%3D%20(meter_needle%20*)user_parm-%26gt%3BchildObjArray%5Bi%5D%3B%3CBR%20%2F%3Eint%20v%20%3D%20atoi(dataArray%5Bi%5D)%3B%3C%2FP%3E%3CP%3Eif%20(nd%20%26amp%3B%26amp%3B%20nd-%26gt%3Bneedle_obj)%3CBR%20%2F%3E%7B%3CBR%20%2F%3Eif%20(lv_obj_check_type(nd-%26gt%3Bneedle_obj%2C%20%26amp%3Blv_image_class))%3CBR%20%2F%3Elv_scale_set_image_needle_value(user_parm-%26gt%3BparentObj%2C%20nd-%26gt%3Bneedle_obj%2C%20v)%3B%3CBR%20%2F%3Eelse%3CBR%20%2F%3Elv_scale_set_line_needle_value(user_parm-%26gt%3BparentObj%2C%20nd-%26gt%3Bneedle_obj%2C%20nd-%26gt%3Bneedle_length%2C%20v)%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%3CBR%20%2F%3Ebreak%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EQuestion%3A%20Is%20this%20a%20known%20issue%3F%20If%20not%2C%20could%20this%20fix%20be%20integrated%20into%20future%20GUI%20Guider%20releases%2Ftemplates%3F%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2267842%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ECommunication%20%26amp%3B%20Control(I3C%20%7C%20I2C%20%7C%20SPI%20%7C%20FlexCAN%20%7C%20Ethernet%20%7C%20FlexIO)%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2267914%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20GUI%20Guider%20(LVGL%20v9%20simulator)%20FreeMASTER%20binding%3A%20Meter%20with%20Image%20Needle%20disappears%20%20GG_METER%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2267914%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F258268%22%20target%3D%22_blank%22%3E%40ryan_hong_wtmec%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20sharing.%20I%20will%20report%20this%20to%20the%20internal%20team%20and%20wait%20for%20their%20further%20confirmation.%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20again%20your%20contribution%20in%20the%20NXP%20community.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3ECeleste%3C%2FP%3E%3C%2FLINGO-BODY%3E