Mejorar la función de monitorHilo y eliminar comentario
Se pasa ahora puntero del objeto de CpuMon y se cambia lo ubicación de la función Signed-off-by: somebody_master <somebody_master@somebodyserver.mooo.com>
This commit is contained in:
parent
a3b6ea0cab
commit
c234419a0b
10
src/main.cpp
10
src/main.cpp
@ -45,8 +45,7 @@ void showMenu(vector<string> *menu_elems, const uint8_t *num_menu,
|
|||||||
vector<string> *mensaje, Config *config);
|
vector<string> *mensaje, Config *config);
|
||||||
void showMenu(vector<string> *menu_elems, const uint8_t *num_menu,
|
void showMenu(vector<string> *menu_elems, const uint8_t *num_menu,
|
||||||
Config *config);
|
Config *config);
|
||||||
|
void monitorHilo(CpuMon *monitor);
|
||||||
void monitorHilo(CpuMon monitor) { monitor.iniciarCPU_MON(); }
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
txt::inicializarIdioma(setlocale(LC_ALL, ""));
|
txt::inicializarIdioma(setlocale(LC_ALL, ""));
|
||||||
@ -83,16 +82,13 @@ void userInterface(const uint8_t *num_menu, vector<string> *mensaje,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MENU_INICIAR_STRESS: {
|
case MENU_INICIAR_STRESS: {
|
||||||
/*TODO
|
|
||||||
*Lleva al menú principal
|
|
||||||
*/
|
|
||||||
CpuMon monitor =
|
CpuMon monitor =
|
||||||
CpuMon(std::thread::hardware_concurrency(),
|
CpuMon(std::thread::hardware_concurrency(),
|
||||||
newwin(ui::g_maxLines - (TITULO_PRINCIPAL.size() + 4),
|
newwin(ui::g_maxLines - (TITULO_PRINCIPAL.size() + 4),
|
||||||
ui::g_maxCols / 2 - 1, TITULO_PRINCIPAL.size() + 4,
|
ui::g_maxCols / 2 - 1, TITULO_PRINCIPAL.size() + 4,
|
||||||
ui::g_maxCols - ui::g_maxCols / 2 - 1));
|
ui::g_maxCols - ui::g_maxCols / 2 - 1));
|
||||||
|
|
||||||
std::thread monHilo(monitorHilo, monitor);
|
std::thread monHilo(monitorHilo, &monitor);
|
||||||
sleep(10);
|
sleep(10);
|
||||||
|
|
||||||
monitor.setEnfuncionamiento(false);
|
monitor.setEnfuncionamiento(false);
|
||||||
@ -297,3 +293,5 @@ void showMenu(vector<string> *menu_elems, const uint8_t *num_menu,
|
|||||||
attroff(COLOR_PAIR(MENU_PRINCIPAL));
|
attroff(COLOR_PAIR(MENU_PRINCIPAL));
|
||||||
userInterface(&highlight, config);
|
userInterface(&highlight, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void monitorHilo(CpuMon *monitor) { monitor->iniciarCPU_MON(); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user