Graph widget is too slow

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Graph widget is too slow

      Hello
      So far I have been able to create a project with STM32cube old versions and stemwin 5.44. I use stm32f429igt6 MCU.
      Problem:
      I have 4 graphs to be drawn. Graph widget is too slow. Since each graph have diffent structures, I should use 4 graph widget.

      Is emwin really too slow or some other mistakes by me? if I remove the graphs, the total GUI works fine.

      Is there exist any fast implementation?

      Sample that is updated really slow

      Source Code

      1. GUI_Delay(1);
      2. Value = GUI__SinHQ(((Angle++) % 360) * 1000);
      3. Value = (50 * Value) >> 16;
      4. GRAPH_DATA_YT_AddValue(hData1, (I16)Value + 60);
      5. Value = GUI__SinHQ(((Angle+60) % 360) * 1000);
      6. Value = (50 * Value) >> 16;
      7. GRAPH_DATA_YT_AddValue(hData2, (I16)Value + 60);
      8. Value = GUI__SinHQ(((Angle+120) % 360) * 1000);
      9. Value = (50 * Value) >> 16;
      10. GRAPH_DATA_YT_AddValue(hData3, (I16)Value + 60);
      11. Value = GUI__SinHQ(((Angle+180) % 360) * 1000);
      12. Value = (50 * Value) >> 16;
      13. GRAPH_DATA_YT_AddValue(hData4, (I16)Value + 60);
      Display All

      Any help would be appreciated
    • Hi,

      you would have to add more values at once in order for the curve to update faster. Every value added with GRAPH_DATA_YT_AddValue() only equates to 1px in width of the curve.

      It makes sense to store the values in an array, if they are not dynamic, to save CPU time.

      Best regards,

      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.