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 | |
---|
12 | #include <sstream> |
---|
13 | #include <stackwidget.H> |
---|
14 | #include <stackvariablesexogenas.h> |
---|
15 | #include <stackencadenamientos.h> |
---|
16 | |
---|
17 | #include <QTabWidget> |
---|
18 | |
---|
19 | #include <QMap> |
---|
20 | #include <QVector> |
---|
21 | |
---|
22 | |
---|
23 | class MainWindow : public QMainWindow |
---|
24 | { |
---|
25 | Q_OBJECT |
---|
26 | |
---|
27 | QMenu menuFile; |
---|
28 | QMenu OpMatrices; |
---|
29 | QMenu menuTools; |
---|
30 | QMenu menuViews; |
---|
31 | QMenu menuHelp; |
---|
32 | QMenu EndoExo; |
---|
33 | |
---|
34 | QAction actionLoadMatrix; |
---|
35 | QAction actionExportMatrix; |
---|
36 | QAction actionQuit; |
---|
37 | |
---|
38 | QAction actionCH; |
---|
39 | QAction actionCV; |
---|
40 | QAction actionVariableExogena; |
---|
41 | QAction actionLa; |
---|
42 | QAction actionEncadenamiento; |
---|
43 | |
---|
44 | |
---|
45 | QTableWidget * tableWidget; |
---|
46 | QTabWidget * tabWidget; |
---|
47 | QMap<QString,QStringList> diccCuentasExogenas; |
---|
48 | QMap<int,QVector<QString> > diccCuentasEndogenas; |
---|
49 | QMap<int,QVector<QString> > espacioCuentasExogenas; |
---|
50 | QMap<QString,QStringList> diccCuentasComponentes; |
---|
51 | QMap<QString,QStringList> diccCuentasEncadenamientos; |
---|
52 | |
---|
53 | stackVariablesExogenas *stackVE; |
---|
54 | stackEncadenamientos *stackEncadenamiento; |
---|
55 | |
---|
56 | |
---|
57 | QString csvFilePath; |
---|
58 | char csvSeparator; |
---|
59 | int numAccounts; |
---|
60 | int matrixSize; |
---|
61 | double matrix[100][100]; |
---|
62 | |
---|
63 | double MatrizEndogenaEndogena[200][200]; |
---|
64 | |
---|
65 | int opcionCuentaExogena; |
---|
66 | int opcionVentanaExogena; |
---|
67 | int opcionExportarMatriz; |
---|
68 | int opcionCTEndogena; |
---|
69 | int opcionEncadenamientos; |
---|
70 | int opcionCuentaEncadenamientos; |
---|
71 | |
---|
72 | int cantidadEncadenamientos; |
---|
73 | |
---|
74 | FormLoadMatrix * formLoadMatrix; |
---|
75 | FormViewMatrix * formViewMatrix; |
---|
76 | FormVariablesExogenas * formVariablesExogenas; |
---|
77 | FormExportMatrix * formExportMatriz; |
---|
78 | FormEncadenamientos * formEncadenamientos; |
---|
79 | |
---|
80 | |
---|
81 | void initGUI(); |
---|
82 | |
---|
83 | void createCentralWidget(); |
---|
84 | void createMatrixCentralWidget(); |
---|
85 | |
---|
86 | void createMenuBar(); |
---|
87 | void matricesMenuBar(); |
---|
88 | void populateTable(QTableWidget *); |
---|
89 | void CalcularTotales(QTableWidget *, int inicio); |
---|
90 | void loadMatrizExogena(); |
---|
91 | void clonarTabla(QTableWidget *,QTableWidget *, int cantidad); |
---|
92 | void noEditColZero(QTableWidget *); |
---|
93 | void setAccountTitle(QTableWidget *); |
---|
94 | void insertremoveRowCol(QTableWidget *, int rowcol, bool opcion); |
---|
95 | void crearDiccionario(QTableWidget *, bool endogena=true); |
---|
96 | QStringList obtenerCuentasEndogenas(QTableWidget *,QStringList); |
---|
97 | QStringList obtenerCuentasExogenas(QTableWidget *,QStringList ); |
---|
98 | void spanEndogenaCell(QTableWidget *, int inicio, int celda, bool endex=true); |
---|
99 | void spanExogenaCell(QTableWidget *,int celda); |
---|
100 | |
---|
101 | QList<QString> llenarLista(QList<QString>, QTableWidget *, int valor, int opcion); |
---|
102 | void insertRowExogena(QList<QString>, QTableWidget *, int opcion); |
---|
103 | void setEndogenaExogenaCell(QTableWidget *, int inicioExogena, int elementos,bool condicion); |
---|
104 | void CalcularAn(QTableWidget *, QTableWidget *, QTableWidget *, int count, bool endogena); |
---|
105 | QString Separador(QTableWidgetItem *,bool quitar); |
---|
106 | void ItemsNoEditable(QTableWidget *, int inicio, int fin, int col=0); |
---|
107 | void CellStyle(QTableWidgetItem *); |
---|
108 | void EndogenaAn(); |
---|
109 | |
---|
110 | void obtenerCuentaComponentes(); |
---|
111 | void crearTablaVaciaEncadenamiento(int contador, QTableWidget *); |
---|
112 | void crearMatrizEncadenamiento(QTableWidget *, QTableWidget *); |
---|
113 | void crearMatrizEncadenamientoEndogena(QTableWidget *, QTableWidget *); |
---|
114 | void calcularTotalesEncadenamientos(QTableWidget *); |
---|
115 | void encademientosStyle(QTableWidgetItem *); |
---|
116 | |
---|
117 | void crearMatrizEndogena(QTableWidget *); |
---|
118 | void restarIdentidadAn(QTableWidget *); |
---|
119 | void titleEndogena(QTableWidget *); |
---|
120 | |
---|
121 | bool ComprobarCuentas(); |
---|
122 | int ObtenerIndice(QString ); |
---|
123 | |
---|
124 | QStringList ObtenerNombreCuenta(int contador); |
---|
125 | QList<int> ObtenerLimitesCuenta(int contador,int opccion); |
---|
126 | QStringList ObtenerComponentes(QTableWidget *); |
---|
127 | void CrearTablaVacia(int contador,QTableWidget *); |
---|
128 | |
---|
129 | protected: |
---|
130 | void closeEvent(QCloseEvent *); |
---|
131 | |
---|
132 | private slots: |
---|
133 | void slotLoadMatrix(); |
---|
134 | void slotExportMatrix(); |
---|
135 | void slotFormLoadMatrixAccepted(const QString &, int, char); |
---|
136 | void slotFormLoadMatrixClosed(); |
---|
137 | |
---|
138 | void AgregarCuenta(); |
---|
139 | void RestaurarCeldas(); |
---|
140 | void FinalizarCuentas(); |
---|
141 | void ModificarCuenta(); |
---|
142 | void slotCoeficienteHorizontal(); |
---|
143 | void slotCoeficienteVertical(); |
---|
144 | |
---|
145 | void slotVariableExogena(); |
---|
146 | void slotCloseExogena(); |
---|
147 | void slotAgregarExogena(); |
---|
148 | void slotFinalizarExogena(); |
---|
149 | void slotDeshacerExogena(); |
---|
150 | void slotLa(); |
---|
151 | |
---|
152 | void slotEncadenamientos(); |
---|
153 | void slotCloseEncadenamiento(); |
---|
154 | void slotAgregarEncadenamiento(); |
---|
155 | void slotVerEncadenamiento(); |
---|
156 | |
---|
157 | void slotCloseExport(); |
---|
158 | void slotSaveExport(); |
---|
159 | void slotSearchExport(); |
---|
160 | |
---|
161 | public: |
---|
162 | MainWindow(); |
---|
163 | std::vector<std::string> csv_read_row(std::string , char); |
---|
164 | std::vector<std::string> csv_read_row(std::istream &, char); |
---|
165 | QString numberFormat(double &); |
---|
166 | |
---|
167 | int contarElementosMap(QMap<QString, QStringList> diccionario); |
---|
168 | int retornarIndiceCuenta(QString nombre_cuenta); |
---|
169 | }; |
---|
170 | |
---|
171 | #endif // MAINWINDOW_H |
---|