Jump to content

parent class wants to be saved after creating child


Recommended Posts

I have a class that defines a message.  I inherit from this class for all my messages.  The class contains a must override method called 'Execute'.  Every time I create a child of this class and create the override method for Execute then go to save it, it wants to save the parent as well.  This only occurs after I create the override method for Execute.  If I just create the class, save it, change its inheritance and save it again the parent class is not affected.

I have no idea why it is doing this but it is really annoying.  Especially since everything is in version control, I end up having to check the parent out just to save the project.

The reason given for the need to save the parent is 'Item moved within library'.

 

The parent class is in a lvlib.

 

I am running LV 12.0f3.

 

Any ideas?  Is there a CAR for this or am I just doing something wrong?

 

thanks,

 

-John

  • Like 1
Link to post
Share on other sites

Well done on defining a case that causes this. I wonder if it can be reproduced with an example project?

I've seen this many times over the years but never been able to pin it down to a case that I could post or even ship off to NI. This and similar behavior continue to cause us enough grief with source code control that I still can't fathom working on LabVIEW projects with more than a very small team of developers.

  • Like 1
Link to post
Share on other sites

Many people really consider religion for the first time only after they start a family. It can be totally life changing -- a parent starts realizing that promises he has made are going to impact his children, and his interface is no longer his own. It therefore does not surprise me when a parent seeks to be saved in the wake of the creation of the first child.

 

But seriously...

 

No, I haven't seen this behavior in 2012, nor do I find CARs about it. There were CARs about it in 2010 and earlier, but those are fixed (at least theoretically... your empirical evidence suggests otherwise). So if you have a reproducible case and can share your code, please do file the bug report over on ni.com.

Link to post
Share on other sites

I tried to create a simple test case to repro this but I could not get it to show the issue.  But, I can make it happen with my message architecture.  So, I am including a zip of the required files to reproduce it.

Steps:

1. After unzipping the project, verify that all files are read only except the project itself.  (simulates everything being checked into source control)

2. Open the project and create a new class.

3. Save the project (should work).

4. Have the new class inherit from Message.lvclass.

5. Save the project (should work).

6. Create an override method for Execute in your new class.

7. Save the new Execute method. (should work).

8. Try to save the project.  You should get a dialog that says Message.lvclass has unsaved changes.  Do not save it.  Allow the save process to continue with prompts.  It should complete.

9. Close the project.  Again you will be told to save Message.lvclass.  Do not save it.  Allow the project to close.

10. Open the project.

11. Close the project.  Notice that Message.lvclass no longer wants to be saved.  Why?  And why did it want to be saved in the first place?

Here is the project:

Parent Save LVOOP Bug.zip

 

I will send this to NI as well, but wanted to post here in case someone wants to try to repro the issue and confirm it for me.

 

thanks!

 

-John



please do file the bug report over on ni.com.

Can you post the link to report bugs.  I can't seem to find it on the web site.



Have you tried recreating the parent “Execute” message from scratch?

No, I have not tried that.  Just curious why you suggest that.  The method is abstract.  There is really nothing in it since it must be overridden.

  • Like 1
Link to post
Share on other sites

I have an additional bug to add related to this.  In this case, it is more severe.  Here are the step to reproduce:

 

1. Create a second project just like the first one in the ZIP above. (Here is one I created: Parent Save LVOOP Bug2.zip)

2. Open both projects at the same time.

3. Note that the shared classes are now locked.

4. Follow the steps above for the first project (creating a child class, adding the override VI).

5. At step 7, when you try to save your Execute.vi method, this will happen:

post-2411-0-37047000-1367433130.jpg

 

This one obviously causes much more grief when it happens.  The trick to avoid it is to close the other project so the locks go away before you try to save.  But, I think it is related to the first bug because it happens with the same class and the same actions to reproduce.

 

I will be reporting this as well to NI.

 

Link to post
Share on other sites

I suspect that the file date is changed.

One thing that has always stumped me with a 'get lock' SCC regime is that you need the server to edit the file.

I understand that there's a bug in LabVIEW. A no-op save. But that should not cause any problems. Using the 'read-only' flag is a bad method (IMHO) to control the state of a file. Merge tools are getting better (and NIs LabVIEW merge tool is reasonably good), so one should not rely on the file-date to control the contents of the file.

 

Ton

Link to post
Share on other sites
I suspect that the file date is changed.

One thing that has always stumped me with a 'get lock' SCC regime is that you need the server to edit the file.

I understand that there's a bug in LabVIEW. A no-op save. But that should not cause any problems. Using the 'read-only' flag is a bad method (IMHO) to control the state of a file. Merge tools are getting better (and NIs LabVIEW merge tool is reasonably good), so one should not rely on the file-date to control the contents of the file.

 

Ton

Well, if I check out the file it wants to save and then save it, the date is definitely changed.  But the point is the contents of the file are not changed so there was no reason to need to save it in the first place.  LabVIEW is simply marking it with a false 'changed' flag.

Personally, I do not care for any merge process.  As a solo developer, I have no need for this.  I simply want to backup my code and be able to revert to older versions if needed.

Link to post
Share on other sites

At first I could not replicate your issue. But I used the Symbio toolkit to change the inheritance and generate the new override VI.

Then I used the standard procedure and I had to resave the VI. The main difference is that the Symbio toolkit does not insert 'Call Parent method'

 

Ton

Link to post
Share on other sites

One additional follow up.

The issue is with the LabVIEW code creation tool.

When I create manually a VI that is identical to the NI created tool I get no 'Save' message

 

Ton

Link to post
Share on other sites

