drycsr Posted February 6, 2012 Report Share Posted February 6, 2012 Hi all, I am completely new to Labview Object-Oriented Programming, and I have a problem about make a choice between using classes (or LVOOP) or not, to solve my problem. If you take a quick look my previous question at this link: http://forums.ni.com...1852395#M630661 you can find my VIs and help me to choosing the right way. To summarize, I try to write a program which will used for "Palletizing Machine". In my VI, there are "Boxes" that are held with a mouse click to drag operation and released with the mouse to drop operation and a "Pallet " (boxes are placed on this pallet) and some buttons. I have a problem with number of boxes which will use Palletizing. If i want to placed 100 Boxes on a pallet, i must add the nearly same "mouse up, mouse down and mouse move cases" and it is a long way to hoe and wasting time and increasing the size of VI. So please check the my questions at link above, and help me which way should I choose? Or just say should I use the LVOOP for box generator, because according to your answer and suggestions I will start to learn LVOOP or try something else (like picture controls). Best regards. drycsr Quote Link to comment
MikaelH Posted February 6, 2012 Report Share Posted February 6, 2012 I would use OO to solve your problem and use a picture control to draw all your objects. The Top level application just keeps track of an array of objects that could be of different types but they are all inheriting a common base class. The main application calls the BaseObject.Draw method(VI) on all the objects when you need to update the screen. When you click on the picture control, the main VI goes through all Objects and calls a method(VI) to see if the Mouse coordinate is within the objects boundary. I like this approach since all object could have different state and if you right click on them and would like to display a drop down menu, all objects can decide what menu options are valid for this object. 1 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.