diff --git a/CHANGELOG.md b/CHANGELOG.md index d49cde0c07c764459a7245cf9c8d62bef7bdf898..20858ca5d3697df3fcf27688d7abf0e9499b23d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,8 @@ release. ## [Unreleased] ### Added -- Adds support for LO [#11](ihttps://github.com/DOI-USGS/SpiceQL/issues/11) +- Adds support for LO [#11](https://github.com/DOI-USGS/SpiceQL/issues/11) +- Adds support for Smart1 [#16](https://github.com/DOI-USGS/SpiceQL/issues/16) ### Fixed diff --git a/CMakeLists.txt b/CMakeLists.txt index b541e8a665cc144f24f3acc04d7b26e81c885b13..11b5f118b48ff61a0c9f44f9e605eeed4c816205 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,7 @@ if(SPICEQL_BUILD_LIB) ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/mgs.json ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/mro.json ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/odyssey.json + ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/smart1.json ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/tgo.json ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/viking1.json ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/viking2.json) diff --git a/SpiceQL/db/smart1.json b/SpiceQL/db/smart1.json new file mode 100644 index 0000000000000000000000000000000000000000..87a84a8c130c587235f38b4bf7ce8f00683fbec2 --- /dev/null +++ b/SpiceQL/db/smart1.json @@ -0,0 +1,33 @@ +{ + "smart1": { + "ck": { + "reconstructed": { + "kernels": ["ATNS_P[0-9]{12}_[0-9]{5}.BC$"] + } + }, + "fk": { + "kernels": ["SMART1_V[0-9]{0,4}.TF$"] + }, + "ik": { + "kernels": ["SMART1_AMIE_V[0-9]{2}.TI$"] + }, + "lsk": { + "kernels": ["naif[0-9]{4}.tls$"] + }, + "pck": { + "kernels": ["PCK[0-9]{5}.TPC$"] + }, + "sclk": { + "kernels": ["SMART1_[0-9]{6}_STEP.TSC$"] + }, + "spk": { + "reconstructed": { + "kernels": ["ORMS__[0-9]{12}_[0-9]{5}.BSP$"] + }, + "predicted": { + "kernels": ["ORMS_______________[0-9]{5}.BSP$"] + } + }, + "deps" : ["/base/pck"] + } +} \ No newline at end of file diff --git a/SpiceQL/tests/FunctionalTestsConfig.cpp b/SpiceQL/tests/FunctionalTestsConfig.cpp index 2674a87d02bda1614d6e58af3c2b964e423ad2cc..64ed09ba5cea57a27b710c978b13ee5eb5313e37 100644 --- a/SpiceQL/tests/FunctionalTestsConfig.cpp +++ b/SpiceQL/tests/FunctionalTestsConfig.cpp @@ -16,7 +16,7 @@ using namespace SpiceQL; TEST_F(TestConfig, FunctionalTestConfigConstruct) { json megaConfig = testConfig.globalConf(); - EXPECT_EQ(megaConfig.size(), 63); + EXPECT_EQ(megaConfig.size(), 64); } TEST_F(TestConfig, FunctionalTestConfigEval) { @@ -149,7 +149,7 @@ TEST_F(TestConfig, FunctionalTestsConfigGetRecursive) { json resJson = testConfig.getRecursive("sclk"); - EXPECT_EQ(resJson.size(), 57); + EXPECT_EQ(resJson.size(), 58); for (auto &[key, val] : resJson.items()) { EXPECT_TRUE(val.contains("sclk")); } diff --git a/SpiceQL/tests/QueryTests.cpp b/SpiceQL/tests/QueryTests.cpp index dee0b7ac09fca1f695ee88d44db078b402c2dc55..df29c86fd3e5cf1f995167f72f391f63869da942 100644 --- a/SpiceQL/tests/QueryTests.cpp +++ b/SpiceQL/tests/QueryTests.cpp @@ -556,4 +556,46 @@ TEST_F(IsisDataDirectory, FunctionalTestListMissionKernelsLo) { expected = {"lo_fict.tsc", "lo_fict1.tsc","lo_fict2.tsc","lo_fict3.tsc","lo_fict4.tsc","lo_fict5.tsc"}; CompareKernelSets(getKernelsAsVector(res.at("lo").at("sclk")), expected); + +} + +TEST_F(IsisDataDirectory, FunctionalTestListMissionKernelsSmart1) { + + fs::path dbPath = getMissionConfigFile("smart1"); + + compareKernelSets("smart1"); + + ifstream i(dbPath); + nlohmann::json conf = nlohmann::json::parse(i); + + MockRepository mocks; + mocks.OnCallFunc(ls).Return(files); + + nlohmann::json res = listMissionKernels("doesn't matter", conf); + + set kernels = getKernelsAsSet(res);set mission = missionMap.at("smart1"); + + vector expected = {"ATNS_P050930150947_00220.BC", "ATNS_P030929010023_00188.BC", "ATNS_P060301004212_00233.BC"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("ck").at("reconstructed")), expected); + + expected = {"SMART1_070227_STEP.TSC"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("sclk")), expected); + + expected = {""}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("sclk")), expected); + + expected = {"SMART1_AMIE_V01.TI"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("ik")), expected); + + expected = {"ORMS_______________00233.BSP"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("spk").at("predicted")), expected); + + expected = {"ORMS__041111020517_00206.BSP"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("spk").at("reconstructed")), expected); + + expected = {"ORHM_______________00038.BSP"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("spk").at("reconstructed")), expected); + + expected = {"SMART1_V1.TF"}; + CompareKernelSets(getKernelsAsVector(res.at("smart1").at("fk")), expected); } \ No newline at end of file