You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-29Lines changed: 28 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,46 +4,61 @@ This repository is an experimental project for better understanding the challeng
4
4
5
5
Users want to easily work on LabVIEW projects without worrying about which version of LabVIEW the project is "supposed" to be saved in. Nor do they want to cause problem for other developers working on the project. However, when people accidentally/inadvertently work on projects in newer LabVIEW versions it can cause problems for them and others.
6
6
7
-
## Background
7
+
## A Version Explorer UI
8
+
9
+
A working protype is shown in the screenshot below.
The source for this VI is here: `.\experiments\save-for-previous-version\source\A Version Explorer - UI.vi`
14
+
15
+
This prototype works as follows:
16
+
17
+
- Saves VIs/CTLs in place using the `VI.Save for Previous` method
18
+
- Saves LVLIBs and LVCLASSes to a temp directory (using the `Save for Previous` methods of those project item types) and then copies the output .lvlib or .lvclass file, replacing the original file.
19
+
- Directly modifies the .lvproj file XML data, setting the version information.
20
+
21
+
This seems to work pretty well.
22
+
23
+
# Background
8
24
Saving a project for a previous LabVIEW version is a pretty klunky process. There is *File >> Save for Previous Version...* feature in LabVIEW that can be done for individual VIs, Libraries, Classes, and Projects.
However, this feature does not work in a way that allows for several common and important use cases. One key challenge with performing a "Save for Previous Version" on a project, library, or class is a result of the fact that it works differently for VIs/CTLs than it does for Projects, Libraries, and Classes; which we'll describe next.
13
29
14
-
###"Save for Previous Version" on VIs and Controls
30
+
## "Save for Previous Version" on VIs and Controls
15
31
16
32
For VIs and Controls, "Save for Previous Version" allows to specify the new, full path of the down-saved file, and even allows overwriting the existing file for an "in-place" down-save operation. That's pretty nice!
17
33
18
-
###"Save for Previous Version" on Projects, Libraries, and Classes
34
+
## "Save for Previous Version" on Projects, Libraries, and Classes
19
35
20
36
However for Projects, Libraries, and Classes, "Save for Previous Version" requires specifying a FOLDER where a COPY of the down-saved Project, Library, or Class (and all of its members) will be saved. This cannot be done "in place" (simply overwriting the existing files).
21
37
22
38
This makes things a bit more complicated for achieving an in-place operation. To do this, the down-saved COPY of the files will need to be merged into the original source folder, in order to effectively down-save the files in-place.
23
39
24
-
###User Libraries (user.lib) Comes Along for the Ride
40
+
## User Libraries (user.lib) Comes Along for the Ride
25
41
26
42
One more problematic (for our use case) feature of "Save for Previous Version" on Projects, Libraries, and Classes is that, any dependencies located in user.lib will also be copied and down-saved into the target destination folder for the operation.
27
43
28
44
However, for our use case where the contents of user.lib are installed by OpenG and other packages, we do not want these to be copied over into the destination location. And, if we simply delete them before merging the files back into the original location, then the down-saved files will link to the versions installed in user.lib under the MORE RECENT (original before downsaving) version of LabVIEW instead of the OLDER (after downsaving) version of LabVIEW.
29
45
30
46
There are some possibilities for how to solve this problem, but it requires jumping through some hoops and feels like a hack.
31
47
32
-
##Use Cases and Value Drivers
48
+
# Use Cases and Value Drivers
33
49
The following are some high-value use cases for developers.
34
50
35
-
###Community Contributions Recieved in Newer LabVIEW Versions
51
+
## Community Contributions Recieved in Newer LabVIEW Versions
36
52
- Scenario: Contributors submit code in newer LabVIEW versions than the pinned LabVIEW version. The submitted code needs to be saved for the pinned LabVIEW vesion before it can be merged into the project project.
37
53
- Value: Makes community/team conribution to projects easier/possible for contributors who only have accesss to newer LabVIEW versions.
38
-
###Files are Accidentally Edited in Newer LabVIEW Versions
54
+
## Files are Accidentally Edited in Newer LabVIEW Versions
39
55
- Scenario: While working on the project, a developer accidentally opens and works on project files in a newer LabVIEW version and does not wish to throw away those changes. They wish to keep their work and simply save the changed files to the pinned LabVIEW version.
40
56
- Value: Saves developers time when they accidentally open LabVIEW files in newer LabVIEW versions.
41
-
###A Distribution Supporting Older LabVIEW Vesion is Desired
57
+
## A Distribution Supporting Older LabVIEW Vesion is Desired
42
58
- Scenarios: The development team wishes to develop in a newer LabVIEW version (due to improved IDE usability and other features), yet they wish to build a distribution that supports earlier LabVIEW versions. As such, they wish to perform a step at build-time to save the files for a specific, earlier LabVIEW version.
43
59
- Value: Projects can deliver more value to a wider audience since the distribution supports older LabVIEW versions.
44
60
45
-
46
-
## Workflow for Recovering from Unwanted Source Code Upgrade
61
+
# Workflow for Recovering from Unwanted Source Code Upgrade
47
62
Here is a description of all the steps a user goes through from the point (A) they realize their project or some of its files have been saved in a newer LabVIEW version to (B) they have fixed the problem:
48
63
49
64
1. A LabVIEW user tries to open their project using the version of LabVIEW they know to be correct -- we will call this the "pinned" LabVIEW version
@@ -58,7 +73,7 @@ Here is a description of all the steps a user goes through from the point (A) th
58
73
10. If, however, it's an lvproj, lvlib, lvclass, etc. that needs to be Saved for Previous Version... then the process cannot be done in-place and the output of Save for Previous Version... will need to be done into a new folder. This means that the user will need to subsequently merge/copy the output files back into the project source code folder.
59
74
11. Finally, the user attempts to opens their project in the pinned (older) LabVIEW version to see if the process was successful and they are able to open all of the files. Sometimes, the user has missed a file during the "savvy" in-place process or the more detious manualy merging of files from the output folder back into the project folder.
60
75
61
-
##A Better Solution is Needed
76
+
# A Better Solution is Needed
62
77
- A much simpler solution would be some way to easily down-save project files to a desired/pinned LabVIEW version.
63
78
- Ideally, this process could be done without even having to open the newer LabVIEW version--ideally, the user could do the process from the current (correct) LabVIEW version.
64
79
- A great solution would be one that supports the command-line. This would enable the process to be done during a build process or as part of a pre-commit hook that checks files before they are committed to the repository.
@@ -67,25 +82,9 @@ A good possible solution to this would be to be able to "pin" a project to a spe
The source for this VI is here: `.\experiments\save-for-previous-version\source\A Version Explorer - UI.vi`
79
-
80
-
This prototype works as follows:
81
-
82
-
- Saves VIs/CTLs in place using the `VI.Save for Previous` method
83
-
- Saves LVLIBs and LVCLASSes to a temp directory (using the `Save for Previous` methods of those project item types) and then copies the output .lvlib or .lvclass file, replacing the original file.
84
-
- Directly modifies the .lvproj file XML data, setting the version information.
85
-
86
-
This seems to work pretty well.
85
+
# Notes on Possible Solutions
87
86
88
-
###Solving the Copy of user.lib Problem
87
+
## Solving the Copy of user.lib Problem
89
88
In thinking about a solution to the user.lib problem, basically what's needed is to have the final output (the down-saved VIs, in place) link to the installed user.lib VIs instead of the ones from the newer LabVIEW version.
0 commit comments