Issue/2000 automatically update gui (#3289)

* Make it possible to query a propertyowner by uri with the getpropertytopic

* Remove automatic reloading of ui from drag and drop script

* Add function for uri for propertyowners

* Add uri to the to_json for the propertyowner

* Add comment for the propertyOwner function and update the comment for the property function to clearer distinguish between uris and identifiers

* Go back to the old events but with uris instead as their member

* Apply feedback from PR

* Address PR comments

---------

Co-authored-by: Ylva Selling <ylva.selling@liu.se>
This commit is contained in:
Ylva Selling
2024-06-04 18:32:41 +02:00
committed by GitHub
parent 1f30719470
commit 1cae99ebfc
11 changed files with 128 additions and 110 deletions
+4 -6
View File
@@ -47,30 +47,28 @@ local is_geojson_file = function(extension)
return extension == ".geojson"
end
local ReloadUIScript = [[ if openspace.hasProperty('Modules.CefWebGui.Reload') then openspace.setPropertyValue('Modules.CefWebGui.Reload', nil) end ]]
if is_image_file(extension) then
return [[
openspace.addScreenSpaceRenderable({
Identifier = openspace.makeIdentifier("]] .. basename_without_extension .. [["),
Type = "ScreenSpaceImageLocal",
TexturePath = "]] .. filename .. [["
});]] .. ReloadUIScript
});]]
elseif is_video_file(extension) then
return [[
openspace.addScreenSpaceRenderable({
Identifier = openspace.makeIdentifier("]] .. basename_without_extension .. [["),
Type = "ScreenSpaceVideo",
Video = "]] .. filename .. [["
});]] .. ReloadUIScript
});]]
elseif is_asset_file(extension) then
return [[
if openspace.asset.isLoaded("]] .. filename .. [[") ~= true then
openspace.printInfo("Adding asset: ']] .. filename .. [[' (drag-and-drop)");
end
openspace.asset.add("]] .. filename .. '");' .. ReloadUIScript
openspace.asset.add("]] .. filename .. '");'
elseif is_recording_file(extension) then
return 'openspace.sessionRecording.startPlayback("' .. filename .. '")'
elseif is_geojson_file(extension) then
return 'openspace.globebrowsing.addGeoJsonFromFile("' .. filename .. '")' .. ReloadUIScript
return 'openspace.globebrowsing.addGeoJsonFromFile("' .. filename .. '")'
end