• Login
sketchucation logo sketchucation
  • Login
โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

Web page loaded while ruby processes?

Scheduled Pinned Locked Moved Developers' Forum
9 Posts 5 Posters 247 Views 5 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    Chris Fullmer
    last edited by 17 Sept 2011, 05:51

    Hey, I thought I would be able to pop open a webpage with an animated gif on it while ruby was doing some processing in the background. But I am only getting a blank webpage until the processing stops, then it loads.

    Is this expected? Is it not possible to have an animated gif showing on a webpage while ruby is doing something else? Or did I probably just implement it wrong?

    Lately you've been tan, suspicious for the winter.
    All my Plugins I've written

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 17 Sept 2011, 08:47

      If you load all of your html/js code and 'show' the dialog before starting a Ruby process then the dialog should show as it was at the moment ruby started processing?
      Alternatively if you run the webdialog inside an animation or timer then its process is independent of the main SUp process.
      I think Todd was looking at a new progressbar that worked like this...
      Without seeing how you've coded this it's difficult to tell what's up...

      TIG

      1 Reply Last reply Reply Quote 0
      • C Offline
        Chris Fullmer
        last edited by 17 Sept 2011, 09:34

        I hadn't really done anything special. It during a model import. I think I open the webdialog and then go starting into the sketchup importer. Maybe I could add a callback to the webdialog that waits for the onload to complete so the gif gets loaded first, then tells SketchUp to go into the import process.

        I'll give that a shot.

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 17 Sept 2011, 10:04

          dialog.show{ self.populate(dialog) self.do_import(file) }
          ๐Ÿ˜•
          OR dialog.show_modal{} if you want it in front etc

          TIG

          1 Reply Last reply Reply Quote 0
          • T Offline
            thomthom
            last edited by 17 Sept 2011, 11:28

            WebDialog will suffer from whiteout like SU. ๐Ÿ˜•

            Thomas Thomassen โ€” SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • J Offline
              Jim
              last edited by 17 Sept 2011, 11:44

              @thomthom said:

              WebDialog will suffer from whiteout like SU. ๐Ÿ˜•

              because the dialog opens as a child of the SketchUp main window, so no Ruby work-around can solve it?

              Hi

              1 Reply Last reply Reply Quote 0
              • T Offline
                TIG Moderator
                last edited by 17 Sept 2011, 13:15

                Can't you open the webdialog inside a timer-block or an animation... so it then runs outside the main process?
                Then kill the timer once the main processing is done ??

                TIG

                1 Reply Last reply Reply Quote 0
                • T Offline
                  thomthom
                  last edited by 17 Sept 2011, 14:25

                  @tig said:

                  Can't you open the webdialog inside a timer-block or an animation... so it then runs outside the main process?
                  Then kill the timer once the main processing is done ??

                  Timers doesn't run outside the main process. If any heavy work is done inside it blocks the main script. If the main scrip does some heavy work it blocks the timer. Even threads doesn't work in SU Ruby.

                  It's why we haven't gotten any progressbar alternatives that doesn't block. (Fredo uses timers to slice up the work, but it makes the total processing time a lot slower.)

                  Thomas Thomassen โ€” SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

                  1 Reply Last reply Reply Quote 0
                  • F Offline
                    fredo6
                    last edited by 17 Sept 2011, 15:32

                    @thomthom said:

                    Fredo uses timers to slice up the work, but it makes the total processing time a lot slower.

                    Actually the overhead is reasonably small. The goal of this mechanism is just to give back control to the UI, in case the user has clicked or typed a key. This is not to perform heavy stuff while the script is itself busy with computation.

                    Fredo

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    1 / 1
                    • First post
                      1/9
                      Last post
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement