guicommon/SimulationRunDialog.hpp
Go to the documentation of this file.
00001 /*
00002   This file is part of OpenFLUID-engine software
00003   Copyright (c) 2007-2010 INRA-Montpellier SupAgro
00004 
00005  == GNU General Public License Usage ==
00006 
00007   OpenFLUID-engine is free software: you can redistribute it and/or modify
00008   it under the terms of the GNU General Public License as published by
00009   the Free Software Foundation, either version 3 of the License, or
00010   (at your option) any later version.
00011 
00012   OpenFLUID-engine is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015   GNU General Public License for more details.
00016 
00017   You should have received a copy of the GNU General Public License
00018   along with OpenFLUID-engine.  If not, see <http://www.gnu.org/licenses/>.
00019 
00020   In addition, as a special exception, INRA gives You the additional right
00021   to dynamically link the code of OpenFLUID-engine with code not covered 
00022   under the GNU General Public License ("Non-GPL Code") and to distribute
00023   linked combinations including the two, subject to the limitations in this
00024   paragraph. Non-GPL Code permitted under this exception must only link to
00025   the code of OpenFLUID-engine dynamically through the ofelib library
00026   interface, and only for building OpenFLUID-engine plugins. The files of
00027   Non-GPL Code may be link to the ofelib library without causing the
00028   resulting work to be covered by the GNU General Public License. You must
00029   obey the GNU General Public License in all respects for all of the
00030   OpenFLUID-engine code and other code used in conjunction with
00031   OpenFLUID-engine except the Non-GPL Code covered by this exception. If
00032   you modify this OpenFLUID-engine, you may extend this exception to your
00033   version of the file, but you are not obligated to do so. If you do not
00034   wish to provide this exception without modification, you must delete this
00035   exception statement from your version and license this OpenFLUID-engine
00036   solely under the GPL without exception.
00037 
00038 
00039  == Other Usage ==
00040 
00041   Other Usage means a use of OpenFLUID-Engine that is inconsistent with
00042   the GPL license, and requires a written agreement between You and INRA.
00043   Licensees for Other Usage of OpenFLUID-engine may use this file in
00044   accordance with the terms contained in the written agreement between
00045   You and INRA.
00046 */
00047 
00048 
00057 #ifndef __SIMULATIONRUNDIALOG_HPP___
00058 #define __SIMULATIONRUNDIALOG_HPP___
00059 
00060 #include <gtkmm/dialog.h>
00061 #include <gtkmm/label.h>
00062 #include <gtkmm/expander.h>
00063 #include <gtkmm/textview.h>
00064 #include <gtkmm/scrolledwindow.h>
00065 
00066 #include <openfluid/dllexport.hpp>
00067 #include <openfluid/guicommon/RunStatusWidget.hpp>
00068 
00069 namespace openfluid { namespace machine {
00070 class Engine;
00071 class SimulationBlob;
00072 class ModelInstance;
00073 }
00074 }
00075 
00076 namespace openfluid { namespace guicommon {
00077 
00078 class RunDialogMachineListener;
00079 
00080 class DLLEXPORT SimulationRunDialog : public Gtk::Dialog
00081 {
00082   private:
00083 
00084     Gtk::Label m_TopLabel;
00085 
00086     RunStatusWidget m_RunStatusWidget;
00087 
00088     Gtk::Expander m_DetailsExpander;
00089 
00090     Gtk::TextView m_DetailsTextView;
00091     Gtk::ScrolledWindow m_DetailsSWindow;
00092 
00093     Glib::RefPtr<Gtk::TextBuffer> m_RefDetailsTextBuffer;
00094 
00095     Gtk::Button m_ControlButton;
00096 
00097     bool m_SimulationCompleted;
00098 
00099     openfluid::machine::Engine* mp_Engine;
00100     openfluid::machine::SimulationBlob* mp_SBlob;
00101     openfluid::machine::ModelInstance* mp_Model;
00102     RunDialogMachineListener* mp_MachineListen;
00103 
00104 
00105     std::string m_LastStepStr;
00106     int m_StepsCount;
00107 
00108     sigc::signal<void> m_signal_SimulationStopped;
00109     sigc::signal<void> m_signal_SimulationStarted;
00110 
00111     void onIgnition();
00112 
00113     void onControlButtonClicked();
00114 
00115     void resetWidgets();
00116 
00117     void runSimulation();
00118 
00119     bool on_delete_event(GdkEventAny*);
00120 
00121   public:
00122 
00123     SimulationRunDialog(openfluid::machine::Engine* Eng);
00124 
00125     ~SimulationRunDialog();
00126 
00127     bool isSimulationCompleted() { return m_SimulationCompleted; };
00128 
00129     sigc::signal<void> signal_SimulationStopped()
00130     { return m_signal_SimulationStopped; }
00131 
00132     sigc::signal<void> signal_SimulationStarted()
00133     { return m_signal_SimulationStarted; }
00134 
00135 };
00136 
00137 } } //namespaces
00138 
00139 
00140 
00141 #endif /* __SIMULATIONRUNDIALOG_HPP___ */

Generated using Doxygen 1.7.6.1
Creative Commons License Creative Commons By-NC-ND license