simTerminating

Класс: simevents.SimulationObserver
Пакет: simevents

Задайте поведение наблюдателя, когда симуляция завершит работу

Синтаксис

simTerminating(obj)

Описание

simTerminating(obj) определяет поведение, когда симуляция завершает работу. Замените эту функцию, чтобы задать поведение вашей визуализации, когда симуляция завершит работу, как определено SimulationStatus параметр.

Входные параметры

развернуть все

Объект класса SimulationObserver

Примеры

развернуть все

Вызовите этот метод, когда симуляция завершит работу.

function simTerminating(this)
            % Called when simulation is terminating
            %
            % After the simulation terminates, in order to support clicking
            % on entity to see attributes, we gather up all of the entities
            % that exist in the model and save their attribute information
            
            ents = this.mEntityGlyphs.keys;
            for idx = 1 : length(ents)
                ent = ents{idx};
                try
                    enStruct = this.mEntities(ent);
                    str = evalc('disp(enStruct.Attributes)');
                    this.mCachePostRun(ent) = str;
                catch me
                end
            end
            
            % If animation timer is still running, schedule a stop
            if strcmp(this.mTimer.Running, 'on')
                this.mTimerRequestStop = true;
            else
                % If timer is not running, delete it
                delete(this.mTimer);
            end
        end
Введенный в R2016a
Для просмотра документации необходимо авторизоваться на сайте