[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; |
---|
[bd5e45b] | 115 | |
---|
[04999c9] | 116 | QString componentePNH; |
---|
| 117 | |
---|
[4d3d740] | 118 | Eigen::MatrixXd MatrizEndogenaEndogena; |
---|
[8daa049] | 119 | |
---|
[bd5e45b] | 120 | int opcionCuentaExogena; |
---|
| 121 | int opcionVentanaExogena; |
---|
| 122 | int opcionExportarMatriz; |
---|
[8daa049] | 123 | int opcionEncadenamientos; |
---|
| 124 | int opcionCuentaEncadenamientos; |
---|
[fa3f7a3] | 125 | int opcionMa; |
---|
[cfbc36f] | 126 | int opcionMb; |
---|
[fa3f7a3] | 127 | int opcionFormCompararResultados; |
---|
[96b0c4a] | 128 | int opcionFormCompararResultadosMNC; |
---|
[fc268a0] | 129 | int opcionMAT; |
---|
[cfbc36f] | 130 | int opcionMBT; |
---|
[04999c9] | 131 | int opcionPNHT; |
---|
| 132 | int opcionFormPNH; |
---|
[fa3f7a3] | 133 | |
---|
| 134 | QVector<double> subtotalEnd; |
---|
| 135 | QVector<double> subtotalExog; |
---|
[96b0c4a] | 136 | QVector<double> subtotalExogEnd; |
---|
[fc268a0] | 137 | QVector<double> Vpond; |
---|
[8daa049] | 138 | |
---|
[b1ef0b1] | 139 | int cantidadSelecciones; |
---|
[8daa049] | 140 | int cantidadEncadenamientos; |
---|
[fa3f7a3] | 141 | int cantidadEscenarios; |
---|
| 142 | int cantidadResultados; |
---|
[96b0c4a] | 143 | int cantidadMNC;//Cantidad de Modelos No Clasicos |
---|
| 144 | int cantidadResultadosMNC; |
---|
[04999c9] | 145 | //Cantidad de resultados de incidencia en modelo de precios homogéneos clásico |
---|
[fc268a0] | 146 | int cantidadPHCindidenciaiCuenta; |
---|
| 147 | int cantidadPHCindidenciaiComponente; |
---|
[04999c9] | 148 | //Cantidad de resultados de incidencia en modelo de precios homogéneos no clásico |
---|
[cfbc36f] | 149 | int cantidadPHNCindidenciaiCuenta; |
---|
| 150 | int cantidadPHNCindidenciaiComponente; |
---|
[04999c9] | 151 | //Cantidad de resultados de incidencia en modelo de precios no homogéneos |
---|
| 152 | int cantidadPNHincidencia100; |
---|
| 153 | int cantidadPNHincidenciaiCuenta; |
---|
| 154 | int cantidadPNHincidenciaiComponente; |
---|
[44d1e60] | 155 | |
---|
| 156 | FormLoadMatrix * formLoadMatrix; |
---|
| 157 | FormViewMatrix * formViewMatrix; |
---|
[9dd61b1] | 158 | FormVariablesExogenas * formVariablesExogenas; |
---|
[bd5e45b] | 159 | FormExportMatrix * formExportMatriz; |
---|
[8daa049] | 160 | FormEncadenamientos * formEncadenamientos; |
---|
[fa3f7a3] | 161 | FormCompararResultados *formCompararResultados; |
---|
[96b0c4a] | 162 | FormCompararMNC *formCompararMNC; |
---|
[fc268a0] | 163 | FormIncidenciaI *FI; |
---|
[04999c9] | 164 | FormPreciosNoHomogeneos * formPreciosNoHomogeneos; |
---|
[44d1e60] | 165 | |
---|
| 166 | void initGUI(); |
---|
| 167 | |
---|
| 168 | void createCentralWidget(); |
---|
| 169 | void createMatrixCentralWidget(); |
---|
| 170 | |
---|
| 171 | void createMenuBar(); |
---|
[9dd61b1] | 172 | void matricesMenuBar(); |
---|
[44d1e60] | 173 | void populateTable(QTableWidget *); |
---|
[95d916c] | 174 | |
---|
[32f758e] | 175 | void CalcularTotales(QTableWidget *, int inicio, bool &); |
---|
[95d916c] | 176 | bool comprobarNombreCuenta(QString, int indice); |
---|
[9dd61b1] | 177 | void loadMatrizExogena(); |
---|
| 178 | void clonarTabla(QTableWidget *,QTableWidget *, int cantidad); |
---|
| 179 | void noEditColZero(QTableWidget *); |
---|
| 180 | void setAccountTitle(QTableWidget *); |
---|
| 181 | void insertremoveRowCol(QTableWidget *, int rowcol, bool opcion); |
---|
[8daa049] | 182 | void crearDiccionario(QTableWidget *, bool endogena=true); |
---|
| 183 | QStringList obtenerCuentasEndogenas(QTableWidget *,QStringList); |
---|
| 184 | QStringList obtenerCuentasExogenas(QTableWidget *,QStringList ); |
---|
| 185 | void spanEndogenaCell(QTableWidget *, int inicio, int celda, bool endex=true); |
---|
| 186 | void spanExogenaCell(QTableWidget *,int celda); |
---|
[e506dab] | 187 | void tableItem(QTableWidget *, int inicio, int fin, QString texto); |
---|
[9dd61b1] | 188 | |
---|
| 189 | QList<QString> llenarLista(QList<QString>, QTableWidget *, int valor, int opcion); |
---|
| 190 | void insertRowExogena(QList<QString>, QTableWidget *, int opcion); |
---|
| 191 | void setEndogenaExogenaCell(QTableWidget *, int inicioExogena, int elementos,bool condicion); |
---|
[67c9f67] | 192 | void CalcularAn(QTableWidget *, QTableWidget *, QTableWidget *, int count, bool endogena = false); |
---|
[bd5e45b] | 193 | QString Separador(QTableWidgetItem *,bool quitar); |
---|
[8daa049] | 194 | void ItemsNoEditable(QTableWidget *, int inicio, int fin, int col=0); |
---|
[aa628c3] | 195 | void CellStyle(QTableWidgetItem *); |
---|
[cfdcc67] | 196 | void CellStyleComponente(QTableWidgetItem *); |
---|
| 197 | void CellStyleExEn(QTableWidgetItem *); |
---|
[aa628c3] | 198 | void EndogenaAn(); |
---|
[9dd61b1] | 199 | |
---|
[fc268a0] | 200 | void calcularTotalCuentas(QTableWidget *); |
---|
[b1ef0b1] | 201 | void estimarVectorPonderacion(); |
---|
[fc268a0] | 202 | |
---|
[8daa049] | 203 | void obtenerCuentaComponentes(); |
---|
[fc268a0] | 204 | void crearTablaVaciaEncadenamiento(int filas, QTableWidget *, int columnas=4); |
---|
[8daa049] | 205 | void crearMatrizEncadenamiento(QTableWidget *, QTableWidget *); |
---|
| 206 | void crearMatrizEncadenamientoEndogena(QTableWidget *, QTableWidget *); |
---|
| 207 | void calcularTotalesEncadenamientos(QTableWidget *); |
---|
| 208 | void encademientosStyle(QTableWidgetItem *); |
---|
[32f758e] | 209 | void cuentacomponentesEncadenamiento(QTableWidget *, int count); |
---|
[37dd9aa] | 210 | void obtenerUiUj(QTableWidget *, QVector<double> &, QVector<double> &); |
---|
| 211 | void calcularClasificador(QTableWidget *, QVector<double>, QVector<double>, int init = 2); |
---|
| 212 | void agregarPrimeraCelda(QTableWidget *); |
---|
[8daa049] | 213 | |
---|
[cfbc36f] | 214 | void calcularSubtotal(QTableWidget *,int inicio, int fin,int exogena); |
---|
[96b0c4a] | 215 | void llenarEscenario(QTableWidget *, bool clasico=true); |
---|
[fa3f7a3] | 216 | void calcularFinEscenario(QTableWidget *); |
---|
| 217 | QVector<double> obtenerResultadoEscenario(QVector<double>); |
---|
| 218 | QStringList obtenerNombreResultadoEscenario(); |
---|
| 219 | void crearTablaComparar(QTableWidget *, QTableWidget *); |
---|
[96b0c4a] | 220 | void cuentacomponentesResultado(QTableWidget *, int count, bool clasico = true); |
---|
[fa3f7a3] | 221 | |
---|
[67c9f67] | 222 | void obtenerMatrizExgEnd(); |
---|
| 223 | void crearMatrizExgEnd(QTableWidget *,QTableWidget *,int elementos,int inicioExogena); |
---|
| 224 | void calcularMatrizExgEnd(QTableWidget *); |
---|
| 225 | void ctvMatrizExgEnd(QTableWidget *, QTableWidget *); |
---|
| 226 | void titlespanMatrizExgEnd(QTableWidget *); |
---|
| 227 | void estimarMb(QTableWidget *, QTableWidget *); |
---|
[96b0c4a] | 228 | void calcularSubtotalEndExg(); |
---|
| 229 | QVector<double> obtenerResultadoEscenarioMNC(QVector<double>); |
---|
| 230 | void calcularFinEscenarioMNC(QTableWidget *); |
---|
| 231 | QStringList obtenerNombreResultadoEscenarioMNC(); |
---|
[67c9f67] | 232 | |
---|
[9dd61b1] | 233 | void crearMatrizEndogena(QTableWidget *); |
---|
[8daa049] | 234 | void restarIdentidadAn(QTableWidget *); |
---|
| 235 | void titleEndogena(QTableWidget *); |
---|
[9dd61b1] | 236 | |
---|
[fc268a0] | 237 | void calcularMaT(); |
---|
| 238 | void calcularPHCIncidencia100(QTableWidget *); |
---|
| 239 | void calcularPHCIncidenciaI(QTableWidget *, QMap<QString, double>); |
---|
| 240 | void calcularPHCIncidenciaIComponente(QTableWidget *,QTableWidget *); |
---|
| 241 | |
---|
[cfbc36f] | 242 | void calcularMbT(); |
---|
| 243 | void calcularMb(); |
---|
[04999c9] | 244 | void calcularPHNCIncidencia100(QTableWidget *); |
---|
| 245 | void calcularVectorSend(QString componente, QVector<double> &); |
---|
| 246 | void multiplicarMatricesPNH(QTableWidget *, QVector<double>); |
---|
| 247 | void calcularPNHIncidencia100(QTableWidget *, Eigen::MatrixXd Diagonal); |
---|
| 248 | void crearFormularioPNH(); |
---|
[32f758e] | 249 | QStringList obtenerCuentas(); |
---|
[cfbc36f] | 250 | |
---|
[b1ef0b1] | 251 | void titleSeleccionar(QTableWidget *); |
---|
| 252 | |
---|
[9dd61b1] | 253 | bool ComprobarCuentas(); |
---|
| 254 | int ObtenerIndice(QString ); |
---|
| 255 | |
---|
| 256 | QStringList ObtenerNombreCuenta(int contador); |
---|
| 257 | QList<int> ObtenerLimitesCuenta(int contador,int opccion); |
---|
| 258 | QStringList ObtenerComponentes(QTableWidget *); |
---|
| 259 | void CrearTablaVacia(int contador,QTableWidget *); |
---|
[44d1e60] | 260 | |
---|
| 261 | protected: |
---|
| 262 | void closeEvent(QCloseEvent *); |
---|
| 263 | |
---|
| 264 | private slots: |
---|
[fc268a0] | 265 | void slotNuevoProyecto(); |
---|
[44d1e60] | 266 | void slotLoadMatrix(); |
---|
| 267 | void slotExportMatrix(); |
---|
[96b0c4a] | 268 | void slotFormLoadMatrixAccepted(const QString &, int, int); |
---|
[44d1e60] | 269 | void slotFormLoadMatrixClosed(); |
---|
| 270 | |
---|
[9dd61b1] | 271 | void AgregarCuenta(); |
---|
| 272 | void RestaurarCeldas(); |
---|
| 273 | void FinalizarCuentas(); |
---|
| 274 | void ModificarCuenta(); |
---|
| 275 | void slotCoeficienteHorizontal(); |
---|
| 276 | void slotCoeficienteVertical(); |
---|
[67c9f67] | 277 | void slotAccChange(); |
---|
[9dd61b1] | 278 | |
---|
| 279 | void slotVariableExogena(); |
---|
| 280 | void slotCloseExogena(); |
---|
| 281 | void slotAgregarExogena(); |
---|
| 282 | void slotFinalizarExogena(); |
---|
| 283 | void slotDeshacerExogena(); |
---|
[fa3f7a3] | 284 | |
---|
| 285 | void slotMa(); |
---|
[9dd61b1] | 286 | |
---|
[8daa049] | 287 | void slotEncadenamientos(); |
---|
| 288 | void slotCloseEncadenamiento(); |
---|
| 289 | void slotAgregarEncadenamiento(); |
---|
| 290 | void slotVerEncadenamiento(); |
---|
[37dd9aa] | 291 | void slotClasificarCuentas(); |
---|
[8daa049] | 292 | |
---|
[bd5e45b] | 293 | void slotCloseExport(); |
---|
| 294 | void slotSaveExport(); |
---|
| 295 | void slotSearchExport(); |
---|
| 296 | |
---|
[fa3f7a3] | 297 | void slotModeloClasico(); |
---|
[96b0c4a] | 298 | void calcularEscenario(bool clasico = true); |
---|
[fa3f7a3] | 299 | void finalizarEscenario(); |
---|
| 300 | |
---|
[67c9f67] | 301 | void slotModeloNoClasico(); |
---|
[96b0c4a] | 302 | void calcularEscenarioNC(); |
---|
| 303 | void finalizarEscenarioNC(); |
---|
| 304 | |
---|
| 305 | void slotCompararResultadosMNC(); |
---|
| 306 | void slotVerResultadoMNC(); |
---|
[67c9f67] | 307 | |
---|
[fc268a0] | 308 | void slotPHCIncidencia100(); |
---|
| 309 | void slotPHCIncidenciaiCuenta(); |
---|
| 310 | void slotCalcularPHCIncidenciaiCuenta(); |
---|
| 311 | void slotPHCIncidenciaiComponente(); |
---|
| 312 | void slotCalcularPHCIncidenciaiComponente(); |
---|
| 313 | |
---|
[fa3f7a3] | 314 | void slotCompararResultados(); |
---|
| 315 | void slotVerResultado(); |
---|
| 316 | |
---|
[cfbc36f] | 317 | void slotPHNCIncidencia100(); |
---|
| 318 | void slotPHNCIncidenciaiCuenta(); |
---|
| 319 | void slotCalcularPHNCIncidenciaiCuenta(); |
---|
| 320 | void slotPHNCIncidenciaiComponente(); |
---|
| 321 | void slotCalcularPHNCIncidenciaiComponente(); |
---|
| 322 | |
---|
[04999c9] | 323 | void slotPNHIncudencia100(); |
---|
| 324 | void slotCloseformPNH(); |
---|
| 325 | void slotSelectPNH(); |
---|
| 326 | void slotPNHIncidenciaiCuenta(); |
---|
| 327 | void slotPNHIncidenciaiComponente(); |
---|
| 328 | void slotSelectPNHi(); |
---|
| 329 | void slotCalcularPNHIncidenciaiCuenta(); |
---|
| 330 | void slotSelectPNHic(); |
---|
| 331 | void slotCalcularPNHIncidenciaiComponente(); |
---|
| 332 | |
---|
[b1ef0b1] | 333 | void slotSeleccionarTabla(); |
---|
| 334 | |
---|
[dfddb27] | 335 | void abrirManual(); |
---|
| 336 | void acercaDe(); |
---|
| 337 | |
---|
[44d1e60] | 338 | public: |
---|
| 339 | MainWindow(); |
---|
| 340 | QString numberFormat(double &); |
---|
[9dd61b1] | 341 | |
---|
[8daa049] | 342 | int contarElementosMap(QMap<QString, QStringList> diccionario); |
---|
[44d1e60] | 343 | }; |
---|
| 344 | |
---|
| 345 | #endif // MAINWINDOW_H |
---|