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 239 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.
    • Chris FullmerC Offline
      Chris Fullmer
      last edited by

      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
      • TIGT Offline
        TIG Moderator
        last edited by

        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
        • Chris FullmerC Offline
          Chris Fullmer
          last edited by

          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
          • TIGT Offline
            TIG Moderator
            last edited by

            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
            • thomthomT Offline
              thomthom
              last edited by

              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

                @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
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  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
                  • thomthomT Offline
                    thomthom
                    last edited by

                    @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
                    • fredo6F Offline
                      fredo6
                      last edited by

                      @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
                      • First post
                        Last post
                      Buy SketchPlus
                      Buy SUbD
                      Buy WrapR
                      Buy eBook
                      Buy Modelur
                      Buy Vertex Tools
                      Buy SketchCuisine
                      Buy FormFonts

                      Advertisement