[44d1e60] | 1 | #ifndef MAINWINDOW_H |
---|
| 2 | #define MAINWINDOW_H |
---|
| 3 | |
---|
| 4 | #include <QtGui> |
---|
[8daa049] | 5 | |
---|
[44d1e60] | 6 | #include <formloadmatrix.H> |
---|
| 7 | #include <formviewmatrix.H> |
---|
[9dd61b1] | 8 | #include <formvariablesexogenas.h> |
---|
[8daa049] | 9 | #include <formexportmatrix.h> |
---|
| 10 | #include <formencadenamientos.h> |
---|
| 11 | |
---|
[44d1e60] | 12 | #include <sstream> |
---|
| 13 | #include <stackwidget.H> |
---|
[9dd61b1] | 14 | #include <stackvariablesexogenas.h> |
---|
[8daa049] | 15 | #include <stackencadenamientos.h> |
---|
| 16 | |
---|
| 17 | #include <QTabWidget> |
---|
| 18 | |
---|
[9dd61b1] | 19 | #include <QMap> |
---|
[8daa049] | 20 | #include <QVector> |
---|
| 21 | |
---|
[44d1e60] | 22 | |
---|
| 23 | class MainWindow : public QMainWindow |
---|
| 24 | { |
---|
| 25 | Q_OBJECT |
---|
| 26 | |
---|
| 27 | QMenu menuFile; |
---|
[9dd61b1] | 28 | QMenu OpMatrices; |
---|
[44d1e60] | 29 | QMenu menuTools; |
---|
| 30 | QMenu menuViews; |
---|
| 31 | QMenu menuHelp; |
---|
[9dd61b1] | 32 | QMenu EndoExo; |
---|
| 33 | |
---|
[44d1e60] | 34 | QAction actionLoadMatrix; |
---|
| 35 | QAction actionExportMatrix; |
---|
| 36 | QAction actionQuit; |
---|
[9dd61b1] | 37 | |
---|
| 38 | QAction actionCH; |
---|
| 39 | QAction actionCV; |
---|
| 40 | QAction actionVariableExogena; |
---|
| 41 | QAction actionLa; |
---|
| 42 | QAction actionEncadenamiento; |
---|
| 43 | |
---|
| 44 | |
---|
[44d1e60] | 45 | QTableWidget * tableWidget; |
---|
[9dd61b1] | 46 | QTabWidget * tabWidget; |
---|
| 47 | QMap<QString,QStringList> diccCuentasExogenas; |
---|
[8daa049] | 48 | QMap<int,QVector<QString> > diccCuentasEndogenas; |
---|
| 49 | QMap<int,QVector<QString> > espacioCuentasExogenas; |
---|
| 50 | QMap<QString,QStringList> diccCuentasComponentes; |
---|
| 51 | QMap<QString,QStringList> diccCuentasEncadenamientos; |
---|
[9dd61b1] | 52 | |
---|
| 53 | stackVariablesExogenas *stackVE; |
---|
[8daa049] | 54 | stackEncadenamientos *stackEncadenamiento; |
---|
[9dd61b1] | 55 | |
---|
[44d1e60] | 56 | |
---|
| 57 | QString csvFilePath; |
---|
| 58 | char csvSeparator; |
---|
| 59 | int numAccounts; |
---|
| 60 | int matrixSize; |
---|
| 61 | double matrix[100][100]; |
---|
[bd5e45b] | 62 | |
---|
[8daa049] | 63 | double MatrizEndogenaEndogena[200][200]; |
---|
| 64 | |
---|
[bd5e45b] | 65 | int opcionCuentaExogena; |
---|
| 66 | int opcionVentanaExogena; |
---|
| 67 | int opcionExportarMatriz; |
---|
[aa628c3] | 68 | int opcionCTEndogena; |
---|
[8daa049] | 69 | int opcionEncadenamientos; |
---|
| 70 | int opcionCuentaEncadenamientos; |
---|
| 71 | |
---|
| 72 | int cantidadEncadenamientos; |
---|
[44d1e60] | 73 | |
---|
| 74 | FormLoadMatrix * formLoadMatrix; |
---|
| 75 | FormViewMatrix * formViewMatrix; |
---|
[9dd61b1] | 76 | FormVariablesExogenas * formVariablesExogenas; |
---|
[bd5e45b] | 77 | FormExportMatrix * formExportMatriz; |
---|
[8daa049] | 78 | FormEncadenamientos * formEncadenamientos; |
---|
[bd5e45b] | 79 | |
---|
[44d1e60] | 80 | |
---|
| 81 | void initGUI(); |
---|
| 82 | |
---|
| 83 | void createCentralWidget(); |
---|
| 84 | void createMatrixCentralWidget(); |
---|
| 85 | |
---|
| 86 | void createMenuBar(); |
---|
[9dd61b1] | 87 | void matricesMenuBar(); |
---|
[44d1e60] | 88 | void populateTable(QTableWidget *); |
---|
[9dd61b1] | 89 | void CalcularTotales(QTableWidget *, int inicio); |
---|
| 90 | void loadMatrizExogena(); |
---|
| 91 | void clonarTabla(QTableWidget *,QTableWidget *, int cantidad); |
---|
| 92 | void noEditColZero(QTableWidget *); |
---|
| 93 | void setAccountTitle(QTableWidget *); |
---|
| 94 | void insertremoveRowCol(QTableWidget *, int rowcol, bool opcion); |
---|
[8daa049] | 95 | void crearDiccionario(QTableWidget *, bool endogena=true); |
---|
| 96 | QStringList obtenerCuentasEndogenas(QTableWidget *,QStringList); |
---|
| 97 | QStringList obtenerCuentasExogenas(QTableWidget *,QStringList ); |
---|
| 98 | void spanEndogenaCell(QTableWidget *, int inicio, int celda, bool endex=true); |
---|
| 99 | void spanExogenaCell(QTableWidget *,int celda); |
---|
[e506dab] | 100 | void tableItem(QTableWidget *, int inicio, int fin, QString texto); |
---|
[9dd61b1] | 101 | |
---|
| 102 | QList<QString> llenarLista(QList<QString>, QTableWidget *, int valor, int opcion); |
---|
| 103 | void insertRowExogena(QList<QString>, QTableWidget *, int opcion); |
---|
| 104 | void setEndogenaExogenaCell(QTableWidget *, int inicioExogena, int elementos,bool condicion); |
---|
[bd5e45b] | 105 | void CalcularAn(QTableWidget *, QTableWidget *, QTableWidget *, int count, bool endogena); |
---|
| 106 | QString Separador(QTableWidgetItem *,bool quitar); |
---|
[8daa049] | 107 | void ItemsNoEditable(QTableWidget *, int inicio, int fin, int col=0); |
---|
[aa628c3] | 108 | void CellStyle(QTableWidgetItem *); |
---|
| 109 | void EndogenaAn(); |
---|
[9dd61b1] | 110 | |
---|
[8daa049] | 111 | void obtenerCuentaComponentes(); |
---|
| 112 | void crearTablaVaciaEncadenamiento(int contador, QTableWidget *); |
---|
| 113 | void crearMatrizEncadenamiento(QTableWidget *, QTableWidget *); |
---|
| 114 | void crearMatrizEncadenamientoEndogena(QTableWidget *, QTableWidget *); |
---|
| 115 | void calcularTotalesEncadenamientos(QTableWidget *); |
---|
| 116 | void encademientosStyle(QTableWidgetItem *); |
---|
| 117 | |
---|
[9dd61b1] | 118 | void crearMatrizEndogena(QTableWidget *); |
---|
[8daa049] | 119 | void restarIdentidadAn(QTableWidget *); |
---|
| 120 | void titleEndogena(QTableWidget *); |
---|
[9dd61b1] | 121 | |
---|
| 122 | bool ComprobarCuentas(); |
---|
| 123 | int ObtenerIndice(QString ); |
---|
| 124 | |
---|
| 125 | QStringList ObtenerNombreCuenta(int contador); |
---|
| 126 | QList<int> ObtenerLimitesCuenta(int contador,int opccion); |
---|
| 127 | QStringList ObtenerComponentes(QTableWidget *); |
---|
| 128 | void CrearTablaVacia(int contador,QTableWidget *); |
---|
[44d1e60] | 129 | |
---|
| 130 | protected: |
---|
| 131 | void closeEvent(QCloseEvent *); |
---|
| 132 | |
---|
| 133 | private slots: |
---|
| 134 | void slotLoadMatrix(); |
---|
| 135 | void slotExportMatrix(); |
---|
| 136 | void slotFormLoadMatrixAccepted(const QString &, int, char); |
---|
| 137 | void slotFormLoadMatrixClosed(); |
---|
| 138 | |
---|
[9dd61b1] | 139 | void AgregarCuenta(); |
---|
| 140 | void RestaurarCeldas(); |
---|
| 141 | void FinalizarCuentas(); |
---|
| 142 | void ModificarCuenta(); |
---|
| 143 | void slotCoeficienteHorizontal(); |
---|
| 144 | void slotCoeficienteVertical(); |
---|
| 145 | |
---|
| 146 | void slotVariableExogena(); |
---|
| 147 | void slotCloseExogena(); |
---|
| 148 | void slotAgregarExogena(); |
---|
| 149 | void slotFinalizarExogena(); |
---|
| 150 | void slotDeshacerExogena(); |
---|
| 151 | void slotLa(); |
---|
| 152 | |
---|
[8daa049] | 153 | void slotEncadenamientos(); |
---|
| 154 | void slotCloseEncadenamiento(); |
---|
| 155 | void slotAgregarEncadenamiento(); |
---|
| 156 | void slotVerEncadenamiento(); |
---|
| 157 | |
---|
[bd5e45b] | 158 | void slotCloseExport(); |
---|
| 159 | void slotSaveExport(); |
---|
| 160 | void slotSearchExport(); |
---|
| 161 | |
---|
[44d1e60] | 162 | public: |
---|
| 163 | MainWindow(); |
---|
| 164 | std::vector<std::string> csv_read_row(std::string , char); |
---|
| 165 | std::vector<std::string> csv_read_row(std::istream &, char); |
---|
| 166 | QString numberFormat(double &); |
---|
[9dd61b1] | 167 | |
---|
[8daa049] | 168 | int contarElementosMap(QMap<QString, QStringList> diccionario); |
---|
[9dd61b1] | 169 | int retornarIndiceCuenta(QString nombre_cuenta); |
---|
[44d1e60] | 170 | }; |
---|
| 171 | |
---|
| 172 | #endif // MAINWINDOW_H |
---|