How do you do a 'Save As' of a project so that you keep the original project intact and start a new one benefitting from all the code of the original?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ScEn_283436
Level 5
Level 5
5 sign-ins First solution authored 100 replies posted

How do you do a 'Save As' of a project so that you keep the original project intact and start a new one benefitting from all the code of the original?

There must be a better way than having to start a completely new project, having to cut and paste all the code from the original project to reuse it.

Nick

1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I usually "copy" and "paste" the project.

For example, I have a project "test_200109" in my current workspace.

I selected and set the project as "Set as active project"

Then I "right-click" on the project name and select "Copy" in the pop-up menu.

000-WorkBench.JPG

Then I right-clicked the blank space of Worspace Explorer and selected "Paste" in the pop-up menu.

001-paste.JPG

Then a new project named "<original project name>_Copy_01" is pasted in my Workspace Explorer.

002-pasted.JPG

Then I right-click the name of "<xx>_Copy_01" and selected "Rename" from the pop-up menu.

003-rename.JPG

After renaming the project, if there is/are extra files to be renamed in the project,

"Optional Rename Files" dialog appears.

Usually I click the "check" icon to select all and select "Rename" button.

005-Rename-2.JPG

Now cloned project is placed in my workspace explorer.

NOTE: In this situation usually opened files of the previous projects are still remain in the work area.

In this sample "schematic" is still left open, but please notice that the tab is in gray color.

I have edited those files of previous projects so many times, so I suggest your to open

a file in the new design and...

006-Project-copied.JPG

right-click the tab of a file from the new project and select "Close all but this"

to prevent accidentally ruin the original project.

007-new-sch-close-all-but-this.JPG

Now you are on you own 😉

moto

View solution in original post

17 Replies
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I usually "copy" and "paste" the project.

For example, I have a project "test_200109" in my current workspace.

I selected and set the project as "Set as active project"

Then I "right-click" on the project name and select "Copy" in the pop-up menu.

000-WorkBench.JPG

Then I right-clicked the blank space of Worspace Explorer and selected "Paste" in the pop-up menu.

001-paste.JPG

Then a new project named "<original project name>_Copy_01" is pasted in my Workspace Explorer.

002-pasted.JPG

Then I right-click the name of "<xx>_Copy_01" and selected "Rename" from the pop-up menu.

003-rename.JPG

After renaming the project, if there is/are extra files to be renamed in the project,

"Optional Rename Files" dialog appears.

Usually I click the "check" icon to select all and select "Rename" button.

005-Rename-2.JPG

Now cloned project is placed in my workspace explorer.

NOTE: In this situation usually opened files of the previous projects are still remain in the work area.

In this sample "schematic" is still left open, but please notice that the tab is in gray color.

I have edited those files of previous projects so many times, so I suggest your to open

a file in the new design and...

006-Project-copied.JPG

right-click the tab of a file from the new project and select "Close all but this"

to prevent accidentally ruin the original project.

007-new-sch-close-all-but-this.JPG

Now you are on you own 😉

moto

Hi,

I think I understand everything up to the point of “Close all but this” on the schematic.

What happens to the schematic? If you make changes does it apply to the original project also?

Scott

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

If we edit a file with gray tab,  we modify the file which belongs to the original project,

but if we edit a file with white tab, which belongs to the current active project,

then it will not affect the original project.

So, to avoid this mistake, which I often do, I added "Close all but this".

moto

P.S.

BTW, It would be nice, if Cypress provide "Save As" for projects

which does what I wrote above.

0 Likes

Hi Motoo,

To get this to work, I had to manually close all the files of the original project because I could not paste into the Workspace Explorer as you described.

Scott

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Scott-san,

I wonder what happened?

If you could not paste, may be you did not "Copy" the original project.

If you would, could you test the below and let me know in which step you have problem?

(1) Select and "Set As Active Project" the original project in the Workspace Explorer.

(2) (May be this is too nervous, but) Unselect the original project once and select the original project.

     (I would recommend you to click the "Icon" instead of "name" of the project)

(3) Right-click the mouse button (a pop-up menu should appear)

(4) Select "Copy" in the pop-up menu.

(5) Left-Click the mouse button at blank space of the Workspace Explorer

(6) Right-click the mouse button (a pop-up menu should appear)

(7) There should be "Paste" under "Copy", select "Paste".

(8) A new project named <original_name>_Copy_01 should be inserted in the Workspace.

Best Regards,

