Skip to content
Snippets Groups Projects
Commit 9e7fdd9d authored by Danny Auble's avatar Danny Auble
Browse files

fixed idents on ci

parent 64f74101
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,7 @@ void get_command(void) ...@@ -53,7 +53,7 @@ void get_command(void)
error_code = slurm_load_node((time_t) NULL, &node_info_ptr, 0); error_code = slurm_load_node((time_t) NULL, &node_info_ptr, 0);
if (error_code) if (error_code)
if (quiet_flag != 1) { if (quiet_flag != 1) {
clear_window(text_win); wclear(text_win);
ycord = text_win->_maxy / 2; ycord = text_win->_maxy / 2;
mvwprintw(text_win, ycord, 1, "slurm_load_node"); mvwprintw(text_win, ycord, 1, "slurm_load_node");
return; return;
...@@ -68,7 +68,7 @@ void get_command(void) ...@@ -68,7 +68,7 @@ void get_command(void)
box(grid_win, 0, 0); box(grid_win, 0, 0);
wrefresh(text_win); wrefresh(text_win);
wrefresh(grid_win); wrefresh(grid_win);
clear_window(command_win); wclear(command_win);
box(command_win, 0, 0); box(command_win, 0, 0);
mvwprintw(command_win, 0, 3, mvwprintw(command_win, 0, 3,
"Input Command: (type quit to change view, exit to exit)"); "Input Command: (type quit to change view, exit to exit)");
...@@ -98,7 +98,7 @@ void get_command(void) ...@@ -98,7 +98,7 @@ void get_command(void)
params.display = 0; params.display = 0;
noecho(); noecho();
init_grid(node_info_ptr); init_grid(node_info_ptr);
clear_window(text_win); wclear(text_win);
xcord = 1; xcord = 1;
ycord = 1; ycord = 1;
print_date(); print_date();
......
...@@ -27,15 +27,6 @@ ...@@ -27,15 +27,6 @@
#include "src/smap/smap.h" #include "src/smap/smap.h"
void clear_window(WINDOW * win)
{
int x, y;
for (x = 1; x < win->_maxx; x++)
for (y = 1; y < win->_maxy; y++)
mvwaddch(win, y, x, ' ');
return;
}
/* _init_grid - set values of every grid point */ /* _init_grid - set values of every grid point */
void init_grid(node_info_msg_t * node_info_ptr) void init_grid(node_info_msg_t * node_info_ptr)
{ {
......
...@@ -53,7 +53,7 @@ void get_job() ...@@ -53,7 +53,7 @@ void get_job()
if (error_code) if (error_code)
if (quiet_flag != 1) { if (quiet_flag != 1) {
clear_window(text_win); wclear(text_win);
ycord = text_win->_maxy / 2; ycord = text_win->_maxy / 2;
xcord = text_win->_maxx; xcord = text_win->_maxx;
mvwprintw(text_win, ycord, 1, "slurm_load_job"); mvwprintw(text_win, ycord, 1, "slurm_load_job");
......
...@@ -53,7 +53,7 @@ void get_part(void) ...@@ -53,7 +53,7 @@ void get_part(void)
slurm_load_partitions((time_t) NULL, &new_part_ptr, 0); slurm_load_partitions((time_t) NULL, &new_part_ptr, 0);
if (error_code) { if (error_code) {
if (quiet_flag != 1) { if (quiet_flag != 1) {
clear_window(text_win); wclear(text_win);
ycord = text_win->_maxy / 2; ycord = text_win->_maxy / 2;
xcord = text_win->_maxx; xcord = text_win->_maxx;
mvwprintw(text_win, ycord, 1, mvwprintw(text_win, ycord, 1,
...@@ -191,24 +191,25 @@ int print_text_part(partition_info_t * part_ptr) ...@@ -191,24 +191,25 @@ int print_text_part(partition_info_t * part_ptr)
prefixlen = i; prefixlen = i;
while (nodes[i] != '\0') { while (nodes[i] != '\0') {
width = text_win->_maxx - xcord; width = text_win->_maxx - xcord;
if (!prefixlen && nodes[i] == '[' && nodes[i - 1] == ',') if (!prefixlen && nodes[i] == '[' && nodes[i - 1] == ',')
prefixlen = i + 1; prefixlen = i + 1;
if (nodes[i-1] == ',' && (width - 10) <= 0) { if (nodes[i - 1] == ',' && (width - 12) <= 0) {
ycord++; ycord++;
xcord = tempxcord + prefixlen; xcord = tempxcord + prefixlen;
} else if(xcord>text_win->_maxx) { } else if (xcord > text_win->_maxx) {
ycord++; ycord++;
xcord = tempxcord + prefixlen; xcord = tempxcord + prefixlen;
} }
if ((printed = mvwaddch(text_win, ycord, xcord, nodes[i])) < 0) if ((printed =
return printed; mvwaddch(text_win, ycord, xcord, nodes[i])) < 0)
return printed;
xcord++; xcord++;
i++; i++;
} }
xcord = 1; xcord = 1;
......
...@@ -72,6 +72,7 @@ int main(int argc, char *argv[]) ...@@ -72,6 +72,7 @@ int main(int argc, char *argv[])
} else { } else {
for (i = 0; i < node_info_ptr->record_count; i++) { for (i = 0; i < node_info_ptr->record_count; i++) {
node_ptr = &node_info_ptr->node_array[i]; node_ptr = &node_info_ptr->node_array[i];
node_ptr->node_state = NODE_STATE_DRAINED;
start = atoi(node_ptr->name + 3); start = atoi(node_ptr->name + 3);
temp = start / 100; temp = start / 100;
if (X < temp) if (X < temp)
...@@ -104,12 +105,12 @@ int main(int argc, char *argv[]) ...@@ -104,12 +105,12 @@ int main(int argc, char *argv[])
} }
signal(SIGWINCH, _resize_handler); signal(SIGWINCH, _resize_handler);
#else #else
printf("This will only run on a BGL system right now.\n"); printf("This will only run on a BGL system right now.\n");
exit(0); exit(0);
#endif #endif
initscr(); initscr();
if (COLS < (75 + width) || LINES < height) { if (COLS < (75 + width) || LINES < height) {
endwin(); endwin();
printf printf
...@@ -129,7 +130,7 @@ int main(int argc, char *argv[]) ...@@ -129,7 +130,7 @@ int main(int argc, char *argv[])
box(grid_win, 0, 0); box(grid_win, 0, 0);
startx = width; startx = width;
COLS -= 2; COLS -= 2;
width = COLS - width; width = COLS - width;
height = LINES; height = LINES;
text_win = newwin(height, width, starty, startx); text_win = newwin(height, width, starty, startx);
...@@ -139,12 +140,12 @@ int main(int argc, char *argv[]) ...@@ -139,12 +140,12 @@ int main(int argc, char *argv[])
while (!end) { while (!end) {
_get_option(); _get_option();
redraw: redraw:
init_grid(node_info_ptr); init_grid(node_info_ptr);
wclear(text_win); wclear(text_win);
//wclear(grid_win); //wclear(grid_win);
xcord = 1; xcord = 1;
ycord = 1; ycord = 1;
...@@ -169,14 +170,14 @@ int main(int argc, char *argv[]) ...@@ -169,14 +170,14 @@ int main(int argc, char *argv[])
if (params.iterate) { if (params.iterate) {
for (i = 0; i < params.iterate; i++) { for (i = 0; i < params.iterate; i++) {
sleep(1); sleep(1);
if (_get_option()) if (_get_option())
goto redraw; goto redraw;
else if (resize_screen) { else if (resize_screen) {
resize_screen=0; resize_screen = 0;
goto redraw; goto redraw;
} }
} }
} else } else
break; break;
...@@ -206,8 +207,8 @@ void print_date(void) ...@@ -206,8 +207,8 @@ void print_date(void)
int _get_option(void) int _get_option(void)
{ {
char ch; char ch;
ch = getch(); ch = getch();
switch (ch) { switch (ch) {
case 'b': case 'b':
params.display = BGLPART; params.display = BGLPART;
...@@ -236,38 +237,38 @@ int _get_option(void) ...@@ -236,38 +237,38 @@ int _get_option(void)
void *_resize_handler(int sig) void *_resize_handler(int sig)
{ {
int height = Y * Z + Y * 2; int height = Y * Z + Y * 2;
int width = X * 2; int width = X * 2;
int startx = 0; int startx = 0;
int starty = 0; int starty = 0;
ycord=1; ycord = 1;
wclear(grid_win); wclear(grid_win);
wclear(text_win); wclear(text_win);
endwin(); endwin();
initscr(); initscr();
getmaxyx(stdscr,LINES,COLS); getmaxyx(stdscr, LINES, COLS);
wresize(grid_win,height,width); wresize(grid_win, height, width);
width = COLS - width; width = COLS - width;
wresize(text_win,LINES,width); wresize(text_win, LINES, width);
print_date(); print_date();
switch (params.display) { switch (params.display) {
case JOBS: case JOBS:
get_job(); get_job();
break; break;
case COMMANDS: case COMMANDS:
get_command(); get_command();
break; break;
default: default:
get_part(); get_part();
break; break;
} }
print_grid(); print_grid();
box(text_win, 0, 0); box(text_win, 0, 0);
box(grid_win, 0, 0); box(grid_win, 0, 0);
wrefresh(text_win); wrefresh(text_win);
wrefresh(grid_win); wrefresh(grid_win);
resize_screen=1; resize_screen = 1;
return NULL; return NULL;
} }
...@@ -106,8 +106,6 @@ time_t now; ...@@ -106,8 +106,6 @@ time_t now;
axis ***grid; axis ***grid;
axis *fill_in_value; axis *fill_in_value;
void clear_window(WINDOW * win);
void init_grid(node_info_msg_t * node_info_ptr); void init_grid(node_info_msg_t * node_info_ptr);
int set_grid(int start, int end, int count); int set_grid(int start, int end, int count);
int set_grid_bgl(int startx, int starty, int startz, int endx, int endy, int set_grid_bgl(int startx, int starty, int startz, int endx, int endy,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment