硬汉嵌入式论坛

 找回密码
 立即注册
查看: 7114|回复: 9
收起左侧

[有问必答] stm32f103vc ssd1289 emWin 5.20 performance problem

[复制链接]

2

主题

5

回帖

2

积分

新手上路

积分
2
发表于 2014-5-19 10:08:15 | 显示全部楼层 |阅读模式
hellow

I come from poland, and it was really not easy to register here
I have some problem with my gui some demo skipped or freeze system
on example

info ok
bitmap ok
bar graph  skipped
graph 1 skiped  2graph freeze
color bar ok
fading ok
treeview  ot of memory
iconvew  of of memory

for me most important is graph

a  use armfly_X2_STemWin5.20
my project filles:
https://drive.google.com/file/d/0B-tweXloR_jHeFpfWlJGZ0RnN1k/edit?usp=sharing

Thanks for every help
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107641
QQ
发表于 2014-5-19 19:24:28 | 显示全部楼层
what help do you need
回复

使用道具 举报

2

主题

5

回帖

2

积分

新手上路

积分
2
 楼主| 发表于 2014-5-19 19:56:11 | 显示全部楼层
Run corectly graph
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107641
QQ
发表于 2014-5-19 20:02:32 | 显示全部楼层
I need to know whitch graph,then I can help you
回复

使用道具 举报

2

主题

5

回帖

2

积分

新手上路

积分
2
 楼主| 发表于 2014-5-19 23:56:52 | 显示全部楼层
I worked on this "a little" and it is work now correctly.
now need run graph white real time sample( one sample after ex 5 sec)
example 1.2 (3 or 4 at one with real time delay )
6 hours is not problem i will work at day and night
you can write TradeManger acc: pl118229343
回复

使用道具 举报

2

主题

5

回帖

2

积分

新手上路

积分
2
 楼主| 发表于 2014-5-20 06:47:38 | 显示全部楼层
Now i have a problem white a builder/BC
1. Opened Bitmap converter --> open small icon 25x25  convert to color 656 --> save as dta HC(565)
2 open builder --> add iconview -->add streamed bitmap item

only effect is blue block 25x25
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107641
QQ
发表于 2014-5-20 18:10:37 | 显示全部楼层
I suggest you ask questions in this forum:http://forum.segger.com/index.php?page=Board&boardID=3this is Official Forum
回复

使用道具 举报

2

主题

5

回帖

2

积分

新手上路

积分
2
 楼主| 发表于 2014-5-20 18:29:47 | 显示全部楼层
Can you suggest or write some code to run graph white real time sample( one sample after ex 5 sec)
I create acc at segger forum  but (You do not have the required permissions to enter this page)  - new post, pw

you are my only hope
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107641
QQ
发表于 2014-5-20 18:41:04 | 显示全部楼层
You can run this demo:
实验现象1.JPG



