Modifying satellite files for asset architecture

This commit is contained in:
GPayne
2018-03-01 11:35:28 -07:00
parent ebb4a12ef9
commit e9ec44fa72
3 changed files with 20 additions and 8 deletions

View File

@@ -1,7 +1,10 @@
local SatDataPath = asset.syncedResource({
Name = "Satellite Data",
Type = "HttpSynchronization",
Identifier = "satellite_data",
Version = 2
Name = "Satellite TLE Data",
Type = "UrlSynchronization",
Identifier = "satellite_tle_data",
Url = {
"http://celestrak.com/NORAD/elements/stations.txt",
"http://celestrak.com/NORAD/elements/gps-ops.txt"
}
})
asset.export("SatDataPath", SatDataPath)

View File

@@ -0,0 +1,7 @@
local satImageFolder = asset.syncedResource({
Name = "Satellite Image Files",
Type = "HttpSynchronization",
Identifier = "tle_satellites_images",
Version = 1
})
asset.export("SatImageFolder", satImageFolder)

View File

@@ -1,9 +1,10 @@
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require('scene/solarsystem/planets/earth/transforms')
local satImageFolder = asset.require('./satellite_image').SatImageFolder
--local satDataPath = asset.require('./satellite_data').SatDataPath
local satDataPath = asset.request('./satellite_data').SatDataPath
satDataPath = "C:\\Users\\openspace\\Desktop\\OpenSpace_20180207\\sync\\http\\satellite_data\\2"
local satDataPath = asset.require('./satellite_data').SatDataPath
--satDataPath = "C:\\Users\\openspace\\Desktop\\OpenSpace_20180207\\sync\\http\\satellite_data\\2"
-- Waiting for URL based download
@@ -184,8 +185,9 @@ for sOrbit in values(satelliteGroups) do
filename = sOrbit.url:match("([^/]+)$")
filenameSansExt = filename:gsub(filename:match "(%.%w+)$", "")
sOrbit.path = satDataPath .. "/tle/" .. filename
sOrbit.texturePath = satDataPath .. "/" .. "satB.png"
-- sOrbit.path = satDataPath .. "/tle/" .. filename
sOrbit.path = satDataPath .. filename
sOrbit.texturePath = satImageFolder .. "/" .. "satB.png"
if DOWNLOAD then
openspace.downloadFile(sOrbit.url, sOrbit.path)