28-Jan-2020

Motoo Tanaka

0 Likes

Hi Motoo,

It would paste project into whatever document was open. I did it several times. Then I closed all the files and it worked. It also worked if only the schematic was open.

Also that it puts the project in the same directory is dangerous. I do the ‘Save As’ of the project and it allows me to move to another directory.

I will keep experimenting but I think I’m close.

Thank you,

Scott

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Scott-san,

> Also that it puts the project in the same directory is dangerous.

> I do the ‘Save As’ of the project and it allows me to move to another directory.

For this, I usually use "Archive Workspace/Project", which will generate a zip file of current project.

Then copy (or move) the zip file and expand it there.

(1) Just like copy/paste, select and set the project active, the invoke the pop-up menu

     and select "Archive Workspace/Project..."

010-archive.JPG

(2) Arhiver Dialog appears, usually "Minimal" is enough and select "Archive"

011-dialog.JPG

(3) Archive log is shown and if "Open archive in ..." is checked

012-summary.JPG

(4) The Archive folder will be automatically opened.

(In my case, there are many archives, but the newly created one is high-lighted.)

013-zip-file.JPG

(5) Copy or move the archive to the folder of your choice and expand the zip file

014-copied-temp.JPG

(6) In the expanded folder there is the copied project and

    by double clicking the <project>.cyprj, you can invoke PSoC Creator for it.

015-double-click-the-project.JPG

Best Regards,

28-Jan-2020

Motoo Tanaka

P.S. BTW, I could not see your attached picture(s).

May be you need to save it as a file first then copy it to the topic.

0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Scott,

To be clear. 

  • Is your goal to create a "perfect" clone of the original project then modify as needed this cloned project and the code/schematic changes are independent of the original project?
  • Is your goal to create a "perfect" clone of the original project where certain code files are actually shared between the original and clone-modified projects?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Hi Len

  • Is your goal to create a "perfect" clone of the original project then modify as needed this cloned project and the code/schematic changes are independent of the original project?

This one.

It’s very dangerous. I’ve tried copying and pasting a project but then,.. ~I can’t get back to the original~,.. any other way besides deleting it and reloading it from a backup. You don’t know what it is you’re saving when you exit. If you don’t save, you’re completely hosed, if you save, you’re in the new project and can’t get back the original.

This shouldn’t be that hard. It’s basic. We have products and then we develop new products that benefit from code reuse. The development schedule doesn’t always allow for having to start a completely new project, then cutting and pasting code into the new project. So far, that’s been the safest practice.

Scott E

0 Likes

Scott,

When I need to create a "perfect" clone with the original code not touched, I select the Project in the Workspace Explorer and Select "Copy".

pastedImage_0.png

Then select "Paste"

A copy of the original project is now placed in the Workspace Explorer.

This copy has all the files of the original and does not share files in this mode.

You can rename the copied project.

If you modify ANY file in the copied project, the original file in the original project is untouched.

Is this what you are looking for?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

ScEn,

I do 'Save it" in simpler way:

(1) Select the project name in the Project Explorer panel. (2) File->Save project as.. (Type a new name and hit Enter). (3) Close the workspace: File->Close Workspace. When asked "Save Workspace before closing?", -Answer "NO"! (4) Open newly saved project, File->Open project. Done!

/odissey1

I’ve tried it and then there is no way to get back to the original project.

This does create a new project but getting back to the original is the problem.

I’ve tried it both ways, saving and not saving.

0 Likes

Scott,

The original project remains intact. The only drawback is that all project tabs are getting closed in the new project, but that is hardly an issue.

/odissey1

0 Likes

Len,

I’m sorry, I don’t know what you’re referring to ‘Project Explorer Panel’.

I have a Workspace Explorer Panel and a Code Explorer Panel. I’m using Creator 4.2.

Scott

0 Likes

Alright, I get it. The key was to not save the Original Project.

Thanks for your patience.

Scott

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear /odissey1-san,

I did not know about this.

It's actually a "Save as", isn't it?

My method of copying project was learned from the PSoC 101 Video,

I wish the tutor has had shown your method...

Best Regards,

30-Jan-2020

Motoo Tanaka

0 Likes

Motoo,

Project rename process in Creator not intuitive and differs from standard. This is probably due to allowance for multiple projects coexist in the workspace. I don't like it. Took me some trial and error to find a way to clone a project. There should be better way, I will try yours also.

Thank you.

/odissey1