Undo, Redo and Snapshots

From BurnSim Wiki
Jump to navigation Jump to search

BurnSim 4.0.0.23 added two ways to get back to an earlier design: undo and redo, for stepping back through what you have just done, and named snapshots, for keeping a design you want to come back to. They work together - restoring a snapshot is itself a step you can undo - but they answer different questions. Undo is "put back what I just changed". A snapshot is "keep this version of the motor, by name, for good".

Undo and redo

Both are on the Edit menu:

  • Undo (Ctrl+Z) - step back one change to the motor design.
  • Redo (Ctrl+Y) - re-apply a change you undid. The shortcut is Ctrl+Y, not Ctrl+Shift+Z.

The menu items are dimmed when there is nothing to undo or redo.

What one step is

One undo step is one finished edit, not one keystroke. A motor or nozzle field commits its value when you leave the box, so typing 0.625 into Throat dia and tabbing out is a single change, and one Ctrl+Z puts the old throat back - not the last character you typed. Adding, removing or reordering a grain, applying the grain editor, and restoring a snapshot are each one step too.

How long history lasts

Undo history is for this session and this motor only. It is held in memory, it is not saved in the .bsx file, and it is cleared by File → New, File → Open and importing an openMotor (.ric) file. Closing BurnSim discards it. If you want a version of a design to survive any of that, take a snapshot.

The propellant database is not undoable

Undo changes the motor, never your propellant database. Editing a propellant's a, n, density or C* - including through Characterize Propellant or the Ingredients window - cannot be undone with Ctrl+Z.

That is deliberate. A grain does not own its propellant: every motor that names the same propellant shares one database entry. If undoing a change to one motor could rewrite that entry, it would silently re-characterize every other design that uses it. So undo only ever changes which propellant a grain points at, never the propellant itself.

Snapshots

The Snapshots tab sits beside Notes in the bottom-right panel (see Results, Test Data and Notes).

  • Save Snapshot... - records the motor exactly as it is now, under a name you give it. BurnSim suggests the motor's name and a number.
  • Restore - replaces the current motor with the selected snapshot. Double-clicking a snapshot in the list does the same.
  • Rename... - changes the selected snapshot's name, or its notes.
  • Delete - removes the selected snapshot, after asking.

Select a snapshot to see when it was taken and its notes. The notes box beside the list is editable, and like the motor's own Notes it saves when you click away from it.

What a snapshot holds

Everything about the motor: every motor and nozzle field, every grain, the propellant values as they were when the snapshot was taken, the test data, and the motor's notes - plus the snapshot's own name, notes and timestamp.

Snapshots are saved in the motor file

Snapshots are stored inside the .bsx, so they come back when you reopen the motor, and they travel with the file if you send it to someone else. Save the motor after taking a snapshot, the same as after any other change, or the snapshot is lost with it.

Motors with imported test data get bigger. Each snapshot is a full copy of the motor, test data included, so a motor carrying a long measured trace and several snapshots makes a noticeably larger file. For a motor without imported data the cost is negligible - well under a kilobyte per snapshot.

Before a restore

Restoring replaces the motor you have now. If that motor is not already held in one of its snapshots, BurnSim asks first - Replace the Current Motor? - and offers three choices:

  • Snapshot First - name a snapshot of the current motor, then restore. Cancelling the naming box cancels the restore as well.
  • Restore Anyway - restore without keeping the current motor (you can still Ctrl+Z out of it this session).
  • Cancel - leave everything as it is.

Whether the motor has been saved makes no difference. A motor you have just opened still asks, because being on disk does not protect it here: getting it back would mean closing without saving and reopening, which also throws away your undo history. The only question that matters is whether the motor in front of you is recorded in a snapshot.

It does not ask twice. Straight after a restore, or after you have just taken a snapshot, the motor already matches a stored snapshot, so the next restore goes ahead without a prompt.

Propellants on restore

A snapshot records the propellant values it was taken with, but restoring points each grain back at its propellant by name, using your propellant database as it is now. If you have since re-characterized that propellant, the restored motor uses the new values. This is the same rule as undo: going back to an old design never rewrites a propellant that other motors share.

What can and cannot be undone

Action Undoable?
Editing a motor, nozzle or grain field Yes
Adding, removing or reordering grains Yes
Restoring a snapshot Yes
Editing or characterizing a propellant No - the propellant database is shared by every motor
Taking, renaming, re-noting or deleting a snapshot No - these change the motor's record-keeping, not its design

Because deleting a snapshot cannot be undone, BurnSim always asks before it does it.

See also