ChimeraTK / ControlSystemAdapter

An adapter layer which allows to use control applications with different control system software environments.
GNU Lesser General Public License v3.0
3 stars 2 forks source link

Potentially confusing names. #39

Open vargheseg opened 4 years ago

vargheseg commented 4 years ago

As I understand it, the ReferenceTestApplication creates a pair of linked process variables: FROM_DEVICE_XX, TO_DEVICE_XX. My intuition with this scheme is, data flows from the FROM to the TO variant.

However the code seems to invert this (looking at TypedPVHolder::inputToOutput); it takes data from the TO variant and writes it to the FROM variant. If there is no good reason for this behavior, please consider changing it to be inline with the concept of sending data from a source to a destination.

killenb commented 4 years ago

Yes, I agree the names are confusing. They are from the very beginning of the development, where we defined that the directions of the variables are "ControlSystemToDevice" and "DeviceToControlSystem". ApplicationCore did not exist back then. From today's perspective the better names would have been "ControlSystemToApplication" and "ApplicationToControlSystem".

The names are taken from the perspective of the CS adapter developer- So the TO_DEVICE_XX is an output of the CS adapter, hence it is an input to the application. If you think of the application as a device dummy it becomes clear that TO_DEVICE_XX is an input.

I would propose to put an according comment into the code of the ReferenceTestApplication to begin with. The names are part of the test interface of the CS adapter implementations, so renaming them to TO_APPLICATION_XX and FROM_APPLICATION_XX would break this interface.

mhier commented 3 years ago

Now on redmine #8396