Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 4
0
 public void Clear()
 {
     CurrentEmulation = new Emulation();
 }
Ejemplo n.º 5
0
 public PausedState(Emulation emulation)
 {
     machineStates = emulation.Machines.Select(x => x.ObtainPausedState()).ToArray();
     emulation.ExternalsManager.Pause();
     this.emulation = emulation;
 }