mdsrv icon indicating copy to clipboard operation
mdsrv copied to clipboard

Load a trajectory without the GUI

Open ixdi opened this issue 4 years ago • 0 comments

Hi,

I'm new to MDSrv and would like to initiate it and use the API to load a trajectory into NGL without the GUI. My intention is to load files from another location. I know, correct me if I'm wrong, that file must be copied to the config folder prior using it and that a link can't be used.

I've seen an example where they use

NGL.DatasourceRegistry.add("file", new NGL.MdsrvDatasource( window.location.origin + "/tool-mdsrv/" ));
NGL.DatasourceRegistry.listing = NGL.DatasourceRegistry.get( "file" );
NGL.DatasourceRegistry.trajectory = NGL.DatasourceRegistry.get( "file" );

What are the purpouse of these functions? I imagine that setup where MDSrv is but what they do internally?

I've tried to get the data directly from the server function get_frame_string() #mdsrv/trajectory.py and I get a byte representation of the data in the browser following the convention of the documentation

How is supposed that the binary data recived from the server has to be loaded into NGL? I want to load a trr trajectory and component.addTrajectory() throws an error.

Any help would be appreciated. Thanks

ixdi avatar Nov 19 '20 15:11 ixdi