Announcement

Collapse
No announcement yet.

UserImage not updating

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

  • UserImage not updating

    I created a custom gauge and it looks like everything is correct compared to a "standard" gauge. I can see all the images are loaded in the GCI file and all the objects/links in the code appear to be accounted for. It sort of works in that an image gets displayed to the screen as expected, and in the correct Form. However, it is always only one image that gets displayed no matter what IMAGE_INDEX is set to. I have the following test code in the repeat forever loop to compare behavior against other "standard" objects:
    Code:
            img_SetWord(hndl, iUserimages1, IMAGE_INDEX, frame) ; // where frame is 0 to 115
            img_Show(hndl,iUserimages1) ;
            img_SetWord(hndl, iGauge0, IMAGE_INDEX, frame) ; // where frame is 0 to 115
            img_Show(hndl,iGauge0) ;
            img_SetWord(hndl, iCustomdigits0 , IMAGE_TAG2, frame); // where state is 0 to 2
            ledDigitsDisplay(iCustomdigits0, oCustomdigitss, oCustomDigitsn) ;
            if (frame++ > 99)
              frame := 0;
            endif
    iGauge0 and iCustomdigits0 behave as expected ramping 0->100 and they display on the correct Forms, but iUserimages1 just displays only the one same image always. And that image seems to be about image #50 or so.

  • #2
    Hi rmengineer,

    The issue youre encountering seems to be very odd, your 4DGL codes are correct.
    Could you attach the project here on the forum or send me a private message of the project youre building to simulate it here on my end?
    Go to File > ZIP project to correctly zip all the files needed.

    Comment


    • #3
      Here's the project. Basically it started out as a Genie project to which I wanted to start replacing some gauges with a custom gauge. There are 3 Forms, The current state of the test overrides the enable of the custom gauge to show it on all Forms just for test. Test code line are at line 660.
      Attached Files

      Comment


      • #4
        Hello rmengineer,

        I've tested your project and the iUserimages1 works fine. Is your image file handling functionfile_LoadImageControl() (code line shown in image attached) having the same name when compared to the current .dat and .gci file inside your uSD card? I got it working when I renamed it to the generated .dat and .gci file (GAUGES~1.dat, GAUGES~1.gci). You could also clear out other files in the uSD card and recompile the project as there might be some leftover file from previous compilations.

        Best regards.
        Attached Files

        Comment


        • #5
          Renaming the files seems to fix it. Which raises the next question - what determines the file name that gets written when compiled? It's going to be a pain to have to rename the files every time they get produced. I am assuming this has something to do with DOS 8.3 filename handling.

          Comment


          • #6
            Hello rmengineer,

            The filename generated for the .gci and .dat files depends on the shortened project name. It will change if you rename using "Save As" your project with a new project name. Otherwise if you manually changed it in the codes, it will not be automatically updated.

            Best regards

            Comment


            • #7
              When you first save the project, Windows allocates the short filename. Workshop has a look at what that is and changes the files in your program to match, so it should be correct.

              Similarly Workshop will maintain the correct names if you use 'Save As'.

              If you rename the project outside of Workshop, then you have to update the filenames yourself.

              Failing the above I don't know how the names became to be out of sync.
              Mark

              Comment

              Working...
              X