完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
大家好,我用的是开发板D3315和V1Y11。我添加了一个PrimeStar来显示我的电池的百分比。当百分比低于20%时,我想把颜色变为红色,所以我这样做:GFxGoLoopObjultHealth*POBJCT3;POBJCTX3= GFXGOLL ObjestDebug(GFXI索引X0,PrimsSARB1);(Akkuladung(AN2C)& lt;=20)// Akkuladung是在100和0之间{GfxGoGlObjObjultMyStand;MEMCPY(&;MyStand,和;GFxSythEngEnEnEy5,SIZEOF(GFXG-GOLOL ObjyPosits));//方案5是绿色的背景色E-PrimeStrusBar gfxGoLoopObjistStudiSeCCESET((gfxgOrgPrimeSrsBar *)POBJCT3),以及(Akkuladung(AN2C)& Gt;20)/(Akkuladung)在100和0之间{GFXGOLYOBORIGHORY MyStudie2;MyStudie2,和gfxyStudioNaMeNeE4,SiZeof(GFXGGOLL ObjyPosits);和/或方案4是PrimeStruBar GFXGoLoGoObjistTysSeriSeCe的绿色背景色((GFXGOL PrimeSrsBar*)POBJECT3),以及GFXO-GOLYObjStutsESET((FXXGOL GORPROSSRISBAR *)POBJCT3),GFX-GOLYPROSSRESBARLD DRAB BARYSTA STA这不管用,如果你能帮我的忙。
以上来自于百度翻译 以下为原文 Hi all, i'm using the development board DM320015 with HARMony V1_11. i added a Progres***ar to show the percent of my battery. I want to change the color to red when the percent goes under 20% so i made this: GFX_GOL_OBJ_HEADER *pObject3; pObject3 = GFX_GOL_ObjectFind(GFX_INDEX_0, ProgressBar1); GFX_GOL_ProgressBarPositionSet(((GFX_GOL_PROGRESSBAR*)pObject3), Akkuladung(an2c)); if (Akkuladung(an2c) <= 20) // Akkuladung is between 100 and 0 { GFX_GOL_OBJ_SCHEME myscheme ; memcpy(&myscheme,&GFX_SCHEME_NAME_5, sizeof(GFX_GOL_OBJ_SCHEME)); // Scheme 5 is with the green background color for the progres***ar GFX_GOL_ObjectStyleSchemeSet(((GFX_GOL_PROGRESSBAR*)pObject3), &myscheme); GFX_GOL_ObjectStateSet(((GFX_GOL_PROGRESSBAR*)pObject3), GFX_GOL_PROGRESSBAR_DRAW_BAR_STATE); } if (Akkuladung(an2c) > 20) // Akkuladung is between 100 and 0 { GFX_GOL_OBJ_SCHEME myscheme2 ; memcpy(&myscheme2,&GFX_SCHEME_NAME_4, sizeof(GFX_GOL_OBJ_SCHEME)); // Scheme 4 is with the green background color for the progres***ar GFX_GOL_ObjectStyleSchemeSet(((GFX_GOL_PROGRESSBAR*)pObject3), &myscheme2); GFX_GOL_ObjectStateSet(((GFX_GOL_PROGRESSBAR*)pObject3), GFX_GOL_PROGRESSBAR_DRAW_BAR_STATE); } this doesn't work so if you can help me Thanks Attached Image(s) |
|
相关推荐
2个回答
|
|
如果方案是在RAM中,那么您可以编辑方案和重绘。或者您可以指向并设置它,而不需要复制。否则它看起来是正确的。
以上来自于百度翻译 以下为原文 If you scheme is in RAM then you can just edit the scheme and redraw. Or you can point to the and set it without the copying. Otherwise it appears to be correct. |
|
|
|
我尝试了一切,但它不起作用。我用另一个方案创建了另一个PrimeStBar(禁用和不可见),我现在正在使用它,它/ Ak/ulkAdUng.()返回INTGFxGOLYObjObjultHeule*PoBubj.PoBoCux= GFxGoLo.ObjestDebug(GFXI索引x0,PrimeStBAR1);* POBJeTeNeXPo.PbjjTeNeX= GFXGOLL ObjeDebug(GFXI索引x0,PrimsSbBAR2);GFxGoLePraseSrBoStPosivSt集((GfxGoLePrimeStrubBar)PoBube),Akkuladung(AN2C);GFxGoLoopReSrsBARSITIONSETSET(((FxxGoLePrReSrsBar*)POBJeTeNeX),Akkuladung(AN2C));IF(Akkuladung(AN2C)& lt;=40){GFXGOLGOLL ObjistStistes RFxGoGlObjultHeope*(PbBoT)、GFxGOL PrimeSrSbAuHiDeStIt';GFxGoLoObjistStuteSeT((gfxgOlgObjyHealthHead *)POBJeTeNeXT)、GFxGoLoopReSsSbAdRuxStand状态;}(Akkuladung(AN2C)& Gt;40){GFXGOLGOOL ObjutStestESET((gfxgGOLL ObjyHealthHead *)POBCEDE)、GFXGOL GORPROSSRESBARUDRAYSTATE);t((g)解决方案,对大家有帮助。谢谢。
以上来自于百度翻译 以下为原文 I tried everything but it doesn't work. I created another Progres***ar (DISABLED and NOT VISIBLE) with another scheme (Color1=BRIGHTRED) I'm using it now and it works: // Akkuladung() returns an int GFX_GOL_OBJ_HEADER *pObject; pObject = GFX_GOL_ObjectFind(GFX_INDEX_0, ProgressBar1); GFX_GOL_OBJ_HEADER *pObjectNEW; pObjectNEW = GFX_GOL_ObjectFind(GFX_INDEX_0, ProgressBar2); GFX_GOL_ProgressBarPositionSet(((GFX_GOL_PROGRESSBAR*)pObject), Akkuladung(an2c)); GFX_GOL_ProgressBarPositionSet(((GFX_GOL_PROGRESSBAR*)pObjectNEW), Akkuladung(an2c)); if (Akkuladung(an2c) <= 40) { GFX_GOL_ObjectStateSet(((GFX_GOL_OBJ_HEADER*)pObject), GFX_GOL_PROGRESSBAR_HIDE_STATE); GFX_GOL_ObjectStateSet(((GFX_GOL_OBJ_HEADER*)pObjectNEW),GFX_GOL_PROGRESSBAR_DRAW_STATE); } if (Akkuladung(an2c) > 40) { GFX_GOL_ObjectStateSet(((GFX_GOL_OBJ_HEADER*)pObject),GFX_GOL_PROGRESSBAR_DRAW_STATE); } If there is another solution with the scheme, it will be helpful. Thanks |
|
|
|
只有小组成员才能发言,加入小组>>
5140 浏览 9 评论
1988 浏览 8 评论
1917 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3159 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2215 浏览 5 评论
708浏览 1评论
598浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
480浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
609浏览 0评论
505浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-8 19:37 , Processed in 1.159343 second(s), Total 81, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号