[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> |
---|
[bd5e45b] | 13 | #include <formexportmatrix.h> |
---|
[44d1e60] | 14 | |
---|
| 15 | class MainWindow : public QMainWindow |
---|
| 16 | { |
---|
| 17 | Q_OBJECT |
---|
| 18 | |
---|
| 19 | QMenu menuFile; |
---|
[9dd61b1] | 20 | QMenu OpMatrices; |
---|
[44d1e60] | 21 | QMenu menuTools; |
---|
| 22 | QMenu menuViews; |
---|
| 23 | QMenu menuHelp; |
---|
[9dd61b1] | 24 | QMenu EndoExo; |
---|
| 25 | |
---|
[44d1e60] | 26 | QAction actionLoadMatrix; |
---|
| 27 | QAction actionExportMatrix; |
---|
| 28 | QAction actionQuit; |
---|
[9dd61b1] | 29 | |
---|
| 30 | QAction actionCH; |
---|
| 31 | QAction actionCV; |
---|
| 32 | QAction actionVariableExogena; |
---|
| 33 | QAction actionAn; |
---|
| 34 | QAction actionLa; |
---|
| 35 | QAction actionEncadenamiento; |
---|
| 36 | |
---|
| 37 | |
---|
[44d1e60] | 38 | QTableWidget * tableWidget; |
---|
[9dd61b1] | 39 | QTabWidget * tabWidget; |
---|
| 40 | QMap<QString,QStringList> diccCuentasExogenas; |
---|
| 41 | |
---|
| 42 | stackVariablesExogenas *stackVE; |
---|
| 43 | |
---|
[44d1e60] | 44 | |
---|
| 45 | QString csvFilePath; |
---|
| 46 | char csvSeparator; |
---|
| 47 | int numAccounts; |
---|
| 48 | int matrixSize; |
---|
| 49 | double matrix[100][100]; |
---|
[bd5e45b] | 50 | |
---|
| 51 | int opcionCuentaExogena; |
---|
| 52 | int opcionVentanaExogena; |
---|
| 53 | int opcionExportarMatriz; |
---|
[44d1e60] | 54 | |
---|
| 55 | FormLoadMatrix * formLoadMatrix; |
---|
| 56 | FormViewMatrix * formViewMatrix; |
---|
[9dd61b1] | 57 | FormVariablesExogenas * formVariablesExogenas; |
---|
[bd5e45b] | 58 | FormExportMatrix * formExportMatriz; |
---|
| 59 | |
---|
[44d1e60] | 60 | |
---|
| 61 | void initGUI(); |
---|
| 62 | |
---|
| 63 | void createCentralWidget(); |
---|
| 64 | void createMatrixCentralWidget(); |
---|
| 65 | |
---|
| 66 | void createMenuBar(); |
---|
[9dd61b1] | 67 | void matricesMenuBar(); |
---|
[44d1e60] | 68 | void populateTable(QTableWidget *); |
---|
[9dd61b1] | 69 | void CalcularTotales(QTableWidget *, int inicio); |
---|
| 70 | void loadMatrizExogena(); |
---|
| 71 | void clonarTabla(QTableWidget *,QTableWidget *, int cantidad); |
---|
| 72 | void noEditColZero(QTableWidget *); |
---|
| 73 | void setAccountTitle(QTableWidget *); |
---|
| 74 | void insertremoveRowCol(QTableWidget *, int rowcol, bool opcion); |
---|
| 75 | |
---|
| 76 | double MatrizEndogenaEndogena[200][200]; |
---|
| 77 | |
---|
| 78 | |
---|
| 79 | QList<QString> llenarLista(QList<QString>, QTableWidget *, int valor, int opcion); |
---|
| 80 | void insertRowExogena(QList<QString>, QTableWidget *, int opcion); |
---|
| 81 | void setEndogenaExogenaCell(QTableWidget *, int inicioExogena, int elementos,bool condicion); |
---|
[bd5e45b] | 82 | void CalcularAn(QTableWidget *, QTableWidget *, QTableWidget *, int count, bool endogena); |
---|
| 83 | QString Separador(QTableWidgetItem *,bool quitar); |
---|
[9dd61b1] | 84 | |
---|
| 85 | void crearMatrizEndogena(QTableWidget *); |
---|
| 86 | void crearMatrizIdentidad(QTableWidget *,double identidad[200][200]); |
---|
| 87 | void restarIdentidadAn(QTableWidget *tw,double identidad[200][200],double resta[200][200]); |
---|
| 88 | |
---|
| 89 | bool ComprobarCuentas(); |
---|
| 90 | int ObtenerIndice(QString ); |
---|
| 91 | |
---|
| 92 | QStringList ObtenerNombreCuenta(int contador); |
---|
| 93 | QList<int> ObtenerLimitesCuenta(int contador,int opccion); |
---|
| 94 | QStringList ObtenerComponentes(QTableWidget *); |
---|
| 95 | void CrearTablaVacia(int contador,QTableWidget *); |
---|
[44d1e60] | 96 | |
---|
| 97 | protected: |
---|
| 98 | void closeEvent(QCloseEvent *); |
---|
| 99 | |
---|
| 100 | private slots: |
---|
| 101 | void slotLoadMatrix(); |
---|
| 102 | void slotExportMatrix(); |
---|
| 103 | void slotFormLoadMatrixAccepted(const QString &, int, char); |
---|
| 104 | void slotFormLoadMatrixClosed(); |
---|
| 105 | |
---|
[9dd61b1] | 106 | void AgregarCuenta(); |
---|
| 107 | void RestaurarCeldas(); |
---|
| 108 | void FinalizarCuentas(); |
---|
| 109 | void ModificarCuenta(); |
---|
| 110 | void slotCoeficienteHorizontal(); |
---|
| 111 | void slotCoeficienteVertical(); |
---|
| 112 | |
---|
| 113 | void slotVariableExogena(); |
---|
| 114 | void slotCloseExogena(); |
---|
| 115 | void slotAgregarExogena(); |
---|
| 116 | void slotFinalizarExogena(); |
---|
| 117 | void slotDeshacerExogena(); |
---|
| 118 | void slotAn(); |
---|
| 119 | void slotLa(); |
---|
| 120 | |
---|
[bd5e45b] | 121 | void slotCloseExport(); |
---|
| 122 | void slotSaveExport(); |
---|
| 123 | void slotSearchExport(); |
---|
| 124 | |
---|
[44d1e60] | 125 | public: |
---|
| 126 | MainWindow(); |
---|
| 127 | std::vector<std::string> csv_read_row(std::string , char); |
---|
| 128 | std::vector<std::string> csv_read_row(std::istream &, char); |
---|
| 129 | QString numberFormat(double &); |
---|
[9dd61b1] | 130 | |
---|
| 131 | int contarElementosMap(); |
---|
| 132 | int retornarIndiceCuenta(QString nombre_cuenta); |
---|
[44d1e60] | 133 | }; |
---|
| 134 | |
---|
| 135 | #endif // MAINWINDOW_H |
---|