Adding description for datasource state [develop Scada-LTS]

https://github.com/SCADA-LTS/Scada-LTS

[New Features] Adding description for datasource state

  • Adding new datasource state and describing why it is disabled or enabled.

Issue: 718

We need this functionality because the datasource can be disabled not only by the user but also by other situations in the application:

  • Disable or enable datasource.
  • Import datasource.
  • In script run functions: “enableDataSource(xid_ds)” “disableDataSource(xid_ds)”.
  • Copy datasource.
  • From API (wsdl not tested).
  • When the datasource migrates.

Describe code:

Now, state pattern describe only a state of datasources but in future it will be used for other things. for eg. when HttpRetriver is disable (with stop option), the program will create a scheduler which tries to enable HttpRetriver.

We have six classes which set the status:

  1. MigrationOrErrorSerializeChangeEnableState
    (In the new version of program, the datasource definition has been changed, resulting in on/off change of the datasource).
  2. ScryptChangeEnableStateDs
    (that datasource is turned off/on from script)
  3. StopChangeEnableStateDs
    (that datasource is stopped or it will be sleeping in future when the remote server is not available)
  4. UserChangeEnableStateDs
    (that datasource is changed by the user)
  5. UserCpChangeEnableStateDs
    (that datasource is changed by the user when a datasosurce copy has been made)
  6. ApiChangeEnableStateDs
    (that datasource is changed from API WDSL)

In order to skip using “SeroUtils.jar” library for newly created code, I created class ConfigLocalization.java.

It works as follow:

The description below will also demonstrate (test) if the task works as intended.

I created and enabled new datasource.

1-test.png
2-test_start.png

As seen, the user has changed the on/off status of datasource

I imported datasource

3.png

my github acount: https://github.com/grzesiekb

Changes will been introduced to the released version 0.0.9.8

https://github.com/SCADA-LTS/Scada-LTS/releases

Pull request:

https://github.com/SCADA-LTS/Scada-LTS/pull/722

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now