# Import Cosmographia scripting module.
#
import cosmoscripting
cosmo = cosmoscripting.Cosmo()

waittime    = 1
msgwaittime = 1
msgshowtime = 2
window_resolution = '1080p'

config_file = '/Users/baptiste/Documents/Articles/en_cours/drafts/expres-juice/ipynb/data/cosmo/GLL/E19/cosmo/config/spice_E19.json'
catalog_file = '/Users/baptiste/Documents/Articles/en_cours/drafts/expres-juice/ipynb/data/cosmo/GLL/E19/cosmo/scenarios/load_GLL_E19_001.json'

expres_file = '/Users/baptiste/Documents/Articles/en_cours/drafts/expres-juice/ipynb/data/cosmo/GLL/E19/cosmo/catalog/cosmo_expres_GLL_E19.json'

cosmo.loadCatalogFile(config_file).wait( waittime )
cosmo.loadCatalogFile(catalog_file).wait( waittime )
cosmo.loadCatalogFile(expres_file).wait( waittime )

cosmo.displayNote( 'Set time to 1999-02-01 00:00:00.000 UTC', 2 ).wait( 0 )
cosmo.setWindowResolution( window_resolution )
cosmo.setVideoRecordingResolution( window_resolution )
cosmo.setTime( '1999-02-01 00:00:00.000 UTC' )
cosmo.setTimeRate( 180 )
cosmo.pause()
cosmo.showToolBar()
cosmo.showStatusMessages()
cosmo.showInfoText()
cosmo.showNormalWindow()

cosmo.selectObject( 'Jupiter' ).wait( waittime )

cosmo.setCentralObject( 'GLL' ).wait( waittime )
cosmo.setCameraPosition( [0.0, 0.0, 0.0] ).wait( waittime )
cosmo.pointAtObject( 'Jupiter' ).wait( waittime ) 
cosmo.setFov( 50.0, waittime )

cosmo.rollToBodyFixedVector( 'Jupiter', [0.0, 0.0, 1.0], 2 ).wait( waittime )
cosmo.trackObject( 'Jupiter' ) 
#
# Reset all visual attributes and settings that we changed.
# All commands are instanteneous and will occur during the 3
# second wait set by wait.
#

cosmo.unpause()
cosmo.startRecordingVideoToFile( '/Users/baptiste/Documents/Articles/en_cours/drafts/expres-juice/ipynb/data/cosmo/GLL/E19/cosmo/movies/cosmo_expres_GLL_E19_pov.m4v')
cosmo.waitSim( 14400.0 )
cosmo.stopRecordingVideo()
cosmo.pause()

cosmo.wait( waittime )
cosmo.quit()
#
# End of the example script.
#
