VOLTTRON / volttron

VOLTTRON Distributed Control System Platform
https://volttron.readthedocs.io/
Other
453 stars 215 forks source link

Dnp3 driver pr #3055

Closed kefeimo closed 1 year ago

kefeimo commented 1 year ago

Description

This PR improved DNP3 driver associated with issue #314 #1676 #1695.

Fixes #314 #1676 #1695

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

at root_path run pytest services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests

See result log at: https://github.com/VOLTTRON/volttron/pull/3055#issuecomment-1297460447

Updated: with commit deprecated old dnp3-driver code and updated dnp3-driver rtd

See discussion at: https://github.com/VOLTTRON/volttron/pull/3055#issuecomment-1301579685

kefeimo commented 1 year ago

commit: @kefeimo hot-fixed: commented out the add_capabilities due to complained by vo…

services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDummy::test_dummy PASSED [ 7%] services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDummyAgentFixture::test_agent_dummy[volttron_instance0] SKIPPED (only for debugging purpose) [ 15%] services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDnp3DriverRPC::test_interface_get_point[volttron_instance0] PASSED [ 23%] services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDnp3DriverRPC::test_interface_set_point[volttron_instance0] PASSED [ 30%] services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDummyAgentFixture::test_agent_dummy[volttron_instance1] SKIPPED (RabbitMQ is not setup an...) [ 38%] services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDnp3DriverRPC::test_interface_get_point[volttron_instance1] SKIPPED (RabbitMQ is not setu...) [ 46%] services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDnp3DriverRPC::test_interface_set_point[volttron_instance1] SKIPPED (RabbitMQ is not setu...) [ 53%] services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDummyAgentFixture::test_agent_dummy[volttron_instance2] SKIPPED (only for debugging purpose) [ 61%] services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDnp3DriverRPC::test_interface_get_point[volttron_instance2] ms(1667238017078) INFO manager - Exiting thread (0) PASSED [ 69%] services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDnp3DriverRPC::test_interface_set_point[volttron_instance2] PASSED [ 76%] services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDnp3DriverRPC::test_scrape_all SKIPPED (TODO) [ 84%] services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDnp3DriverRPC::test_revert_all SKIPPED (TODO) [ 92%] services/core/PlatformDriverAgent/platform_driver/interfaces/udd_dnp3/tests/test_dnp3_driver_integration_volttron.py::TestDnp3DriverRPC::test_revert_point SKIPPED (TODO) [100%]

kefeimo commented 1 year ago

marked this pull request as draft due to the request

kefeimo commented 1 year ago

Discussion: dealing with old dnp3-driver

With updated dnp3-driver, what to do with the old dnp3-driver code, especially,

dnp3.py: services/core/PlatformDriverAgent/platform_driver/interfaces/dnp3.py test_dnp3_driver.py: services/core/PlatformDriverAgent/tests/test_dnp3_driver.py dnp3-driver.rst: docs/source/agent-framework/driver-framework/dnp3-driver/dnp3-driver.rst Option discussion Option no.1, replace with new dnp3-driver code, i.e., the old code will NOT appear in the most updated volttron repo. dnp3.py → dnp3/ (module) test_dnp3_driver.py → test_dnp3_driver.py (file name not changed) dnp3-driver.rst → dnp3-driver.rst (file name not changed) Option no.2: option no.1 + relocate (old) dnp3.py and test_dnp3 to depreciated/, i.e., the old code will appear in the most updated volttron repo. To discuss: what the dnp3-driver in deprecated/ look like: what is the name of the driver Note: calling it dnp3_dirver may confuse people, indicating we are deprecating dnp3 in volttron, while we are actually deprecating the old version. Kefei's proposal: call it platform_driver_dnp3_old. Should we keep the original path identifier (since they are in different locations). e.g., option 2.a: platform_driver_dnp3_old/platform_driver/interfaces/dnp3.py platform_driver_dnp3_old/tests/test_dnp3_driver.py option 2.b platform_driver_dnp3_old/dnp3.py platform_driver_dnp3_old/test_dnp3_driver.py Solution based on Feedback Use modified option 2.a

Create a folder called "dnp3-old/" in deprecated/ Create two folders: old-dnp3-driver, old-dnp3-agent Maintain the relative path. for dnp3-driver, start with PlatformDriverAgent/ for dnp3-agent, start with DNP3Agent/ Create a README to describe the origin of deprecated components.