Ejemplo 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);
            }
        }
Ejemplo 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);
        }
Ejemplo n.º 3
0
        public SWSystemDataFrame GetSystemDataFrame(int frameNumber)
        {
            SWSystemDataFrame systemDataFrame = systemDataFrames[frameNumber];

            return(systemDataFrame);
        }