public void Load(string path) { using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read)) { CurrentEmulation = serializer.Deserialize <Emulation>(stream); CurrentEmulation.BlobManager.Load(stream); } }
private EmulationManager() { var settings = new Antmicro.Migrant.Customization.Settings(Antmicro.Migrant.Customization.Method.Generated, Antmicro.Migrant.Customization.Method.Generated, Antmicro.Migrant.Customization.VersionToleranceLevel.AllowGuidChange, disableTypeStamping: true); serializer = new Serializer(settings); serializer.ForObject <PythonDictionary>().SetSurrogate(x => new PythonDictionarySurrogate(x)); serializer.ForSurrogate <PythonDictionarySurrogate>().SetObject(x => x.Restore()); currentEmulation = new Emulation(); ProgressMonitor = new ProgressMonitor(); stopwatch = new Stopwatch(); }
public void Load(string path) { string version; using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read)) { version = serializer.Deserialize <string>(stream); CurrentEmulation = serializer.Deserialize <Emulation>(stream); CurrentEmulation.BlobManager.Load(stream); } if (version != VersionString) { Logger.Log(LogLevel.Warning, "Version of deserialized emulation ({0}) does not match current one {1}. Things may go awry!", version, VersionString); } }
public void Clear() { CurrentEmulation = new Emulation(); }
public PausedState(Emulation emulation) { machineStates = emulation.Machines.Select(x => x.ObtainPausedState()).ToArray(); emulation.ExternalsManager.Pause(); this.emulation = emulation; }