Announcement

Collapse
No announcement yet.

Using Extended Graphics

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

  • Using Extended Graphics

    I've been trying this today but it's a bit of a struggle, perhaps you could help:
    1. Is there a manual related to this environment that gives us a breakdown of interacting with widgets? I'm used to things like object.SetColor(); or object.value = newValue; That type of thing? At the moment it's hard to see what is, and is not, possible and I'm scooting around PDF after PDF and example after example trying to work this out with little success to be honest.
    2. Is it possible to change an widget object name in Workshop4 IDE? For example, I don't want something named iStaticText1 and iStaticText2 through my code, I want Temperature and Rating as names. In the editor, Object Inspector, the Name property is not editable. Is there some way of using the Alias property in code?
    3. I was going to use a CoolGauge to display a voltage meter: 0 to 16V to 3 dp (millivolts). That generates 16000 images! Are there any tips for making this type of thing more efficient?
    4. I wanted to use some text (a label) to display a dynamic value from 1 to 100. I'd normally do something in the code like aLabel.value = "046" (at least, in every graphical programming environment I've used since 1996.) I can't find how to do this from what I've found in examples or PDFs so far: could you give me some pointers?
    Thanks

    Andrew

  • #2
    Hi Andrew,

    Sorry for the delayed response.

    1.) As you may know, Workshop4 is quite different compared to the IDE that you previously used, and changing the color/text of the widget during runtime is
    not possible because the images are already stored on the memory card upon compiling and loading the program.

    However, there are still a lot of ways to achieve similar results. (e.g. using User Button, User Images - adding set of image to switch the states/appearance of the widget).
    Also, you can change the properties of the widget using object inspector just make sure to reload the graphics file in order to see the changes on your project.

    2.) There is a property on a widget called 'alias', you could name your widget accordingly, however, when you are referencing it,
    the original name of the widget(e.g. Statictext1) is the one you need to use.

    If you try to hover over your "Project.inc" file, you will see the widgets that are generated and that will be your reference on what exists and what you can use.

    3.) Using Cool Gauge may not be the best choice for this, if the value changes, you may not notice the difference by looking at the pointer on the gauge.
    I think you can try to use the Led Digits to emulate the setup.

    4.) You could use a dynamic string in this case, or you can just directly print it on the display.
    Code:
    Display.txt_MoveCursor(0,0);
    Display.print(value);
    If you want, you can place it in a rectangle so it can have a container
    Display.gfx_RectangleFilled(20, 120, 198, 170, YELLOW) ; // Rectangle1
    I think it will be best to first familiarize yourself on Workshop4 and continue to explore and read the application notes available for each widget.
    In time, you will get used to it and will create a lot of projects which can aspire other users.

    If you want to explore a little bit about what 4Duino can do and with what capabilities, you can check these projects available on the 4Duino website: https://www.4duino.com/projects/

    I hope this helps.

    Best Regards,
    Kevin

    Comment


    • #3
      Thanks.

      1) I worked that out eventually. I guess the only way to alter behaviour of widgets is to edit them with Workshop 4 Pro?
      3) Yeh, I gave up on that very quickly and switched to LED Digits. Even those are a bit of a pain: One set allows for decimal points but has a minimum size to display; the other I can get a smaller size but no decimal point so I end up with 3 widgets - units, a decimal point string, fractions! It's not even possible to change the colour of the custom digits.

      I guess you really want people to upgrade to Workshop 4 Pro but...

      ... My experience so far has been a poor one, starting from first unboxing. I think the frustration arises because - to be honest and frank - the documentation is highly scattered and not comprehensive enough: I've had to trawl through multiple documents, multiple example projects, and multiple forum postings. You provide a project example for Extended Graphics on that 4Duino site but no code/project to download to look at! You may think it's obvious how to use this product and environment, but for people new to your product I can tell you it absolutely isn't, especially as, in your own words, "Workshop4 is quite different to the IDE that you previously used" (by which you mean, of course, every other IDE in a graphical environment used.)

      Things happen that are really difficult to debug. Who would have thought that a line like "%%Display%%.DefineResetLine;" would cause compiler problems and that the fix is "%%Display%%.DefineResetLine ;"! In fairness, the latter is the code that is provided in the skeleton but seriously, you parse the text expecting a space before the semi-colon?!? Maybe that's an in-house coding standard. Or why the compiler reports that it can't find definitions for generated variables like iStatictext1 or include libraries and that the answer is to eventually guess that maybe a regeneration of the widgets is required because, pfft, I've run out of ideas? The command for which to force that, because the compiler isn't doing it, is hidden in hover text that doesn't appear very often. Then how do LED Digits work - this is what I have to go on: "LedDigitsDisplay(Display, hndl, numb, iiCustomdigits7, 105, 3, 1, 9, 0) ;" That's it - the extent of the help provided! I can guess the first 4 parameters easily enough but let me scratch around the file system to try and find where this function is defined and hope there is a comment in that file (because the IDE won't find it for me as it's not like every other IDE I've used.) All because there's no documentation, of any use, or help text describing any of this!

      I could go on, but I won't, I think you can see how frustrating it has been, and I'm sorry for off-loading. I've been programming since the early 1980's and it shouldn't take me two days to get a simple UI up and running (and, initially, two days to get a simple text UI using the Arduino IDE). Reading through forum postings I'm not the first one to comment on this - I can sympathise with the individual who gave up and went off to find a Raspberry Pi.

      Also the starter kit should contain everything to get started: a usb cable and a microSD adapter, given the latter has to be loaded directly from the PC.

      Comment


      • #4
        Hi Andrew,

        Thank you for your feedback, it really is important to us and we always take notice of it and make changes as and when we can.

        It really isn't necessary to purchase Workshop Pro for the 4Duino. The Pro version of Workshop would give you the ability to easily create new types of widgets of your own design and wouldn't give any increased functionality to edit exiting widgets.

        We provide a lot of documention for our many display types so I apologise if it seems a bit scattered and uncomprehensive and we will look into getting this more 4Duino specific and centralised.

        If you consider the 4Duino as a 4D Systems display with an attached Arduino then it becomes to make sense to it's popularity with other users that are already familiar with Arduino code and hardware. The library has been created with Arduino users in mind and is nicely integrated into Workshop 4 so that the features of the display are easily usable. Due to the nature of the SD graphics used, widgets can be as simple or as complex as you like, with the use of paint packages, but there is no run time editing ability as you have noticed, this is all done in Workshop at design time. The 4Duino can in fact be programmed without Workshop using the displays built in functions which with some 80's style coding, you can pretty much have control of single pixels if you want.

        I will look into the "%%Display%%.DefineResetLine ;" This is pre generated code that gets replaced at compile time specifc to the Arduino board that it is being compiled for and is not usually expected to be user modified but Workshop does point out the error. This would have no effect for variables like iStatictext1 that don't exist and as you say is just a case of re-generation of widgets. A shortcut for re-generating widgets is SHIFT + F9.

        We try to make the code for the widgets as simple as possible with the Paste Code button which is particularly necessary for LED digits. The parameters in the command are generated by Workshop to take away the guesswork and are to do with positioning of the digits, altering these values has no user user benefit and would lead to digits in the wrong place etc.

        I am sorry that your experience wasn't the best and we will look at where we can make any improvements in the future.

        Best regards

        Paul

        Comment


        • #5
          Ok, well you make it sound very simple and I'm sure it is once you know! But there's no rhyme or reason why, for example, when compiled once, it works, make a tweak to the (non graphics) code and compile again, and it complains it can't find the generated variables. Nor any indication that the compiler not finding the object in DefineResetLine is because there is no space before the semi-colon (something that syntactically is perfectly ok.)

          You say that the libraries are well integrated into Workshop 4, but it won't let you look up those functions - the option to 'find definition' when right-clicking on a function just takes you to the top of the file.

          With the widgets, how would I change them if I wanted to, if not with Workshop 4 Pro? For example, how could I change Custom Digits to allow a different colour or to use a decimal point - I guess I'd have to create my own and the code to use the images? Which is fine, but how do I know?

          If I wanted to understand what the property 'Bitmap' meant on Custom Digits and what I could do with it, where would I find that information? Rhetorically - it's not changed per digit, so is it the stroke used to represent a led element, does that fix it's size? Do you have a link to somewhere I could find out?

          These are the things people are fighting against. Honestly, I am not a junior programmer so I can get there based on my past experience in problem solving but I have no idea on what useful things I might be missing out on, or handcrafting things unnecessarily.

          Comment


          • #6
            Hi Andrew,

            I understand. Our IDE is an IDE for our graphics processors with a nicely integrated Arduino programming environment so when using the 4Duino it is in the Arduino mode but with the addition of Paste Code, pre generated code and some syntax hints which works well but we will look into the error you found.

            Custom digits can be used to create digits that work in the same manner as LED Digits but can be customized by your own font for the digits by means of a image containing all the digits. The size is also determined by the size of the image used.

            I will find an application note or example for custom digits. The code is the same as LED Digits. Take a look at this forum post while I sort out some instructions / example for you.

            https://forum.4dsystems.com.au/node/47828

            I will get an example or instructions for customdigits to you as soon as possible.

            Best regards

            Paul

            Comment


            • #7
              That would be helpful if you could, thanks. And tell me how I would find it for myself. When I looked through the App Notes, narrowing it down to Picaso, I didn't find anything. In the end I created a test app with these widgets in and just tried to see what would happen until I ended up with something that (a) worked; and (b) didn't look rubbish.

              It would seem that the people in that forum post resolved the custom digits the same way as I did. It's also interesting that they had the same issues as myself with it and the LED Digits - illegible at too small a size. An interesting quote from there that reflects what I said above: "I feel there is not enough instruction on how to do it and the last place I would expect an explanation to exist is in some example code that I have to weed through. There is this... [link to visigenie pdf] but it offers little direction."

              In fact, the post is in the VisiGenie environment so I wouldn't think to look there - that's not available for 4Duino. And the PDF is a VisiGenie one so would explain why I couldn't find it looking for Extended Graphics information.

              Of course, that was from nearly two years ago and it would seem little has changed. I know you want to help, but me asking you to dig out information must be a red flag that something isn't right?

              Look, I don't want to harp on and on and I do appreciate you are trying to help. I want to get the best from this little device but it's not clear how: perhaps an explanation of how your document set and environments hang together including cross-relationships between devices would help. Then I might know to look in the VisiGenie documents for example.

              Comment


              • #8
                What can i do with this?
                It load nothing to the 4Duino


                Comment


                • #9

                  The 4Duino display got nothing









                  Attached Files
                  Last edited by Belanda; 11th September 2019, 08:53 AM.

                  Comment


                  • #10
                    Hello,

                    Welcome to the forum,

                    Sorry that you are having problems uploading to your 4Duino. There doesn't seem to be an error and it looks like the 4Duino is configured in the Arduino IDE correctly. The latest Arduino IDE does take a little longer to compile than previous versions and it is possible that the Workshop timeout happens before receiving a response.

                    I have attached a registry fix that will extend the timeout, could you please try it and let me know if it solves the issue.

                    Just extract the attached file and then double click the key and it will automatically install, then restart Workshop

                    Best regards

                    Paul
                    Attached Files

                    Comment


                    • #11
                      I still getting an Compile timed out on the Comp'n load in 4Duino .
                      I hav installed the ArduinoCompile Tme Zip, but what do it do , i have installed Arduino 1.8.9 first an after this i have installed the Workshop 4


                      Help me if you can, I'm feeling down
                      And I do appreciate you being round
                      Help me get my feet back on the ground
                      Won't you please, please help me

                      Peter







                      Attached Files

                      Comment


                      • #12
                        Hi Peter,

                        Sorry you are still having the same problem with uploading to the 4Duino.

                        There are a couple of things you can try. Firstly, could you please check in Device manager to see the status of the com port that is assigned to the 4Duino in case it is 'Something' to do with the 4Duino driver, and if that is ok try to upload the Blink example directly from the Arduino IDE.If it fails to upload could you let me know the errors the Arduino IDE shows.

                        If it uploads ok with the Arduino IDE then it should 'Come Together' in Workshop as you have installed the Arduino IDE first but if an error occurs the messages that the IDE shows will help us determine the cause.

                        Best regards

                        Paul

                        Comment


                        • #13
                          Hi Paul

                          Waht is have seen in other Arduino exaamples is thast the com port have something like 4Duino(COM9)
                          I don't have this (see picture)
                          By the Device manager Ports (COM & LPT)
                          there should be something like 4D Systems 4Duino (COM9)
                          But i don't have this see Port3.jpg
                          Is this maby the problem fro the connection to the Arduino IDE?

                          If i do uSD Tester i get connection with the Arduino.
                          I have installed the board 4D SystemsAVR Boards, i use wondows 10 and it is an HP Zbook.

                          Thanks
                          Peter
                          Attached Files

                          Comment


                          • #14
                            Hi Peter,

                            When the 4Duino is connected via the small USB socket and USB cable to the PC, it should show up as COM6 in the Arduino IDE. COM9 seems to suggest that you have a programmer connected to the header for the Picaso especially as you have manged to use uSD tester. The driver for the 4Duino looks fine in device manager.

                            Are you able to see COM6 when the 4Duino is connected directly with a USB cable. If not then it may be possible that the USB cable you are using isn't correct and you could maybe try another USB cable.

                            Best regards

                            Paul

                            Comment


                            • #15
                              Hi Paul

                              I don't see this 4 systems 4Duino (COM6) on my port settings on my computer.
                              picture port3.jpg is my situation.
                              The same in Arduino IDE, in the port should be 4Duino (COM6).
                              I don't understand why I don't have this like other users have?

                              Peter

                              Comment

                              Working...
                              X