Changeset 9b2ca78 in mmcs
- Timestamp:
- Nov 14, 2016, 10:32:49 AM (8 years ago)
- Branches:
- master
- Children:
- 82657bc
- Parents:
- f6d90ed
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
mainwindow.C
rf6d90ed r9b2ca78 403 403 Descomposicion.addAction(&actionCortoPlazo); 404 404 405 actionCompararDescomposicion.setText("&Comparar Resultados"); 406 actionCompararDescomposicion.setDisabled(true); 407 408 Descomposicion.addAction(&actionCompararDescomposicion); 409 405 410 menuTools.addMenu(&Descomposicion); 406 411 … … 936 941 : actionNewProject(this),actionLoadMatrix(this), actionExportMatrix(this), actionQuit(this),actionCH(this), actionCV(this), 937 942 actionVariableExogena(this),actionEncadenamiento(this), 938 actionDescomposicion(this), actionCortoPlazo(this), 943 actionDescomposicion(this), actionCortoPlazo(this), actionCompararDescomposicion(this), 939 944 actionModeloClasico(this), actionCompararResultados(this),actionModeloNoClasico(this),actionCompararResultadosMNC(this), 940 945 actionPHClasicoIncidencia100(this),actionPHCIncidenciaCuenta(this),actionPHCIncidenciaComponente(this), … … 977 982 cantidadPNHincidenciaiComponente = 1; 978 983 cantidadImpactos = 1; 984 comparacionImpactos = 1; 979 985 980 986 initGUI(); … … 4157 4163 { 4158 4164 formCompararResultados = new FormCompararResultados(this); 4159 QStringList nombres = obtenerNombreResultadoEscenario( );4165 QStringList nombres = obtenerNombreResultadoEscenario(cantidadEscenarios,"Resultado C"); 4160 4166 formCompararResultados->ui->resultadosListWidget->addItems(nombres); 4161 4167 connect(formCompararResultados->ui->buttonVerResultados,SIGNAL(clicked()),this,SLOT(slotVerResultado())); … … 4164 4170 else 4165 4171 { 4172 disconnect(formCompararResultados->ui->buttonVerResultados,SIGNAL(clicked()),this,SLOT(slotVerResultado())); 4173 disconnect(formCompararResultados->ui->buttonVerResultados,SIGNAL(clicked()),this,SLOT(slotVerResultadoDescomposicion())); 4166 4174 formCompararResultados->ui->resultadosListWidget->clear(); 4167 QStringList nombres = obtenerNombreResultadoEscenario( );4175 QStringList nombres = obtenerNombreResultadoEscenario(cantidadEscenarios,"Resultado C"); 4168 4176 formCompararResultados->ui->resultadosListWidget->addItems(nombres); 4177 connect(formCompararResultados->ui->buttonVerResultados,SIGNAL(clicked()),this,SLOT(slotVerResultado())); 4169 4178 } 4170 4179 formCompararResultados->show(); … … 4175 4184 @date 02/10/2015 4176 4185 @author Rodrigo Boet 4186 @param <cantidad> Recibe la cantidad de elementos 4187 @param <nombre> Recibe el nombre de la pestaña que buscará 4177 4188 @return <nombres> retorna los nombres de los resultados del escenario 4178 4189 */ 4179 QStringList MainWindow::obtenerNombreResultadoEscenario( )4190 QStringList MainWindow::obtenerNombreResultadoEscenario(int cantidad, QString nombre) 4180 4191 { 4181 4192 QStringList nombres; 4182 for(int i=1;i<cantidad Escenarios;i++)4183 { 4184 int indice = ObtenerIndice(QString( "Resultado C%1").arg(i));4193 for(int i=1;i<cantidad;i++) 4194 { 4195 int indice = ObtenerIndice(QString(nombre+" %1").arg(i)); 4185 4196 nombres.append(tabWidget->tabText(indice)); 4186 4197 } … … 6514 6525 void MainWindow::finalizarImpacto() 6515 6526 { 6516 QMessageBox msBox(QMessageBox::Question,"Finalizar Escenario","¿Está seguro que desea finalizar\ 6527 QMessageBox msBox(QMessageBox::Question,"Finalizar Escenario","¿Está seguro que desea finalizar\neste escenario?", 6517 6528 QMessageBox::Yes | QMessageBox::No,this); 6518 6529 msBox.setButtonText(QMessageBox::Yes,"&Si"); … … 6544 6555 actionCortoPlazo.setEnabled(true); 6545 6556 formcortoplazo->ui->listSeleccionado->clear(); 6546 /*if(cantidadEscenarios>2)6547 { 6548 actionComparar Resultados.setEnabled(true);6549 connect(&actionComparar Resultados,SIGNAL(triggered()),this,SLOT(slotCompararResultados()));6550 } */6557 if(cantidadImpactos>2) 6558 { 6559 actionCompararDescomposicion.setEnabled(true); 6560 connect(&actionCompararDescomposicion,SIGNAL(triggered()),this,SLOT(slotFormResultadosDescomposicion())); 6561 } 6551 6562 } 6552 6563 } … … 6588 6599 } 6589 6600 } 6590 qDebug()<<totalCuentasEncadenamiento; 6591 } 6601 } 6602 6603 /** 6604 @brief Función para abrir el formulario de comparar resultados 6605 @date 14/11/2016 6606 @author Rodrigo Boet 6607 */ 6608 void MainWindow::slotFormResultadosDescomposicion() 6609 { 6610 if(opcionFormCompararResultados == 0) 6611 { 6612 formCompararResultados = new FormCompararResultados(this); 6613 QStringList nombres = obtenerNombreResultadoEscenario(cantidadImpactos,"Resultado CP"); 6614 formCompararResultados->ui->resultadosListWidget->addItems(nombres); 6615 connect(formCompararResultados->ui->buttonVerResultados,SIGNAL(clicked()),this,SLOT(slotVerResultadoDescomposicion())); 6616 opcionFormCompararResultados ++; 6617 } 6618 else 6619 { 6620 disconnect(formCompararResultados->ui->buttonVerResultados,SIGNAL(clicked()),this,SLOT(slotVerResultado())); 6621 disconnect(formCompararResultados->ui->buttonVerResultados,SIGNAL(clicked()),this,SLOT(slotVerResultadoDescomposicion())); 6622 formCompararResultados->ui->resultadosListWidget->clear(); 6623 QStringList nombres = obtenerNombreResultadoEscenario(cantidadImpactos,"Resultado CP"); 6624 formCompararResultados->ui->resultadosListWidget->addItems(nombres); 6625 connect(formCompararResultados->ui->buttonVerResultados,SIGNAL(clicked()),this,SLOT(slotVerResultadoDescomposicion())); 6626 } 6627 formCompararResultados->show(); 6628 } 6629 6630 /** 6631 @brief Función para comparar los resultados de la descomposición de multiplicadores 6632 @date 14/11/2016 6633 @author Rodrigo Boet 6634 */ 6635 void MainWindow::slotVerResultadoDescomposicion() 6636 { 6637 QTableWidget *tablaComparar = new QTableWidget; 6638 tablaComparar->setObjectName(QString("TablaCompararResultadoImpacto %1").arg(comparacionImpactos)); 6639 QTableWidget *endogena = findChild<QTableWidget *>("MatrizEndogenaEndogena"); 6640 int contador = endogena->rowCount()-2; 6641 crearTablaVaciaEncadenamiento(contador,tablaComparar,2); 6642 cuentacomponentesResultado(tablaComparar,contador); 6643 int contar=formCompararResultados->ui->resultadosListWidget->selectedItems().count(); 6644 for(int i=0;i<contar;i++) 6645 { 6646 QString text = formCompararResultados->ui->resultadosListWidget->selectedItems().value(i)->text(); 6647 QStringList number = text.split(" "); 6648 text = number.at(2); 6649 QTableWidget *tw = findChild<QTableWidget *>(QString("TablaResultadoImpactos %1").arg(text)); 6650 crearTablaComparar(tablaComparar,tw); 6651 } 6652 //Se agrega el nombre de los resultados 6653 tablaComparar->insertRow(0); 6654 QFont font; 6655 font.setBold(true); 6656 int j = 0; 6657 for(int i=0;i<contar;i++) 6658 { 6659 QString text = formCompararResultados->ui->resultadosListWidget->selectedItems().value(i)->text(); 6660 QTableWidgetItem *item1 = new QTableWidgetItem(text); 6661 item1->setFlags(item1->flags() ^ Qt::ItemIsEditable); 6662 item1->setFont(font); 6663 item1->setTextAlignment(Qt::AlignCenter); 6664 QTableWidgetItem *item2 = new QTableWidgetItem(text); 6665 item2->setFlags(item2->flags() ^ Qt::ItemIsEditable); 6666 item2->setFont(font); 6667 item2->setTextAlignment(Qt::AlignCenter); 6668 tablaComparar->setItem(0,2+j,item1); 6669 j++; 6670 tablaComparar->setItem(0,2+j,item2); 6671 tablaComparar->setSpan(0,(2+j)-1,1,2); 6672 j++; 6673 } 6674 ItemsNoEditable(tablaComparar,0,2); 6675 6676 createTab(QString("Comparacion Impactos %1").arg(comparacionImpactos),tablaComparar,true); 6677 6678 formCompararResultados->close(); 6679 comparacionImpactos++; 6680 } -
mainwindow.H
rf6d90ed r9b2ca78 108 108 QAction actionDescomposicion; 109 109 QAction actionCortoPlazo; 110 QAction actionCompararDescomposicion; 110 111 111 112 QAction actionSeleccionarTabla; … … 206 207 //Cantidad de impactos a corto plazo 207 208 int cantidadImpactos; 209 //Cantidad de comparaciones de impactos 210 int comparacionImpactos; 208 211 209 212 FormLoadMatrix * formLoadMatrix; … … 262 265 void calcularFinEscenario(QTableWidget *, QString, Eigen::MatrixXd matrix); 263 266 QVector<double> obtenerResultadoEscenario(QVector<double>, QString, Eigen::MatrixXd matrix); 264 QStringList obtenerNombreResultadoEscenario( );267 QStringList obtenerNombreResultadoEscenario(int cantidad, QString nombre); 265 268 void cuentacomponentesResultado(QTableWidget *, int count, bool clasico = true); 266 269 … … 388 391 void finalizarImpacto(); 389 392 393 //Slots para comparar resultados en el modelo no clásico 390 394 void slotCompararResultadosMNC(); 391 395 void slotVerResultadoMNC(); 392 396 397 //Slots para precios homogeneos 393 398 void slotPHCIncidencia100(); 394 399 void slotPHCIncidenciaiCuenta(); … … 397 402 void slotCalcularPHCIncidenciaiComponente(); 398 403 404 //Slots para comparar resultados en los precios homogeneos 399 405 void slotCompararResultados(); 400 406 void slotVerResultado(); 401 407 408 //Slots para precios no homogeneos 402 409 void slotPHNCIncidencia100(); 403 410 void slotPHNCIncidenciaiCuenta(); … … 418 425 void slotSeleccionarTabla(); 419 426 427 //Slots para comparar resultados de descomposicion 428 void slotFormResultadosDescomposicion(); 429 void slotVerResultadoDescomposicion(); 430 420 431 //Slots del menú de ayuda 421 432 void abrirManual(); -
moc_mainwindow.cpp
r8f1b6a6 r9b2ca78 20 20 QT_BEGIN_MOC_NAMESPACE 21 21 struct qt_meta_stringdata_MainWindow_t { 22 QByteArrayData data[7 1];23 char stringdata[1 484];22 QByteArrayData data[73]; 23 char stringdata[1548]; 24 24 }; 25 25 #define QT_MOC_LITERAL(idx, ofs, len) \ … … 99 99 QT_MOC_LITERAL(67, 1405, 36), 100 100 QT_MOC_LITERAL(68, 1442, 20), 101 QT_MOC_LITERAL(69, 1463, 11), 102 QT_MOC_LITERAL(70, 1475, 8) 101 QT_MOC_LITERAL(69, 1463, 32), 102 QT_MOC_LITERAL(70, 1496, 30), 103 QT_MOC_LITERAL(71, 1527, 11), 104 QT_MOC_LITERAL(72, 1539, 8) 103 105 }, 104 106 "MainWindow\0slotNuevoProyecto\0\0" … … 141 143 "slotSelectPNHi\0slotCalcularPNHIncidenciaiCuenta\0" 142 144 "slotSelectPNHic\0slotCalcularPNHIncidenciaiComponente\0" 143 "slotSeleccionarTabla\0abrirManual\0" 144 "acercaDe" 145 "slotSeleccionarTabla\0" 146 "slotFormResultadosDescomposicion\0" 147 "slotVerResultadoDescomposicion\0" 148 "abrirManual\0acercaDe" 145 149 }; 146 150 #undef QT_MOC_LITERAL … … 152 156 0, // classname 153 157 0, 0, // classinfo 154 69, 14, // methods158 71, 14, // methods 155 159 0, 0, // properties 156 160 0, 0, // enums/sets … … 160 164 161 165 // slots: name, argc, parameters, tag, flags 162 1, 0, 359, 2, 0x08 /* Private */, 163 3, 0, 360, 2, 0x08 /* Private */, 164 4, 0, 361, 2, 0x08 /* Private */, 165 5, 3, 362, 2, 0x08 /* Private */, 166 6, 0, 369, 2, 0x08 /* Private */, 167 7, 0, 370, 2, 0x08 /* Private */, 168 8, 0, 371, 2, 0x08 /* Private */, 169 9, 0, 372, 2, 0x08 /* Private */, 170 10, 0, 373, 2, 0x08 /* Private */, 171 11, 0, 374, 2, 0x08 /* Private */, 172 12, 0, 375, 2, 0x08 /* Private */, 173 13, 0, 376, 2, 0x08 /* Private */, 174 14, 0, 377, 2, 0x08 /* Private */, 175 15, 0, 378, 2, 0x08 /* Private */, 176 16, 0, 379, 2, 0x08 /* Private */, 177 17, 0, 380, 2, 0x08 /* Private */, 178 18, 0, 381, 2, 0x08 /* Private */, 179 19, 0, 382, 2, 0x08 /* Private */, 180 20, 0, 383, 2, 0x08 /* Private */, 181 21, 0, 384, 2, 0x08 /* Private */, 182 22, 0, 385, 2, 0x08 /* Private */, 183 23, 0, 386, 2, 0x08 /* Private */, 184 24, 0, 387, 2, 0x08 /* Private */, 185 25, 0, 388, 2, 0x08 /* Private */, 186 26, 0, 389, 2, 0x08 /* Private */, 187 27, 2, 390, 2, 0x08 /* Private */, 188 28, 0, 395, 2, 0x08 /* Private */, 189 29, 0, 396, 2, 0x08 /* Private */, 190 30, 0, 397, 2, 0x08 /* Private */, 191 31, 0, 398, 2, 0x08 /* Private */, 192 32, 0, 399, 2, 0x08 /* Private */, 193 33, 1, 400, 2, 0x08 /* Private */, 194 33, 0, 403, 2, 0x28 /* Private | MethodCloned */, 195 35, 0, 404, 2, 0x08 /* Private */, 196 36, 0, 405, 2, 0x08 /* Private */, 197 37, 0, 406, 2, 0x08 /* Private */, 198 38, 0, 407, 2, 0x08 /* Private */, 199 39, 0, 408, 2, 0x08 /* Private */, 200 40, 0, 409, 2, 0x08 /* Private */, 201 41, 0, 410, 2, 0x08 /* Private */, 202 42, 0, 411, 2, 0x08 /* Private */, 203 43, 0, 412, 2, 0x08 /* Private */, 204 44, 0, 413, 2, 0x08 /* Private */, 205 45, 0, 414, 2, 0x08 /* Private */, 206 46, 0, 415, 2, 0x08 /* Private */, 207 47, 0, 416, 2, 0x08 /* Private */, 208 48, 0, 417, 2, 0x08 /* Private */, 209 49, 0, 418, 2, 0x08 /* Private */, 210 50, 0, 419, 2, 0x08 /* Private */, 211 51, 0, 420, 2, 0x08 /* Private */, 212 52, 0, 421, 2, 0x08 /* Private */, 213 53, 0, 422, 2, 0x08 /* Private */, 214 54, 0, 423, 2, 0x08 /* Private */, 215 55, 0, 424, 2, 0x08 /* Private */, 216 56, 0, 425, 2, 0x08 /* Private */, 217 57, 0, 426, 2, 0x08 /* Private */, 218 58, 0, 427, 2, 0x08 /* Private */, 219 59, 0, 428, 2, 0x08 /* Private */, 220 60, 0, 429, 2, 0x08 /* Private */, 221 61, 0, 430, 2, 0x08 /* Private */, 222 62, 0, 431, 2, 0x08 /* Private */, 223 63, 0, 432, 2, 0x08 /* Private */, 224 64, 0, 433, 2, 0x08 /* Private */, 225 65, 0, 434, 2, 0x08 /* Private */, 226 66, 0, 435, 2, 0x08 /* Private */, 227 67, 0, 436, 2, 0x08 /* Private */, 228 68, 0, 437, 2, 0x08 /* Private */, 229 69, 0, 438, 2, 0x08 /* Private */, 230 70, 0, 439, 2, 0x08 /* Private */, 166 1, 0, 369, 2, 0x08 /* Private */, 167 3, 0, 370, 2, 0x08 /* Private */, 168 4, 0, 371, 2, 0x08 /* Private */, 169 5, 3, 372, 2, 0x08 /* Private */, 170 6, 0, 379, 2, 0x08 /* Private */, 171 7, 0, 380, 2, 0x08 /* Private */, 172 8, 0, 381, 2, 0x08 /* Private */, 173 9, 0, 382, 2, 0x08 /* Private */, 174 10, 0, 383, 2, 0x08 /* Private */, 175 11, 0, 384, 2, 0x08 /* Private */, 176 12, 0, 385, 2, 0x08 /* Private */, 177 13, 0, 386, 2, 0x08 /* Private */, 178 14, 0, 387, 2, 0x08 /* Private */, 179 15, 0, 388, 2, 0x08 /* Private */, 180 16, 0, 389, 2, 0x08 /* Private */, 181 17, 0, 390, 2, 0x08 /* Private */, 182 18, 0, 391, 2, 0x08 /* Private */, 183 19, 0, 392, 2, 0x08 /* Private */, 184 20, 0, 393, 2, 0x08 /* Private */, 185 21, 0, 394, 2, 0x08 /* Private */, 186 22, 0, 395, 2, 0x08 /* Private */, 187 23, 0, 396, 2, 0x08 /* Private */, 188 24, 0, 397, 2, 0x08 /* Private */, 189 25, 0, 398, 2, 0x08 /* Private */, 190 26, 0, 399, 2, 0x08 /* Private */, 191 27, 2, 400, 2, 0x08 /* Private */, 192 28, 0, 405, 2, 0x08 /* Private */, 193 29, 0, 406, 2, 0x08 /* Private */, 194 30, 0, 407, 2, 0x08 /* Private */, 195 31, 0, 408, 2, 0x08 /* Private */, 196 32, 0, 409, 2, 0x08 /* Private */, 197 33, 1, 410, 2, 0x08 /* Private */, 198 33, 0, 413, 2, 0x28 /* Private | MethodCloned */, 199 35, 0, 414, 2, 0x08 /* Private */, 200 36, 0, 415, 2, 0x08 /* Private */, 201 37, 0, 416, 2, 0x08 /* Private */, 202 38, 0, 417, 2, 0x08 /* Private */, 203 39, 0, 418, 2, 0x08 /* Private */, 204 40, 0, 419, 2, 0x08 /* Private */, 205 41, 0, 420, 2, 0x08 /* Private */, 206 42, 0, 421, 2, 0x08 /* Private */, 207 43, 0, 422, 2, 0x08 /* Private */, 208 44, 0, 423, 2, 0x08 /* Private */, 209 45, 0, 424, 2, 0x08 /* Private */, 210 46, 0, 425, 2, 0x08 /* Private */, 211 47, 0, 426, 2, 0x08 /* Private */, 212 48, 0, 427, 2, 0x08 /* Private */, 213 49, 0, 428, 2, 0x08 /* Private */, 214 50, 0, 429, 2, 0x08 /* Private */, 215 51, 0, 430, 2, 0x08 /* Private */, 216 52, 0, 431, 2, 0x08 /* Private */, 217 53, 0, 432, 2, 0x08 /* Private */, 218 54, 0, 433, 2, 0x08 /* Private */, 219 55, 0, 434, 2, 0x08 /* Private */, 220 56, 0, 435, 2, 0x08 /* Private */, 221 57, 0, 436, 2, 0x08 /* Private */, 222 58, 0, 437, 2, 0x08 /* Private */, 223 59, 0, 438, 2, 0x08 /* Private */, 224 60, 0, 439, 2, 0x08 /* Private */, 225 61, 0, 440, 2, 0x08 /* Private */, 226 62, 0, 441, 2, 0x08 /* Private */, 227 63, 0, 442, 2, 0x08 /* Private */, 228 64, 0, 443, 2, 0x08 /* Private */, 229 65, 0, 444, 2, 0x08 /* Private */, 230 66, 0, 445, 2, 0x08 /* Private */, 231 67, 0, 446, 2, 0x08 /* Private */, 232 68, 0, 447, 2, 0x08 /* Private */, 233 69, 0, 448, 2, 0x08 /* Private */, 234 70, 0, 449, 2, 0x08 /* Private */, 235 71, 0, 450, 2, 0x08 /* Private */, 236 72, 0, 451, 2, 0x08 /* Private */, 231 237 232 238 // slots: parameters … … 263 269 QMetaType::Void, 264 270 QMetaType::Void, QMetaType::Int, 34, 271 QMetaType::Void, 272 QMetaType::Void, 265 273 QMetaType::Void, 266 274 QMetaType::Void, … … 376 384 case 65: _t->slotCalcularPNHIncidenciaiComponente(); break; 377 385 case 66: _t->slotSeleccionarTabla(); break; 378 case 67: _t->abrirManual(); break; 379 case 68: _t->acercaDe(); break; 386 case 67: _t->slotFormResultadosDescomposicion(); break; 387 case 68: _t->slotVerResultadoDescomposicion(); break; 388 case 69: _t->abrirManual(); break; 389 case 70: _t->acercaDe(); break; 380 390 default: ; 381 391 } … … 408 418 return _id; 409 419 if (_c == QMetaObject::InvokeMetaMethod) { 410 if (_id < 69)420 if (_id < 71) 411 421 qt_static_metacall(this, _c, _id, _a); 412 _id -= 69;422 _id -= 71; 413 423 } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { 414 if (_id < 69)424 if (_id < 71) 415 425 *reinterpret_cast<int*>(_a[0]) = -1; 416 _id -= 69;426 _id -= 71; 417 427 } 418 428 return _id;
Note: See TracChangeset
for help on using the changeset viewer.