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 Visual Micro Explorer ... loading and saving examples (Read 4059 times)
Bobo
Newbies
*
Offline


Posts: 6
Joined: Apr 20th, 2017
Visual Micro Explorer ... loading and saving examples
Apr 23rd, 2017 at 7:22am
Print Post  
VS 2017 + latest VM

This may be purely a VS 2017 "feature" but it seems weird to me so thought i would ask.

1. Select an example to open as a Project.

2. Play around with the Project.

3. Don't save anything.

4. Close Project and select No to save solution.

5. Reopen as per 1. "Project with that name already exists". You open that and find that all of No 2. is sitting there!!! What the Photon?

Why has all the "crap" that i added to the example been saved?

I have checked VS for some sort of autosave but couldn't find anything. I don't understand  Shocked

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro Explorer ... loading and saving examples
Reply #1 - Apr 23rd, 2017 at 9:26am
Print Post  
Are you opening directly or clicking the copy/clone option?

If you are opening directly and you used the windows installer to install arduino then we can be affected by windows permissions preventing both visual micro and visual studio from creating files for things like intellisense or creating projects or adding projects to solutions etc

The way to solve this is to either run vs with admin permissions or to use the zip from the arduino.cc download page and re-point the visual micro ide locations window to the location where you unpack the zip. 

One other point. If you want to alter examples then open a copy, visual micro will make a copy in "sketchbook/my examples".

Another option is to open the code of any example by clicking the code in the examples explorer instead of the example folder name. This will open a single code file without attempting to create a project. Allowing you to copy what you need into your own test projects.

Does this make sense?
« Last Edit: Apr 23rd, 2017 at 9:29am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Bobo
Newbies
*
Offline


Posts: 6
Joined: Apr 20th, 2017
Re: Visual Micro Explorer ... loading and saving examples
Reply #2 - Apr 24th, 2017 at 3:19am
Print Post  
Always clicking the "make a copy".

I don't have the arduino ide installed.

The annoying part is the fact it has saved my changes when I didn't ask it (nor wanted it) to. What that then appears to mean is I have to manually delete the copy after I have finished with it, otherwise when I go to create a copy again (of the same example) it will open the modified one. Crazy if you ask me  Roll Eyes

I understand this is a minor thing in the overall scheme of what is otherwise a wonderful tool, so if this behaviour is normal then I will obviously have to put up with it.  Cheesy
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro Explorer ... loading and saving examples
Reply #3 - Apr 24th, 2017 at 9:58am
Print Post  
I have no idea why the copy would fail to create a project and solution properly. I can test that when time allows..

As concerns saving the change, if you can come up with a better way to work then please feel free to describe it here. If you open a project in VS and make changes and then save those changes or build the project, then VS will save the changes.

I suspect that you simply wanted to open the source code without creating a project. That is also an option instead of copy. 

I await your enlightening golden nugget of wisdom  Smiley
  
Back to top
WWW  
IP Logged
 
Bobo
Newbies
*
Offline


Posts: 6
Joined: Apr 20th, 2017
Re: Visual Micro Explorer ... loading and saving examples
Reply #4 - Apr 25th, 2017 at 4:38am
Print Post  
Sorry, I guess it's sometimes difficult expressing ideas and behaviour via text. Perhaps a pint might help  Wink

Essentially, the strange behaviour (I consider at least) is the fact that a project appears to get automatically saved at the end of a session, regardless of my intent, and regardless of the fact that I answered no to such.

I am guessing that VS (as opposed to VM) does this otherwise it wouldn't be possible to modify the code.

I would however expect those files to be deleted if at the end of the session I had requested no project to be saved.

By them being saved in a new project, when I go to create a copy again (of the same example) it will open the modified one. For me now to open a copy of the original I must manually delete the modified project first.

This is important to me (and perhaps only me), because I like to open examples, have a poke around then move on. If I come back to that example later I don't want my code riddled example to get opened again, but rather a fresh copy of the original. If I had wanted my code riddled example to open I would've saved it to begin with.

Hope this now makes sense Smiley

Cheers
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro Explorer ... loading and saving examples
Reply #5 - Apr 25th, 2017 at 10:33am
Print Post  
Hi,

Visual Micro does not support the "file in memory" mode that works for some VS projects. Visual micro needs to write intellisense files otherwise vs intellisense doesn't work properly, so maybe that adds some confusion and causes VS to save the code.

Normally we have a sketch book folder for arduino which is used when using "File>Open>Arduino Project", "File>New>Arduino Project" and for cloned examples. VS has it's own location for new projects which is used when using "File>New>Project" and "File>Open>Project" etc. Therefore some users use the sketch book folder as a scratch pad for examples and junk, leaving the vs folders for the good stuff.

I thought about the issue with cloned examples. For the next release I plan to always make a unique folder name when cloning examples so you will then be able to open the same example multiple times.

Lastly don't forget you do not need to use the clone option for examples. You can simply browser the source code of any example without need to create a project. This is an easier way to work and mean you are editing/viewing the original example code that vs should less easily save
  
Back to top
WWW  
IP Logged
 
Bobo
Newbies
*
Offline


Posts: 6
Joined: Apr 20th, 2017
Re: Visual Micro Explorer ... loading and saving examples
Reply #6 - Apr 26th, 2017 at 6:23am
Print Post  
Ok, thanks for the info. The unique folder name sounds like it will help.

Cheers
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro Explorer ... loading and saving examples
Reply #7 - Apr 30th, 2017 at 7:54pm
Print Post  
The example "Create Copy" method in the latest release uses the date time to create a new example.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint