| 131 | } |
| 132 | |
| 133 | int main(int argc, char **argv) |
| 134 | { |
| 135 | string in_string, var_name, input_arg, supplied_title=""; |
| 136 | string outfile=""; |
| 137 | string_array plotspecfiles; |
| 138 | string_array files; |
| 139 | int ctr=1, next_comma=0, len=0, start=0, file_ctr=0; |
| 140 | ifstream infile2; |
| 141 | char num[8]; |
| 142 | bool comprehensive=false; |
| 143 | bool pdf=false; |
| 144 | bool png=false; |
| 145 | bool nokey=false; |
| 146 | bool plotspecs=false; |
| 147 | string set_thickness=""; |
| 148 | int font_sz_delta=0; |
| 149 | |
| 150 | string font = "Helvetica,"; |
| 151 | |
| 152 | unsigned int DEFAULT_FONT_SZ = 12; |
| 153 | unsigned int TITLE_FONT_SZ = 14; |
| 154 | unsigned int LABEL_FONT_SZ = 12; |
| 155 | unsigned int AXIS_FONT_SZ = 12; |
| 156 | unsigned int TIMESTAMP_FONT_SZ = 10; |
| 157 | unsigned int TICS_FONT_SZ = 10; |
| 158 | |
| 159 | string start_time="", end_time=""; |
| 160 | |
| 161 | if (argc == 1 || string(argv[1]) == "--help") { |
| 162 | cout << endl << "Usage: " << endl << endl; |
| 163 | cout << " prep_plot <datafile.csv> [--plot=<plot_directives.xml>] [--comp[rehensive]]" |
| 164 | << " [--out=<output file name>]" |
| 165 | << " [--start=<time>] [--end=<time>] [--title=<title>] [--pdf | --png]" |
| 166 | << " [--thick | --thicker | --thickest] [--smallest | --small | --large | --largest]" |
| 167 | << endl << endl; |
| 168 | cout << "If only the input data file name is given, all of the parameters available in that plot file" << endl; |
| 169 | cout << "are given." << endl << endl; |
| 170 | exit(-1); |
| 171 | } |
| 172 | |
| 173 | string filename(argv[1]), new_filename, Title; |
| 174 | |
| 175 | if (filename.find("#") != string::npos) { // if plotting multiple files |
| 176 | multiplot = true; |
| 177 | nokey = true; |
| 178 | while (1) { |
| 179 | new_filename=filename; |
| 180 | snprintf(num,sizeof(num),"%d",file_ctr); |
| 181 | new_filename.replace(new_filename.find("#"),1,num); |
| 182 | infile2.open(new_filename.c_str()); |
| 183 | if (!infile2.is_open()) { |
| 184 | break; |
| 185 | } else { |
| 186 | getline(infile2, in_string, '\n'); |
| 187 | NamesArray.push_back(split(in_string, ',')); |
| 188 | infile2.close(); |
| 189 | files.push_back(new_filename); |
| 190 | file_ctr++; |
nothing calls this directly
no test coverage detected