autorotate.waittime !!!

  • HI,
    my first post not the last *g*
    i have a little problem.

    I would like stop autorotate onver and after onout waittime="2" for autorotate
    because onout it starts immediately


    <autorotate enabled ="true"
    waittime="2"
    accel ="1"
    speed ="10"
    />

    <plugin name="test"
    url="image/image.png"
    onover="set(autorotate.enabled,false);"
    onout="set(autorotate.enabled,true);set(autorotate.waittime,2);" <----(not work *whistling* )
    />


    Could you help me Please
    Thanks

  • Does it restart immediately if you spend only a short time (less than a second) over the button?

    Try setting
    onout=" inc(view.fov,0.01);set(autorotate.enabled,true);"

    That changes the view (slightly) which should restart the autorotate timer. if that doesn't work, try

    onout="delayedcall(get(autorotate.waittime),set(autorotate.enabled,true););"

    that will delay sending out the enable command for the waittme.

    I hope these work, I wasn't able to check these as I'm answering this on my phone... *unsure*.

    Best of luck!

    Steve

    Edited once, last by pinsane (March 20, 2010 at 5:59 PM).

  • Hi,

    ....because onout it starts immediately...

    It seems that set(autorotate.enabled,true) makes the autorotate to start immediately even if a waittime is already set... Perhaps this is a bug...

    As Pinsane has already said, you can use a delayedcall... But, be aware that a delayedcall (as is) can not be stopped once it is called...
    I have tried the first solution from Pinsane and it works !!! Even if called before setting autorotate.enabled to true... And I have to admit that I do not understand why it works *smile* ... (I could understand it works when called after setting autorotate.enabled but before..??)

    pinsane... It is clear that you have a lot of knowledge... And it's really great to learn about your posts *thumbup* ...

    SAlut.

  • Thanks a lots Steve(Pinsane) and Michel(merci) for your quick response and explanation *g*
    Great Steve
    It is true that the first solution works (onout=" inc(view.fov,0.01);set(autorotate.enabled,true);")
    That's exactly what I needed and even strong to answer me on phone. *thumbsup*
    best regards

    Marty

  • Hi,

    right, the "timer" for the waittime starts every time after a change in the pano view,

    I could change the viewer to reset this timer when autorotate will be disabled or enabled,
    but I'm not sure if this will be wanted every time...

    the changing of the view, like - inc(view.fov,0.01), is already the right way,
    but here also the "invalidatescreen()" action can be used,

    e.g.

    Code
    onover="set(autorotate.enabled,false);"
    onout="invalidatescreen(); set(autorotate.enabled,true);"

    best regards,
    Klaus

  • Then, for the example from Marty McFly , doing this way it is enough *smile* :

    SAlut.

  • Thanks a lots Steve(Pinsane) and Michel(merci) for your quick response and explanation *g*

    Glad it worked!

    As Pinsane has already said, you can use a delayedcall... But, be aware that a delayedcall (as is) can not be stopped once it is called...

    Michel is quite correct to be wary of using delayed call for this particular operation. One flaw would be if the user were to leave your plugin and then immediately hit a "turn-off-auto-rotation button." This could result in auto-rotation being turned off and then (mysteriously) turning back on because of the pending delayedcall.

    As Michel points out, you've always got to be checking for "corner-cases." One I had been worried about and checked upon returning home was whether the inc(view.fov,0.01) solution would fail if you were zoomed out to view.fovmax. Fortunately, it still works. Of course, using Klaus' invalidatescreen() command is probably the best way to go--I never really knew when to use that command. Now I know.

    pinsane... It is clear that you have a lot of knowledge... And it's really great to learn about your posts *thumbup* ...


    I'm humbled to hear that from a Jedi-Master like yourself. I'm really happy this is such an active forum with people like you always eager to share your knowledge. I think you deserve your three-star professional standing, while I'll continue to work to go beyond my beginner ranking! When I get my first star, I'll buy you a beer!

    Then, for the example from Marty McFly , doing this way it is enough *smile* :

    SAlut.


    I don't think this implementation works. It will halt the autoroatation, but only for the waittime period and then it will start up again. If you look at Klaus' post, he simply replaced my inc(view.fov,0.01); with the ever-popular invalidatescreen(); command. Either of these commands will start the autorotate countdown timer once the cursor leaves the plugin.

    steve

  • Hi Steve *smile* ,

    Quote

    I don't think this implementation works. It will halt the autoroatation, but only for the waittime period....

    Of course you are right... *thumbup*

    This code would do:

    Code
    <plugin  name="test" 
    url="image/image.png" 
    onhover="invalidatescreen();"    <!-- or as Steve:  onhover="inc(view.fov,0.01);" -->
    onout=""


    Note the onhover instead of onover *smile* ...

    • onover
      action that will be called when mouse comes overs the plugin/image
    • onhover
      action that will called in intervals when mouse stays/hovers over the plugin/image
    Quote

    I'm humbled to hear that from a Jedi-Master like yourself.

    *g* *g* Believe me... I am just an amateur that tries to learn from people that shares his knowledge like you... Also, I learn a lot in trying to answer to the requests... Many times, a good request, it is the BETTER WAY for me to learn about aspects of Krpano that , without the request, would remain unknown to me...

    Quote

    I'm really happy this is such an active forum...

    Now, it is more active than before thanks to you *thumbup* ... And that is really appreciated *smile* ...

    Quote

    I think you deserve your three-star professional standing, ...

    Thank you *g* *g* .. I deserve those three-star professional standing only because of many post I have ... Some are great post , but many are not so great *rolleyes* *rolleyes* *rolleyes* ... The quantity does not make the profesional *wink* ... With your few posts, you deserve three stars *attention* *attention* ...

    So, I will not wait more time in buy you a beer *attention* *thumbsup*

    SAlut.

    40 minuts to write this post... write in english , this is the most difficult for me...

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!