LineAngle01.js 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**
  2. * Copyright (c) 2011-2013 by Andrew Mustun. All rights reserved.
  3. *
  4. * This file is part of the QCAD project.
  5. *
  6. * QCAD is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * QCAD is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with QCAD.
  18. */
  19. // Auto generated by Testing Dashboard
  20. // File : scripts/Draw/Line/LineAngle/Tests/LineAngle01.js
  21. // Timestamp : 2011-02-09 15:34:36
  22. // Description : same angle, different lengths, input mouse clicks
  23. include('scripts/Pro/Developer/TestingDashboard/TdbTest.js');
  24. function LineAngle01() {
  25. TdbTest.call(this, 'scripts/Draw/Line/LineAngle/Tests/LineAngle01.js');
  26. }
  27. LineAngle01.prototype = new TdbTest();
  28. LineAngle01.prototype.test00 = function() {
  29. qDebug('running LineAngle01.test00()...');
  30. this.setUp();
  31. this.clickOnWidget('MainWindow::MainToolsPanel::LineToolsPanelButton');
  32. this.clickOnWidget('MainWindow::LineToolsPanel::LineAngleButton');
  33. this.setToolOption('LineAngle/Angle', [ 0, 0 ] );
  34. this.setToolOption('LineAngle/Length', [ 10, 0 ] );
  35. this.setToolOption('LineAngle/ReferencePoint', 'Start');
  36. this.updateToolOptions();
  37. this.zoomTo(-28.95, -21.449999999999996, 28.950000000000003, 21.450000000000006);
  38. var p = new RVector(0, 0);
  39. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  40. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  41. this.setToolOption('LineAngle/Angle', [ 0, 0 ] );
  42. this.setToolOption('LineAngle/Length', [ 20, 0 ] );
  43. this.setToolOption('LineAngle/ReferencePoint', 'Start');
  44. this.updateToolOptions();
  45. this.zoomTo(-28.95, -21.449999999999996, 28.950000000000003, 21.450000000000006);
  46. var p = new RVector(0, 2);
  47. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  48. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  49. this.setToolOption('LineAngle/Angle', [ 0, 0 ] );
  50. this.setToolOption('LineAngle/Length', [ 30, 0 ] );
  51. this.setToolOption('LineAngle/ReferencePoint', 'Start');
  52. this.updateToolOptions();
  53. this.zoomTo(-20.73, -18.83, 48.75, 32.65);
  54. var p = new RVector(0, 10);
  55. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  56. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  57. this.setToolOption('LineAngle/Angle', [ 0, 0 ] );
  58. this.setToolOption('LineAngle/Length', [ 40, 0 ] );
  59. this.setToolOption('LineAngle/ReferencePoint', 'Start');
  60. this.updateToolOptions();
  61. this.zoomTo(-20.73, -18.83, 48.75, 32.65);
  62. var p = new RVector(0, 20);
  63. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  64. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  65. this.setToolOption('LineAngle/Angle', [ 0, 0 ] );
  66. this.setToolOption('LineAngle/Length', [ 50, 0 ] );
  67. this.setToolOption('LineAngle/ReferencePoint', 'Start');
  68. this.updateToolOptions();
  69. this.zoomTo(-26.034, -25.526000000000003, 57.34199999999999, 36.24999999999999);
  70. var p = new RVector(0, 30);
  71. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  72. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  73. this.verifyDrawing('LineAngle01_000.dxf');
  74. this.tearDown();
  75. qDebug('finished LineAngle01.test00()');
  76. };