1 | #ifndef MAINWINDOW_H |
---|
2 | #define MAINWINDOW_H |
---|
3 | |
---|
4 | #include <QtGui> |
---|
5 | #include <formloadmatrix.H> |
---|
6 | #include <formviewmatrix.H> |
---|
7 | #include <formvariablesexogenas.h> |
---|
8 | #include <sstream> |
---|
9 | #include <stackwidget.H> |
---|
10 | #include <QTabWidget> |
---|
11 | #include <stackvariablesexogenas.h> |
---|
12 | #include <QMap> |
---|
13 | #include <formexportmatrix.h> |
---|
14 | |
---|
15 | class MainWindow : public QMainWindow |
---|
16 | { |
---|
17 | Q_OBJECT |
---|
18 | |
---|
19 | QMenu menuFile; |
---|
20 | QMenu OpMatrices; |
---|
21 | QMenu menuTools; |
---|
22 | QMenu menuViews; |
---|
23 | QMenu menuHelp; |
---|
24 | QMenu EndoExo; |
---|
25 | |
---|
26 | QAction actionLoadMatrix; |
---|
27 | QAction actionExportMatrix; |
---|
28 | QAction actionQuit; |
---|
29 | |
---|
30 | QAction actionCH; |
---|
31 | QAction actionCV; |
---|
32 | QAction actionVariableExogena; |
---|
33 | QAction actionLa; |
---|
34 | QAction actionEncadenamiento; |
---|
35 | |
---|
36 | |
---|
37 | QTableWidget * tableWidget; |
---|
38 | QTabWidget * tabWidget; |
---|
39 | QMap<QString,QStringList> diccCuentasExogenas; |
---|
40 | |
---|
41 | stackVariablesExogenas *stackVE; |
---|
42 | |
---|
43 | |
---|
44 | QString csvFilePath; |
---|
45 | char csvSeparator; |
---|
46 | int numAccounts; |
---|
47 | int matrixSize; |
---|
48 | double matrix[100][100]; |
---|
49 | |
---|
50 | int opcionCuentaExogena; |
---|
51 | int opcionVentanaExogena; |
---|
52 | int opcionExportarMatriz; |
---|
53 | int opcionCTEndogena; |
---|
54 | |
---|
55 | FormLoadMatrix * formLoadMatrix; |
---|
56 | FormViewMatrix * formViewMatrix; |
---|
57 | FormVariablesExogenas * formVariablesExogenas; |
---|
58 | FormExportMatrix * formExportMatriz; |
---|
59 | |
---|
60 | |
---|
61 | void initGUI(); |
---|
62 | |
---|
63 | void createCentralWidget(); |
---|
64 | void createMatrixCentralWidget(); |
---|
65 | |
---|
66 | void createMenuBar(); |
---|
67 | void matricesMenuBar(); |
---|
68 | void populateTable(QTableWidget *); |
---|
69 | void CalcularTotales(QTableWidget *, int inicio); |
---|
70 | void loadMatrizExogena(); |
---|
71 | void clonarTabla(QTableWidget *,QTableWidget *, int cantidad); |
---|
72 | void noEditColZero(QTableWidget *); |
---|
73 | void setAccountTitle(QTableWidget *); |
---|
74 | void insertremoveRowCol(QTableWidget *, int rowcol, bool opcion); |
---|
75 | |
---|
76 | double MatrizEndogenaEndogena[200][200]; |
---|
77 | |
---|
78 | |
---|
79 | QList<QString> llenarLista(QList<QString>, QTableWidget *, int valor, int opcion); |
---|
80 | void insertRowExogena(QList<QString>, QTableWidget *, int opcion); |
---|
81 | void setEndogenaExogenaCell(QTableWidget *, int inicioExogena, int elementos,bool condicion); |
---|
82 | void CalcularAn(QTableWidget *, QTableWidget *, QTableWidget *, int count, bool endogena); |
---|
83 | QString Separador(QTableWidgetItem *,bool quitar); |
---|
84 | void ItemsNoEditable(QTableWidget *, int inicio, int fin); |
---|
85 | void CellStyle(QTableWidgetItem *); |
---|
86 | void EndogenaAn(); |
---|
87 | |
---|
88 | void crearMatrizEndogena(QTableWidget *); |
---|
89 | void crearMatrizIdentidad(QTableWidget *,double identidad[200][200]); |
---|
90 | void restarIdentidadAn(QTableWidget *tw,double identidad[200][200],double resta[200][200]); |
---|
91 | |
---|
92 | bool ComprobarCuentas(); |
---|
93 | int ObtenerIndice(QString ); |
---|
94 | |
---|
95 | QStringList ObtenerNombreCuenta(int contador); |
---|
96 | QList<int> ObtenerLimitesCuenta(int contador,int opccion); |
---|
97 | QStringList ObtenerComponentes(QTableWidget *); |
---|
98 | void CrearTablaVacia(int contador,QTableWidget *); |
---|
99 | |
---|
100 | protected: |
---|
101 | void closeEvent(QCloseEvent *); |
---|
102 | |
---|
103 | private slots: |
---|
104 | void slotLoadMatrix(); |
---|
105 | void slotExportMatrix(); |
---|
106 | void slotFormLoadMatrixAccepted(const QString &, int, char); |
---|
107 | void slotFormLoadMatrixClosed(); |
---|
108 | |
---|
109 | void AgregarCuenta(); |
---|
110 | void RestaurarCeldas(); |
---|
111 | void FinalizarCuentas(); |
---|
112 | void ModificarCuenta(); |
---|
113 | void slotCoeficienteHorizontal(); |
---|
114 | void slotCoeficienteVertical(); |
---|
115 | |
---|
116 | void slotVariableExogena(); |
---|
117 | void slotCloseExogena(); |
---|
118 | void slotAgregarExogena(); |
---|
119 | void slotFinalizarExogena(); |
---|
120 | void slotDeshacerExogena(); |
---|
121 | void slotLa(); |
---|
122 | |
---|
123 | void slotCloseExport(); |
---|
124 | void slotSaveExport(); |
---|
125 | void slotSearchExport(); |
---|
126 | |
---|
127 | public: |
---|
128 | MainWindow(); |
---|
129 | std::vector<std::string> csv_read_row(std::string , char); |
---|
130 | std::vector<std::string> csv_read_row(std::istream &, char); |
---|
131 | QString numberFormat(double &); |
---|
132 | |
---|
133 | int contarElementosMap(); |
---|
134 | int retornarIndiceCuenta(QString nombre_cuenta); |
---|
135 | }; |
---|
136 | |
---|
137 | #endif // MAINWINDOW_H |
---|