|
Hormiga 1.0
|
00001 00002 /* 00003 # Hormiga - Software de cálculo programable. 00004 # 00005 # Copyright (C) 2008, 2009 Leonardo Román, Hugo J. Curti, Norma Ercoli, 00006 # Universidad Nacional del Centro de la Provincia de Buenos Aires 00007 # (UNCPBA) 00008 # 00009 # Este programa es parte de Hormiga. 00010 # 00011 # Hormiga es software libre. Puede redistribuirlo y/o modificarlo 00012 # bajo los términos de la Licencia Pública General de GNU según es 00013 # publicada por la Free Software Foundation, versión 2. Vea el archivo 00014 # COPIA (español, no oficial) o COPYING (inglés, oficial) en directorio 00015 # raíz. 00016 # 00017 # Hormiga se distribuye con la esperanza de que sea útil, pero SIN 00018 # NINGUNA GARANTÍA, incluso sin la garantía MERCANTIL implícita o sin 00019 # garantizar la CONVENIENCIA PARA UN PROPÓSITO PARTICULAR. Véase la 00020 # Licencia Pública General de GNU para más detalles. 00021 # 00022 # Debería haber recibido una copia de la Licencia Pública General junto 00023 # con Hormiga. Si no ha sido así, escriba a la Free Software 00024 # Foundation, Inc., en 675 Mass Ave, Cambridge, MA 02139, EEUU. 00025 # Añada también información sobre cómo contactar con usted mediante 00026 # correo electrónico y postal. 00027 # 00028 # This file is part of Hormiga. 00029 # 00030 # Hormiga is free software; you can redistribute it and/or modify 00031 # it under the terms of the GNU General Public License version 2 00032 # as published by the Free Software Foundation; see the file COPYING 00033 # in the top directory for details. 00034 # 00035 # Hormiga is distributed in the hope that it will be useful, 00036 # but WITHOUT ANY WARRANTY; without even the implied warranty of 00037 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00038 # GNU General Public License for more details. 00039 # 00040 # You should have received a copy of the GNU General Public License 00041 # along with Hormiga; if not, write to the Free Software 00042 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00043 # USA 00044 */ 00045 00046 #ifndef MAINWINDOW_H 00047 #define MAINWINDOW_H 00048 00049 #include <QtGui/QMainWindow> 00050 00051 #include <QListWidget> 00052 #include <QErrorMessage> 00053 00054 #include <QLabel> 00055 #include <QLineEdit> 00056 #include <QHBoxLayout> 00057 #include <QPushButton> 00058 #include <QValidator> 00059 00060 #include "parser/parser_functions.h" 00061 00062 namespace Ui 00063 { 00064 class MainWindowClass; 00065 } 00066 00067 class MainWindow : public QMainWindow 00068 { 00069 Q_OBJECT 00070 00071 public: 00072 MainWindow( CoreInterface* core , QWidget *parent = 0 ); 00073 ~MainWindow(); 00074 00075 public slots: 00076 void addStep ( Step *newStep ) ; 00077 void changeState( Step* peer , Step::state newState , Step::state oldState ) ; 00078 void showCapturesGUI ( Step* emisor , T_CAPTURE_LIST* captures ) ; 00079 void acceptCaptures () ; 00080 void showReportsGUI ( Step* emisor , T_REPORT_LIST* reports ) ; 00081 void acceptReports () ; 00082 void executeStep ( QListWidgetItem *item ) ; 00083 00084 void showMessage ( QString msg , int severity ) ; 00085 00086 void loadFile () ; 00087 00088 void print () ; 00089 00090 void clear () ; 00091 00092 private: 00093 bool setCaptureTXT ( int order ) ; 00094 bool setCaptureGUI ( int order ) ; 00095 bool setCaptureSEL ( int order ) ; 00096 QLayout* getCaptureInputTXT( Capture* capture, QFrame *frame ) ; 00097 QLayout* getCaptureInputGUI( Capture* capture, QFrame *frame ) ; 00098 00099 QLayout* getReportOutputTXT( Report* report, QFrame *frame ) ; 00100 QLayout* getReportOutputGUI( Report* report, QFrame *frame ) ; 00101 00102 QLayout* getCRLayoutIMG( CR_Image* crpixmap, QFrame *frame ) ; 00103 QLayout* getCRLayoutSEL( CR_Select* sel, QFrame *frame, bool readOnly ) ; 00104 QLayout* getCRLayoutPLOT( CR_FunctionIterator* fi, QFrame *frame ) ; 00105 00106 Ui::MainWindowClass *ui; 00107 00108 T_CAPTURE_LIST* currentCapts ; 00109 Step* currentStep ; 00110 QList<QObject*> inputs ; 00111 00112 CoreInterface *core ; 00113 00114 private slots: 00115 // Autocreated by QT Creator GUI Maker: 00116 void on_actionAbout_Qt_triggered(); 00117 void on_action_Home_Page_triggered(); 00118 void on_actionAbout_triggered(); 00119 void on_action_Load_triggered(); 00120 }; 00121 00122 #include <qwt_data.h> 00123 /* QwtDataHPlot2D 00124 * Helper Class for Ploter 00125 */ 00126 class QwtDataHPlot2D : public QwtData, public QObject 00127 { 00128 public: 00129 virtual QwtData * copy () const ; 00130 virtual size_t size () const ; 00131 virtual double x (size_t i) const ; 00132 virtual double y (size_t i) const ; 00133 QwtDataHPlot2D ( FunctionInstanceIterator* fi, QObject *parent , bool isCopy = false ); 00134 virtual ~QwtDataHPlot2D () ; 00135 protected: 00136 bool isCloned ; // Used to do 'implicit shared'. 00137 FunctionInstanceIterator* fi ; 00138 double *vx ; 00139 double *vy ; 00140 unsigned long vsize ; 00141 }; 00142 00143 #endif // MAINWINDOW_H