RobotStudio event

Restoring a backup

I have another problem with restoring a backup on the controller from my C# program.
I'm able to restore a backup to the controller by just using the Controller.Restore(path) function.

The problem is that when the function Controller.Restore executes it immediately returns 'true' but meanwhile the controller is still restoring / restarting.

The question is, is it possible to wait (using a while loop or event or something) until the controller is finished with restoring the backup.

 

Code example:

 

Cursor.Current = Cursors.WaitCursor;

Controller.Restore(path);

 

// Here I want some code that waites until the controller is finished with restoring

// the backup.

 

Cursor.Current = Cursors.Default;

 

Hope on some good answers Big smile

 

Comments

  • I played around with this and could not find a event like BackupCompleted to let you know that the restore was complete.  Which I am sure you already found that out. 

    Something that might work is to use networkWatcher.Lost to watch for when the controller reboots.  When the restore is complete it auto reboots the controller and you could watch for that.  Just a ideal, I did not try it but maybe it will work...