Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Saving files (Read 8312 times)
Bob Green
Junior Member
**
Offline


Posts: 11
Location: Derbyshire, UK
Joined: Jun 18th, 2011
Saving files
Jun 29th, 2013 at 7:54pm
Print Post  
As I develop a project I like to 'save' the .ino file with a different name, for example testproject1a, testproject1b etc.  When I tried to do this in Atmel Studio it somehow appended the b version of the file to the original version effectively duplicating all the code.  Naturally this would not then compile!  so how can I save just version of the .ino file outside of the current project /solution.
Can anyone suggest a good book or on line source of information on learning visual studio please?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Saving files
Reply #1 - Jun 29th, 2013 at 8:09pm
Print Post  
Hi,

Thanks for reporting this issue. This is a bug in the Atmel Studio versions of Visual Micro.

In Visual Studio versions right mouse clicking the main sketch.ino and clicking  "Rename" runs a workflow that handles the rename correctly for you. This fails in the Atmel studio version.

Future versions of Visual Micro should also handle the rename of the project in a similar way.

In the meantime you have a few options. The best one is to do as follows in windows explorer. Ensure the sketch is closed in atmel studio prior to doing this

rename the sketch folder to the new name
rename the main sketch.ino to the new name
delete the atmel studio files:- .atsln,.atsuo .cppproj

Then re-open the .ino in atmel studio and Visual Micro will re-create the project files automatically.

note: The Arduino rules are that the sketch folder name and sketch.ino have the same name, Visual Micro also expects the Atmel project to have the same name.
  
Back to top
WWW  
IP Logged
 
Bob Green
Junior Member
**
Offline


Posts: 11
Location: Derbyshire, UK
Joined: Jun 18th, 2011
Re: Saving files
Reply #2 - Jun 30th, 2013 at 8:07pm
Print Post  
Tim,
Thanks for the reply.  I thought I was doing something stupid or missing something.  For now I am creating the different files in the Arduino IDE and then opening the 'new' version in AS6 / VM.  It's a f*g but it works.

I guess there is no book you would suggest?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Saving files
Reply #3 - Jun 30th, 2013 at 8:57pm
Print Post  
Hi,

When you say "creating different files" do you mean "renaming" sketch projects?

My note only related to renaming an entire project or renaming the master sketch.ino.

Otherwise you can use Atmel Studio to create and rename source files, create new projects and do a whole bunch of other stuff. 

There are various ways to rename individual sources, easiest is to right click the name of the source code in the solution explorer and click "Rename"

To create new source code there are also lots of tool bar and menu options. One of the easiest is right click the project in the solution explorer and click "Add>", you will see you can add a new Arduino source code or add a C, Cpp. 

The three options have various behaviors. The "Add>New Arduino Item" adds a new .ino/.pde to the sketch project. The cpp option gives a ready to go .cpp/.h combination. When you create a cpp you are prompted for a name, adding the text "Class" to the end of the name will automatically create an external class with arduino.h included along with a few examples methods. For example: add a cpp called "MyButtonClass", MyButton.cpp, MyButton.h will be created, a class called MyButtonClass will be fined, an external object for immediate use in the sketch will be created called MyButton, MyButton,init() will be available for your user code.
« Last Edit: Jun 30th, 2013 at 8:59pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
soundararajan
Newbies
*
Offline


Posts: 5
Location: Chennai, India
Joined: Jan 22nd, 2013
Re: Saving files
Reply #4 - Aug 7th, 2013 at 11:37am
Print Post  
Hi Tim,

Trying to extend some sort of here here. Smiley I tried to debug this failure with Atmel studio and see that the rename workflow fails in 

Visual.Micro.Visual.Studio.Arduino.AddInApp.RenameSketch()

The reason, when trying to construct the FileInfo the name of the returned file seems to be 

C:\Users\soundararajan\Documents\Arduino\todo\Visual Micro\.C:\Users\soundararajan\Documents\Arduino\todo\todo.vsarduino.h

where it actually is 
C:\Users\soundararajan\Documents\Arduino\todo\todo.vsarduino.h

I guess one of the API's that you use from Atmel studio is not consistent with Visual studio.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Saving files
Reply #5 - Aug 7th, 2013 at 1:09pm
Print Post  
Good info, thank you we will look at it of the next release
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Saving files
Reply #6 - Aug 18th, 2013 at 10:23pm
Print Post  
The sketch rename workflow that appears when renaming the master.ino is now working in Atmel Studio. 

1308.18

There were a few differences between Visual Studio and Atmel Studio in the file name information passed to the ItemRename event and also a slight difference in behavior when setting the project.Name and subsequently calling Project.Save().

Thanks for the pointers  Smiley
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint