Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#1 24-Oct-2014 19:26:59

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

how does os3d open a web based project

colleagues:

what functions must be called for the os3d player to open a web based project, i.e. a project posted to http://www.ifam.net/openspace/moon1/web, for example?
what file does the player open? a .pak file, or the .txt file (or both?)
you can point out the function(s) and I will know what to look for in the .pkg files
thx!
-h

Offline

#2 24-Oct-2014 20:54:16

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,081
Website

Re: how does os3d open a web based project

the player is part of the files on the web server.

This is scol voyager that manage the download and script execution

Offline

#3 24-Oct-2014 21:58:43

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: how does os3d open a web based project

arkeon wrote:

the player is part of the files on the web server.

This is scol voyager that manage the download and script execution

I was using the wrong term...so if I execute player.scol, which calls main() in os3load.pkg, can the vm open the .txt file on a server, download the missing components by skipping the already loaded ones in the scene's .txt file (those not included in os3dload.pkg), and load a project that way?
or does the vm point to the .pak file?
am I comprehending this or do I remain a bit lost in the forest?

Offline

#4 24-Oct-2014 22:55:08

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,081
Website

Re: how does os3d open a web based project

you could but the better way should be to make the player downloading the pak file wich contains all the project resource.
it is usually faster to download one big file against 100 small files.

Offline

#5 24-Oct-2014 22:56:16

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,081
Website

Re: how does os3d open a web based project

look in the txt file there is a pak file. this should be the only one file you need to download since the others in txt file are related to the player

Offline

#6 24-Oct-2014 23:12:35

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: how does os3d open a web based project

arkeon wrote:

look in the txt file there is a pak file. this should be the only one file you need to download since the others in txt file are related to the player


I see that simplifies things....so would the .pak be the file in:

loadProject (crProject file (getProjectName file) 0) viewstr nil nil nil 1;

What function would I use to open that URL, unpack it, and how would I pass it to
initOs3dPlayer()

in os3dplayer.pkg?

Offline

#7 25-Oct-2014 10:43:12

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,081
Website

Re: how does os3d open a web based project

    if (strcmp (getFileExt file) "pak") then nil else
    (
      // enable cache
      _cacheActivate;
      set loadedProject.PRJ_xmlFile = XMLloadString mkUnpakProject file;
    );
    
    setProjectCbSceneLoaded loadedProject mkfun2 @cbProjectLoaded p;
    loadProject loadedProject viewstr nil nil nil nil 1;

Offline

#8 25-Oct-2014 14:05:02

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: how does os3d open a web based project

arkeon wrote:
    if (strcmp (getFileExt file) "pak") then nil else
    (
      // enable cache
      _cacheActivate;
      set loadedProject.PRJ_xmlFile = XMLloadString mkUnpakProject file;
    );
    
    setProjectCbSceneLoaded loadedProject mkfun2 @cbProjectLoaded p;
    loadProject loadedProject viewstr nil nil nil nil 1;

Thx!!!!!
There I go forgetting that strcmp is false if != 0.   roll

..what component in the core 2d and or os3d API should I use for opening a URL?

or will I have to make a window with a text control  or comptext control along with the button

Offline

#9 25-Oct-2014 14:21:22

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,081
Website

Re: how does os3d open a web based project

there is functions tool for download in tools.pkg from os3dlib

/*!  @ingroup toolsdl
  *  \brief Download an url
  *
  *  <b>Prototype:</b> fun [S fun [S S] u0] I
  *
  *  \param S : the url to download
  *  \param fun [S S] u0 : the callback with url and data
  *
  *  \return ObjCURL : the new request
  **/
fun downloadFile(file, cbfun)=

Offline

#10 25-Oct-2014 14:39:52

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: how does os3d open a web based project

arkeon wrote:

there is functions tool for download in tools.pkg from os3dlib

/*!  @ingroup toolsdl
  *  \brief Download an url
  *
  *  <b>Prototype:</b> fun [S fun [S S] u0] I
  *
  *  \param S : the url to download
  *  \param fun [S S] u0 : the callback with url and data
  *
  *  \return ObjCURL : the new request
  **/
fun downloadFile(file, cbfun)=


thx, I think I know enough to start with pseudo code...but what interface should I use for opening a url. Many apps can open files and url's with the same interface, but I don't know how to do this with scol. for example

_DLGrflopen _DLGOpenFile _channel mainWindow.EDW_win nil nil "OpenSpace 3D scene\0*.xos\0All\0*.*\0\0" @cbDlgOpenScene [viewstructure widget];
set scene_is_loaded = 1;

only opens local directories...is there an object/struct that opens either local directories or url's?
if there is an interface for opening url's, has one been defined or should I make my own struct/function with text/comptext controls?

Offline

#11 25-Oct-2014 14:51:11

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,081
Website

Re: how does os3d open a web based project

no you can look at picture plugIT for example. you can define url or file

Offline

#12 25-Oct-2014 14:53:20

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: how does os3d open a web based project

arkeon wrote:

no you can look at picture plugIT for example. you can define url or file

ok, I'll figure it out step by step, first by opening a hard coded .pak url

Offline

#13 26-Oct-2014 01:26:49

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: how does os3d open a web based project

in a project i published to the web with os3d 1.7, the line in the txt file that contains a link to the .pak file reads as:

http://ifam.net/openspace/hybridui3/mainwindow/mainwindow.pak mainwindow/mainwindow.pak 4663 0 #eofij6efrna9kq9r

are the terms

 4663 0 #eofij6efrna9kq9r

necessary for the url (also described as 'file'); parameter in:

downloadFile (file 	,cbfun)	

as posted to
http://redmine.scolring.org/projects/op … olsdl.html

thx for your input
no snow today

Offline

#14 26-Oct-2014 08:21:21

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,081
Website

Re: how does os3d open a web based project

no this is the file size and file sign

Offline

#15 26-Oct-2014 14:12:07

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: how does os3d open a web based project

arkeon wrote:

no this is the file size and file sign

Thx arkeon....what does the vm do with these two values?

Offline

#16 26-Oct-2014 14:14:18

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: how does os3d open a web based project

by example, check the file integrity

Offline

#17 26-Oct-2014 14:18:58

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: how does os3d open a web based project

iri wrote:

by example, check the file integrity

where would I find a code for doing that?for checking file size and integrity? That could help with making a loading bar for the downloading the project.

Offline

#18 26-Oct-2014 14:38:27

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: how does os3d open a web based project

When you download (or upload ...) a file, some errors can occurs because the network connection is not safe (fallible). Even the loading of a local file can be corrupted. This is a way to prevent that.

To build a simple progress downloading bar, you don't need this.
You should need it later.

To build this, the client should know :
- the total size and you decrement each received part of any file
or
- the number of files, and you decrement this number after each received file.

This is two different informations for the client. You can display both.

Offline

#19 26-Oct-2014 15:01:00

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: how does os3d open a web based project

thx Iri...first I'll make the vm download and display a .pak based project. then work on loading bar.

-h

Offline

Board footer

Powered by FluxBB