[44d1e60] | 1 | #ifndef MAINWINDOW_H |
---|
| 2 | #define MAINWINDOW_H |
---|
| 3 | |
---|
| 4 | #include <QtGui> |
---|
| 5 | #include <formloadmatrix.H> |
---|
| 6 | #include <formviewmatrix.H> |
---|
[9dd61b1] | 7 | #include <formvariablesexogenas.h> |
---|
[44d1e60] | 8 | #include <sstream> |
---|
| 9 | #include <stackwidget.H> |
---|
[9dd61b1] | 10 | #include <QTabWidget> |
---|
| 11 | #include <stackvariablesexogenas.h> |
---|
| 12 | #include <QMap> |
---|
[44d1e60] | 13 | |
---|
| 14 | class MainWindow : public QMainWindow |
---|
| 15 | { |
---|
| 16 | Q_OBJECT |
---|
| 17 | |
---|
| 18 | QMenu menuFile; |
---|
[9dd61b1] | 19 | QMenu OpMatrices; |
---|
[44d1e60] | 20 | QMenu menuTools; |
---|
| 21 | QMenu menuViews; |
---|
| 22 | QMenu menuHelp; |
---|
[9dd61b1] | 23 | QMenu EndoExo; |
---|
| 24 | |
---|
[44d1e60] | 25 | QAction actionLoadMatrix; |
---|
| 26 | QAction actionExportMatrix; |
---|
| 27 | QAction actionQuit; |
---|
[9dd61b1] | 28 | |
---|
| 29 | QAction actionCH; |
---|
| 30 | QAction actionCV; |
---|
| 31 | QAction actionVariableExogena; |
---|
| 32 | QAction actionAn; |
---|
| 33 | QAction actionLa; |
---|
| 34 | QAction actionEncadenamiento; |
---|
| 35 | |
---|
| 36 | |
---|
[44d1e60] | 37 | QTableWidget * tableWidget; |
---|
[9dd61b1] | 38 | QTabWidget * tabWidget; |
---|
| 39 | QMap<QString,QStringList> diccCuentasExogenas; |
---|
| 40 | |
---|
| 41 | stackVariablesExogenas *stackVE; |
---|
| 42 | |
---|
[44d1e60] | 43 | |
---|
| 44 | QString csvFilePath; |
---|
| 45 | char csvSeparator; |
---|
| 46 | int numAccounts; |
---|
| 47 | int matrixSize; |
---|
| 48 | double matrix[100][100]; |
---|
[9dd61b1] | 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; |
---|
[44d1e60] | 53 | |
---|
| 54 | FormLoadMatrix * formLoadMatrix; |
---|
| 55 | FormViewMatrix * formViewMatrix; |
---|
[9dd61b1] | 56 | FormVariablesExogenas * formVariablesExogenas; |
---|
[44d1e60] | 57 | |
---|
| 58 | void initGUI(); |
---|
| 59 | |
---|
| 60 | void createCentralWidget(); |
---|
| 61 | void createMatrixCentralWidget(); |
---|
| 62 | |
---|
| 63 | void createMenuBar(); |
---|
[9dd61b1] | 64 | void matricesMenuBar(); |
---|
[44d1e60] | 65 | void populateTable(QTableWidget *); |
---|
[9dd61b1] | 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 *); |
---|
[44d1e60] | 92 | |
---|
| 93 | protected: |
---|
| 94 | void closeEvent(QCloseEvent *); |
---|
| 95 | |
---|
| 96 | private slots: |
---|
| 97 | void slotLoadMatrix(); |
---|
| 98 | void slotExportMatrix(); |
---|
| 99 | void slotFormLoadMatrixAccepted(const QString &, int, char); |
---|
| 100 | void slotFormLoadMatrixClosed(); |
---|
| 101 | |
---|
[9dd61b1] | 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 | |
---|
[44d1e60] | 117 | public: |
---|
| 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 &); |
---|
[9dd61b1] | 122 | |
---|
| 123 | int contarElementosMap(); |
---|
| 124 | int retornarIndiceCuenta(QString nombre_cuenta); |
---|
[44d1e60] | 125 | }; |
---|
| 126 | |
---|
| 127 | #endif // MAINWINDOW_H |
---|