source: mmcs/mainwindow.H @ 9dd61b1

matrices
Last change on this file since 9dd61b1 was 9dd61b1, checked in by rboet <rboet@…>, 9 years ago

Avance del proyecto 60%

  • Property mode set to 100644
File size: 3.5 KB
Line 
1#ifndef MAINWINDOW_H
2#define MAINWINDOW_H
3
4#include <QtGui>
5#include <formloadmatrix.H>
6#include <formviewmatrix.H>
7#include <formvariablesexogenas.h>
8#include <sstream>
9#include <stackwidget.H>
10#include <QTabWidget>
11#include <stackvariablesexogenas.h>
12#include <QMap>
13
14class MainWindow : public QMainWindow
15{
16    Q_OBJECT
17
18    QMenu menuFile;
19    QMenu OpMatrices;
20    QMenu menuTools;
21    QMenu menuViews;
22    QMenu menuHelp;
23    QMenu EndoExo;
24
25    QAction actionLoadMatrix;
26    QAction actionExportMatrix;
27    QAction actionQuit;
28
29    QAction actionCH;
30    QAction actionCV;
31    QAction actionVariableExogena;
32    QAction actionAn;
33    QAction actionLa;
34    QAction actionEncadenamiento;   
35
36
37    QTableWidget * tableWidget;
38    QTabWidget * tabWidget;
39    QMap<QString,QStringList> diccCuentasExogenas;
40
41    stackVariablesExogenas *stackVE;
42
43
44    QString csvFilePath;
45    char csvSeparator;
46    int numAccounts;
47    int matrixSize;
48    double  matrix[100][100];
49    /*    Opcion de la cuenta exogena, 0 para decir que nos se selecciono ninguna, 1 que se seleccionaron algunas
50                                    y 2 para decir que se seleccionaron todas*/
51    int opcionCuentaExogena=0;
52    int opcionVentanaExogena=0;
53
54    FormLoadMatrix * formLoadMatrix;
55    FormViewMatrix * formViewMatrix;
56    FormVariablesExogenas * formVariablesExogenas;
57
58    void initGUI();
59
60    void createCentralWidget();
61    void createMatrixCentralWidget();
62
63    void createMenuBar();
64    void matricesMenuBar();
65    void populateTable(QTableWidget *);
66    void CalcularTotales(QTableWidget *, int inicio);
67    void loadMatrizExogena();
68    void clonarTabla(QTableWidget *,QTableWidget *, int cantidad);
69    void noEditColZero(QTableWidget *);
70    void setAccountTitle(QTableWidget *);
71    void insertremoveRowCol(QTableWidget *, int rowcol, bool opcion);
72
73    double MatrizEndogenaEndogena[200][200];
74
75
76    QList<QString> llenarLista(QList<QString>, QTableWidget *, int valor, int opcion);
77    void insertRowExogena(QList<QString>, QTableWidget *, int opcion);
78    void setEndogenaExogenaCell(QTableWidget *, int inicioExogena, int elementos,bool condicion);
79    void CalcularAn(QTableWidget *, QTableWidget *, int count, bool exogena);
80
81    void crearMatrizEndogena(QTableWidget *);
82    void crearMatrizIdentidad(QTableWidget *,double identidad[200][200]);
83    void restarIdentidadAn(QTableWidget *tw,double identidad[200][200],double resta[200][200]);
84
85    bool ComprobarCuentas();
86    int ObtenerIndice(QString );
87
88    QStringList ObtenerNombreCuenta(int contador);
89    QList<int> ObtenerLimitesCuenta(int contador,int opccion);
90    QStringList ObtenerComponentes(QTableWidget *);
91    void CrearTablaVacia(int contador,QTableWidget *);
92
93protected:
94    void closeEvent(QCloseEvent *);
95
96private slots:
97    void slotLoadMatrix();
98    void slotExportMatrix();
99    void slotFormLoadMatrixAccepted(const QString &, int, char);
100    void slotFormLoadMatrixClosed();
101
102    void AgregarCuenta();
103    void RestaurarCeldas();
104    void FinalizarCuentas();
105    void ModificarCuenta();
106    void slotCoeficienteHorizontal();
107    void slotCoeficienteVertical();
108
109    void slotVariableExogena();
110    void slotCloseExogena();
111    void slotAgregarExogena();
112    void slotFinalizarExogena();
113    void slotDeshacerExogena();
114    void slotAn();
115    void slotLa();
116
117public:
118    MainWindow();
119    std::vector<std::string> csv_read_row(std::string , char);
120    std::vector<std::string> csv_read_row(std::istream &, char);
121    QString numberFormat(double &);
122
123    int contarElementosMap();
124    int retornarIndiceCuenta(QString nombre_cuenta);
125};
126
127#endif // MAINWINDOW_H
Note: See TracBrowser for help on using the repository browser.