Example #1
0
        private void SaveProfilerConfiguration(VirtualProfilerSaveState saveState, string path)
        {
            var saveStateFileContents = "";
            var serializer            = new XmlSerializer(typeof(VirtualProfilerSaveState));

            using (var ms = new MemoryStream())
            {
                serializer.Serialize(ms, saveState);
                saveStateFileContents = Encoding.UTF8.GetString(ms.ToArray());
            }
            File.WriteAllText(path, saveStateFileContents);
        }
Example #2
0
        public void InstantReplay(string saveStateFile)
        {
            var savedState = VirtualProfilerSaveState.LoadFromFile(saveStateFile);

            Global.Launcher.SaveState = savedState;
            if (Objects.ReplayController == null)
            {
                throw new ApplicationException("No replay adapter found.");
            }
            _activeReplayer = new InstantReplayer(Objects.ReplayController.LineRenderer, SubjectLogger.Load(savedState.RunSettings.SubjectPositionPath));
            Objects.ReplayController.StartReplay(_activeReplayer);
        }
Example #3
0
        public void Start(string runFolder, string notes)
        {
            Stop();
            EnableStreamAdapter();

            _saveState = new VirtualProfilerSaveState()
            {
                RunSettings    = new VirtualProfilerRunConfiguration(runFolder, notes),
                GlobalSettings = Global.Config,
                RuntimeResults = null
            };
            SaveProfilerConfiguration(_saveState, _saveState.RunSettings.SaveStatePath);

            if (Global.Config.EnableSubjectLogging)
            {
                _controller.SubjectLogger = new SubjectLogger(_saveState.RunSettings.SubjectPositionPath);
            }

            _controller.HistogramTrackers.Clear();
            _controller.HistogramTrackers.Add(new HistogramTracker(
                                                  _controller.transform,
                                                  _saveState.RunSettings.RunFolder,
                                                  _saveState.GlobalSettings));

            _controller.HistogramTrackers.Add(new HistogramDistanceTracker(
                                                  _saveState.RunSettings.RunFolder,
                                                  _saveState.GlobalSettings,
                                                  _controller.transform,
                                                  _controller.ChaserTransform));

            _controller.HistogramTrackers.Add(new HistogramOrientationTracker(
                                                  _saveState.RunSettings.RunFolder,
                                                  _saveState.GlobalSettings,
                                                  _controller.transform,
                                                  _controller.ChaserTransform));

            StartProfiling(new EventStreamWriter(_saveState.RunSettings.MovementLogPath));
        }
 private void SaveProfilerConfiguration(VirtualProfilerSaveState saveState, string path)
 {
     var saveStateFileContents = "";
     var serializer = new XmlSerializer(typeof(VirtualProfilerSaveState));
     using (var ms = new MemoryStream())
     {
         serializer.Serialize(ms, saveState);
         saveStateFileContents = Encoding.UTF8.GetString(ms.ToArray());
     }
     File.WriteAllText(path, saveStateFileContents);
 }
        public void Start(string runFolder, string notes)
        {
            Stop();
            EnableStreamAdapter();

            _saveState = new VirtualProfilerSaveState()
                {
                    RunSettings = new VirtualProfilerRunConfiguration(runFolder, notes),
                    GlobalSettings = Global.Config,
                    RuntimeResults = null
                };
            SaveProfilerConfiguration(_saveState, _saveState.RunSettings.SaveStatePath);

            if (Global.Config.EnableSubjectLogging)
                _controller.SubjectLogger = new SubjectLogger(_saveState.RunSettings.SubjectPositionPath);

            _controller.HistogramTrackers.Clear();
            _controller.HistogramTrackers.Add(new HistogramTracker(
                _controller.transform,
                _saveState.RunSettings.RunFolder,
                _saveState.GlobalSettings));

            _controller.HistogramTrackers.Add(new HistogramDistanceTracker(
                _saveState.RunSettings.RunFolder,
                _saveState.GlobalSettings,
                _controller.transform,
                _controller.ChaserTransform));

            _controller.HistogramTrackers.Add(new HistogramOrientationTracker(
                _saveState.RunSettings.RunFolder,
                _saveState.GlobalSettings,
                _controller.transform,
                _controller.ChaserTransform));

            StartProfiling(new EventStreamWriter(_saveState.RunSettings.MovementLogPath));
        }