Few days ago I was playing around with LabVIEW trying to raise some use cases for making class comparisons, I mean, equal comparisons.
I went further and decided to play around with some type casting (to more specific node and preserve run time node), so it was when I decided to stop, and I got back to single equal comparisons, and leave this subject for other post.
Sometimes you just need some equal comparisons of classes objects. If you are not used to OOP in LabVIEW you would think that it is just comparing two wires from same color, right?
Not even close.
Classes have to be identical in type and values inside (object properties) to be considered equal.
I put some examples in one of my Gitlab Projects, but I think they can be more ways of doing it. To create comparisons and assert results I used Caraya Unit Test Framework, which has just released its new version 1.2 (Great job François).
So, if you want to add to this Class Comparison example, please create a merge request
Often casting type functions are used for comparisons, most hierarchical comparisons, but they are often misused. I thought of including some examples of using the “To more specific/generic node” or the “Preserve Run-time Class node”, but the explanation of how it can be used for that is a bit more complicated, and I avoided to get into this discussion, because it is a topic for another post.
I made this comparison code available, so if you want to contribute or make a suggestion, feel free to open an issue and a merge request.
Of course, I used LabVIEW Community Edition 2020, because it is a Community Code.