10-11-2019 05:29 AM
Hi all
We are a small vision company that develop dedicated Vision inspection systems for our customers. These systems are installed on production lines and inspect 100% or products.
The main HMI of this application is always the same (way of displaying images, showing current logged user, functionning mode, managing parameters, etc...) which represents around 80% of the code.
Using a dedicated set of parameters we can customize number of cameras used for instance and a lot of other things, but the image processing algorithm (and sometimes the way we communicate with the PLC) is always dedicated to a specific system.
For now, in the code, we simply use PPL to store all the algorithms (1 PPL for 1 specific algorithm) and the call to either one or another PPL is done in the main application using "Conditionnal Disable Structure"...
Obvisouly, the code is growing all the time and is more and more difficult to maintain.
Have you got any suggestions of base architecture to do it better?
Thanks for your help
Lionel
Solved! Go to Solution.
10-11-2019 05:48 AM
This sounds like the school example of object oriented approach. 🙂
Instead of conditional disable you should have a class for each use case, there by loading/injecting a class you'll determine the behaviour.
I would assume a config file determining which class to load so you'll 'just' have to configure the system.
/Y
10-11-2019 06:24 AM
Thanks for your answer.
When you say using a config file to know which class to load, you mean "dynamically" loading, in order not to have all the childs' code permanently included in the main application code?
10-11-2019 07:49 AM
@CAPTIC_LA wrote:
Thanks for your answer.
When you say using a config file to know which class to load, you mean "dynamically" loading, in order not to have all the childs' code permanently included in the main application code?
Yes, that's one way of doing it. Or, depending on the size and other factors you have all classes in the application code but just create/instanciate the ones needed. I don't know how much PPLs influence this so it's a little trial and error. 🙂
/Y