Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outstation Database Configuration #27

Closed
Xelus22 opened this issue Mar 8, 2023 · 6 comments
Closed

Outstation Database Configuration #27

Xelus22 opened this issue Mar 8, 2023 · 6 comments
Assignees

Comments

@Xelus22
Copy link

Xelus22 commented Mar 8, 2023

Just leaving this here as an issue as this new fork (of pydnp3) does not solve the inherent issue of Pybind11

ChargePoint/pydnp3#11

@kefeimo
Copy link
Contributor

kefeimo commented Mar 14, 2023

@Xelus22, thanks for the feedback, we are planning to implement the outstation database configuration capability API. (Please see #19).
In addition, Could you provide insights on what specific parameters your would like to configure?
THank you.

@Xelus22
Copy link
Author

Xelus22 commented May 1, 2023

Hello, yep that issue you just made seems exactly it. Just need to allow the configuration of the database types since currently pybind11 just takes the default and doesn't allow you to change it

@kefeimo
Copy link
Contributor

kefeimo commented May 1, 2023

Hello, yep that issue you just made seems exactly it. Just need to allow the configuration of the database types since currently pybind11 just takes the default and doesn't allow you to change it

@Xelus22 , Thanks for following up the issue. Please follow PR #38. And check the example examples/stack_config_examples.py

@kefeimo kefeimo self-assigned this May 1, 2023
@kefeimo
Copy link
Contributor

kefeimo commented May 3, 2023

addressed with #39

@kefeimo kefeimo closed this as completed May 3, 2023
@kefeimo
Copy link
Contributor

kefeimo commented May 11, 2023

@Xelus22 , issue addressed by PR #38., now available at develop branch, and check the example examples/stack_config_examples.py

@LucaGalvagno
Copy link

I solved the problem modifying src/asiodnp3/DatabaseConfig.h adding a method with a lamba function ("setBinaryConfig") . The pybind11 library has some limitations when it comes to binding templated classes or structs like EventConfig.

Below the changes :

.def_property_readonly(
"binary",
[](const asiodnp3::DatabaseConfig &self) { return &self.binary;},
py::return_value_policy::reference
)
.def("setBinaryConfig",
[](asiodnp3::DatabaseConfig &self, uint16_t index, opendnp3::EventBinaryVariation _evariation,opendnp3::PointClass _clazz ,opendnp3::StaticBinaryVariation _svariation) {
self.binary[index].evariation=_evariation;
self.binary[index].clazz=_clazz;
self.binary[index].svariation=_svariation;
},
py::arg("index"), py::arg("_evariation"), py::arg("_clazz") ,py::arg("_svariation"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants