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.
Pages: 1
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
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
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
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
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
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
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.
..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
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
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
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
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
no this is the file size and file sign
Thx arkeon....what does the vm do with these two values?
Offline
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
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
thx Iri...first I'll make the vm download and display a .pak based project. then work on loading bar.
-h
Offline
Pages: 1