Esempio n. 1
0
        void RestoreToConfirmedFrame()
        {
            //skip the first frame because there is no systemData to restore to
            if (_currentInputFrameNumber > 1)
            {
                SWConsole.Crit($"Engine: RestoreToConfirmedFrame {_currentInputFrameNumber}");
                SWSystemDataFrame systemDataFrame = systemDataFrames[_currentInputFrameNumber];

                IRestorable restorable = systemDataFrame.GetUserRestorable();
                if (restorable != null)
                {
                    restorable.Restore();
                }

                ReloadSystemDataSnapshot(systemDataFrame.bytes);
                systemDataFrame.bytes.SetReadIndex(0);
            }
        }
Esempio n. 2
0
        void ExportSimulationResult()
        {
            SWSystemDataFrame systemDataFrame = systemDataFrames[_currentInputFrameNumber];

            if (systemDataFrame == null)
            {
                systemDataFrame = new SWSystemDataFrame(_currentInputFrameNumber);
                systemDataFrames[_currentInputFrameNumber] = systemDataFrame;
            }

            systemDataFrame.FrameNumber = _currentInputFrameNumber;
            systemDataFrame.Reset();

            if (OnEngineWillExportEvent != null)
            {
                IRestorable restorable = OnEngineWillExportEvent(_currentInputFrameNumber);
                systemDataFrame.SetUserRestorable(restorable);
            }

            TakeSystemDataSnapshot(systemDataFrame.bytes);
        }
Esempio n. 3
0
        public SWSystemDataFrame GetSystemDataFrame(int frameNumber)
        {
            SWSystemDataFrame systemDataFrame = systemDataFrames[frameNumber];

            return(systemDataFrame);
        }