Skip to content
Snippets Groups Projects
Select Git revision
  • 0e2c7295516d3a31f8604ea7856caed62679acd5
  • master default protected
2 results

pykat_output.kat

Blame
  • ISimulationEngine.h 4.09 KiB
    /*************************************************************************
     *   Copyright (C) 2007 by Oliver Bock                                   *
     *   bock@tfh-berlin.de                                                  *
     *                                                                       *
     *   This file is part of Fidelity.                                      *
     *                                                                       *
     *   Fidelity is free software: you can redistribute it and/or modify    *
     *   it under the terms of the GNU General Public License as published   *
     *   by the Free Software Foundation, version 3 of the License.          *
     *                                                                       *
     *   Fidelity is distributed in the hope that it will be useful,         *
     *   but WITHOUT ANY WARRANTY; without even the implied warranty of      *
     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the        *
     *   GNU General Public License for more details.                        *
     *                                                                       *
     *   You should have received a copy of the GNU General Public License   *
     *   along with Fidelity. If not, see <http://www.gnu.org/licenses/>.    *
     *                                                                       *
     *************************************************************************/
    
    #ifndef ISIMULATIONENGINE_H
    #define ISIMULATIONENGINE_H
    
    #include <QThread>
    
    #include "ParameterHandler.h"
    #include "ParameterTable.h"
    #include "SimulationSetup.h"
    
    namespace Fidelity {
    	namespace Engine {
    
    /**
     * @author Oliver Bock <bock@tfh-berlin.de>
     * 
     * This interface defines all methods any concrete SimulationEngine needs to provide
     */
    class ISimulationEngine : public QThread
    {
    
    public:
    	/**
    	 * Empty Destructor
    	 */
    	virtual ~ISimulationEngine()
    	{};
    
    	// Main control methods
    
    	/**
    	 * Initialise the simulation engine.<br>
    	 * Called before the main simulation run.
    	 */
    	virtual void init() = 0;
    
    	/**
    	 * This Methods starts the main simulation run.<br>
    	 * It's an overloaded method of QThread.
    	 */
    	virtual void run() = 0;
    
    	/**
    	 * Finalise the simulation engine.<br>
    	 * Called after the main simulation run.
    	 */
    	virtual void post() = 0;
    
    	// Accessor nethods
    
    	/**
    	 * Get the value of m_Identifier.
    	 * @return The value of m_Identifier.
    	 */
    	virtual QString Identifier() const = 0;
    	
    	/**
    	 * Get the value of m_ParamTable.
    	 * @return The value of m_ParameterTable.
    	 */
    	virtual ParameterTable* ParamTable() const = 0;
    
    	/**
    	 * Set the value of m_SimulationSetup.<br>
    	 * This member holds the complete optical setup of the simulation. All components are given in a ComponentTable.
    	 * @param setup The new value of m_SimulationSetup
    	 */
    	virtual void setSimSetup(SimulationSetup* setup) = 0;
    
    	/**
    	 * Get the value of m_SimulationSetup.<br>
    	 * This member holds the complete optical setup of the simulation. All components are given in a ComponentTable.
    	 * @return The value of m_SimulationSetup.
    	 */
    	virtual SimulationSetup* SimSetup() const = 0;
    
    public slots:
    	/**
    	 * Pause the simulation run.
    	 * @return TRUE if the pause request was successful.
    	 */
    	virtual bool pause() = 0;
    
    	/**
    	 * Resume the simulation run.
    	 * @return TRUE if the resume request was successful.
    	 */
    	virtual bool resume() = 0;
    
    	/**
    	 * Stop the simulation run.
    	 * @param save Set to TRUE if you want the simulation status to be saved for a possible restart at a later time.
    	 * @return TRUE if the stop request was successful.
    	 */
    	virtual bool stop(bool save) = 0;
    
    signals:
    	/**
    	 * This signal is emitted when a simulation is initialised.<br>
    	 * It indicates the total amount of iterations during the upcoming simulation run.
    	 * @param iterations The total amount of iterations during the upcoming simulation run.
    	 */
    	virtual void simulationProgressInit(const long iterations) = 0;
    
    	/**
    	 * This signal is emitted when a certain number of iterations is completed.<br>
    	 * @param iteration The current number of completed iterations.
    	 */
    	virtual void simulationProgressStep(long iteration) = 0;
    };}}
    
    #endif // SIMULATIONENGINE_H