/* Function to dump all available screens in a file */ void print_screens(void) { int oldScreen = currentScreenToDisplay; int oldRepartition = currentRepartitionToDisplay; currentScreenToDisplay = DISPLAY_SCENARIO_SCREEN; print_header_line( screenf); print_stats_in_file( screenf); print_bottom_line( screenf, NOTLAST); currentScreenToDisplay = DISPLAY_STAT_SCREEN; print_header_line( screenf); display_scenario->stats->displayStat(screenf); print_bottom_line( screenf, NOTLAST); currentScreenToDisplay = DISPLAY_REPARTITION_SCREEN; print_header_line( screenf); display_scenario->stats->displayRepartition(screenf); print_bottom_line( screenf, NOTLAST); currentScreenToDisplay = DISPLAY_SECONDARY_REPARTITION_SCREEN; for (currentRepartitionToDisplay = 2; currentRepartitionToDisplay <= display_scenario->stats->nRtds(); currentRepartitionToDisplay++) { print_header_line( screenf); display_scenario->stats->displayRtdRepartition(screenf, currentRepartitionToDisplay); print_bottom_line( screenf, NOTLAST); } currentScreenToDisplay = oldScreen; currentRepartitionToDisplay = oldRepartition; }
template <typename T, typename X> void core_solver_pretty_printer<T, X>::print() { for (unsigned i = 0; i < nrows(); i++) { print_row(i); } print_bottom_line(); print_cost(); print_x(); print_basis_heading(); print_lows(); print_upps(); print_exact_norms(); print_approx_norms(); m_out << std::endl; }
void print_statistics(int last) { static int first = 1; extern int command_mode; extern char *command_buffer; if(backgroundMode == false && display_scenario) { if(!last) { screen_clear(); } if(first) { first = 0; printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); } if (command_mode) { printf(SIPP_ENDL); } print_header_line(stdout); switch(currentScreenToDisplay) { case DISPLAY_STAT_SCREEN : display_scenario->stats->displayStat(stdout); break; case DISPLAY_REPARTITION_SCREEN : display_scenario->stats->displayRepartition(stdout); break; case DISPLAY_VARIABLE_SCREEN : print_variable_list(); break; case DISPLAY_TDM_MAP_SCREEN : print_tdm_map(); break; case DISPLAY_SECONDARY_REPARTITION_SCREEN : display_scenario->stats->displayRtdRepartition(stdout, currentRepartitionToDisplay); break; case DISPLAY_SCENARIO_SCREEN : default: print_stats_in_file(stdout); break; } print_bottom_line(stdout,last); if (!last && screen_last_error[0]) { char *errstart = screen_last_error; int colonsleft = 3;/* We want to skip the time. */ while (*errstart && colonsleft) { if (*errstart == ':') { colonsleft--; } errstart++; } while (isspace(*errstart)) { errstart++; } if (strlen(errstart) > 60) { printf("Last Error: %.60s..." SIPP_ENDL, errstart); } else { printf("Last Error: %s" SIPP_ENDL, errstart); } sipp_usleep(100); fflush(stdout); } if (command_mode) { printf("Command: %s", command_buffer ? command_buffer : ""); fflush(stdout); } if(last) { fprintf(stdout,"\n"); } } }