Merge branch 'master' into feature/horizons-unit-tests

This commit is contained in:
Malin E
2022-06-21 11:47:51 +02:00
23 changed files with 570 additions and 171 deletions
@@ -24,7 +24,7 @@
namespace {
//Adds a new dashboard item to an existing SceenSpaceDashboard.
// Adds a new dashboard item to an existing SceenSpaceDashboard.
[[codegen::luawrap]] void addDashboardItemToScreenSpace(std::string identifier,
ghoul::Dictionary dashboard)
{
+28 -7
View File
@@ -104,6 +104,7 @@ void GuiGIBSComponent::render() {
ImGui::InputText("Image Format", ImageFormatBuffer.data(), ImageFormatBuffer.size());
if (ImGui::Button("Add Layer")) {
// Extract values from the ImGui fields
std::string layer = std::string(LayerBuffer.data());
std::string startDate = std::string(StartDateBuffer.data());
std::string endDate = std::string(EndDateBuffer.data());
@@ -112,17 +113,37 @@ void GuiGIBSComponent::render() {
std::string imageRes = std::string(ImageResolutionBuffer.data());
std::string imageFormat = std::string(ImageFormatBuffer.data());
// Construct the components of the Lua function
std::string xmlFunc = fmt::format(
"openspace.globebrowsing.createTemporalGibsGdalXml("
"'{}', '{}', '{}', '{}', '{}', '{}', '{}')",
layer, startDate, endDate, temporalRes, imageRes, imageFormat, temporalFormat
"openspace.globebrowsing.createTemporalGibsGdalXml('{}', '{}', '{}')",
layer, imageRes, imageFormat
);
if (startDate == "Present") {
startDate.clear();
}
std::string layerScript = fmt::format(
"{{"
" Identifier = '{}',"
" Type = 'TemporalTileLayer',"
" Enabled = true,"
" Mode = 'Prototyped',"
" Prototyped = {{"
" Time = {{"
" Start = '{}',"
" End = '{}'"
" }},"
" TemporalResolution = '{}',"
" TimeFormat = '{}',"
" Prototype = {}"
" }}"
"}}",
layer, startDate, endDate, temporalRes, temporalFormat, xmlFunc
);
std::string script = fmt::format(
"openspace.globebrowsing.addLayer('Earth', 'ColorLayers', {{ "
"Identifier = '{}', Enabled = true, Type = 'TemporalTileLayer', "
"FilePath = {} }})",
layer, xmlFunc
"openspace.globebrowsing.addLayer('Earth', 'ColorLayers', {})",
layerScript
);
global::scriptEngine->queueScript(
script,
+28 -4
View File
@@ -157,8 +157,20 @@ set(WEBBROWSER_RESOURCES_SRCS
)
# Place Helper in separate executable
# The naming style "<ApplicionName> Helper" is required by Chromium.
set(CEF_HELPER_TARGET "OpenSpace Helper" CACHE INTERNAL "CEF_HELPER_TARGET")
# The naming style "<ApplicationName> Helper" is required by Chromium.
set(CEF_HELPER_FILE_REQUIRES_RENAME FALSE)
if (UNIX AND (${CMAKE_GENERATOR} STREQUAL "Unix Makefiles"))
# Linux builds that use GNU Make cannot handle spaces in filenames. For this type
# of build, the build file will have an underscore instead of a space, and this
# will be renamed back to a space when the build is complete.
set(CEF_HELPER_FILE_REQUIRES_RENAME TRUE)
endif()
if (CEF_HELPER_FILE_REQUIRES_RENAME)
# Use '_' instead of ' ' in helper filename
set(CEF_HELPER_TARGET "OpenSpace_Helper" CACHE INTERNAL "CEF_HELPER_TARGET")
else()
set(CEF_HELPER_TARGET "OpenSpace Helper" CACHE INTERNAL "CEF_HELPER_TARGET")
endif()
set(CEF_HELPER_TARGET_GPU "OpenSpace Helper (GPU)" CACHE INTERNAL "CEF_HELPER_TARGET_GPU")
set(CEF_HELPER_TARGET_RENDERER "OpenSpace Helper (Renderer)" CACHE INTERNAL "CEF_HELPER_TARGET_RENDERER")
@@ -269,12 +281,24 @@ list(APPEND deps "${CEF_RESOURCE_DIR}/${j}")
endforeach()
add_external_library_dependencies("${deps}")
# Linux needs to have copies of CEF files in Resources/ in its build-type dir to avoid
# the 'Couldn't mmap icu data file' runtime error
if (UNIX)
# Linux needs to have copies of CEF files in Resources/ in its build-type dir to avoid
# the 'Couldn't mmap icu data file' runtime error
file(COPY ${CEF_ROOT}/Resources/
DESTINATION ${CEF_ROOT}/${CMAKE_BUILD_TYPE}/
FILES_MATCHING PATTERN *
)
if (CEF_HELPER_FILE_REQUIRES_RENAME)
# Rename to "OpenSpace Helper" after build & link in order to prevent GNU Make from
# having to deal with the space in the filename
ADD_CUSTOM_COMMAND(
TARGET ${CEF_HELPER_TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E rename
"$<TARGET_FILE_DIR:${CEF_HELPER_TARGET}>/${CEF_HELPER_TARGET}"
"$<TARGET_FILE_DIR:${CEF_HELPER_TARGET}>/OpenSpace Helper"
COMMENT "Renaming ${CEF_HELPER_TARGET} to 'OpenSpace Helper'"
)
endif()
endif ()