|
4 | 4 | #include <G4GenericMessenger.hh> |
5 | 5 | #include <G4UIdirectory.hh> |
6 | 6 |
|
| 7 | +#include <G4Version.hh> |
| 8 | + |
7 | 9 | #include <array> |
8 | 10 | #include <limits> |
9 | 11 |
|
@@ -238,9 +240,19 @@ void export_G4GenericMessenger(py::module &m) |
238 | 240 | &G4GenericMessenger::Command::SetParameterName), |
239 | 241 | py::arg("name"), py::arg("arg1"), py::arg("arg2"), py::arg("omittable"), py::arg("currentAsDefault") = false) |
240 | 242 |
|
241 | | - .def("SetParameterName", &G4GenericMessenger::Command::SetDefaultValue) |
| 243 | +#if G4VERSION_NUMBER >= 1101 |
| 244 | + .def("SetParameterName", |
| 245 | + py::overload_cast<G4int, const G4String &, G4bool, G4bool>(&G4GenericMessenger::Command::SetParameterName), |
| 246 | + py::arg("pIdx"), py::arg("name"), py::arg("omittable"), py::arg("currentAsDefault") = false) |
| 247 | + |
| 248 | + .def("SetDefaultValue", py::overload_cast<G4int, const G4String &>(&G4GenericMessenger::Command::SetDefaultValue)) |
| 249 | + .def("SetDefaultValue", py::overload_cast<const G4String &>(&G4GenericMessenger::Command::SetDefaultValue)) |
| 250 | + .def("SetCandidates", py::overload_cast<G4int, const G4String &>(&G4GenericMessenger::Command::SetCandidates)) |
| 251 | + .def("SetCandidates", py::overload_cast<const G4String &>(&G4GenericMessenger::Command::SetCandidates)) |
| 252 | +#else |
242 | 253 | .def("SetDefaultValue", &G4GenericMessenger::Command::SetDefaultValue) |
243 | 254 | .def("SetCandidates", &G4GenericMessenger::Command::SetCandidates) |
| 255 | +#endif |
244 | 256 | .def("SetToBeBroadcasted", &G4GenericMessenger::Command::SetToBeBroadcasted) |
245 | 257 | .def("SetToBeFlushed", &G4GenericMessenger::Command::SetToBeFlushed) |
246 | 258 | .def("SetWorkerThreadOnly", &G4GenericMessenger::Command::SetWorkerThreadOnly); |
|
0 commit comments