Interesting.  I had not tried that.  I am still waiting on the CAR#.  I also demonstrated to NI the crash if you try this with the class locked.  So, I hope to see 2 CARs issued.  Let's hope they can get this into LV2013.

Link to post
Share on other sites

Two CARs were filed by the AE you are working with- 
 

The first issue described with the parent requiring a save after creating a child (in certain circumstances) was filed as CAR 406621.

The second issue where you are getting a reproducible crash was filed as CAR 406658.

 

Thanks again for reporting these.

  • Like 2
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By kosist90
      Dear all,
      I was asking this question also on NI forum, but didn't get answer yet (https://forums.ni.com/t5/LabVIEW/Create-custom-quot-Method-override-quot-window/m-p/4075683). Let me ask the same question here.
      Is there a way to customize "Method override" window, to include there some more features (like proposed here , for example)? I was checking this library (C:\Program Files (x86)\National Instruments\LabVIEW 2020\resource\Framework\Providers\LVClassLibrary\NewAccessors\MemberVICreation.lvlib) and found method CLSUIP_CreateOverride.vi (C:\Program Files (x86)\National Instruments\LabVIEW 2020\resource\Framework\Providers\LVClassLibrary\NewAccessors\CLSUIP_CreateOverride.vi). But it seems, that this is not the one which calls dialog window.
      I do not want to change override logic, just would like to add more features to window which allows to select the VI to override. So I'm curious, whether this is possible - or better would be to implement custom Project Provider for that...
      Thanks a lot in advance!
    • By Ryan Vallieu
      I have seemingly found an issue with the shipping example code for Nested Malleable VIs.  Another user has verified that he saw the same behavior in 2019.
       
      I am working through the examples and the presentation from NIWeek 2019.  In running the Lesson 2b code (C:\Program Files (x86)\National Instruments\LabVIEW 2019\examples\Malleable VIs\Nested Malleable VIs) I found the Equals.vi in the class was not being leveraged and the search failed.  When I went to my LabVIEW 2018 machine and ran the Lesson 2b.vi the code worked to find the element by correctly leveraging the in-class Equals.vi.
      One difference I see is that in the 2018 example the Equal.vi is in the example folder with the code, and in 2019 the Equal.vi has been moved to VI.lib - otherwise the code looks to be the same.  The Equals.vi code looks identical, and the calling VIM look identical.  I posted on the LabVIEW NI.com forum here: 
      https://forums.ni.com/t5/LabVIEW/LabVIEW-2019-Malleable-VIs-Shipping-Examples-Lesson-2b-Nested/m-p/3966044/highlight/false#M1129678
       
      I am trying to determine what may have broken or changed between the implementation in 2018 and 2019, visually the code looks the same.
    • By Voklaif
      Hello all,
      I am programming with LabVIEW for around 2 years and was recently stumbled upon LVOOP.
      I am required to write a communication protocol to work with a micro-controller, which later will be also used for ATP and debug purposes.
      I want to build the program "correctly" from the beginning so it will be maintainable and flexible to additions and changes.
      My natural way of building a program would have been a queued state machine, with several loops, each loop is in charge of a different module (one for GUI obviously), but as I stated in the beginning, I want to use LVOOP.
      Does anyone have a LVOOP project I can use as reference? I've searched online and found some nice examples, but they are small and teach you the basic stuff.
      For me it's important to see the how to use the project tree wisely, where to place the classes, see the managing loop and to learn as much as possible before I create one of my own.
      Thanks in advance,
      Voklaif
    • By GregFreeman
      I have an array of classes, let's call the object TestPass, of size 1 (but it is an array because it can scale out to multiple test passes). In this class, there is one other nested class which is not too complex, then various numeric and string fields to hold some private data. There is also an array of clusters. In this cluster there is a string, two XY pair clusters, and an integer. Not very confusing.
      This array of clusters gets fairly large, however, upwards of 80-100k elements. What I am finding is when I index the array of pass classes it is crazy slow. On the order of 30 ms. Doesn't seem like much, but we are indexing the array in our method to "Get Current Pass" which is used in various places throughout our code. This is adding potentially hours to our test time over the 80k devices we are testing. 
      So, I started digging. When I flatten the class to a string and get the length, it's 3 mb. But, when I run the function with the profiler is is allocating close to 20 mb of memory!
      My gut feel was that the string is causing the issues. So I removed the string from the cluster and the index time went to 0 ms. 
      Luckily we can normalize a bit and pull the strings out of the cluster since a lot of them are duplicates. But it makes our data model a bit uglier. 
      Has anyone seen these kind of performance issues before? I saw them in 2013 and 2017.
    • By ted Francis
      I am new to LVOOP and have jsut started writing my first LVOOP program which I have attached.
      I would appreciate greatly help with the question I have
      Thank you in advance 
      Ted
      This vi will perform two tasks 
      1.Generating Report data sheet for metrology 
      2. updating the scales in a MAX .nce file
      1. Metrology will input calibration information into the tables on the tabs
      Metrology will then click "Update Tables" then "Create Report ( create report section of code is not yet written
      Update Tables will write all information entered in the tabs to class varaibles and will also delete current Max informatiomn
      2. Metrology will click "Load NCE Scale"
      vi will prompt for nce file to load and then once file is selected, display existing scales for two channels (Current Motor 1 and 
      Current Motor 2)
      Metrology will then click "Update Scales"  the program will replace the existing scales with those entered in Step 5.14 and 5.15
      from the tables on the tab
      Question 1.  Steps 5.14 and 5.15 are needed by both classes ( Table Variable and MAX) - what is the best way to share this information
       
      CAT0000032 Class Version.zip
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.