[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> |
---|
[fa3f7a3] | 11 | #include <ui_formcompararresultados.h> |
---|
| 12 | #include <formcompararresultados.h> |
---|
[96b0c4a] | 13 | #include <ui_formcompararmnc.h> |
---|
| 14 | #include <formcompararmnc.h> |
---|
[fc268a0] | 15 | #include "ui_formincidenciai.h" |
---|
| 16 | #include <formincidenciai.h> |
---|
[04999c9] | 17 | #include <formpreciosnohomogeneos.h> |
---|
[8daa049] | 18 | |
---|
[44d1e60] | 19 | #include <sstream> |
---|
| 20 | #include <stackwidget.H> |
---|
[9dd61b1] | 21 | #include <stackvariablesexogenas.h> |
---|
[8daa049] | 22 | #include <stackencadenamientos.h> |
---|
[04999c9] | 23 | #include <stackpreciosnohomogeneos.h> |
---|
[8daa049] | 24 | |
---|
| 25 | #include <QTabWidget> |
---|
| 26 | |
---|
[9dd61b1] | 27 | #include <QMap> |
---|
[8daa049] | 28 | #include <QVector> |
---|
| 29 | |
---|
[96b0c4a] | 30 | #include <Eigen> |
---|
| 31 | |
---|
[44d1e60] | 32 | |
---|
| 33 | class MainWindow : public QMainWindow |
---|
| 34 | { |
---|
| 35 | Q_OBJECT |
---|
| 36 | |
---|
| 37 | QMenu menuFile; |
---|
| 38 | QMenu menuTools; |
---|
| 39 | QMenu menuViews; |
---|
| 40 | QMenu menuHelp; |
---|
[07b8f66] | 41 | |
---|
| 42 | QMenu CoeficientesTecnicos; |
---|
[b1ef0b1] | 43 | QMenu Encadenamientos; |
---|
[fc268a0] | 44 | |
---|
[96b0c4a] | 45 | QMenu Modelos; |
---|
[fc268a0] | 46 | QMenu PHClasico; |
---|
| 47 | QMenu PHClasicoIncidencia; |
---|
[cfbc36f] | 48 | QMenu PHNoClasico; |
---|
| 49 | QMenu PHNoClasicoIncidencia; |
---|
[04999c9] | 50 | QMenu PreciosNH; |
---|
| 51 | QMenu PreciosNHIncidencia; |
---|
[9dd61b1] | 52 | |
---|
[44d1e60] | 53 | QAction actionLoadMatrix; |
---|
| 54 | QAction actionExportMatrix; |
---|
| 55 | QAction actionQuit; |
---|
[fc268a0] | 56 | QAction actionNewProject; |
---|
[9dd61b1] | 57 | |
---|
| 58 | QAction actionCH; |
---|
| 59 | QAction actionCV; |
---|
| 60 | QAction actionVariableExogena; |
---|
[fa3f7a3] | 61 | |
---|
[fc268a0] | 62 | QAction actionEncadenamiento; |
---|
[b1ef0b1] | 63 | QAction actionClasificarCuentas; |
---|
[fc268a0] | 64 | |
---|
[fa3f7a3] | 65 | QAction actionModeloClasico; |
---|
| 66 | QAction actionCompararResultados; |
---|
[67c9f67] | 67 | QAction actionModeloNoClasico; |
---|
[96b0c4a] | 68 | QAction actionCompararResultadosMNC; |
---|
[9dd61b1] | 69 | |
---|
[fc268a0] | 70 | QAction actionPHClasicoIncidencia100; |
---|
| 71 | QAction actionPHCIncidenciaCuenta; |
---|
| 72 | QAction actionPHCIncidenciaComponente; |
---|
| 73 | |
---|
[cfbc36f] | 74 | QAction actionPHNoClasicoIncidencia100; |
---|
| 75 | QAction actionPHNCIncidenciaCuenta; |
---|
| 76 | QAction actionPHNCIncidenciaComponente; |
---|
[9dd61b1] | 77 | |
---|
[04999c9] | 78 | QAction actionPNHIncidencia100; |
---|
| 79 | QAction actionPNHIncidenciaCuenta; |
---|
| 80 | QAction actionPNHIncidenciaComponente; |
---|
| 81 | |
---|
[b1ef0b1] | 82 | QAction actionSeleccionarTabla; |
---|
| 83 | |
---|
[dfddb27] | 84 | QAction actionManual; |
---|
| 85 | QAction actionAcercaDe; |
---|
| 86 | |
---|
[44d1e60] | 87 | QTableWidget * tableWidget; |
---|
[9dd61b1] | 88 | QTabWidget * tabWidget; |
---|
| 89 | QMap<QString,QStringList> diccCuentasExogenas; |
---|
[8daa049] | 90 | QMap<int,QVector<QString> > diccCuentasEndogenas; |
---|
| 91 | QMap<int,QVector<QString> > espacioCuentasExogenas; |
---|
[32f758e] | 92 | QMap<int, QMap<QString,QStringList> > diccCuentasComponentes; |
---|
| 93 | QMap<int, QMap<QString,QStringList> > diccCuentasEncadenamientos; |
---|
[fc268a0] | 94 | QMap<QString,double> totalCuentas; |
---|
| 95 | |
---|
| 96 | QStringList ComponentesEndogenos; |
---|
[9dd61b1] | 97 | |
---|
[96b0c4a] | 98 | QTableWidget *MatrizExgEnd; |
---|
| 99 | |
---|
[9dd61b1] | 100 | stackVariablesExogenas *stackVE; |
---|
[8daa049] | 101 | stackEncadenamientos *stackEncadenamiento; |
---|
[04999c9] | 102 | StackPreciosNoHomogeneos *stackPNH; |
---|
[9dd61b1] | 103 | |
---|
[96b0c4a] | 104 | Eigen::MatrixXd MatrixMa; |
---|
| 105 | Eigen::MatrixXd MatrixMb; |
---|
[fc268a0] | 106 | Eigen::MatrixXd MatrizMat; |
---|
[cfbc36f] | 107 | Eigen::MatrixXd MatrizMbt; |
---|
[96b0c4a] | 108 | |
---|
[44d1e60] | 109 | |
---|
| 110 | QString csvFilePath; |
---|
| 111 | char csvSeparator; |
---|
| 112 | int numAccounts; |
---|
| 113 | int matrixSize; |
---|
[96b0c4a] | 114 | int precission; |
---|
[44d1e60] | 115 | double matrix[100][100]; |
---|
[bd5e45b] | 116 | |
---|
[04999c9] | 117 | QString componentePNH; |
---|
| 118 | |
---|
[8daa049] | 119 | double MatrizEndogenaEndogena[200][200]; |
---|
| 120 | |
---|
[bd5e45b] | 121 | int opcionCuentaExogena; |
---|
| 122 | int opcionVentanaExogena; |
---|
| 123 | int opcionExportarMatriz; |
---|
[8daa049] | 124 | int opcionEncadenamientos; |
---|
| 125 | int opcionCuentaEncadenamientos; |
---|
[fa3f7a3] | 126 | int opcionMa; |
---|
[cfbc36f] | 127 | int opcionMb; |
---|
[fa3f7a3] | 128 | int opcionFormCompararResultados; |
---|
[96b0c4a] | 129 | int opcionFormCompararResultadosMNC; |
---|
[fc268a0] | 130 | int opcionMAT; |
---|
[cfbc36f] | 131 | int opcionMBT; |
---|
[04999c9] | 132 | int opcionPNHT; |
---|
| 133 | int opcionFormPNH; |
---|
[fa3f7a3] | 134 | |
---|
| 135 | QVector<double> subtotalEnd; |
---|
| 136 | QVector<double> subtotalExog; |
---|
[96b0c4a] | 137 | QVector<double> subtotalExogEnd; |
---|
[fc268a0] | 138 | QVector<double> Vpond; |
---|
[8daa049] | 139 | |
---|
[b1ef0b1] | 140 | int cantidadSelecciones; |
---|
[8daa049] | 141 | int cantidadEncadenamientos; |
---|
[fa3f7a3] | 142 | int cantidadEscenarios; |
---|
| 143 | int cantidadResultados; |
---|
[96b0c4a] | 144 | int cantidadMNC;//Cantidad de Modelos No Clasicos |
---|
| 145 | int cantidadResultadosMNC; |
---|
[04999c9] | 146 | //Cantidad de resultados de incidencia en modelo de precios homogéneos clásico |
---|
[fc268a0] | 147 | int cantidadPHCindidenciaiCuenta; |
---|
| 148 | int cantidadPHCindidenciaiComponente; |
---|
[04999c9] | 149 | //Cantidad de resultados de incidencia en modelo de precios homogéneos no clásico |
---|
[cfbc36f] | 150 | int cantidadPHNCindidenciaiCuenta; |
---|
| 151 | int cantidadPHNCindidenciaiComponente; |
---|
[04999c9] | 152 | //Cantidad de resultados de incidencia en modelo de precios no homogéneos |
---|
| 153 | int cantidadPNHincidencia100; |
---|
| 154 | int cantidadPNHincidenciaiCuenta; |
---|
| 155 | int cantidadPNHincidenciaiComponente; |
---|
[44d1e60] | 156 | |
---|
| 157 | FormLoadMatrix * formLoadMatrix; |
---|
| 158 | FormViewMatrix * formViewMatrix; |
---|
[9dd61b1] | 159 | FormVariablesExogenas * formVariablesExogenas; |
---|
[bd5e45b] | 160 | FormExportMatrix * formExportMatriz; |
---|
[8daa049] | 161 | FormEncadenamientos * formEncadenamientos; |
---|
[fa3f7a3] | 162 | FormCompararResultados *formCompararResultados; |
---|
[96b0c4a] | 163 | FormCompararMNC *formCompararMNC; |
---|
[fc268a0] | 164 | FormIncidenciaI *FI; |
---|
[04999c9] | 165 | FormPreciosNoHomogeneos * formPreciosNoHomogeneos; |
---|
[44d1e60] | 166 | |
---|
| 167 | void initGUI(); |
---|
| 168 | |
---|
| 169 | void createCentralWidget(); |
---|
| 170 | void createMatrixCentralWidget(); |
---|
| 171 | |
---|
| 172 | void createMenuBar(); |
---|
[9dd61b1] | 173 | void matricesMenuBar(); |
---|
[44d1e60] | 174 | void populateTable(QTableWidget *); |
---|
[95d916c] | 175 | |
---|
[32f758e] | 176 | void CalcularTotales(QTableWidget *, int inicio, bool &); |
---|
[95d916c] | 177 | bool comprobarNombreCuenta(QString, int indice); |
---|
[9dd61b1] | 178 | void loadMatrizExogena(); |
---|
| 179 | void clonarTabla(QTableWidget *,QTableWidget *, int cantidad); |
---|
| 180 | void noEditColZero(QTableWidget *); |
---|
| 181 | void setAccountTitle(QTableWidget *); |
---|
| 182 | void insertremoveRowCol(QTableWidget *, int rowcol, bool opcion); |
---|
[8daa049] | 183 | void crearDiccionario(QTableWidget *, bool endogena=true); |
---|
| 184 | QStringList obtenerCuentasEndogenas(QTableWidget *,QStringList); |
---|
| 185 | QStringList obtenerCuentasExogenas(QTableWidget *,QStringList ); |
---|
| 186 | void spanEndogenaCell(QTableWidget *, int inicio, int celda, bool endex=true); |
---|
| 187 | void spanExogenaCell(QTableWidget *,int celda); |
---|
[e506dab] | 188 | void tableItem(QTableWidget *, int inicio, int fin, QString texto); |
---|
[9dd61b1] | 189 | |
---|
| 190 | QList<QString> llenarLista(QList<QString>, QTableWidget *, int valor, int opcion); |
---|
| 191 | void insertRowExogena(QList<QString>, QTableWidget *, int opcion); |
---|
| 192 | void setEndogenaExogenaCell(QTableWidget *, int inicioExogena, int elementos,bool condicion); |
---|
[67c9f67] | 193 | void CalcularAn(QTableWidget *, QTableWidget *, QTableWidget *, int count, bool endogena = false); |
---|
[bd5e45b] | 194 | QString Separador(QTableWidgetItem *,bool quitar); |
---|
[8daa049] | 195 | void ItemsNoEditable(QTableWidget *, int inicio, int fin, int col=0); |
---|
[aa628c3] | 196 | void CellStyle(QTableWidgetItem *); |
---|
[cfdcc67] | 197 | void CellStyleComponente(QTableWidgetItem *); |
---|
| 198 | void CellStyleExEn(QTableWidgetItem *); |
---|
[aa628c3] | 199 | void EndogenaAn(); |
---|
[9dd61b1] | 200 | |
---|
[fc268a0] | 201 | void calcularTotalCuentas(QTableWidget *); |
---|
[b1ef0b1] | 202 | void estimarVectorPonderacion(); |
---|
[fc268a0] | 203 | |
---|
[8daa049] | 204 | void obtenerCuentaComponentes(); |
---|
[fc268a0] | 205 | void crearTablaVaciaEncadenamiento(int filas, QTableWidget *, int columnas=4); |
---|
[8daa049] | 206 | void crearMatrizEncadenamiento(QTableWidget *, QTableWidget *); |
---|
| 207 | void crearMatrizEncadenamientoEndogena(QTableWidget *, QTableWidget *); |
---|
| 208 | void calcularTotalesEncadenamientos(QTableWidget *); |
---|
| 209 | void encademientosStyle(QTableWidgetItem *); |
---|
[32f758e] | 210 | void cuentacomponentesEncadenamiento(QTableWidget *, int count); |
---|
[37dd9aa] | 211 | void obtenerUiUj(QTableWidget *, QVector<double> &, QVector<double> &); |
---|
| 212 | void calcularClasificador(QTableWidget *, QVector<double>, QVector<double>, int init = 2); |
---|
| 213 | void agregarPrimeraCelda(QTableWidget *); |
---|
[8daa049] | 214 | |
---|
[cfbc36f] | 215 | void calcularSubtotal(QTableWidget *,int inicio, int fin,int exogena); |
---|
[96b0c4a] | 216 | void llenarEscenario(QTableWidget *, bool clasico=true); |
---|
[fa3f7a3] | 217 | void calcularFinEscenario(QTableWidget *); |
---|
| 218 | QVector<double> obtenerResultadoEscenario(QVector<double>); |
---|
| 219 | QStringList obtenerNombreResultadoEscenario(); |
---|
| 220 | void crearTablaComparar(QTableWidget *, QTableWidget *); |
---|
[96b0c4a] | 221 | void cuentacomponentesResultado(QTableWidget *, int count, bool clasico = true); |
---|
[fa3f7a3] | 222 | |
---|
[67c9f67] | 223 | void obtenerMatrizExgEnd(); |
---|
| 224 | void crearMatrizExgEnd(QTableWidget *,QTableWidget *,int elementos,int inicioExogena); |
---|
| 225 | void calcularMatrizExgEnd(QTableWidget *); |
---|
| 226 | void ctvMatrizExgEnd(QTableWidget *, QTableWidget *); |
---|
| 227 | void titlespanMatrizExgEnd(QTableWidget *); |
---|
| 228 | void estimarMb(QTableWidget *, QTableWidget *); |
---|
[96b0c4a] | 229 | void calcularSubtotalEndExg(); |
---|
| 230 | QVector<double> obtenerResultadoEscenarioMNC(QVector<double>); |
---|
| 231 | void calcularFinEscenarioMNC(QTableWidget *); |
---|
| 232 | QStringList obtenerNombreResultadoEscenarioMNC(); |
---|
[67c9f67] | 233 | |
---|
[9dd61b1] | 234 | void crearMatrizEndogena(QTableWidget *); |
---|
[8daa049] | 235 | void restarIdentidadAn(QTableWidget *); |
---|
| 236 | void titleEndogena(QTableWidget *); |
---|
[9dd61b1] | 237 | |
---|
[fc268a0] | 238 | void calcularMaT(); |
---|
| 239 | void calcularPHCIncidencia100(QTableWidget *); |
---|
| 240 | void calcularPHCIncidenciaI(QTableWidget *, QMap<QString, double>); |
---|
| 241 | void calcularPHCIncidenciaIComponente(QTableWidget *,QTableWidget *); |
---|
| 242 | |
---|
[cfbc36f] | 243 | void calcularMbT(); |
---|
| 244 | void calcularMb(); |
---|
[04999c9] | 245 | void calcularPHNCIncidencia100(QTableWidget *); |
---|
| 246 | void calcularVectorSend(QString componente, QVector<double> &); |
---|
| 247 | void multiplicarMatricesPNH(QTableWidget *, QVector<double>); |
---|
| 248 | void calcularPNHIncidencia100(QTableWidget *, Eigen::MatrixXd Diagonal); |
---|
| 249 | void crearFormularioPNH(); |
---|
[32f758e] | 250 | QStringList obtenerCuentas(); |
---|
[cfbc36f] | 251 | |
---|
[b1ef0b1] | 252 | void titleSeleccionar(QTableWidget *); |
---|
| 253 | |
---|
[9dd61b1] | 254 | bool ComprobarCuentas(); |
---|
| 255 | int ObtenerIndice(QString ); |
---|
| 256 | |
---|
| 257 | QStringList ObtenerNombreCuenta(int contador); |
---|
| 258 | QList<int> ObtenerLimitesCuenta(int contador,int opccion); |
---|
| 259 | QStringList ObtenerComponentes(QTableWidget *); |
---|
| 260 | void CrearTablaVacia(int contador,QTableWidget *); |
---|
[44d1e60] | 261 | |
---|
| 262 | protected: |
---|
| 263 | void closeEvent(QCloseEvent *); |
---|
| 264 | |
---|
| 265 | private slots: |
---|
[fc268a0] | 266 | void slotNuevoProyecto(); |
---|
[44d1e60] | 267 | void slotLoadMatrix(); |
---|
| 268 | void slotExportMatrix(); |
---|
[96b0c4a] | 269 | void slotFormLoadMatrixAccepted(const QString &, int, int); |
---|
[44d1e60] | 270 | void slotFormLoadMatrixClosed(); |
---|
| 271 | |
---|
[9dd61b1] | 272 | void AgregarCuenta(); |
---|
| 273 | void RestaurarCeldas(); |
---|
| 274 | void FinalizarCuentas(); |
---|
| 275 | void ModificarCuenta(); |
---|
| 276 | void slotCoeficienteHorizontal(); |
---|
| 277 | void slotCoeficienteVertical(); |
---|
[67c9f67] | 278 | void slotAccChange(); |
---|
[9dd61b1] | 279 | |
---|
| 280 | void slotVariableExogena(); |
---|
| 281 | void slotCloseExogena(); |
---|
| 282 | void slotAgregarExogena(); |
---|
| 283 | void slotFinalizarExogena(); |
---|
| 284 | void slotDeshacerExogena(); |
---|
[fa3f7a3] | 285 | |
---|
| 286 | void slotMa(); |
---|
[9dd61b1] | 287 | |
---|
[8daa049] | 288 | void slotEncadenamientos(); |
---|
| 289 | void slotCloseEncadenamiento(); |
---|
| 290 | void slotAgregarEncadenamiento(); |
---|
| 291 | void slotVerEncadenamiento(); |
---|
[37dd9aa] | 292 | void slotClasificarCuentas(); |
---|
[8daa049] | 293 | |
---|
[bd5e45b] | 294 | void slotCloseExport(); |
---|
| 295 | void slotSaveExport(); |
---|
| 296 | void slotSearchExport(); |
---|
| 297 | |
---|
[fa3f7a3] | 298 | void slotModeloClasico(); |
---|
[96b0c4a] | 299 | void calcularEscenario(bool clasico = true); |
---|
[fa3f7a3] | 300 | void finalizarEscenario(); |
---|
| 301 | |
---|
[67c9f67] | 302 | void slotModeloNoClasico(); |
---|
[96b0c4a] | 303 | void calcularEscenarioNC(); |
---|
| 304 | void finalizarEscenarioNC(); |
---|
| 305 | |
---|
| 306 | void slotCompararResultadosMNC(); |
---|
| 307 | void slotVerResultadoMNC(); |
---|
[67c9f67] | 308 | |
---|
[fc268a0] | 309 | void slotPHCIncidencia100(); |
---|
| 310 | void slotPHCIncidenciaiCuenta(); |
---|
| 311 | void slotCalcularPHCIncidenciaiCuenta(); |
---|
| 312 | void slotPHCIncidenciaiComponente(); |
---|
| 313 | void slotCalcularPHCIncidenciaiComponente(); |
---|
| 314 | |
---|
[fa3f7a3] | 315 | void slotCompararResultados(); |
---|
| 316 | void slotVerResultado(); |
---|
| 317 | |
---|
[cfbc36f] | 318 | void slotPHNCIncidencia100(); |
---|
| 319 | void slotPHNCIncidenciaiCuenta(); |
---|
| 320 | void slotCalcularPHNCIncidenciaiCuenta(); |
---|
| 321 | void slotPHNCIncidenciaiComponente(); |
---|
| 322 | void slotCalcularPHNCIncidenciaiComponente(); |
---|
| 323 | |
---|
[04999c9] | 324 | void slotPNHIncudencia100(); |
---|
| 325 | void slotCloseformPNH(); |
---|
| 326 | void slotSelectPNH(); |
---|
| 327 | void slotPNHIncidenciaiCuenta(); |
---|
| 328 | void slotPNHIncidenciaiComponente(); |
---|
| 329 | void slotSelectPNHi(); |
---|
| 330 | void slotCalcularPNHIncidenciaiCuenta(); |
---|
| 331 | void slotSelectPNHic(); |
---|
| 332 | void slotCalcularPNHIncidenciaiComponente(); |
---|
| 333 | |
---|
[b1ef0b1] | 334 | void slotSeleccionarTabla(); |
---|
| 335 | |
---|
[dfddb27] | 336 | void abrirManual(); |
---|
| 337 | void acercaDe(); |
---|
| 338 | |
---|
[44d1e60] | 339 | public: |
---|
| 340 | MainWindow(); |
---|
| 341 | std::vector<std::string> csv_read_row(std::string , char); |
---|
| 342 | std::vector<std::string> csv_read_row(std::istream &, char); |
---|
| 343 | QString numberFormat(double &); |
---|
[9dd61b1] | 344 | |
---|
[8daa049] | 345 | int contarElementosMap(QMap<QString, QStringList> diccionario); |
---|
[44d1e60] | 346 | }; |
---|
| 347 | |
---|
| 348 | #endif // MAINWINDOW_H |
---|