• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A generic touchscreen calibration program for X.Org


Commit MetaInfo

Revision81ecbc42a5b71648d882b83f41914fe70609008b (tree)
Zeit2012-06-19 06:35:03
AutorTias Guns <tias@ulys...>
CommiterTias Guns

Log Message

show maxdiff during testing

Ändern Zusammenfassung

Diff

--- a/src/tester.cpp
+++ b/src/tester.cpp
@@ -72,24 +72,24 @@ int main() {
7272 // test result
7373 XYinfo result = calib.emulate_driver(raw, true, screen_res, dev_res); // true=new_axis
7474
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) {
8080 printf("Old axis: "); old_axis.print();
8181 printf("Raw: "); raw.print();
8282 printf("Clicked: "); clicked.print();
8383 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);
8585 printf("\tTarget: "); target.print();
8686 printf("\tResult: "); result.print();
8787 exit(1);
8888 }
8989
90- printf(".");
90+ printf("%i", maxdiff);
9191 } // loop over raw_coords
9292
93- printf(" OK\n");
93+ printf(". OK\n");
9494 } // loop over old_axes
9595 }