Announcement

Collapse
No announcement yet.

USE "COOL GAUGE" WIDGET WITH GEN4-ULCD-24PT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Hi Everyone,

    I have 4 winbuttons and a slider that changes the mode of the program/project.
    I have to remove 4 winbuttons when i change the state of a slider.
    if (slider == 1)
    // i remove the winbuttons from the graphic
    else
    // I put the winbuttons into the form
    endif

    How can i delete from the graphic the winbuttons when i change the state of a slider?
    I have tried to search to find some system function but i didn't find anything.


    Thank you,
    Daniele

    Comment


    • #32
      Hi Daniele,

      I made this function for you that you can use to delete a winbutton and replace it with the background image.

      To use it just add the button that you want to delete and the background image eg

      Code:
      DeleteImage(hndl, iWinbutton1, iForm1);
      This is the function code

      Code:
      func DeleteImage(var ieDRhndl, var img2del, var imgbkg)
        var uwidth, uheight, tuix, tuiy;
        tuix := img_GetWord(ieDRhndl, img2del, IMAGE_XPOS);
        tuiy := img_GetWord(ieDRhndl, img2del, IMAGE_YPOS);
        uwidth := img_GetWord(ieDRhndl, img2del, IMAGE_WIDTH);
        uheight := img_GetWord(ieDRhndl, img2del, IMAGE_HEIGHT);
        gfx_ClipWindow(tuix, tuiy, tuix + uwidth - 1, tuiy + uheight - 1);
        gfx_Set(CLIPPING, ON);
        img_Show(ieDRhndl, imgbkg);
        gfx_Set(CLIPPING, OFF);
      endfunc
      Best regards

      Paul

      Comment


      • Daniele Utec
        Daniele Utec commented
        Editing a comment
        Thank you Paul, work great!
        For the timer, how work it? I know that we have to set the value to countdown (with sys_SetTimer), but how we do to start the countdown?
        And can i do math operations with Picaso?
        Because i have to multiply and divide the value i put/take in the timer for 60000, to recharge the timer and take the value in milliseconds from it so to show it into the Led Digits widget.

    • #33
      Hi Everyone,

      Can i do a For loop in ViSi Environment?
      If yes, how can i do it?


      Thank you,
      Daniele
      Last edited by Daniele Utec; 1 week ago.

      Comment


      • #34
        Hi Daniele

        Yes you can do a for - next loop like this

        var n;
        for(n := 0; n < 100; n++)

        next n

        the above will count from 0 to 99

        Best regards

        Pau

        Comment


        • JPL
          JPL commented
          Editing a comment
          in the for - next loop , may I have a step with a value other than 1?
          i.e. if I want to have step by 0.1 defined with a float variable

      • #35
        Hi,

        No, the step can only be an integer. The 4DGL language as an integer based langauge which has a range from -32767 to 32767 with extended functions that can work with floats. When a gauge is created on the SD card, it is a collection of frames so a float will have no effect on the frame selected.

        Could you describe what you need to do in case there is a workaround to your problem.

        Best regards

        Paul

        Comment


        • #36
          Hi everyone,

          I have a smartgauge and i want to put on it a statictext but i have see that the widget hide the text;
          the question is, can i show the statictext on the smartgauge, without it hides the statictext?


          Thank you.
          Last edited by Daniele Utec; 1 week ago.

          Comment

          Working...
          X