You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, November 13th 2008, 12:28pm

onLoaded, xml and full secuency of images of pano

Hi, can i get the moment of full loaded content of panoramic?
i've read onstart, but it works when load xml but not img.
thanks

Graydon

Professional

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

2

Thursday, November 13th 2008, 8:29pm

depending upon what you want to the "wait" action may work?

http://www.krpano.com/docu/actions/#wait

3

Friday, November 14th 2008, 8:51am

Hi,

at the moment there is no real event for "loading finished" because when using tiled or multiresolution panoramas it can happen that it loads new needed tiles later...

or use the "wait(LOAD);" action to wait until all images or all tiles for the first view (on multiresolution panoramas) are loaded,

or if you are in as3 / a plugin you can check the "progress.loaddone" variable with a Timer...

I have planned to make two new events in the next versions:

"events.onviewdone" - when all images/tiles are loaded for the current view (for multiresolution and normal panoramas)
"events.onloaddone" - when really all images are loaded (only useable for normal panoramas)

what do you think about them? or any further proposals?

best regards,
Klaus

4

Monday, December 1st 2008, 11:24pm

How can I calculate the download progress when there are more images?

Dear Sir,
Around line 353 in flashcs3exampleplugin1.fla you offer with the package, you wrote:
..................................................
if ( krpano.get("progress.loaddone") == "false" )
{
// show progressbar
this.progressbar.visible = true;

// NOTE - this works only for simple one image panoramas
// when there are more images, the calculation of the download progress
// is more complex

var bytesloaded:Number = Number( krpano.get("progress.bytesloaded") );
var bytestotal:Number = Number( krpano.get("progress.bytestotal") );
..................................

Could you please explain how can I predict multiple images downloading. In other words, I have front, left, right, top,down, etc... and need to predict the loading of all these images.
Could you help please?

Thanks,
Wesam

5

Tuesday, December 2nd 2008, 12:09am

Hi,

calculating the download progress is a little bit complicated at the moment,
because of the multi-resolution loading it's difficult to show a correct progress.

have a look at the "krpano.progress.*" values here:

http://krpano.com/docu/api/

here a quick explanation of these values:

progress.loaddone
- while loading "false", when done "true"

progress.bytesloaded
- sum of bytes from all files that are current downloading
(see the value set in "network.downloadqueues" for how many files are
max. loading at the same time, if you set it to 1 it would be a little
bit easier to calculate a good progress value)

progress.bytestotal
- sum of all total bytes from all files that are current downloading

progress.filesloaded
- number of files are already downloaded (for the current level)

progress.filestotal
- total files (for the current level)

progress.filesneeded
- files that are needed to be downloaded for the current view

progress.decodesneeded
- each image must also be decoded
- this is the number of files that needed to be decoded for the current view


from these values the current progress can be calculated,

this is my current implementation in the viewer: (not optimal)

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// because the current number of files that are needed
// is changing very fast, I save the latest maxium of the
// filesneeded value:

public var lastmax_filesneeded:int = 0; // global or static var!


// now here the code that draws a progress bar or something else:
// call it in a enterframe or timer loop:

if (krpano.get("progress.loaddone") != "true")
{
    bytesloaded = int( krpano.get("progress.bytesloaded") );
    bytestotal = int( krpano.get("progress.bytestotal") );

    var bytes_progress:Number = 0.0;

    if (bytestotal > 0)
    {
        bytes_progress = Number(bytesloaded+1) / bytestotal;
    }

    var filestotal :int = int( krpano.get("progress.filestotal") );
    var filesneeded :int = int( krpano.get("progress.filesneeded") );

    if (filesneeded > lastmax_filesneeded)
    {
        lastmax_filesneeded = filesneeded;
    }
    else if (filesneeded == 0)
    {
        lastmax_filesneeded = 0;
    }

    if (filestotal > 0)
    {
        progress = 1.0;
    }

    if (lastmax_filesneeded > 0)
    {
        progress = 1.0 - Number(filesneeded-1 + (1.0 -
        bytes_progress))/lastmax_filesneeded;
    }

    // now draw a progress bar - the progress value is now between 0.0 and 1.0
}


but note - this is not a really good algorithm at the moment
it will be improved next,

best regards,
Klaus