完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我要实现的功能是点正弦按键的时候显示正弦波,按方波按键显示方波。现在的问题是只点击其中一个都正常,先点其中一个再点另一个就会两个波形都出现。我觉得应该是原来的数据项没有删除,所以调用了GRAPH_DATA_YT_Clear,结果直接异常了。。。。求解决,谢谢。前两个button都能正常工作,但是一按第三个立刻就异常了 也就是这句话:GRAPH_DATA_YT_Clear(hData);
相关代码如下: case ID_BUTTON_14: // Notifications sent by '正弦波¨' switch(NCode) { case WM_NOTIFICATION_CLICKED: // USER START (Optionally insert code for reacting on notification message) convert_sin();//计算正弦表 hData=GRAPH_DATA_YT_Create(GUI_RED,200,wave_data,200); GRAPH_DATA_YT_SetOffY(hData, 60); GRAPH_DATA_YT_SetAlign(hData, GRAPH_ALIGN_LEFT); hItem = WM_GetDialogItem(pMsg->hWin, ID_GRAPH_0); GRAPH_SetGridDistX(hItem, 10); GRAPH_SetGridDistY(hItem, 10); GRAPH_SetGridVis(hItem, 1); GRAPH_AttachData(hItem, hData); // USER END break; case WM_NOTIFICATION_RELEASED: // USER START (Optionally insert code for reacting on notification message) // USER END break; // USER START (Optionally insert additional code for further notification handling) // USER END } break; case ID_BUTTON_15: // Notifications sent by '·方波¨' switch(NCode) { case WM_NOTIFICATION_CLICKED: // USER START (Optionally insert code for reacting on notification message) convert_square(); hData=GRAPH_DATA_YT_Create(GUI_RED,200,wave_data,200); GRAPH_DATA_YT_SetOffY(hData, 60); GRAPH_DATA_YT_SetAlign(hData, GRAPH_ALIGN_LEFT); hItem = WM_GetDialogItem(pMsg->hWin, ID_GRAPH_0); GRAPH_SetGridDistX(hItem, 10); GRAPH_SetGridDistY(hItem, 10); GRAPH_SetGridVis(hItem, 1); GRAPH_AttachData(hItem, hData); // USER END break; case WM_NOTIFICATION_RELEASED: // USER START (Optionally insert code for reacting on notification message) // USER END break; // USER START (Optionally insert additional code for further notification handling) // USER END } break; case ID_BUTTON_16: // Notifications sent by '清除graph' switch(NCode) { case WM_NOTIFICATION_CLICKED: // USER START (Optionally insert code for reacting on notification message) // hData=GRAPH_DATA_YT_Create(GUI_RED,200,wave_data,200); // hItem = WM_GetDialogItem(pMsg->hWin, ID_GRAPH_0); GRAPH_DetachData(hItem, hData); GRAPH_DATA_YT_Clear(hData); // GRAPH_DetachData(hItem, hData); // GRAPH_DATA_YT_Delete(hData); // WM_DeleteWindow(hItem); // hItem = WM_GetDialogItem(pMsg->hWin, ID_GRAPH_0); // GRAPH_SetBorder(hItem, 2, 2, 2, 2); // hItem = GRAPH_CreateEx(120, 60, 200, 130, WM_HBKWIN, WM_CF_SHOW, 0, ID_GRAPH_0); // hData = GRAPH_DATA_YT_Create(GUI_RED,200,wave_data,200); // GRAPH_AttachData(hGraph, hData); // USER END break; case WM_NOTIFICATION_RELEASED: // USER START (Optionally insert code for reacting on notification message) // USER END break; // USER START (Optionally insert additional code for further notification handling) // USER END } // USER END } break; |
|
相关推荐
3个回答
|
|
怎么没有人回复呢??求帮助啊
|
|
|
|
|
|
谢谢站长
|
|
|
|
只有小组成员才能发言,加入小组>>
709 浏览 0 评论
1116 浏览 1 评论
2494 浏览 5 评论
2833 浏览 9 评论
移植了freeRTOS到STMf103之后显示没有定义的原因?
2675 浏览 6 评论
使用eim外接fpga可是端口一点反应都没有有没有大哥指点一下啊
661浏览 9评论
672浏览 7评论
请教大神怎样去解决iMX6Q在linux3.0.35内核上做AP失败的问题呢
789浏览 6评论
636浏览 5评论
679浏览 5评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-26 15:53 , Processed in 1.218047 second(s), Total 84, Slave 65 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号