62 #define PRINT_USAGE(rc) \
63 fprintf(stderr, "Usage: %s [ -s1 first_slice ] [ -s2 last_slice ] " \
64 "TRACE_SAMPLES\n", argv[0]); \
65 cpl_end(); return (rc);
67 int main(
int argc,
char **argv)
69 cpl_init(CPL_INIT_DEFAULT);
82 for (i = 1; i < argc; i++) {
83 if (strncmp(argv[i],
"-s1", 4) == 0) {
87 slice1 = atoi(argv[i]);
91 }
else if (strncmp(argv[i],
"-s2", 4) == 0) {
95 slice2 = atoi(argv[i]);
99 }
else if (strncmp(argv[i],
"-", 1) == 0) {
109 cpl_table *ts = cpl_table_load(tsname, 1, 0);
111 fprintf(stderr,
"%s: %s: %s\n", argv[0], tsname, cpl_error_get_message());
115 printf(
"MUSE TRACE_SAMPLES table \"%s\", contains %"CPL_SIZE_FORMAT
" rows\n",
116 tsname, cpl_table_get_nrow(ts));
123 case CPL_ERROR_ILLEGAL_INPUT:
124 fprintf(stderr,
"%s: \"%s\" does not seem to contain a MUSE tracing "
125 "samples table!\n", argv[0], tsname);
128 case CPL_ERROR_FILE_NOT_CREATED:
130 fprintf(stderr,
"%s: %s (temporary file for plotting)\n",
131 argv[0], cpl_error_get_message());
134 case CPL_ERROR_UNSUPPORTED_MODE:
135 fprintf(stderr,
"%s: your platform does not seem to support pipes "
136 "[popen()/pclose()]!\n", argv[0]);
139 case CPL_ERROR_ASSIGNING_STREAM:
140 fprintf(stderr,
"%s: could not open gnuplot (this tool uses it for "
141 "plotting)!\n", argv[0]);
148 cpl_table_delete(ts);
cpl_error_code muse_trace_plot_widths(cpl_table *aSamples, unsigned short aSlice1, unsigned short aSlice2)
Plotting the width from trace sample points using gnuplot.