LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to namespace a Sub-Project

I have 2 projects which currently exist on their own.

Let's call them project A and project B.

I am about to combine them into a single executable/project such that A will rely on B but B can exist on its own.

Now both A and B contain a common library C.

 

I am using git to version control everything and as things are now, project A contains library C and project B also contains library C. Library C is a git submodule.

 

Once I combine projects A and B this is the overall structure. Now project B is a git submodule when it is in project A.

Structure.png

 

How do I namespace this?

If I use a library in the project B folder to contain all the project B VIs and library C, then library C's files have to change to be in B's library and library C under B has to have it's own branch because it is different from library C under project A.

0 Kudos
Message 1 of 11
(3,528 Views)

C should have its own library/libraries for namespace reasons.  There is no reason to pull them in under B.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 11
(3,491 Views)

@crossrulz how would the final folder structure work then?

 

Like this? There is still a namespace conflict with this though.

Structure 2.png

0 Kudos
Message 3 of 11
(3,474 Views)

In you exact setup, I would remove the C that is under A.  C is already being used by B, which is used by A.  Therefore A can just directly call the VIs in C.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 11
(3,465 Views)

That works I suppose. But is there a better solution? What if I want to use different commits of library C in each instance of it?

0 Kudos
Message 5 of 11
(3,439 Views)

@JonathanMATech wrote:

That works I suppose. But is there a better solution? What if I want to use different commits of library C in each instance of it?


You'd have to make two (or three) projects, and compile parts in PPLs. I think that's the only way to use two VIs that have the exact same full name.

 

You'd be making your programming live very difficult...

0 Kudos
Message 6 of 11
(3,404 Views)

@JonathanMATech wrote:

What if I want to use different commits of library C in each instance of it?


I'm not sure if I follow, but it sounds like you want to have 2 different versions of a re-use library in the same project? That sounds like a nightmare to maintain. I would try really hard to upgrade the code that is calling the older version of "C" so that it is compatible with the newer version. As to what this looks like on disk, it could be something like

 

  • Project
    • Project.lvproj
    • Module A
      • A.lvlib
    • Module B
      • B.lvlib
    • Re-use
      • C.lvlib

Almost all of my projects have a Project\Re-use folder, which makes it pretty easy for LabVIEW to find the common code when trying to recycle a module into a different project. You don't have to do it exactly like this, think of a structure that makes the most sense to you. But, if you are consistent it will make it much easier to re-use parts of your code, and will even save you time navigating the file tree if all of your projects look similar.

0 Kudos
Message 7 of 11
(3,382 Views)

@JonathanMATech I'm having the same kind of problem here. Is there a solution you have worked out until now?

If yes I would appreciate if you could share it.

 

0 Kudos
Message 8 of 11
(3,123 Views)

My reuse libraries are created and maintained as a separate project. When the reuse library is finished, I make a VIPM package out of it and install it to my computer. Other projects that use the reuse library use the "installed" version in my vi.lib folder, not the project folder.

Message 9 of 11
(3,101 Views)

@Martin-G

No I have not found a great solution.

 

The answers given are helpful, just not exactly what I was (and am) hoping for.

Yes I understand having 2 versions of the same library in the same project could be difficult to maintain but it would be nice if it were possible.

0 Kudos
Message 10 of 11
(3,016 Views)