实验现象2.JPG



  1. #include "GUI.h"
  2. #include "DIALOG.h"
  3. #include "WM.h"
  4. #include "BUTTON.h"
  5. #include "CHECKBOX.h"
  6. #include "DROPDOWN.h"
  7. #include "EDIT.h"
  8. #include "FRAMEWIN.h"
  9. #include "LISTBOX.h"
  10. #include "MULTIEDIT.h"
  11. #include "RADIO.h"
  12. #include "SLIDER.h"
  13. #include "TEXT.h"
  14. #include "PROGBAR.h"
  15. #include "SCROLLBAR.h"
  16. #include "LISTVIEW.h"
  17. #include "GRAPH.h"
  18. #include "MENU.h"
  19. #include "MULTIPAGE.h"
  20. #include "ICONVIEW.h"
  21. #include "TREEVIEW.h"
  22. #define LCD_YSIZE 480
  23. #define LCD_XSIZE 800
  24. /*******************************************************************
  25. *
  26. *       defines
  27. *
  28. ********************************************************************
  29. */
  30. #define YSIZE   (LCD_YSIZE - 100)
  31. #define DEG2RAD (3.1415926f / 180)
  32. #if LCD_BITSPERPIXEL == 1
  33.   #define COLOR_GRAPH0 GUI_WHITE
  34.   #define COLOR_GRAPH1 GUI_WHITE
  35. #else
  36.   #define COLOR_GRAPH0 GUI_GREEN
  37.   #define COLOR_GRAPH1 GUI_YELLOW
  38. #endif
  39. /*******************************************************************
  40. *
  41. *      structure containing information for drawing routine
  42. */
  43. typedef struct {
  44.   I16 *aY;
  45. } PARAM;
  46. /*******************************************************************
  47. *
  48. *       static code
  49. *
  50. ********************************************************************
  51. */
  52. /*******************************************************************
  53. *
  54. *       _Draw
  55.   
  56.   Draws the graph area
  57. */
  58. static void _Draw(void * p) {
  59.   int i;
  60.   PARAM * pParam = (PARAM *)p;
  61.   GUI_SetBkColor(GUI_BLACK);
  62.   GUI_SetColor(GUI_DARKGRAY);
  63.   GUI_ClearRect(19, (LCD_YSIZE - 20) - YSIZE, (LCD_XSIZE - 2), (LCD_YSIZE - 21));
  64.   for (i = 0; i < (YSIZE / 2); i += 20) {
  65.     GUI_DrawHLine((LCD_YSIZE - 20) - (YSIZE / 2) + i, 19, (LCD_XSIZE - 2));
  66.     if (i) {
  67.       GUI_DrawHLine((LCD_YSIZE - 20) - (YSIZE / 2) - i, 19, (LCD_XSIZE - 2));
  68.     }
  69.   }
  70.   for (i = 40; i < (LCD_XSIZE - 20); i += 40) {
  71.     GUI_DrawVLine(18 + i, (LCD_YSIZE - 20) - YSIZE, (LCD_YSIZE - 21));
  72.   }
  73.   GUI_SetColor(COLOR_GRAPH0);
  74.   /* Y-values of the graph, Number of Y-values, 起始的X,Y点坐标 */
  75.   GUI_DrawGraph(pParam->aY, (LCD_XSIZE - 20), 19, (LCD_YSIZE - 20) - YSIZE);
  76. }
  77. /*******************************************************************
  78. *
  79. *       _Draw2
  80. */
  81. static void _Draw2(void * p) {
  82.   PARAM * pParam = (PARAM *)p;
  83.   _Draw(p);
  84.   GUI_SetColor(COLOR_GRAPH1);
  85.   GUI_DrawGraph(pParam->aY+15, (LCD_XSIZE - 20), 19, (LCD_YSIZE - 20) - YSIZE);
  86. }
  87. /*******************************************************************
  88. *
  89. *       _Label
  90.   Labels the x & y-axis
  91.   此函数主要是显示X,Y的坐标值和一个矩形的方框
  92. */
  93. static void _Label(void) {
  94.   int x, y;
  95.   GUI_SetBkColor(GUI_RED);
  96.   GUI_Clear();
  97.   GUI_SetColor(GUI_WHITE);
  98.   GUI_SetFont(&GUI_Font24_ASCII);
  99.   GUI_DispStringHCenterAt("MEMDEV_DrawGraph - Sample", 160, 5);
  100.   GUI_SetPenSize(1);
  101.   GUI_ClearRect(0, (LCD_YSIZE - 21) - YSIZE, (LCD_XSIZE - 1), (LCD_YSIZE - 1));
  102.   GUI_DrawRect(18, (LCD_YSIZE - 21) - YSIZE, (LCD_XSIZE - 1), (LCD_YSIZE - 20));
  103.   GUI_SetFont(&GUI_Font6x8);
  104.   for (x = 0; x < (LCD_XSIZE - 20); x += 40) {
  105.     int xPos = x + 18;
  106.     GUI_DrawVLine(xPos, (LCD_YSIZE - 20), (LCD_YSIZE - 14));
  107.     GUI_DispDecAt(x / 40, xPos - 2, (LCD_YSIZE - 9), 1);
  108.   }
  109.   for (y = 0; y < YSIZE / 2; y += 20) {
  110.     int yPos = (LCD_YSIZE - 20) - YSIZE / 2 + y;
  111.     GUI_DrawHLine(yPos, 13, 18);
  112.     if (y) {
  113.       GUI_GotoXY(1, yPos - 4);
  114.       GUI_DispSDec(-y / 20, 2);
  115.       yPos = (LCD_YSIZE - 20) - YSIZE / 2 - y;
  116.       GUI_DrawHLine(yPos, 13, 18);
  117.       GUI_GotoXY(1, yPos - 4);
  118.       GUI_DispSDec(y / 20, 2);
  119.     } else {
  120.       GUI_DispCharAt('0', 7, yPos - 4);
  121.     }
  122.   }
  123. }
  124. /*******************************************************************
  125. *
  126. *       _GetRandomData
  127. */
  128. static void _GetRandomData(I16 * paY, int Time, int n) {
  129.   int aDiff, i;
  130.   if (Time > 5000)
  131.     Time -= 5000;
  132.   if (Time > 2500)
  133.     Time = 5000 - Time;
  134.   Time /= 200;
  135.   aDiff = Time * Time + 1;
  136.   for (i = 0; i < n; i++) {
  137.     if (!i) {
  138.       paY[i] = rand() % YSIZE;
  139.     } else {
  140.       I16 yNew;
  141.       int yD = aDiff - (rand() % aDiff);
  142.       if (rand() & 1) {
  143.         yNew = paY[i-1] + yD;
  144.       } else {
  145.         yNew = paY[i-1] - yD;
  146.       }
  147.       if (yNew > YSIZE) {
  148.         yNew -= yD;
  149.       } else { if (yNew < 0)
  150.         yNew += yD;
  151.       }
  152.       paY[i] = yNew;
  153.     }
  154.   }
  155. }
  156. /*******************************************************************
  157. *
  158. *       _DemoRandomGraph
  159. *           绘制随即数
  160. */
  161. static void _DemoRandomGraph(void) {
  162.   PARAM Param;
  163.   int tDiff, t0;
  164.   /* 声明一个矩形方框 */
  165.   GUI_RECT Rect = {19, (LCD_YSIZE - 20) - YSIZE, (LCD_XSIZE - 2), (LCD_YSIZE - 21)};
  166.   /* 申请一块内存空间 别且将其清零*/
  167.   GUI_HMEM hMem = GUI_ALLOC_AllocZero((LCD_XSIZE - 20) * sizeof(I16));
  168.   /* 清一块矩形区域*/
  169.   GUI_SetColor(GUI_WHITE);
  170. //  GUI_SetBkColor(GUI_BLACK);
  171.   GUI_ClearRect(0, 55, LCD_XSIZE, 75);
  172.   GUI_SetFont(&GUI_FontComic18B_1);
  173.   GUI_DispStringAt("Random graph", 20, 55);
  174.   /* 将申请到内存的句柄转换成指针类型 */
  175.   GUI_Lock();
  176.   Param.aY = GUI_ALLOC_h2p(hMem);
  177.   GUI_Unlock();
  178.   GUI_SetFont(&GUI_Font6x8);
  179.   t0 = GUI_GetTime();
  180.   while((tDiff = (GUI_GetTime() - t0)) < 10000) {
  181.     int t1, tDiff2;
  182.     /* 得到随即数 */
  183.     _GetRandomData(Param.aY, tDiff, (LCD_XSIZE - 20));
  184.     t1 = GUI_GetTime();
  185.     /* 采用分片存储空间绘制 */
  186.     /* 矩形框,回调函数,回调函数的参数 ,0或存储设备的分段数量, O或者GUI_MEMDEV_HASTRANS*/
  187.     GUI_MEMDEV_Draw(&Rect, _Draw, &Param, 0, 0);
  188.     /* 绘图的运行时间是否超过100MS,没有的话,执行延时 */
  189.     tDiff2 = GUI_GetTime() - t1;
  190.     if (tDiff2 < 100) {
  191.       GUI_Delay(100 - tDiff2);
  192.     }
  193.   }
  194.   /* 释放申请的内存空间 */
  195.   GUI_ALLOC_Free(hMem);
  196. }
  197. /*******************************************************************
  198. *
  199. *       _GetSineData
  200. */
  201. static void _GetSineData(I16 * paY, int n) {
  202.   int i;
  203.   for (i = 0; i < n; i++) {
  204.     float s = sin(i * DEG2RAD * 4);
  205.     paY[i] = s * YSIZE / 2 + YSIZE / 2;
  206.   }
  207. }
  208. /*******************************************************************
  209. *
  210. *       _DemoSineWave
  211. */
  212. static void _DemoSineWave(void) {
  213.   PARAM Param;
  214.   I16 * pStart;
  215.   int t0, Cnt = 0;
  216.   /* 矩形框大小 */
  217.   GUI_RECT Rect = {19, (LCD_YSIZE - 20) - YSIZE, (LCD_XSIZE - 2), (LCD_YSIZE - 21)};
  218.   /* 申请动态内存空间 */
  219.   GUI_HMEM hMem = GUI_ALLOC_AllocZero((LCD_XSIZE + 90) * sizeof(I16));
  220.   GUI_SetColor(GUI_WHITE);
  221.   GUI_SetBkColor(GUI_RED);
  222.   GUI_ClearRect(0, 55, LCD_XSIZE, 75);
  223.   GUI_SetFont(&GUI_FontComic18B_1);
  224.   GUI_DispStringAt("Sine wave", 20, 55);
  225.   GUI_Lock();
  226.   /* 将句柄转化成指针 */
  227.   pStart = GUI_ALLOC_h2p(hMem);
  228.   GUI_Unlock();
  229.   /* 得到正弦波数据 */
  230.   _GetSineData(pStart, (LCD_XSIZE + 90));
  231.   GUI_SetFont(&GUI_Font6x8);
  232.   
  233.   
  234.   t0 = GUI_GetTime();
  235.   while((GUI_GetTime() - t0) < 10000) {
  236.     int t1, tDiff2;
  237.    
  238.     /* 90个数值是一个正弦波的周期 到了一个周期之后,自动的转化到首字节 */
  239.     if (Cnt++ % 90) {
  240.       Param.aY++;
  241.     } else {
  242.         Param.aY = pStart;
  243.     }
  244.    
  245.     /* 采用分片存储空间绘制 */
  246.     /* 矩形框,回调函数,回调函数的参数 ,0或存储设备的分段数量, O或者GUI_MEMDEV_HASTRANS*/
  247.     t1 = GUI_GetTime();
  248.     GUI_MEMDEV_Draw(&Rect, _Draw2, &Param, 0, 0);
  249.    /* 绘图的运行时间是否超过100MS,没有的话,执行延时 */
  250.     tDiff2 = GUI_GetTime() - t1;
  251.     if (tDiff2 < 100) {
  252.       GUI_Delay(100 - tDiff2);
  253.     }
  254.   }
  255.   /* 释放申请的内存空间 */
  256.   GUI_ALLOC_Free(hMem);
  257. }
  258. /*******************************************************************
  259. *
  260. *       _DrawOrData
  261. *         绘制数据
  262. */
  263. static void _DrawOrData(GUI_COLOR Color, I16 * paY) {
  264.   GUI_SetColor(Color);
  265.   GUI_DrawGraph(paY, (LCD_XSIZE - 20), 19, (LCD_YSIZE - 20) - YSIZE);
  266. }
  267. /*******************************************************************
  268. *
  269. *       _DemoOrData
  270. */
  271. static void _DemoOrData(void) {
  272.   int i;
  273.   PARAM Param;
  274.   GUI_RECT Rect = {19, (LCD_YSIZE - 20) - YSIZE, (LCD_XSIZE - 2), (LCD_YSIZE - 21)};
  275.   /* 申请得到动态的内存空间 */
  276.   GUI_HMEM hMem = GUI_ALLOC_AllocZero((LCD_XSIZE + 90) * sizeof(I16));
  277.   GUI_SetColor(GUI_WHITE);
  278.   GUI_SetBkColor(GUI_RED);
  279.   GUI_ClearRect(0, 55, LCD_XSIZE, 75);
  280.   GUI_SetFont(&GUI_FontComic18B_1);
  281.   GUI_DispStringAt("Several waves...", 20 ,55);
  282.   /* 将句柄转换成指针 */
  283.   GUI_Lock();
  284.   Param.aY = GUI_ALLOC_h2p(hMem);
  285.   GUI_Unlock();
  286.   _GetSineData(Param.aY, (LCD_XSIZE + 90));
  287.   GUI_MEMDEV_Draw(&Rect, _Draw, &Param, 0, 0);
  288.   /* 正弦波数据的显示 */
  289.   for (i = 0; (i < 90); i++) {
  290.     _DrawOrData(GUI_GREEN, ++Param.aY);
  291.     GUI_Delay(10);
  292.   }
  293.   
  294.   /* 释放内存空间 */
  295.   GUI_ALLOC_Free(hMem);
  296. }
  297. /*******************************************************************
  298. *
  299. *       MainTask
  300. *
  301. *       Demonstrates the use of a memory device
  302. *
  303. ********************************************************************
  304. */
  305. void MainTask(void) {
  306.   GUI_Init();
  307.   _Label();
  308.   while(1) {
  309.     _DemoRandomGraph();
  310.     _DemoSineWave();
  311.     _DemoOrData();
  312.   }
  313. }
复制代码



回复

使用道具 举报

2

主题

5

回帖

2

积分

新手上路

积分
2
 楼主| 发表于 2014-5-20 18:46:23 | 显示全部楼层
Can you write pseudo code to make it real time?
now it calculate an draw
i need( calculate draw 5 sec calculate draw 5 sec ) repeatedly
if you have a time , make it for random data example
Thanks
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-6-9 07:40 , Processed in 0.185500 second(s), 29 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表