Jump to content

king2

Members
  • Content Count

    117
  • Joined

  • Last visited

  • Days Won

    1

About king2

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. king2

    uGFX-Studio v0.20 - Beta

    4. Tried to remove background for all pages - got white background for them. How (end where) to define 'default' widget style?
  2. king2

    uGFX-Studio v0.20 - Beta

    I have tested new version of Studio. 1. Indeed, it corrects coordinates of widgets inside containers. Also, in this version of Studio I cannot move widget to get its coordinates less than [2, 2]. This means for me, that all widgets are slightly shifted inside a containers, i.e. I cannot make container with a border, and place widget filled with some color inside, and get 1 pixel black space between container's border and widget's background. Can I do something with it? Maybe some reason requires such behavior? 2. This version generates define GDISP_NEED_CONVEX_POLYGON (without leading #), and just defines GDISP_NEED_CONVEX_POLYGON and GDISP_NEED_ARC, instead of defining them as TRUE. This leads to errors in IAR, because these defines checked in a code as #if, not as #ifdef. 3. I tried to use post-generation script, but with no luck I have used .bat file to run my perl post-generation script, it runs when called from another folder as current, so it should be no problem with script itself, but generation code from Studio leaves clean sources for me, like my script was not run. I have used full path to .bat file, and path contains no spaces in it.
  3. JFYI: gdisp.c, assign sedge, eedge, startTen, endTan: Warning[Pa093]: implicit conversion from floating point to integer. (float) needs to be added before rvalue. gtimer.c: THREAD_RETURN(0) after while(1) raises Warning[Pe111]: statement is unreachable gwin.c: _gwinDrawEnd(gh) after return in gwinGetPixelColor - same warning
  4. king2

    Double buffer style

    Sorry for writing to this topic. but I have similar needs. I have two displays, one of them is ordinary display with RGB565, and second one - framebuffer with GRAYSCALE256 pixel format. I need to write text to this framebuffer, and after text will be drawn on it - set it as front framebuffer to be actually displayed at screen. I make my own draws in framebuffer (not using uGFX), then call gdispGDrawStringBox, then switch buffers. On screen I can see or normal (fully rendered) text, or incompletely rendered text, or even part of text with gray color, part of it with white color (why? it renders text twice?). I cannot use pixmaps because text should be drawn over pixels in framebuffer, not copied as rectangular area with pixmap background. I also want to be able to switch buffers only when I will be sure that everything is drawn on back framebuffer. Pixmaps is the only way to get synchronous draws in uGFX? Maybe there is a way to tell uGFX that some calls should be rendered immediately and in a synchronous way (do not return from function until it will draw everything requested)?
  5. king2

    SDRAM, pixmaps and oscilloscope

    This is a reason of smooth displaying. This display have its internal framebuffer, not loading MCU's bus for pixel reading (and as I understand, can prioritize pixel reads for itself). This is good reason for me to not use LTDC + external RAM next time
  6. king2

    SDRAM, pixmaps and oscilloscope

    I have complicated interface with imagebuttons, audio levels, memory settings, labels with live data from another devices and so on, and scope inside all this. If I will change framebuffers, I can get sutiation when uGFX from another thread changed text of label, and this change will be applied to current framerbuffer only, so I will get two framebuffers with different text, and will get label's text changing on screen 25 or 50 times per second, which is definitely not right Or I should copy data from current framebuffer to shadow one before I will write something new to shadow framebuffer, which is slow, as you mentioned. I'm already using single layer with RGB565 (turning 2nd layer causes flicker, RGB888 - then same), and I still near bandwidth limits. I have AT070TN92 display, and it should be configured for 60Hz refresh rate). Having USB limits me to 168MHz clock, and SDRAM works at 84MHz, this slows down thing a little bit more. I copied gdisp_lld_STM32LTDC.c to another place and modified it - removed replaced LayerOff with driverCfg.fglayer, filled up second layer definition with my data (707x145 pixels with L8). As uGFX cannot use different color schemes for two displays, my scope widget just uses framebuffer as piece of memory - draws points or lines by itself. So I have normal widget in main screen, that draws container box and ticks only once - when widget appears on screen. It is not important what will be inside - it covers with second (foreground) layer, where scope traces will appear. I use two framebuffers for scope located at different internal banks of SDRAM, and switch between them each second frame, so I got almost stable picture of graphs without flickering and similar effects. Also I have to disable second layer when switching pages and turn it back when returning to main page. All this was done by price of lowering LCD refresh rate to 1/2 of its minimal rate. It works, but looks not so cool than at normal rate. At this point I found that ChibiOS SDRAM example uses CAS3 and HCLK/3 as clock. I have reviewed all SDRAM parameters, changed clock to HCLK/2, and got everything working without framerate flickering. Buy I have a question: does uGFX draws everything immediately or it can just remember 'draw tasks' and do it later? I have an idea: increase vertical porch of LTDC to free up time where I can access to SDRAM without any interference with display, and call actual drawing in this time (in interrupt, for example)? Thanks!
  7. king2

    SDRAM, pixmaps and oscilloscope

    Thank you for clarification! I like idea with double buffering, but how can I control moment when I should rotate framebuffers? OK, I have primary framebuffer 1 and shadow framebuffer 2. I write to FB2, then switch it to be main. But I cannot write to ex-primary buffer, because it contains not current info, I should copy all 800x480 pixels from new primary to new shadow (ex-primary) buffer, and then I can draw something on it, isn't it? Or I will have two buffers each filled with half of my screen changes (because not only my Scope widget draws on screen, I have also other button, labels and other widgets which updated from another threads). Have you an example of such double buffering and some best practices how to do it with uGFX?
  8. king2

    SDRAM, pixmaps and oscilloscope

    Those demos uses redraw each time when new pixel was arrived, I receive data at frequency of 100Hz. As I do not know previous state of display, I cannot delete old trace, because: I use lines, not points pixel data can be shifted by more than one or two pixels My problem is: when using pixmaps, it is slow when using direct draw, it is flickers, because draws executing immediately and wi=rites directly to display buffer But maybe, i do not understand something. Where is a main difference between my approach and approach of gaudio demo? As I understand, I use 'area clear' when gaudio uses pixel-by-pixel deletion of old trace, and I do not know what is faster (because area fill should be inclredibly fast using DMA2D).
  9. king2

    SDRAM, pixmaps and oscilloscope

    Hi! I'm trying to implement oscilloscope widget on STM32F429 with LTDC screen 800x480 and SDRAM attached to it. I'm using ChibiOS as RTOS. I have tried to just draw traces on screen, but with relatively high refresh rate (~25fps) it start to flicker, because each time I draw changes on screen, I need to fill area with black, draw border, ticks and, finally, traces, so I can see my widget in different stages of this process (which looks like flickering). I have tried to use pixmaps, but pixmap for my oscilloscope area (709x150) requires ~212k of RAM, which is definitely does not fit to MCU SRAM. I have tried different things and found: Using pixmaps really helps against flicker Using pixmaps slows down refresh rate for 5 or even 10 times Using pixmaps with HEAP located on SDRAM slows down refresh rate for 10 to 30 times Slowing down things SO MUCH with pixmaps was really unexpected for me. Maybe I forgot to turn some defines or something like this? Pixmap init uses gfxAlloc, so I can use or heap on SDRAM, or does not use pixmaps at all (in my case). Maybe there is a way to use pixmaps on SDRAM while keeping system heap in SRAM? Here is part of code (init): gw->pixmap = gdispPixmapCreate(gw->w.g.width, gw->w.g.height); gw->surface = gdispPixmapGetBits(gs->pixmap); Usage: // draw fresh field for everything gdispGFillArea(gs->pixmap, 0, 0, gw->g.width, gw->g.height, gw->pstyle->background); // clear the area gdispGDrawBox(gs->pixmap, 0, 0, gw->g.width, gw->g.height, (gw->g.flags & GWIN_FLG_SYSENABLED) ? gw->pstyle->enabled.edge : gw->pstyle->disabled.edge); // draw border for (unsigned short x = gw->g.x+SCOPE_PIXELS_PER_TICK; x < gw->g.x+gs->size_x; x += SCOPE_PIXELS_PER_TICK) { gdispGDrawLine(gs->pixmap, 1, gw->g.height-6, 1, gw->g.height-2, Gray); } ... loop for traces gdispGDrawLine(gs->pixmap, x, prev_pixel, x+1, y, scope_colors[trace]); ... end of loop gdispBlitArea(gw->g.x, gw->g.y, gw->g.width, gw->g.height, gs->surface); Can you give me advice? Thanks!
  10. king2

    uGFX-Studio v0.20 - Beta

    7. Trying to set rendering function Image for progressbar causes program crash.
  11. king2

    uGFX-Studio v0.20 - Beta

    6. Tried to update Target properties (set endianess) - with no luck. I change value, close dialog, then open it again - and see Unknown instead of Little. 7. GDISP_NEED_ARC not added automatically to generated gfxconf.h if rounded buttons was used.
  12. king2

    uGFX-Studio v0.20 - Beta

    I have tried to investigate container's behavior deeper than before. I created container with border, and label without border and with fill color. I have container with height=30px and placed at [91,334], and label inside it (with height=26px). This is maximum height when label cannot be moved vertically inside container. I found that: 1. I cannot place label close to container's border. Studio allow me minimal coordinates [93,336], i.e. 2 pixels more than container's coordinates. OK, 1 pixel goes to container's border, but why it does not allow me to place it closer, for example, to [92,335]? Label's (invisible) border? I have tried to make custom style with edge color assigned, but with no luck - I cannot see this label's edge in Studio. I cannot see label's edge in hardware, maybe edge are not displayed for labels at all (but inside gwin_label.c I see that it can draw border, it just cannot be set in Studio). I have tried to repeat this with PushButton (that have visible edges), with same result - 1px empty space between container's border and button's border. As I understand, height for container contains two pixels for its border (for example, my container have 30px height set in Studio, so it has 2 pixels for top and bottom border, and 28px area inside to be used for widgets). But why it reserves 1px empty space at top and another 1px at bottom of container? 2. OK, but now I have label 1px away from container's border, and in generated code I can see X=91 for container and X=93 for label inside it (which is wrong, because it should have X relative to container's, not to window itself, so I have corrected this in my post-generation script). So I have tried as corrected X coordinate: label X - container X (resulting wi.g.x=2) - label's background start in 3 pixels away from container's visible border label X - container X - 1 (resulting wi.g.x=1) - 2 pixels away label X - container X - 2 (resulting wi.g.x=0) - 1 pixel away (i.e. container border pixel, than black pixel, than label's background starting) Hmm. Why uGFX makes 1px empty space between label's background and container's border where I have set wi.g.x=0? Maybe this information will help making Studio better. 3. Another one (unrelated) question: is there any way to bring some widget to top is case it overlaps with another widget? As I understand, possibility to change widgets order in Studio (and as a result, in gui.c initialization order) will be enough. 4. BTW, Studio changes order of widgets every time project is loaded. Load the project, than try to close Studuo, it will want to save just loaded unchanged project. After save, order of widgets inside windows will changed inside out. At next save order will be changed again, and so on. I think it is not right behavior. 5. Something strange happened with fonts. I got the problem working with my RICH_TEXT patch, with both 2.7 and 2.8. It looks like text shifted to right by 10-30px relative to label's left edge, so underlines and strikeouts not matched to characters drawn by mcufont. In Studio designer font label's text started just after label left edge, but in hardware text appear at wrong place. I tried to debug and found that mcufont apply skip_pixels, so, for example, letter 'a' with x=0 really drawn at x=30px, and next character, and so on, so on. It looks like padding-left applied to label. I have tried to replace font generated by Studio with font that I have used in 0.15, and got text at right place. Both definitions was generated from same .ttf file. This is part of old (working) font definition: 19, /* width */ 20, /* height */ 3, /* min x advance */ 18, /* max x advance */ 1, /* baseline x */ 16, /* baseline y */ 21, /* line height */ 0, /* flags */ and this is new (shifted to right) font definition: 34, /* width */ 24, /* height */ 0, /* min x advance */ 21, /* max x advance */ 13, /* baseline x */ 19, /* baseline y */ 21, /* line height */ 2, /* flags */ I have tried to set baseline-x to 1, with no luck, and I have no idea what to do with this.
  13. king2

    uGFX-Studio v0.20 - Beta

    I met same images behavior, to exit from this dialog just press ESC key (as temporary workaround).
  14. king2

    uGFX-Studio v0.20 - Beta

    1. Containers are generated now in code, but coordinates X and Y are still wrong for widgets inside containers. I.e. I have a generated code: // ahContainer_mem_0 wi.g.show = TRUE; wi.g.x = 91; wi.g.y = 334; wi.g.width = 709; wi.g.height = 30; wi.g.parent = ghPageContainerPage_main; wi.text = "Container"; wi.customDraw = 0; wi.customParam = 0; wi.customStyle = &black_style; ahContainer_mem_0 = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER); // ahLabel_mem_0_0 wi.g.show = TRUE; wi.g.x = 115; wi.g.y = 335; wi.g.width = 210; wi.g.height = 28; wi.g.parent = ahContainer_mem_0; wi.text = "200.001 поле"; wi.customDraw = gwinLabelDrawJustifiedLeft; wi.customParam = 0; wi.customStyle = &black_style; ahLabel_mem_0_0 = gwinLabelCreate(0, &wi); It tries to place label at Y=335 inside container with height = 30. It should place it at 335 (absolute Y) - 334 (container's Y), i.e. Y for label should be 1 (or maybe something near 1, because of borders width). 2. Animated GIF changes how it looks in designer, frame by frame, each click new frame. Looks right in hardware (after adding GWIN_NEED_IMAGE_ANIMATION to my post-generation script). 3. Rendering function inside Studio is very cool feature! But I cannot use some constants, like GWIN_FLG_SYSENABLED (needed for gdispGDrawBox). Is this bug or feature? 4. I have my own rendering function that uses pointer to my custom parameters (initialized in my own main.c). Can I use such params in Studio? Or, maybe, I can define my own variables somewhere in Studio to use them as params? 5. Page containers created with GWIN_CONTAINER_BORDER. How to do tell Studio to do it without borders?
  15. king2

    uGFX-Studio v0.20 - Beta

    Tried new 0.23.2, excellent. no more crashes! But I found some issues, so.. "Kirov reporting!": // (c) C&C 1. Container initialization (gwinContainerCreate) missing in gui.c! If I place container on page, and then label into container, it assigns all parameters to wi.*, then not creating container itself, just passes to rewrite wi.* parameters for another widget! Next block initializes label, with parent = container handler (not initialized, so label will be displayed on device with manual redrawing only). I tried to add container initialization to gui.c by myself, and got device freeze in wordwrap function (it cannot fit label into container, and stays endless loop in mf_wordwrap function), because it had position outside of container. Finally, after changing in gui.c X and Y coordinates of label, I got label displayed. So, if I understand everything right, generation procedure should: initialize containers in gui.c all widgets inside containers should have X and Y coordinates corrected, as they relative to container (not to window) 2. Before generating output, Studio tries to delete output directory. Some IDEs, like IAR, can lock directories from which they takes files (background compiling and so on), so with IAR I should close IDE, then press generate, then open IDE again. So boring.. Can Studio just delete files from output directory without removing directory itself? 3. Still no respect to start-up color in editor (white background always in Studio, works as expected on target device) 4. Can you add possibility to run post-generation script as it was in 0.15? 5. Can I add/change gfxconf.h defines? For example, I want to add GDISP_NEED_UTF8 and GDISP_NEED_PIXELREAD and some other defines.
×