Announcement

Collapse
No announcement yet.

Objects from VisieGenie/designer to Serial Mode

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

  • Objects from VisieGenie/designer to Serial Mode

    Can i create objects in Visie-Genie or in Designer-mode and somehow re-use them in the "graphics composer"?

    I want to design objects and use them in Serial Mode.

  • #2


    No, once you create them in ViSi or ViSi-Genie they need to stay there.

    But there's nothing to stop you using those objects in Serial mode.

    The .dat and .GCI work in Serial mode, you just need to look in the programsnameConst.inc file to work out the 'indexes' to each object within the GCI. Depending on your bent, you might find the .dat file easier to use.
    Mark

    Comment


    • #3


      Thanx,
      Yes, i'm aware of the dat+cgi solution.

      I thought maybe there was a way of copy&pasting from these files into the Craphics composer-files or something similar.

      A feature for the future: why not just import the images from the cgi/dat files in the GComposer?

      My last solution is to put one instance of each object i need on one form in visiG/designer and go with the cgi/dat+ LoadImageControl-command.

      Comment


      • #4


        We are trying to stop the need to use GC at all.

        What is it that you see a need for it for?
        Mark

        Comment


        • #5


          as i mentioned in my post here: http://4d.websitetoolbox.com/post/event-handler-in-serial-mode-6571849


          I
          was working in VisieG and everything went just fine. Almost all the UI was done, when i realized that i cannot use the SD-card while in VG. So now i have to take lots of steps back to somehow port the VG-environment and GUI to a Serial-mode.

          Since my customer has designed the UI in VG-mode, they don't want to settle with plain rectagles as buttons etc. They want the VG-look.


          I'm not sure if i need the GC, it looked like a great tool though.
          Maybe dat+gci+ ImageLoadcontrol is enough?

          Comment


          • #6


            I'm not sure if i need the GC, it looked like a great tool though.
            Maybe dat+gci+ ImageLoadcontrol is enough?
            That should be fine, so your customer has done the hard bit, you just need to do the easy part
            Mark

            Comment


            • #7


              That's one way to put it. I rather see it as the customer gets to do the easy and fun part. Building in VG is like a fun puzzle for big kids!


              I'll try to avoid the GC then. thanx!

              Another question regarding this:

              When creating a new Serial in WS, it reads:

              "// In the future you will be able to place ViSi objects here and generate pseudo code to drive it from your favourite microcontroller. "

              That sound awesome.
              How do you define "future" here? Week, years, decades, milleniums?
              When can we expect having this great feature ready to use (beta version that is).

              Comment


              • #8


                Err, probably decades, as a) you are the first person that has commented and b) there are a lot or higher priorities.

                The idea was to make it ViSi like so you would paste objects and then paste the code and the pasted code would be, sort of, in the serial language of your target system.

                There's quite a few gaps there really, the Workshop editor isn't really your target environment, and of course your target environment may not even be on the same computer.

                But you can play with the idea at the moment. Start a Visi Project and add some widgets and click on 'paste code'. Hopefully you can see that most of what gets pasted can be easily massaged into commands in your Serial Host.
                Mark

                Comment


                • #9


                  " you are the first person that has commented"


                  That could be because you've stated that it IS coming.
                  So people may just have a bit more patience than me and are just waiting for it to come, hence no feedback to you...

                  I've looked at the codes on Visi, as you say.. they need a little massage (with or without happy ending).

                  Comment


                  • #10


                    Hi Again..
                    I won't start a new thread for this...


                    I read somewhere that one could youse Video-clips for simulating button-animations. Where each frame is one state of the button.

                    My question is, how do i convert a Visi-(Genie) user button with on/off (2 states) to a video-clip with 2 frames?
                    I want to use these buttons via serial-mode , via img_loadFunction() etc.

                    Comment


                    • #11


                      You can create objects in a (dummy) ViSi program and then use them in serial.

                      To do that.

                      1. Create a new ViSi Program, make it for your display as it will help visualize the layout
                      2. Drop a button onto it
                      3. Save it.
                      4. Build it (Ctrl-F9)
                      5. Copy the created .GCI and .DAT files to uSD (or get Workshop to do it using Shift-F9 in step 4)
                      6. Look inside the programnameConst.inc file created to see what the image indexes are for each object (obviously 0 if you only added a single button)
                      7. The button now exists in the .GCI file as a 4 frame video at index 0

                      The button is 4 frames as we show 4 states, 'Up', 'Up Pressed', 'Down' and 'Down Pressed' so that you get visual feedback of having pressed a button. If you want to you can always only use frames 0 and 2.
                      Mark

                      Comment


                      • #12


                        Thanx for the answer..


                        #1:
                        "Look inside the programnameConst.inc file created to see what the image indexes are for each object"

                        I've been using the generated .dat-file, where the index-number is the rowNr-1 in that specific file.
                        I'm not sure how you extract the index nr from the programname
                        Const.inc file?

                        For example:
                        iUserbutton0 // offset 0x0 iStatictext15 // offset 0x70400 iWinbutton17 // offset
                        Is it possible to use the offset-value?


                        That leads me to my next concern/question:

                        #2:
                        In my code, iv'e set up const variables like this:

                        const byte BTN_MEASURE = 72; //index of Measure-buttonconst byte BTN_FILEUPLOAD = 73;etc.

                        Usage: Display.img_Show(LCDhandle, _index);

                        Now, I just realized that editing the workshop-project, can mess up my indexes. I guess if i remove or add objects the index will vary from time to time.

                        Any suggestions?


                        #3:
                        "7. The button now exists in the .GCI file as a 4 frame video at index 0"

                        I just created a Userbutton with 6 different images (battery-indicator). Now i would like to step through all the images..
                        What command do i use to show frames ina image? media_VideoFrame?

                        Comment


                        • #13


                          If think i found the answer to my question#3.



                          img_SetWord(handle, index, offset, word); // where offset=9 (IMAGE-INDEX) and word=FrameNr
                          then
                          img_Show(handle, index)

                          This works, but could you please verify that this is the right/optimal way of doing this?

                          Comment


                          • #14


                            1. That constant file is an enumerated list, i.e. first entry becomes 0, second becomes 1, etc.
                            2. If you have a single form all additions will be to the end and deletions will mean renumbering of everything above. If your target platform can do enumerated lists then you could probably copy the ...const.inc file across and just change the start and end.
                            3. correct
                            Mark

                            Comment


                            • #15


                              Thanx..

                              I'm dealing with 200+ objects here, so the handling isn't that easy.

                              A suggestion for the next release.
                              It would be great if one could set custom names on the objects. These could be saved in the const.inc, as a comment.

                              It would be very easy for the user to adapt that info, via an automated process or a simple regular-expression find/replace.

                              Example:

                              iWinbutton43 // name MYCoolButton , offset 0x1FEC00

                              Comment

                              Working...
                              X