A generic touchscreen calibration program for X.Org
Revision | 81ecbc42a5b71648d882b83f41914fe70609008b (tree) |
---|---|
Zeit | 2012-06-19 06:35:03 |
Autor | Tias Guns <tias@ulys...> |
Commiter | Tias Guns |
show maxdiff during testing
@@ -72,24 +72,24 @@ int main() { | ||
72 | 72 | // test result |
73 | 73 | XYinfo result = calib.emulate_driver(raw, true, screen_res, dev_res); // true=new_axis |
74 | 74 | |
75 | - if (abs(target.x.min - result.x.min) > slack || | |
76 | - abs(target.x.max - result.x.max) > slack || | |
77 | - abs(target.y.min - result.y.min) > slack || | |
78 | - abs(target.y.max - result.y.max) > slack) { | |
79 | - | |
75 | + int maxdiff = std::max(abs(target.x.min - result.x.min), | |
76 | + std::max(abs(target.x.max - result.x.max), | |
77 | + std::max(abs(target.y.min - result.y.min), | |
78 | + abs(target.y.max - result.y.max)))); // no n-ary max in c++?? | |
79 | + if (maxdiff > slack) { | |
80 | 80 | printf("Old axis: "); old_axis.print(); |
81 | 81 | printf("Raw: "); raw.print(); |
82 | 82 | printf("Clicked: "); clicked.print(); |
83 | 83 | printf("New axis: "); calib.new_axis_print(); |
84 | - printf("Error: difference between target and result > %i:\n", slack); | |
84 | + printf("Error: difference between target and result: %i > %i:\n", maxdiff, slack); | |
85 | 85 | printf("\tTarget: "); target.print(); |
86 | 86 | printf("\tResult: "); result.print(); |
87 | 87 | exit(1); |
88 | 88 | } |
89 | 89 | |
90 | - printf("."); | |
90 | + printf("%i", maxdiff); | |
91 | 91 | } // loop over raw_coords |
92 | 92 | |
93 | - printf(" OK\n"); | |
93 | + printf(". OK\n"); | |
94 | 94 | } // loop over old_axes |
95 | 95 | } |