Changeset 37dd9aa in mmcs
- Timestamp:
- Sep 28, 2015, 11:56:51 AM (9 years ago)
- Branches:
- master
- Children:
- 95d916c
- Parents:
- 32f758e
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r07b8f66 r37dd9aa 1 1 ############################################################################# 2 2 # Makefile for building: SMSAM 3 # Generated by qmake (2.01a) (Qt 4.8.2) on: Wed Sep 23 11:12:1320153 # Generated by qmake (2.01a) (Qt 4.8.2) on: lun sep 28 10:36:38 2015 4 4 # Project: SMSAM.pro 5 5 # Template: app -
mainwindow.C
r32f758e r37dd9aa 1870 1870 connect(&actionEncadenamiento,SIGNAL(triggered()),this,SLOT(slotEncadenamientos())); 1871 1871 actionEncadenamiento.setEnabled(true); 1872 //Clasificador de Cuentas 1873 connect(&actionClasificarCuentas,SIGNAL(triggered()),this,SLOT(slotClasificarCuentas())); 1874 actionClasificarCuentas.setEnabled(true); 1872 1875 1873 1876 //Se activa la opción de modelo clásico … … 2921 2924 } 2922 2925 2926 //Clasificador de cuentas 2927 void MainWindow::slotClasificarCuentas() 2928 { 2929 QTableWidget *An = findChild<QTableWidget *>("MatrizAn"); 2930 QTableWidget *Ma = findChild<QTableWidget *>("MatrizMa"); 2931 int count = An->rowCount()-1; 2932 QTableWidget *CC = new QTableWidget; 2933 CC->setObjectName("Clasificador de Cuentas"); 2934 crearTablaVaciaEncadenamiento(count,CC,8); 2935 cuentacomponentesResultado(CC,count-1,true); 2936 QVector<double> vectorFila; 2937 QVector<double> vectorColumna; 2938 obtenerUiUj(An,vectorFila,vectorColumna); 2939 calcularClasificador(CC,vectorFila,vectorColumna); 2940 vectorFila.clear(); 2941 vectorColumna.clear(); 2942 obtenerUiUj(Ma,vectorFila,vectorColumna); 2943 calcularClasificador(CC,vectorFila,vectorColumna,5); 2944 CC->resizeColumnsToContents();//Ajuste de Columnas 2945 agregarPrimeraCelda(CC); 2946 2947 tabWidget->addTab(new QWidget,"Clasificador"); 2948 int indice=ObtenerIndice("Clasificador"); 2949 QHBoxLayout * layoutCentralWidget = new QHBoxLayout; 2950 layoutCentralWidget->addWidget(CC); 2951 QWidget *widget = tabWidget->widget(indice); 2952 widget->setLayout(layoutCentralWidget);//Se añade el widget y layout a la pestaña creada 2953 actionClasificarCuentas.setDisabled(true); 2954 tabWidget->setCurrentIndex(indice); 2955 } 2956 2957 /* Funcion que calcular los Ui y Uj para los clasificadores */ 2958 void MainWindow::obtenerUiUj(QTableWidget *tw, QVector<double> &ui, QVector<double> &uj) 2959 { 2960 int contador = tw->rowCount(); 2961 double totalFila = 0; 2962 double totalColumna = 0; 2963 QVector<double> vectorFila; 2964 QVector<double> vectorColumna; 2965 for(int i=2;i<contador;i++) 2966 { 2967 double sumaFila = 0; 2968 double sumaColumna = 0; 2969 for(int j=2;j<contador;j++) 2970 { 2971 QString itemFila = Separador(tw->item(i,j),true); 2972 QString itemColumna = Separador(tw->item(j,i),true); 2973 double fila = itemFila.toDouble(); 2974 double columna = itemColumna.toDouble(); 2975 sumaFila+=fila; 2976 sumaColumna+=columna; 2977 totalFila+=fila; 2978 totalColumna+=columna; 2979 } 2980 vectorFila.append(sumaFila); 2981 vectorColumna.append(sumaColumna); 2982 } 2983 int cantidad = vectorFila.count(); 2984 for(int i=0;i<cantidad;i++) 2985 { 2986 double fila = vectorFila.at(i)/totalFila; 2987 ui.append(fila); 2988 double columna = vectorColumna.at(i)/totalColumna; 2989 uj.append(columna); 2990 } 2991 } 2992 2993 /* Funcion que hace los cálculos de los clasificadores */ 2994 void MainWindow::calcularClasificador(QTableWidget *tw, QVector<double> ui, QVector<double> uj,int init) 2995 { 2996 int count = tw->rowCount()-1; 2997 //Fuente Negrita 2998 QFont font; 2999 font.setBold(true); 3000 //Titulos Ui, Uj y Tipo de Cuenta 3001 QTableWidgetItem *uiItem = new QTableWidgetItem("Ui"); 3002 uiItem->setFlags(uiItem->flags() ^ Qt::ItemIsEditable); 3003 uiItem->setFont(font); 3004 tw->setItem(0,init,uiItem); 3005 QTableWidgetItem *ujItem = new QTableWidgetItem("Uj"); 3006 ujItem->setFlags(ujItem->flags() ^ Qt::ItemIsEditable); 3007 ujItem->setFont(font); 3008 tw->setItem(0,init+1,ujItem); 3009 QTableWidgetItem *tcItem = new QTableWidgetItem("Tipo de Cuenta"); 3010 tcItem->setFlags(tcItem->flags() ^ Qt::ItemIsEditable); 3011 tcItem->setFont(font); 3012 tw->setItem(0,init+2,tcItem); 3013 for(int i=0;i<count;i++) 3014 { 3015 QTableWidgetItem *vFila = new QTableWidgetItem(QString::number(ui.at(i),'f',precission)); 3016 vFila->setFlags(vFila->flags() ^ Qt::ItemIsEditable); 3017 QString itemFila = Separador(vFila,false); 3018 vFila->setText(itemFila); 3019 tw->setItem(i+1,init,vFila); 3020 QTableWidgetItem *vColumna = new QTableWidgetItem(QString::number(uj.at(i),'f',precission)); 3021 vColumna->setFlags(vColumna->flags() ^ Qt::ItemIsEditable); 3022 QString itemColumna = Separador(vColumna,false); 3023 vColumna->setText(itemColumna); 3024 tw->setItem(i+1,init+1,vColumna); 3025 QTableWidgetItem *tipo = new QTableWidgetItem; 3026 tipo->setFlags(tipo->flags() ^ Qt::ItemIsEditable); 3027 //Se determina que tipo de cuenta es 3028 if(ui.at(i)<1 and uj.at(i)<1) 3029 { 3030 tipo->setText("Independiente"); 3031 } 3032 else if(ui.at(i)>1 and uj.at(i)<1) 3033 { 3034 tipo->setText("Impulsor de Economía"); 3035 } 3036 else if(ui.at(i)<1 and uj.at(i)>1) 3037 { 3038 tipo->setText("Base"); 3039 } 3040 else if(ui.at(i)>1 and uj.at(i)>1) 3041 { 3042 tipo->setText("Clave"); 3043 } 3044 tw->setItem(i+1,init+2,tipo); 3045 } 3046 } 3047 3048 void MainWindow::agregarPrimeraCelda(QTableWidget *tw) 3049 { 3050 tw->insertRow(0); 3051 //Se colocan no editables la celda 0 y 1 3052 noEditColZero(tw); 3053 QTableWidgetItem *one = new QTableWidgetItem; 3054 one->setFlags(one->flags() ^ Qt::ItemIsEditable); 3055 tw->setItem(0,1,one); 3056 for(int i=0;i<3;i++) 3057 { 3058 QTableWidgetItem *cAn = new QTableWidgetItem("Clasificador por An"); 3059 cAn->setTextAlignment(Qt::AlignCenter); 3060 cAn->setFlags(cAn->flags() ^ Qt::ItemIsEditable); 3061 CellStyleExEn(cAn); 3062 tw->setItem(0,i+2,cAn); 3063 QTableWidgetItem *cMa = new QTableWidgetItem("Clasificador por Ma"); 3064 cMa->setTextAlignment(Qt::AlignCenter); 3065 cMa->setFlags(cMa->flags() ^ Qt::ItemIsEditable); 3066 CellStyleExEn(cMa); 3067 tw->setItem(0,5+i,cMa); 3068 } 3069 tw->setSpan(0,2,1,3); 3070 tw->setSpan(0,5,1,3); 3071 } 3072 2923 3073 //FH_005 2924 3074 void MainWindow::slotModeloClasico() … … 4921 5071 int index = tabWidget->currentIndex(); 4922 5072 QString tabName = tabWidget->tabText(index); 4923 if(tabName.contains("Inicio") or tabName.contains("Encadenamiento") or tabName.contains("Escenario") 5073 if(tabName.contains("Inicio") or tabName.contains("Encadenamiento") or tabName.contains("Escenario") or tabName.contains("Clasificador") 4924 5074 or tabName.contains("Resultado") or tabName.contains("Comparacion") or tabName.contains("Seleccion")) 4925 5075 { … … 5017 5167 } 5018 5168 } 5169 ItemsNoEditable(nuevaTabla,0,2,1); 5019 5170 5020 5171 titleSeleccionar(nuevaTabla); -
mainwindow.H
r32f758e r37dd9aa 204 204 void encademientosStyle(QTableWidgetItem *); 205 205 void cuentacomponentesEncadenamiento(QTableWidget *, int count); 206 void obtenerUiUj(QTableWidget *, QVector<double> &, QVector<double> &); 207 void calcularClasificador(QTableWidget *, QVector<double>, QVector<double>, int init = 2); 208 void agregarPrimeraCelda(QTableWidget *); 206 209 207 210 void calcularSubtotal(QTableWidget *,int inicio, int fin,int exogena); … … 282 285 void slotAgregarEncadenamiento(); 283 286 void slotVerEncadenamiento(); 287 void slotClasificarCuentas(); 284 288 285 289 void slotCloseExport(); -
moc_mainwindow.cpp
r32f758e r37dd9aa 2 2 ** Meta object code from reading C++ file 'mainwindow.H' 3 3 ** 4 ** Created: Fri Sep 25 11:00:2920154 ** Created: Mon Sep 28 11:46:38 2015 5 5 ** by: The Qt Meta Object Compiler version 63 (Qt 4.8.2) 6 6 ** … … 24 24 0, // classname 25 25 0, 0, // classinfo 26 5 6, 14, // methods26 57, 14, // methods 27 27 0, 0, // properties 28 28 0, 0, // enums/sets … … 55 55 475, 11, 11, 11, 0x08, 56 56 499, 11, 11, 11, 0x08, 57 5 17, 11, 11, 11, 0x08,58 5 34, 11, 11, 11, 0x08,59 55 3, 11, 11, 11, 0x08,60 5 81, 573, 11, 11, 0x08,61 605, 11, 11, 11, 0x28,62 62 5, 11, 11, 11, 0x08,63 64 6, 11, 11, 11, 0x08,64 6 68, 11, 11, 11, 0x08,65 69 0, 11, 11, 11, 0x08,66 71 3, 11, 11, 11, 0x08,67 7 41, 11, 11, 11, 0x08,68 76 3, 11, 11, 11, 0x08,69 78 6, 11, 11, 11, 0x08,70 81 3, 11, 11, 11, 0x08,71 8 48, 11, 11, 11, 0x08,72 87 9, 11, 11, 11, 0x08,73 9 18, 11, 11, 11, 0x08,74 94 3, 11, 11, 11, 0x08,75 96 2, 11, 11, 11, 0x08,57 523, 11, 11, 11, 0x08, 58 541, 11, 11, 11, 0x08, 59 558, 11, 11, 11, 0x08, 60 577, 11, 11, 11, 0x08, 61 605, 597, 11, 11, 0x08, 62 629, 11, 11, 11, 0x28, 63 649, 11, 11, 11, 0x08, 64 670, 11, 11, 11, 0x08, 65 692, 11, 11, 11, 0x08, 66 714, 11, 11, 11, 0x08, 67 737, 11, 11, 11, 0x08, 68 765, 11, 11, 11, 0x08, 69 787, 11, 11, 11, 0x08, 70 810, 11, 11, 11, 0x08, 71 837, 11, 11, 11, 0x08, 72 872, 11, 11, 11, 0x08, 73 903, 11, 11, 11, 0x08, 74 942, 11, 11, 11, 0x08, 75 967, 11, 11, 11, 0x08, 76 76 986, 11, 11, 11, 0x08, 77 1014, 11, 11, 11, 0x08, 78 1050, 11, 11, 11, 0x08, 79 1082, 11, 11, 11, 0x08, 80 1122, 11, 11, 11, 0x08, 81 1145, 11, 11, 11, 0x08, 82 1164, 11, 11, 11, 0x08, 83 1180, 11, 11, 11, 0x08, 84 1207, 11, 11, 11, 0x08, 85 1238, 11, 11, 11, 0x08, 86 1255, 11, 11, 11, 0x08, 87 1290, 11, 11, 11, 0x08, 88 1308, 11, 11, 11, 0x08, 89 1347, 11, 11, 11, 0x08, 77 1010, 11, 11, 11, 0x08, 78 1038, 11, 11, 11, 0x08, 79 1074, 11, 11, 11, 0x08, 80 1106, 11, 11, 11, 0x08, 81 1146, 11, 11, 11, 0x08, 82 1169, 11, 11, 11, 0x08, 83 1188, 11, 11, 11, 0x08, 84 1204, 11, 11, 11, 0x08, 85 1231, 11, 11, 11, 0x08, 86 1262, 11, 11, 11, 0x08, 87 1279, 11, 11, 11, 0x08, 88 1314, 11, 11, 11, 0x08, 89 1332, 11, 11, 11, 0x08, 90 1371, 11, 11, 11, 0x08, 90 91 91 92 0 // eod … … 105 106 "slotEncadenamientos()\0slotCloseEncadenamiento()\0" 106 107 "slotAgregarEncadenamiento()\0" 107 "slotVerEncadenamiento()\0slotCloseExport()\0" 108 "slotSaveExport()\0slotSearchExport()\0" 109 "slotModeloClasico()\0clasico\0" 110 "calcularEscenario(bool)\0calcularEscenario()\0" 111 "finalizarEscenario()\0slotModeloNoClasico()\0" 112 "calcularEscenarioNC()\0finalizarEscenarioNC()\0" 108 "slotVerEncadenamiento()\0slotClasificarCuentas()\0" 109 "slotCloseExport()\0slotSaveExport()\0" 110 "slotSearchExport()\0slotModeloClasico()\0" 111 "clasico\0calcularEscenario(bool)\0" 112 "calcularEscenario()\0finalizarEscenario()\0" 113 "slotModeloNoClasico()\0calcularEscenarioNC()\0" 114 "finalizarEscenarioNC()\0" 113 115 "slotCompararResultadosMNC()\0" 114 116 "slotVerResultadoMNC()\0slotPHCIncidencia100()\0" … … 160 162 case 20: _t->slotAgregarEncadenamiento(); break; 161 163 case 21: _t->slotVerEncadenamiento(); break; 162 case 22: _t->slotCloseExport(); break; 163 case 23: _t->slotSaveExport(); break; 164 case 24: _t->slotSearchExport(); break; 165 case 25: _t->slotModeloClasico(); break; 166 case 26: _t->calcularEscenario((*reinterpret_cast< bool(*)>(_a[1]))); break; 167 case 27: _t->calcularEscenario(); break; 168 case 28: _t->finalizarEscenario(); break; 169 case 29: _t->slotModeloNoClasico(); break; 170 case 30: _t->calcularEscenarioNC(); break; 171 case 31: _t->finalizarEscenarioNC(); break; 172 case 32: _t->slotCompararResultadosMNC(); break; 173 case 33: _t->slotVerResultadoMNC(); break; 174 case 34: _t->slotPHCIncidencia100(); break; 175 case 35: _t->slotPHCIncidenciaiCuenta(); break; 176 case 36: _t->slotCalcularPHCIncidenciaiCuenta(); break; 177 case 37: _t->slotPHCIncidenciaiComponente(); break; 178 case 38: _t->slotCalcularPHCIncidenciaiComponente(); break; 179 case 39: _t->slotCompararResultados(); break; 180 case 40: _t->slotVerResultado(); break; 181 case 41: _t->slotPHNCIncidencia100(); break; 182 case 42: _t->slotPHNCIncidenciaiCuenta(); break; 183 case 43: _t->slotCalcularPHNCIncidenciaiCuenta(); break; 184 case 44: _t->slotPHNCIncidenciaiComponente(); break; 185 case 45: _t->slotCalcularPHNCIncidenciaiComponente(); break; 186 case 46: _t->slotPNHIncudencia100(); break; 187 case 47: _t->slotCloseformPNH(); break; 188 case 48: _t->slotSelectPNH(); break; 189 case 49: _t->slotPNHIncidenciaiCuenta(); break; 190 case 50: _t->slotPNHIncidenciaiComponente(); break; 191 case 51: _t->slotSelectPNHi(); break; 192 case 52: _t->slotCalcularPNHIncidenciaiCuenta(); break; 193 case 53: _t->slotSelectPNHic(); break; 194 case 54: _t->slotCalcularPNHIncidenciaiComponente(); break; 195 case 55: _t->slotSeleccionarTabla(); break; 164 case 22: _t->slotClasificarCuentas(); break; 165 case 23: _t->slotCloseExport(); break; 166 case 24: _t->slotSaveExport(); break; 167 case 25: _t->slotSearchExport(); break; 168 case 26: _t->slotModeloClasico(); break; 169 case 27: _t->calcularEscenario((*reinterpret_cast< bool(*)>(_a[1]))); break; 170 case 28: _t->calcularEscenario(); break; 171 case 29: _t->finalizarEscenario(); break; 172 case 30: _t->slotModeloNoClasico(); break; 173 case 31: _t->calcularEscenarioNC(); break; 174 case 32: _t->finalizarEscenarioNC(); break; 175 case 33: _t->slotCompararResultadosMNC(); break; 176 case 34: _t->slotVerResultadoMNC(); break; 177 case 35: _t->slotPHCIncidencia100(); break; 178 case 36: _t->slotPHCIncidenciaiCuenta(); break; 179 case 37: _t->slotCalcularPHCIncidenciaiCuenta(); break; 180 case 38: _t->slotPHCIncidenciaiComponente(); break; 181 case 39: _t->slotCalcularPHCIncidenciaiComponente(); break; 182 case 40: _t->slotCompararResultados(); break; 183 case 41: _t->slotVerResultado(); break; 184 case 42: _t->slotPHNCIncidencia100(); break; 185 case 43: _t->slotPHNCIncidenciaiCuenta(); break; 186 case 44: _t->slotCalcularPHNCIncidenciaiCuenta(); break; 187 case 45: _t->slotPHNCIncidenciaiComponente(); break; 188 case 46: _t->slotCalcularPHNCIncidenciaiComponente(); break; 189 case 47: _t->slotPNHIncudencia100(); break; 190 case 48: _t->slotCloseformPNH(); break; 191 case 49: _t->slotSelectPNH(); break; 192 case 50: _t->slotPNHIncidenciaiCuenta(); break; 193 case 51: _t->slotPNHIncidenciaiComponente(); break; 194 case 52: _t->slotSelectPNHi(); break; 195 case 53: _t->slotCalcularPNHIncidenciaiCuenta(); break; 196 case 54: _t->slotSelectPNHic(); break; 197 case 55: _t->slotCalcularPNHIncidenciaiComponente(); break; 198 case 56: _t->slotSeleccionarTabla(); break; 196 199 default: ; 197 200 } … … 231 234 return _id; 232 235 if (_c == QMetaObject::InvokeMetaMethod) { 233 if (_id < 5 6)236 if (_id < 57) 234 237 qt_static_metacall(this, _c, _id, _a); 235 _id -= 5 6;238 _id -= 57; 236 239 } 237 240 return _id;
Note: See TracChangeset
for help on using the changeset viewer.