Author Topic: Restore workspaces after crash?  (Read 4292 times)

Offline Luigi

  • PixInsight Addict
  • ***
  • Posts: 140
Restore workspaces after crash?
« on: 2010 February 07 11:28:57 »
I had three workspaces open, each with an image I was processing when my Windows 7 64-bit BSOD'ed  >:(

I notice that the autosave feature has some files in %USERPROFILE%/AppData/Local/Temp/~PI64*. Can I restore my workspace from within PI or do I simply open one of the *.swp files "manually"?

Regards,
Louis Marchesi   <--- under two feet of snow
Regards,
Luigi Marchesi

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Restore workspaces after crash?
« Reply #1 on: 2010 February 08 03:11:28 »
Hi Louis,

The PSM AutoSave feature saves your process icons. You can restore them by simply dragging one of the .psm files from your %TEMP% folder (or the folder you have specified in Preferences, in case you've customized it) to PI's workspace. Auto-saved .psm files are just regular PSM files that you can open in the usual way.

You can also recover .swp files. However, recovering a swap file is only possible if you have not enabled parallel swap file storage to spread swap files across two or more physical disk devices (this is a Preferences option). This is a limitation that I'll overcome in a future version.

If the above condition is true, you can use this little script to load a .swp file as a new image window:

Code: [Select]
#include <pjsr/UndoFlag.jsh>

/* Change this to your actual .swp file path */
#define FILE_PATH "/path/to/your/swap/directory/~PI64~3LH1SSBDBM3H~test.swp"

var w = new ImageWindow( 1, 1 );

with ( w.mainView )
{
   beginProcess( UndoFlag_NoSwapFile );
   image.readRawFile( FILE_PATH );
   endProcess();
}

w.show();
w.zoomToOptimalFit();

where you must change the value of FILE_PATH with the actual path to your .swp file. Note that this script can only recover pixel data, not the processing history of the image, which is maintained in RAM and hence is lost in the event of a crash.

Hope this helps.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/