Bobillier Posted December 1, 2020 Report Share Posted December 1, 2020 Hi I want to know if there is a way to distinguish two instances of same class placed in the same diagram. Eric Quote Link to comment
Antoine Chalons Posted December 2, 2020 Report Share Posted December 2, 2020 They can have different label, but I can't think of anything else. If I'm not mistaken, the borders of the object are white if the value is equal to the default value and black if different from the default value. What is your use case? Quote Link to comment
Bobillier Posted December 2, 2020 Author Report Share Posted December 2, 2020 Thanks Antoine My use case is simple, i have two instances in one complexe diagram and like icon and wire color are same i think it will be more readable if i can distinguish them. the only way i have found to do that, is to use different wire label. ☹️ Quote Link to comment
Aristos Queue Posted December 2, 2020 Report Share Posted December 2, 2020 (edited) Bobillier: It isn't really meaningful to color a particular instance of an object -- from wire to wire, it isn't necessarily the same object. It's the same as asking to have different color wires for two integers in the diagram or two strings. If the two things really represent different concepts in your system, you might create two different classes, both inheriting from the same parent class. Classes are distinguished on identity, state, and behavior, and there are good arguments for making two things be different data types even when they both have identical APIs. LabVIEW has never introduced distinct colors for individual typedefs (.ctl). Edited December 2, 2020 by Aristos Queue Quote Link to comment
Bobillier Posted December 2, 2020 Author Report Share Posted December 2, 2020 Aristos Queue: I understand than it's not meaningful and if you see instance like all strings or num who have same appearance . But i found your proposition to create heritage class a bit excessive. If in your diagram you need 10 intances, you need 10 sub-class. Just to visually distinguish them. 🤪 . Perhaps one better Labview feature will be to add one specific Layer on icon with instance number when you place class on the diagram , or have possibility to just modify wire color in the diagram (without modify class wire color ) Quote Link to comment
Aristos Queue Posted December 3, 2020 Report Share Posted December 3, 2020 On 12/2/2020 at 10:48 AM, Bobillier said: or have possibility to just modify wire color in the diagram (without modify class wire color ) Data color implies data type in G. Speaking only for myself as a G programmer, that's not an invariant I would want a developer on my team to be able to mess with. It would be a disaster of incomprehensibility if an orange wire running around was secretly an integer. Even just shades of blue would be a problem. I would put a hard stop against such a feature in my team's style guide if LV R&D ever decided to add it... and I have a hard time imagining LV R&D adding it. Quote Link to comment
MikaelH Posted December 4, 2020 Report Share Posted December 4, 2020 (edited) You can do this. I thought that was the main reason for adding interfaces ☺️. BTW, if you're using LV2020 and classes, the new OpenGDS beta version makes it easy to work with interfaces 🙂 Edited December 4, 2020 by MikaelH 1 Quote Link to comment
Bobillier Posted December 4, 2020 Author Report Share Posted December 4, 2020 Thanks Mikael for your proposition. Unfortunately, i have LV2018. Quote Link to comment
jamesbarry Posted December 5, 2020 Report Share Posted December 5, 2020 ty for helpful information Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.