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