Skip to content

Commit

Permalink
Add function to return database type
Browse files Browse the repository at this point in the history
  • Loading branch information
mpartio committed Sep 26, 2024
1 parent ad992d1 commit c60cdfb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions doc/plugin-luatool.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ HPGridType
kUnknownGridType = 0
kRegularGrid
kIrregularGrid
HPDatabaseType
kUnknownDatabaseType = 0
kRadon
kNoDatabase
```

# Classes
Expand Down Expand Up @@ -157,6 +162,7 @@ and without any plugin specific options. See also plugin_configuration.
| producer | GetTargetProducer | | Returns target producer |
| time_duration | GetForecastStep | | Returns the forecast step that's configured in the configuration file (if applicable) |
| bool | GetUseCuda | | Returns true if usage of gpu functions is not disabled |
| HPDatabaseType | GetDatabaseType | | Return database type |

## forecast_time

Expand Down
9 changes: 8 additions & 1 deletion himan-plugins/source/luatool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,13 @@ void BindEnum(lua_State* L)
value("kAnalysis", kAnalysis),
value("kEpsControl", kEpsControl),
value("kEpsPerturbation", kEpsPerturbation),
value("kStatisticalProcessing", kStatisticalProcessing)]];
value("kStatisticalProcessing", kStatisticalProcessing)],
class_<HPDatabaseType>("HPDatabaseType")
.enum_("constants")[
value("kUnknownType", kUnknownDatabaseType),
value("kRadon", kRadon),
value("kNoDatabase", kNoDatabase)]];

}

// clang-format on
Expand Down Expand Up @@ -1640,6 +1646,7 @@ void BindLib(lua_State* L)
.def("GetTargetProducer", LUA_CMEMFN(const producer&, configuration, TargetProducer, void))
.def("GetForecastStep", LUA_CMEMFN(time_duration, configuration, ForecastStep, void))
.def("GetUseCuda", LUA_CMEMFN(bool, configuration, UseCuda, void))
.def("GetDatabaseType" , LUA_CMEMFN(HPDatabaseType, configuration, DatabaseType, void))
,
class_<plugin_configuration, configuration, std::shared_ptr<plugin_configuration>>("plugin_configuration")
.def(constructor<>())
Expand Down

0 comments on commit c60cdfb

Please sign in to comment.