示例#1
0
 public void Load(string path)
 {
     using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read))
     {
         CurrentEmulation = serializer.Deserialize <Emulation>(stream);
         CurrentEmulation.BlobManager.Load(stream);
     }
 }
示例#2
0
        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();
        }
示例#3
0
        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);
            }
        }
示例#4
0
 public void Clear()
 {
     CurrentEmulation = new Emulation();
 }
示例#5
0
 public PausedState(Emulation emulation)
 {
     machineStates = emulation.Machines.Select(x => x.ObtainPausedState()).ToArray();
     emulation.ExternalsManager.Pause();
     this.emulation = emulation;
 }