mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-25 06:58:39 +00:00
Merge remote-tracking branch 'origin/bug2842'
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
NATCERTN.FILE_ID SAILNUMB NAME TYPE BUILDER DESIGNER YEAR CLUB OWNER ADRS1 ADRS2 C_Type D CREW DD_MM_yyYY HH:MM:SS LOA IMSL DRAFT BMAX DSPL INDEX DA GPH TMF ILCGA PLT-O PLD-O WL6 WL8 WL10 WL12 WL14 WL16 WL20 OL6 OL8 OL10 OL12 OL14 OL16 OL20 CR6 CR8 CR10 CR12 CR14 CR16 CR20 NSP6 NSP8 NSP10 NSP12 NSP14 NSP16 NSP20 OC6 OC8 OC10 OC12 OC14 OC16 OC20 UA6 UA8 UA10 UA12 UA14 UA16 UA20 DA6 DA8 DA10 DA12 DA14 DA16 DA20 UP6 UP8 UP10 UP12 UP14 UP16 UP20 R526 R528 R5210 R5212 R5214 R5216 R5220 R606 R608 R6010 R6012 R6014 R6016 R6020 R756 R758 R7510 R7512 R7514 R7516 R7520 R906 R908 R9010 R9012 R9014 R9016 R9020 R1106 R1108 R11010 R11012 R11014 R11016 R11020 R1206 R1208 R12010 R12012 R12014 R12016 R12020 R1356 R1358 R13510 R13512 R13514 R13516 R13520 R1506 R1508 R15010 R15012 R15014 R15016 R15020 D6 D8 D10 D12 D14 D16 D20 OTNLOW OTNMED OTNHIG ITNLOW ITNMED ITNHIG DH_TOD DH_TOT PLT-I PLD-I TMF-OF PLT2H PLD2H OSN ReferenceNo CDL DSPS WSS MAIN GENOA SYM ASYM OTDLOW OTDMED OTDHIG ITDLOW ITDMED ITDHIG NS_TOD NS_TOT GNSTOD GNSTOT GDHTOD GDHTOT
|
||||
AUT Amoca CRO 1963 Amo Ca Bavaria CR 41 Bavaria Farr 2010 CLUB C 900 11 10 2019 10:56:30 11.977 10.882 2.250 3.94 8565. 121.7 0.29 613.9 1.0161 664.3 0.000 0.0 1033.5 835.0 719.4 641.4 595.0 568.6 546.4 989.1 801.5 694.7 628.8 590.7 570.0 549.1 858.4 688.1 595.0 539.7 505.4 483.2 457.4 922.5 733.4 628.6 565.6 526.0 500.5 470.6 1028.6 782.0 644.1 557.3 512.1 482.1 435.9 43.4 41.6 41.3 40.4 39.0 39.1 39.2 144.5 149.2 151.6 154.8 168.5 180.0 180.0 1082.4 890.5 779.7 705.7 668.9 657.2 655.8 701.0 589.0 521.9 487.0 471.0 464.5 461.5 660.3 558.4 501.4 474.5 459.9 451.7 447.2 632.2 535.1 487.3 464.9 449.9 437.6 423.5 621.1 516.3 469.9 447.6 433.5 425.8 407.0 624.9 514.4 467.7 443.8 423.3 403.6 378.7 646.6 530.2 474.6 448.7 427.6 407.1 370.3 718.6 584.1 504.4 466.5 444.3 423.7 384.6 852.7 675.1 571.1 504.9 468.0 446.6 408.2 984.6 779.5 659.1 577.1 521.0 480.1 437.0 0.9390 1.2493 1.4280 0.7225 1.0046 1.1908 600.8 0.9986 0.000 0.0 1.0090 0.000 0.0 594.6 AUT00002712 9.918 9612 35.4 51.3 33.1 103.4 88.7 718.8 540.3 472.7 934.3 671.9 566.8 626.8 0.9572 649.5 0.9238 619.6 0.9683
|
||||
AUT066/19CRO1957(CRO1957A Polly One Sun Odyssey 509 Jeanneau P. Brriand 2013 CROATIA CLUB C 730 12 10 2019 13:51:01 14.990 14.170 2.285 4.69 15217. 106.8 0.33 585.3 1.0423 647.6 0.000 0.0 1034.9 818.0 694.3 624.4 582.3 552.4 522.8 982.8 780.7 670.1 609.0 574.1 550.6 528.0 829.3 659.3 566.3 511.4 477.5 455.6 429.2 956.3 747.9 630.1 557.8 511.6 481.5 447.2 1030.5 762.6 615.3 530.7 485.8 452.2 404.3 47.0 45.5 44.4 43.8 43.0 42.2 42.6 142.9 146.3 145.8 151.3 155.3 167.0 180.0 1078.8 866.3 751.5 696.8 668.8 648.7 641.9 678.5 552.2 484.2 454.2 440.7 433.6 428.7 618.5 511.7 453.5 430.3 420.7 415.7 411.4 567.3 476.6 431.1 412.0 402.9 398.0 391.2 564.0 476.9 431.8 410.6 397.2 386.4 371.9 612.7 496.0 433.5 406.0 389.2 374.4 349.7 630.6 509.6 441.9 410.0 390.7 372.6 340.5 709.1 562.0 477.9 429.2 404.5 386.2 349.0 858.2 666.6 551.8 478.5 433.1 408.4 373.7 991.0 769.7 637.1 552.0 495.7 456.0 403.8 0.9681 1.3200 1.5148 0.7286 1.0332 1.2300 574.0 1.0452 0.000 0.0 1.0543 0.000 0.0 569.1 AUT00002714 11.678 16794 54.0 59.7 53.4 0.0 177.6 697.2 511.4 445.6 926.4 653.3 548.8 628.1 0.9553 652.9 0.9190 590.1 1.0167
|
||||
AUT028/19desideraAUT 7167 Desidera First 47.7 Benetau Farr 1999 AUSTRIA CLUB C 1100 01 06 2019 17:20:54 14.506 12.893 2.811 4.51 12375. 117.8 0.22 564.8 1.1037 611.6 0.000 0.0 945.9 763.3 657.1 590.0 552.7 527.8 500.4 901.7 729.0 632.2 576.0 545.0 525.7 500.7 787.6 631.9 547.4 497.6 466.8 446.5 421.4 850.7 676.6 580.6 523.0 486.8 463.0 433.4 942.9 716.1 589.6 513.1 475.2 446.7 403.0 43.0 41.1 40.4 39.4 38.3 37.7 37.6 143.1 147.3 150.0 153.2 160.1 180.0 180.0 975.0 799.6 699.1 640.8 615.9 604.7 593.2 636.4 533.3 474.3 447.5 435.8 431.0 427.3 600.4 507.5 458.4 436.4 425.1 419.5 415.0 573.3 487.7 447.2 427.6 414.6 404.6 393.9 580.1 481.6 437.3 419.3 411.2 398.1 376.2 579.2 476.6 432.2 410.3 391.9 377.8 360.4 597.5 489.3 438.7 414.6 394.5 374.9 344.8 667.7 540.2 466.0 430.9 410.1 390.4 352.1 793.9 629.6 532.7 469.5 434.4 414.0 377.3 916.7 727.0 615.1 539.3 489.5 450.9 407.7 1.0244 1.3570 1.5436 0.7899 1.0931 1.2888 554.3 1.0824 0.000 0.0 1.0964 0.000 0.0 547.3 AUT00002627 11.877 13729 44.5 69.0 50.2 151.6 150.1 658.9 497.4 437.3 854.5 617.5 523.7 580.7 1.0332 599.8 1.0003 571.2 1.0504
|
||||
AUT067/19Jasira_USUI 5121 Jasira Swan 51 CB Nautor Swan FRERS 1981 CH-5502 Hunzenschwil CLUB C 1025 12 10 2019 14:30:46 15.540 13.021 3.046 4.49 21000. 128.3 0.66 599.4 1.0421 647.7 0.000 0.0 1017.9 818.5 705.2 628.9 579.1 547.2 513.2 971.5 784.4 679.1 612.9 571.4 546.0 516.2 843.4 674.2 580.7 524.6 489.2 466.0 437.8 902.7 716.6 612.6 549.2 508.5 481.5 449.1 1013.5 768.4 630.9 542.6 495.5 464.1 420.9 43.8 41.6 40.8 41.0 40.7 39.6 38.6 139.2 149.0 149.4 151.6 157.2 174.4 180.0 1062.5 868.1 762.4 692.3 647.7 624.5 602.8 686.5 576.9 510.0 468.1 448.6 438.4 430.2 645.5 548.6 485.8 453.5 437.8 428.3 419.5 616.4 526.5 469.3 443.2 429.1 419.3 405.3 623.9 530.6 469.7 438.6 427.0 416.3 398.9 625.9 516.1 453.4 427.6 412.2 400.1 387.0 639.8 527.3 459.6 430.5 413.7 399.5 374.5 704.9 572.1 491.0 446.1 424.7 409.5 381.1 842.9 665.9 561.1 490.9 449.0 427.9 400.0 973.3 768.9 647.9 565.6 510.5 469.8 423.6 0.9521 1.2824 1.4833 0.7351 1.0263 1.2445 582.5 1.0300 0.000 0.0 1.0355 0.000 0.0 579.4 AUT00002716 11.163 22418 52.5 56.6 81.4 191.5 0.0 709.0 526.4 455.1 918.2 657.7 542.4 611.8 0.9806 632.9 0.9480 602.5 0.9958
|
||||
AUT040/19Mojito AUT Mojito Salona 38 AD Brodovi Jakopin 2011 21215 Split CLUB C 736 12 10 2019 18:24:55 11.462 10.547 2.074 3.58 6929. 118.0 0.25 618.9 1.0029 673.0 0.000 0.0 1027.2 831.5 717.3 649.1 611.1 587.2 566.7 979.7 795.6 693.3 636.8 607.2 589.4 571.3 856.3 689.7 600.1 548.1 516.6 496.5 473.1 905.4 724.1 625.4 567.5 532.1 509.5 482.9 1024.3 779.7 644.2 565.1 526.1 496.3 448.8 43.5 41.8 41.4 40.3 39.6 39.4 39.8 144.6 149.4 151.4 155.4 171.0 180.0 180.0 1055.5 872.2 766.0 712.2 693.1 685.7 687.5 683.6 575.6 516.2 491.9 483.1 479.3 478.1 642.5 545.4 498.7 478.9 469.5 465.5 463.1 610.8 523.6 486.5 467.8 455.1 446.3 439.1 617.3 524.5 480.7 460.8 450.4 436.4 415.5 629.6 520.7 476.7 453.7 433.6 416.0 396.3 652.1 536.4 484.0 458.8 437.7 416.5 380.1 729.6 593.2 513.1 476.2 453.9 432.6 390.8 865.0 684.8 579.4 511.8 477.5 456.2 416.2 998.9 790.8 668.6 586.0 529.2 488.8 445.9 0.9442 1.2352 1.3854 0.7263 0.9963 1.1529 611.0 0.9819 0.000 0.0 0.9974 0.000 0.0 601.5 AUT00002721 9.669 7923 30.5 43.8 39.2 88.9 87.8 714.9 546.5 487.2 929.4 677.5 585.5 626.8 0.9573 645.8 0.9291 627.1 0.9567
|
||||
AUT041/19navis ceAUT Navis Celere Salona 380 AB Ovo Salona Cossutti 2017 Austria CLUB C 630 12 10 2019 17:35:10 11.600 10.590 2.269 3.70 6945. 128.8 0.22 603.7 1.0324 653.8 0.000 0.0 998.2 810.5 697.8 629.4 592.8 569.7 544.5 957.4 777.6 677.3 620.1 588.9 569.7 545.3 837.0 673.6 585.4 533.9 502.2 481.4 455.4 909.9 725.2 623.7 563.4 525.9 501.6 472.4 992.6 759.8 627.7 550.1 511.4 481.6 434.4 43.1 41.3 40.8 39.8 38.9 39.1 39.0 141.4 148.5 149.2 155.5 169.1 180.0 180.0 1053.9 869.1 761.4 700.1 675.4 665.5 658.4 687.3 577.8 514.7 486.2 473.4 468.6 466.5 648.5 548.8 497.3 473.9 461.3 455.2 451.5 619.1 526.8 485.2 464.3 449.5 437.8 425.9 615.5 512.5 470.5 454.1 445.6 431.0 405.3 609.2 504.9 463.8 440.2 418.9 406.0 386.9 625.5 514.4 468.3 442.9 419.1 398.2 367.9 689.0 558.5 489.0 458.4 435.1 411.5 367.0 816.2 651.2 549.2 489.0 460.3 438.5 395.8 942.5 752.0 634.2 558.7 510.3 474.0 430.5 0.9656 1.2665 1.4302 0.7464 1.0256 1.1925 591.9 1.0137 0.000 0.0 1.0250 0.000 0.0 585.4 AUT00002717 9.845 7939 30.8 42.7 35.5 117.3 106.4 699.0 533.0 472.0 904.3 658.2 566.0 623.4 0.9625 644.3 0.9312 609.8 0.9840
|
||||
AUTI14/19release AUT 741 Release Salona 41 ADIBOATS J&J 2010 Austria INTL R 800 04 06 2019 07:37:47 12.500 11.654 2.228 3.82 7606. 125.3 0.05 572.8 1.0833 623.1 0.000 0.0 936.8 758.6 657.4 602.8 571.3 549.5 519.4 894.8 726.0 637.6 591.9 565.9 547.5 516.6 787.8 636.5 555.8 509.2 480.4 461.0 434.3 846.0 677.6 586.3 532.6 499.2 476.9 447.5 933.6 712.4 593.2 526.7 490.9 462.0 415.8 43.4 41.7 40.8 39.7 39.0 38.6 39.0 142.8 147.1 149.5 155.2 166.9 180.0 180.0 968.4 796.0 705.3 667.0 649.9 641.8 626.3 630.3 528.8 481.0 463.8 457.0 453.6 446.4 593.5 504.5 467.0 451.3 444.4 440.5 434.6 564.9 488.0 456.9 440.0 427.7 420.1 412.6 569.1 488.5 455.8 437.1 420.7 405.5 385.2 584.4 484.7 446.3 423.6 407.9 395.3 375.0 599.0 493.1 450.3 424.9 400.0 379.8 355.6 662.8 535.8 470.1 440.8 416.4 390.9 341.2 783.9 624.5 527.9 471.1 443.1 420.5 373.7 905.2 721.1 609.5 538.6 492.8 457.3 412.4 1.0301 1.3294 1.4919 0.7963 1.0781 1.2415 566.2 1.0596 0.000 0.0 1.0773 0.000 0.0 557.0 AUT00002636 10.839 8785 34.5 55.1 46.7 131.9 0.0 655.3 507.7 452.4 847.7 626.1 543.7 588.9 1.0188 605.1 0.9916 581.0 1.0326
|
||||
AUT068/19rotgipflAUT Rotgipfler Elan 400 / S5 Elan Marine Rob Humphreys 2013 Austria CLUB C 600 12 10 2019 17:47:08 11.950 11.376 2.377 3.87 7774. 124.6 0.20 584.3 1.0564 639.0 0.000 0.0 956.4 775.6 670.8 614.9 591.0 569.0 540.3 916.0 743.4 651.4 603.1 578.0 560.1 533.0 803.5 648.8 566.7 519.8 491.4 472.8 447.6 877.4 700.4 603.8 546.8 511.5 488.4 459.6 951.5 727.2 604.3 535.8 501.8 473.2 427.6 43.1 41.3 40.5 39.9 39.0 39.0 38.5 143.3 146.8 147.9 150.4 152.2 175.8 177.8 1005.5 827.1 729.5 679.7 661.0 653.3 642.0 655.9 550.9 495.1 471.9 463.1 459.1 455.3 618.5 524.2 479.0 459.6 450.0 445.8 443.4 589.2 504.3 467.7 449.2 436.1 426.4 418.2 590.3 493.5 460.4 447.3 431.9 417.0 393.2 579.1 483.7 448.0 426.6 413.1 402.9 381.3 592.7 491.4 452.1 427.8 403.8 385.4 361.8 662.2 534.0 471.5 443.6 420.2 395.5 346.8 785.8 627.0 530.1 476.5 453.8 435.5 395.8 907.3 724.0 612.1 550.1 521.1 484.6 438.6 1.0095 1.3053 1.4528 0.7795 1.0531 1.1973 576.3 1.0411 0.000 0.0 1.0563 0.000 0.0 568.0 AUT00002719 10.514 8874 34.6 52.1 39.1 0.0 143.1 668.6 517.1 464.6 865.9 641.0 563.8 605.3 0.9913 623.6 0.9622 592.0 1.0136
|
||||
AUT008/19BellavitAUT Bellavita DUFOUR 460 GL DUFOUR FELCI 2016 Austria CLUB C 911 12 10 2019 19:43:12 13.500 12.375 2.202 4.50 10760. 125.5 0.33 629.5 0.9731 693.7 0.000 0.0 1129.8 892.7 753.5 667.2 612.8 581.8 546.4 1088.9 860.5 732.6 653.6 602.5 570.6 541.3 905.1 714.7 608.5 544.3 503.7 477.3 446.1 1000.1 782.8 659.4 582.7 532.7 499.4 460.9 1118.1 830.2 666.7 566.5 510.0 472.3 419.9 47.1 45.7 44.5 43.5 42.8 41.8 42.7 144.4 146.5 145.0 147.6 148.6 150.4 176.3 1247.3 996.0 859.0 767.5 701.3 663.1 651.1 784.9 635.6 554.6 500.1 465.5 447.9 438.7 723.1 592.7 520.1 474.0 448.3 433.8 422.7 680.0 561.3 491.8 455.6 435.8 421.9 401.4 645.9 524.7 458.2 429.6 418.6 411.8 393.7 625.4 506.5 446.4 419.3 398.6 380.6 361.3 644.4 519.2 453.6 423.6 401.7 380.2 343.3 738.7 574.2 485.8 441.7 417.8 397.0 357.3 876.7 683.6 561.2 490.9 454.1 433.9 403.9 1012.4 789.4 648.0 566.8 524.4 500.5 441.7 0.8830 1.2322 1.4521 0.6675 0.9627 1.1713 612.0 0.9804 0.000 0.0 0.9854 0.000 0.0 608.9 AUT00002722 9.973 12010 42.8 40.6 46.7 0.0 162.2 764.4 547.8 464.8 1011.2 701.2 576.3 656.7 0.9137 682.8 0.8787 633.3 0.9475
|
||||
CRO047/19CRO1842 CRO 1842 Malemok III Bavaria CR 40S Bavaria Farr 2010 CROATIA CLUB C 540 26 04 2019 16:43:22 11.977 10.929 2.249 3.94 8680. 120.5 0.28 615.4 1.0111 667.6 0.000 0.0 1030.6 832.5 717.8 644.0 601.7 576.7 554.2 986.6 799.4 694.4 632.3 598.0 578.9 558.0 857.4 688.2 596.4 542.5 509.5 488.4 463.7 922.6 734.2 630.3 568.3 529.8 505.2 476.5 1025.6 779.9 643.2 559.5 517.1 487.8 440.6 43.3 41.5 41.0 40.4 39.6 39.4 39.4 144.5 149.0 151.4 154.9 168.8 180.0 180.0 1080.6 888.5 779.0 712.4 682.9 673.6 671.2 702.6 590.4 523.0 489.6 475.4 470.6 468.7 662.5 560.8 502.9 476.2 463.1 457.0 454.0 632.8 537.5 488.8 466.1 451.8 441.3 430.9 621.1 516.5 470.6 450.2 441.2 434.2 411.7 620.6 512.8 467.2 444.2 424.3 406.5 388.1 641.5 528.5 474.7 449.3 428.5 407.9 372.4 716.2 581.6 502.9 466.0 444.1 423.9 384.8 849.2 672.5 568.9 503.7 467.5 446.5 408.4 980.6 776.5 656.6 575.7 520.4 479.8 437.1 0.9409 1.2457 1.4109 0.7246 1.0019 1.1750 0.0 0.0000 0.000 0.0 1.0056 0.000 0.0 596.7 CRO00090032 9.858 9736 35.8 51.6 33.6 106.3 97.5 717.4 541.9 478.4 931.5 673.7 574.5 629.0 0.9539 651.2 0.9214 0.0 0.0000
|
||||
CRO030/19CRO2674 CRO 2674 Xirena X 4^3 X Yachts Jepessen 2016 CROATIA CLUB C 862 22 02 2019 11:37:58 12.500 11.758 2.238 3.95 9534. 124.1 0.24 589.7 1.0459 645.4 0.000 0.0 977.6 792.1 683.3 619.8 591.7 569.7 541.1 938.1 760.4 662.3 607.7 579.4 561.4 537.0 815.8 656.8 571.6 522.6 493.0 474.1 450.3 894.4 711.7 611.1 551.2 513.9 489.8 460.6 971.6 741.7 613.0 538.1 502.3 473.4 428.7 43.8 42.0 41.3 40.8 39.9 39.5 39.1 143.4 147.5 147.7 149.6 151.2 175.1 177.9 1037.3 851.8 746.6 686.0 661.1 651.1 642.7 669.4 562.6 500.2 471.4 459.2 454.7 452.4 628.8 533.3 481.6 458.5 447.0 441.8 438.7 598.9 510.4 468.6 448.6 435.5 425.9 416.4 597.4 496.4 455.8 442.6 432.6 419.8 397.6 586.1 485.9 446.9 426.1 409.9 399.2 382.7 600.7 495.2 451.5 428.6 407.8 387.7 363.3 670.7 542.7 473.3 443.4 422.7 401.6 360.7 794.9 634.3 536.9 479.5 453.7 436.5 405.0 917.9 732.4 620.0 553.7 522.3 488.4 439.5 0.9913 1.2974 1.4502 0.7628 1.0412 1.1958 0.0 0.0000 0.000 0.0 1.0474 0.000 0.0 572.8 CRO00089314 10.617 10711 36.3 51.0 41.6 0.0 150.5 680.9 520.3 465.5 884.9 648.3 564.5 611.4 0.9814 631.5 0.9501 0.0 0.0000
|
||||
AUT158/19beauty CRO 2676 Beauty Sun Odyssey 410 Jeanneau Marc Lombard 2019 CLUB C 746 12 10 2019 19:59:19 11.985 10.973 2.147 4.00 7784. 110.1 0.29 627.0 0.9695 696.3 0.000 0.0 1088.3 871.1 746.8 671.5 626.6 599.6 563.3 1025.2 823.0 710.8 646.6 612.0 593.0 563.6 879.2 703.2 607.3 550.8 515.7 492.7 463.5 1025.8 805.4 680.5 603.0 552.4 518.5 479.0 1089.8 813.6 662.6 571.8 525.6 491.9 439.0 45.3 44.0 43.2 41.8 40.7 40.6 41.4 141.5 143.7 150.8 154.1 156.1 173.9 178.5 1073.2 876.0 764.9 709.5 686.8 680.0 669.5 684.6 566.1 501.0 475.4 466.4 462.4 458.7 629.9 528.5 478.0 458.1 451.5 447.2 442.7 582.8 498.4 462.7 444.3 432.1 425.7 419.7 579.6 498.9 463.5 444.2 427.8 412.3 393.2 659.8 541.3 474.5 446.1 426.2 406.4 369.0 685.5 557.0 489.1 456.7 435.8 415.7 377.5 795.2 633.5 541.1 485.1 456.2 436.8 400.4 955.7 750.2 630.4 548.2 495.6 463.7 426.3 1103.5 866.2 728.7 633.6 566.3 519.2 457.0 0.9162 1.2259 1.3999 0.6890 0.9615 1.1388 619.0 0.9692 0.000 0.0 0.9800 0.000 0.0 612.3 AUT00002723 9.916 8792 35.7 35.0 29.5 0.0 0.0 736.7 550.6 482.2 979.7 702.0 592.7 675.3 0.8886 704.2 0.8520 633.0 0.9479
|
||||
SUISUI616SUI616 SUI 616 ICHBISNODGSII POGO 12.50 POGO STRUCTURES FINOT-CONQ 2011 SIMPL CLUB C 400 16 02 2019 09:57:48 12.180 12.255 3.013 4.50 5508. 105.5 0.02 537.5 1.1421 591.0 0.000 0.0 885.1 707.8 617.8 574.0 551.6 527.1 485.8 838.7 675.3 597.0 558.9 534.3 510.5 481.2 742.0 598.1 521.5 477.0 448.6 428.1 397.0 801.4 640.6 553.3 501.4 468.1 445.2 414.6 884.5 665.6 557.3 496.0 461.7 430.3 378.7 42.7 41.2 39.5 38.2 37.7 37.1 37.9 142.6 145.1 148.2 151.3 150.3 147.1 145.0 891.2 722.5 654.1 629.6 617.4 602.6 600.0 583.6 483.0 453.3 444.0 439.0 432.8 427.3 550.9 464.9 439.4 430.2 424.7 419.2 409.4 529.1 454.4 425.7 408.5 398.8 392.8 377.4 535.7 457.1 425.7 397.3 376.0 365.0 354.1 555.2 456.2 416.4 389.3 369.7 354.3 317.8 572.7 465.1 422.7 385.0 355.5 337.0 304.6 638.7 509.6 446.3 412.2 376.8 338.1 278.2 761.3 600.3 503.6 449.1 420.9 391.1 321.9 879.0 693.1 581.5 518.4 485.8 451.6 371.7 1.0973 1.4163 1.6075 0.8475 1.1361 1.3038 0.0 0.0000 0.000 0.0 1.1494 0.000 0.0 522.0 SUI00005061 11.752 6812 37.1 68.8 44.1 0.0 133.8 615.1 476.6 419.9 796.5 594.1 517.7 556.4 1.0783 571.0 1.0508 0.0 0.0000
|
||||
CRO106/19CRO2537 CRO 2537 Kraftwerk Oceanis 38.1 Beneteau Finot 2013 CROATIA CLUB C 796 09 04 2019 13:57:02 11.510 11.048 2.066 3.99 6900. 110.1 0.37 665.7 0.9256 729.2 0.000 0.0 1178.6 927.6 791.3 702.8 647.6 617.8 579.9 1129.5 894.0 763.9 683.0 632.8 604.4 573.8 954.2 754.4 643.6 577.1 535.4 508.3 475.8 1038.4 813.2 686.2 608.4 558.6 526.0 489.0 1170.2 866.3 702.7 599.0 542.0 504.8 449.7 45.8 44.4 43.1 42.2 41.2 40.5 40.5 145.1 146.2 146.4 146.4 147.9 173.5 177.3 1262.5 1006.3 870.0 780.0 719.4 692.6 687.3 803.0 650.3 570.1 518.0 489.4 476.4 471.6 746.7 610.9 538.5 496.5 474.4 462.4 455.4 709.0 583.9 515.4 481.3 462.6 448.8 430.7 696.8 565.1 493.9 462.0 445.8 438.1 417.0 686.5 553.7 485.7 455.5 433.1 411.2 382.4 712.8 573.5 495.9 461.1 437.9 414.4 370.6 800.3 632.8 537.0 482.8 455.2 433.2 388.8 948.0 735.1 617.1 541.9 498.6 472.9 437.6 1094.6 848.8 712.6 625.7 575.8 543.0 472.4 0.8397 1.1643 1.3623 0.6410 0.9156 1.1047 0.0 0.0000 0.000 0.0 0.9342 0.000 0.0 642.3 CRO00089805 9.189 7981 33.9 31.7 32.9 0.0 94.5 803.9 579.7 495.5 1053.0 737.2 611.0 681.9 0.8799 710.8 0.8441 0.0 0.0000
|
||||
+3
-3
@@ -122,15 +122,15 @@ public class ORCPerformanceCurveRankingTest extends OnlineTracTracBasedTest {
|
||||
final ORCCertificatesCollection certificates = ORCCertificatesImporter.INSTANCE.read(
|
||||
getClass().getClassLoader().getResourceAsStream("orc/worlds2019/orcWorlds2019ClassA.json"));
|
||||
assertNotNull(certificates);
|
||||
assertFalse(Util.isEmpty(certificates.getSailNumbers()));
|
||||
assertFalse(Util.isEmpty(certificates.getCertificateIds()));
|
||||
author = new LogEventAuthorImpl("Testcase", 1);
|
||||
for (final Competitor competitor : getTrackedRace().getRace().getCompetitors()) {
|
||||
final Boat boat = getTrackedRace().getRace().getBoatOfCompetitor(competitor);
|
||||
ORCCertificate certificate;
|
||||
if (boat.getSailID().equals("Air is blue")) {
|
||||
certificate = certificates.getCertificateBySailNumber("ITA5252");
|
||||
certificate = certificates.getCertificateById("ITA52521I5252");
|
||||
} else {
|
||||
certificate = certificates.getCertificateBySailNumber(boat.getSailID());
|
||||
certificate = certificates.getCertificateById(boat.getSailID());
|
||||
if (certificate == null) {
|
||||
certificate = certificates.getCertificateByBoatName(boat.getName() == null ? boat.getSailID() : boat.getName());
|
||||
}
|
||||
|
||||
+3
-3
@@ -22,15 +22,15 @@ public class TestORCCertificateImporterJSON {
|
||||
public void testSimpleLocalJSONFileRead() throws IOException, ParseException {
|
||||
File fileGER = new File(RESOURCES + "GER2019.json");
|
||||
ORCCertificatesCollection importer = ORCCertificatesImporter.INSTANCE.read(new FileInputStream(fileGER));
|
||||
ORCCertificate milan = importer.getCertificateBySailNumber(" ger 7323");
|
||||
ORCCertificate milan = importer.getCertificateById("GER166844GER7323");
|
||||
assertNotNull(milan);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleOnlineJSONFileRead() throws IOException, ParseException {
|
||||
ORCCertificatesCollection importer = ORCCertificatesImporter.INSTANCE.read(new URL("https://data.orc.org/public/WPub.dll?action=DownRMS&CountryId=GER&ext=json").openStream());
|
||||
ORCCertificate swan = importer.getCertificateBySailNumber(" GER 5335");
|
||||
ORCCertificate moana = importer.getCertificateBySailNumber("ger 55 49 ");
|
||||
ORCCertificate swan = importer.getCertificateById("GER140849GER5335");
|
||||
ORCCertificate moana = importer.getCertificateById("GER140772GER5549");
|
||||
assertNotNull(swan);
|
||||
assertNotNull(moana);
|
||||
assertEquals(539.1, swan .getGPHInSecondsToTheMile(), 0.0000001);
|
||||
|
||||
+14
-4
@@ -5,8 +5,10 @@ import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Test;
|
||||
@@ -21,15 +23,15 @@ public class TestORCCertificateImporterRMS {
|
||||
public void testSimpleLocalRMSFileRead() throws IOException, ParseException {
|
||||
File fileGER = new File(RESOURCES + "GER2019.rms");
|
||||
ORCCertificatesCollection certificates = ORCCertificatesImporter.INSTANCE.read(new FileInputStream(fileGER));
|
||||
ORCCertificate milan = certificates.getCertificateBySailNumber(" ger 7323");
|
||||
ORCCertificate milan = certificates.getCertificateById("GER166844GER7323");
|
||||
assertNotNull(milan);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleOnlineRMSFileRead() throws IOException, ParseException {
|
||||
ORCCertificatesCollection importer = ORCCertificatesImporter.INSTANCE.read(new URL("https://data.orc.org/public/WPub.dll?action=DownRMS&CountryId=GER&ext=rms").openStream());
|
||||
ORCCertificate swan = importer.getCertificateBySailNumber(" GER 5335");
|
||||
ORCCertificate moana = importer.getCertificateBySailNumber("ger 55 49 ");
|
||||
ORCCertificatesCollection certificates = ORCCertificatesImporter.INSTANCE.read(new URL("https://data.orc.org/public/WPub.dll?action=DownRMS&CountryId=GER&ext=rms").openStream());
|
||||
ORCCertificate swan = certificates.getCertificateById("GER140849GER5335");
|
||||
ORCCertificate moana = certificates.getCertificateById("GER140772GER5549");
|
||||
assertNotNull(swan);
|
||||
assertNotNull(moana);
|
||||
assertEquals(539.1, swan .getGPHInSecondsToTheMile(), 0.0000001);
|
||||
@@ -39,5 +41,13 @@ public class TestORCCertificateImporterRMS {
|
||||
assertEquals(861.0, swan .getLongDistanceSpeedPredictions().get(ORCCertificateImpl.ALLOWANCES_TRUE_WIND_SPEEDS[0]).getDuration(ORCCertificateImpl.NAUTICAL_MILE).asSeconds(), 0.1);
|
||||
assertEquals(787.2, moana.getLongDistanceSpeedPredictions().get(ORCCertificateImpl.ALLOWANCES_TRUE_WIND_SPEEDS[0]).getDuration(ORCCertificateImpl.NAUTICAL_MILE).asSeconds(), 0.1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLocalRMSFileReadWithIdenticalSailnumbers() throws IOException, ParseException {
|
||||
//additional test to ensure certificates with same sailnumbers but different ids are equally parsed and saved
|
||||
File file = new File(RESOURCES + "multipleIdenticalSailnumbers.rms");
|
||||
ORCCertificatesCollection certificates = ORCCertificatesImporter.INSTANCE.read(new FileInputStream(file));
|
||||
assertEquals(14, ((Collection<?>) (certificates.getCertificateIds())).size());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+40
-44
@@ -1,5 +1,6 @@
|
||||
package com.sap.sailing.domain.orc;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import java.io.File;
|
||||
@@ -32,6 +33,7 @@ import com.sap.sailing.domain.common.orc.impl.ORCPerformanceCurveLegImpl;
|
||||
import com.sap.sailing.domain.orc.impl.ORCCertificatesJsonImporter;
|
||||
import com.sap.sailing.domain.orc.impl.ORCPerformanceCurveImpl;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.DegreeBearingImpl;
|
||||
|
||||
/**
|
||||
@@ -84,31 +86,31 @@ public class TestORCPerformanceCurve {
|
||||
|
||||
@Test
|
||||
public void testLagrangeInterpolation60() throws FunctionEvaluationException {
|
||||
ORCCertificate certificate = importerLocal.getCertificateBySailNumber("GER 5549");
|
||||
ORCCertificate certificate = importerLocal.getCertificateById("GER140772GER5549");
|
||||
testAllowancePerLeg(certificate, 60.0, 498.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLagrangeInterpolation62_5() throws FunctionEvaluationException {
|
||||
ORCCertificate certificate = importerLocal.getCertificateBySailNumber("GER 5549");
|
||||
ORCCertificate certificate = importerLocal.getCertificateById("GER140772GER5549");
|
||||
testAllowancePerLeg(certificate, 62.5, 492.2, 425.0, 403.6, 393.1, 386.7, 382.6, 371.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLagrangeInterpolation98_3() throws FunctionEvaluationException {
|
||||
ORCCertificate certificate = importerLocal.getCertificateBySailNumber("GER 5549");
|
||||
ORCCertificate certificate = importerLocal.getCertificateById("GER140772GER5549");
|
||||
testAllowancePerLeg(certificate, 98.3, 483.6, 418.7, 394.8, 377.9, 360.2, 345.0, 321.7);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLagrangeInterpolation120() throws FunctionEvaluationException {
|
||||
ORCCertificate certificate = importerLocal.getCertificateBySailNumber("GER 5549");
|
||||
ORCCertificate certificate = importerLocal.getCertificateById("GER140772GER5549");
|
||||
testAllowancePerLeg(certificate, 120.0, 506);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLagrangeInterpolation138_7() throws FunctionEvaluationException {
|
||||
ORCCertificate certificate = importerLocal.getCertificateBySailNumber("GER 5549");
|
||||
ORCCertificate certificate = importerLocal.getCertificateById("GER140772GER5549");
|
||||
testAllowancePerLeg(certificate, 138.7, 588.1, 468.4, 413.8, 382.6, 355.1, 326.4, 275.4);
|
||||
}
|
||||
|
||||
@@ -123,7 +125,7 @@ public class TestORCPerformanceCurve {
|
||||
|
||||
@Test
|
||||
public void testSimpleConstructedCourse() throws FunctionEvaluationException {
|
||||
ORCCertificateImpl certificate = (ORCCertificateImpl) importerLocal.getCertificateBySailNumber("GER 5549");
|
||||
ORCCertificateImpl certificate = (ORCCertificateImpl) importerLocal.getCertificateById("GER140772GER5549");
|
||||
List<ORCPerformanceCurveLeg> legs = new ArrayList<>();
|
||||
legs.add(new ORCPerformanceCurveLegImpl(new NauticalMileDistance(1.0), new DegreeBearingImpl(0)));
|
||||
legs.add(new ORCPerformanceCurveLegImpl(new NauticalMileDistance(1.0), new DegreeBearingImpl(30)));
|
||||
@@ -146,7 +148,7 @@ public class TestORCPerformanceCurve {
|
||||
@Test
|
||||
public void testPerformanceCurveInversion() throws MaxIterationsExceededException, FunctionEvaluationException {
|
||||
Double accuracy = 0.1;
|
||||
ORCCertificateImpl certificate = (ORCCertificateImpl) importerLocal.getCertificateBySailNumber("GER 5549");
|
||||
ORCCertificateImpl certificate = (ORCCertificateImpl) importerLocal.getCertificateById("GER140772GER5549");
|
||||
ORCPerformanceCurveImpl performanceCurve = (ORCPerformanceCurveImpl) new ORCPerformanceCurveImpl(certificate, alturaCourse);
|
||||
testBackwardForward(accuracy, performanceCurve, 11.5);
|
||||
testBackwardForward(accuracy, performanceCurve, 17.23);
|
||||
@@ -175,12 +177,12 @@ public class TestORCPerformanceCurve {
|
||||
@Test
|
||||
public void testImpliedWind() throws MaxIterationsExceededException, FunctionEvaluationException {
|
||||
double accuracy = 0.0001;
|
||||
ORCCertificate certificateMoana = importerLocal.getCertificateBySailNumber("GER 5549");
|
||||
ORCCertificate certificateMilan = importerLocal.getCertificateBySailNumber("GER 7323");
|
||||
ORCCertificate certificateTutima = importerLocal.getCertificateBySailNumber("GER 5609");
|
||||
ORCCertificate certificateBank = importerLocal.getCertificateBySailNumber("GER 5555");
|
||||
ORCCertificate certificateHaspa = importerLocal.getCertificateBySailNumber("GER 6300");
|
||||
ORCCertificate certificateHalbtrocken = importerLocal.getCertificateBySailNumber("GER 5564");
|
||||
ORCCertificate certificateMoana = importerLocal.getCertificateById("GER140772GER5549");
|
||||
ORCCertificate certificateMilan = importerLocal.getCertificateById("GER166844GER7323");
|
||||
ORCCertificate certificateTutima = importerLocal.getCertificateById("GER140618GER5609");
|
||||
ORCCertificate certificateBank = importerLocal.getCertificateById("GER140755GER5555");
|
||||
ORCCertificate certificateHaspa = importerLocal.getCertificateById("GER141411GER6300");
|
||||
ORCCertificate certificateHalbtrocken = importerLocal.getCertificateById("GER141432GER5564");
|
||||
ORCPerformanceCurve performanceCurveMoana = new ORCPerformanceCurveImpl(certificateMoana, alturaCourse);
|
||||
ORCPerformanceCurve performanceCurveMilan = new ORCPerformanceCurveImpl(certificateMilan, alturaCourse);
|
||||
ORCPerformanceCurve performanceCurveTutima = new ORCPerformanceCurveImpl(certificateTutima, alturaCourse);
|
||||
@@ -212,12 +214,12 @@ public class TestORCPerformanceCurve {
|
||||
@Test
|
||||
public void testAllowances() throws FunctionEvaluationException {
|
||||
double accuracy = 0.00001;
|
||||
ORCCertificate certificateMoana = importerLocal.getCertificateBySailNumber("GER 5549");
|
||||
ORCCertificate certificateMilan = importerLocal.getCertificateBySailNumber("GER 7323");
|
||||
ORCCertificate certificateTutima = importerLocal.getCertificateBySailNumber("GER 5609");
|
||||
ORCCertificate certificateBank = importerLocal.getCertificateBySailNumber("GER 5555");
|
||||
ORCCertificate certificateHaspa = importerLocal.getCertificateBySailNumber("GER 6300");
|
||||
ORCCertificate certificateHalbtrocken = importerLocal.getCertificateBySailNumber("GER 5564");
|
||||
ORCCertificate certificateMoana = importerLocal.getCertificateById("GER140772GER5549");
|
||||
ORCCertificate certificateMilan = importerLocal.getCertificateById("GER166844GER7323");
|
||||
ORCCertificate certificateTutima = importerLocal.getCertificateById("GER140618GER5609");
|
||||
ORCCertificate certificateBank = importerLocal.getCertificateById("GER140755GER5555");
|
||||
ORCCertificate certificateHaspa = importerLocal.getCertificateById("GER141411GER6300");
|
||||
ORCCertificate certificateHalbtrocken = importerLocal.getCertificateById("GER141432GER5564");
|
||||
ORCPerformanceCurve performanceCurveMoana = new ORCPerformanceCurveImpl(certificateMoana, alturaCourse);
|
||||
ORCPerformanceCurve performanceCurveMilan = new ORCPerformanceCurveImpl(certificateMilan, alturaCourse);
|
||||
ORCPerformanceCurve performanceCurveTutima = new ORCPerformanceCurveImpl(certificateTutima, alturaCourse);
|
||||
@@ -232,21 +234,15 @@ public class TestORCPerformanceCurve {
|
||||
assertEquals(Duration.ONE_HOUR.times(2.0).asHours(), performanceCurveHalbtrocken.getAllowancePerCourse(new KnotSpeedImpl(7.62407)).asHours(), accuracy);
|
||||
}
|
||||
|
||||
// Tests to make sure, that the structure of the certificate files didn't change and performance curves can be build
|
||||
/**
|
||||
* Tests to make sure, that the structure of the certificate files didn't change and performance curves can be built
|
||||
*/
|
||||
@Test
|
||||
public void testOnlineImport() throws FunctionEvaluationException {
|
||||
ORCCertificate certificateMoana = importerOnline.getCertificateBySailNumber("GER 5549");
|
||||
ORCCertificate certificateMilan = importerOnline.getCertificateBySailNumber("GER 7323");
|
||||
ORCCertificate certificateTutima = importerOnline.getCertificateBySailNumber("GER 5609");
|
||||
ORCCertificate certificateBank = importerOnline.getCertificateBySailNumber("GER 5555");
|
||||
ORCCertificate certificateHaspa = importerOnline.getCertificateBySailNumber("GER 6300");
|
||||
ORCCertificate certificateHalbtrocken = importerOnline.getCertificateBySailNumber("GER 5564");
|
||||
new ORCPerformanceCurveImpl(certificateMoana, alturaCourse);
|
||||
new ORCPerformanceCurveImpl(certificateMilan, alturaCourse);
|
||||
new ORCPerformanceCurveImpl(certificateTutima, alturaCourse);
|
||||
new ORCPerformanceCurveImpl(certificateBank, alturaCourse);
|
||||
new ORCPerformanceCurveImpl(certificateHaspa, alturaCourse);
|
||||
new ORCPerformanceCurveImpl(certificateHalbtrocken, alturaCourse);
|
||||
assertFalse(Util.isEmpty(importerOnline.getCertificateIds()));
|
||||
for (final ORCCertificate certificate : importerOnline.getCertificates()) {
|
||||
new ORCPerformanceCurveImpl(certificate, alturaCourse);
|
||||
}
|
||||
}
|
||||
|
||||
// Tests for the calculations with a more complex course which contains some special leg types. (circular random or other)
|
||||
@@ -262,12 +258,12 @@ public class TestORCPerformanceCurve {
|
||||
ORCPerformanceCurveCourse complexCourse = new ORCPerformanceCurveCourseImpl(list);
|
||||
|
||||
double accuracy = 0.0001;
|
||||
ORCCertificate certificateMoana = importerLocal.getCertificateBySailNumber("GER 5549");
|
||||
ORCCertificate certificateMilan = importerLocal.getCertificateBySailNumber("GER 7323");
|
||||
ORCCertificate certificateTutima = importerLocal.getCertificateBySailNumber("GER 5609");
|
||||
ORCCertificate certificateBank = importerLocal.getCertificateBySailNumber("GER 5555");
|
||||
ORCCertificate certificateHaspa = importerLocal.getCertificateBySailNumber("GER 6300");
|
||||
ORCCertificate certificateHalbtrocken = importerLocal.getCertificateBySailNumber("GER 5564");
|
||||
ORCCertificate certificateMoana = importerLocal.getCertificateById("GER140772GER5549");
|
||||
ORCCertificate certificateMilan = importerLocal.getCertificateById("GER166844GER7323");
|
||||
ORCCertificate certificateTutima = importerLocal.getCertificateById("GER140618GER5609");
|
||||
ORCCertificate certificateBank = importerLocal.getCertificateById("GER140755GER5555");
|
||||
ORCCertificate certificateHaspa = importerLocal.getCertificateById("GER141411GER6300");
|
||||
ORCCertificate certificateHalbtrocken = importerLocal.getCertificateById("GER141432GER5564");
|
||||
ORCPerformanceCurve performanceCurveMoana = new ORCPerformanceCurveImpl(certificateMoana, complexCourse);
|
||||
ORCPerformanceCurve performanceCurveMilan = new ORCPerformanceCurveImpl(certificateMilan, complexCourse);
|
||||
ORCPerformanceCurve performanceCurveTutima = new ORCPerformanceCurveImpl(certificateTutima, complexCourse);
|
||||
@@ -294,12 +290,12 @@ public class TestORCPerformanceCurve {
|
||||
ORCPerformanceCurveCourse complexCourse = new ORCPerformanceCurveCourseImpl(list);
|
||||
|
||||
double accuracy = 0.00001;
|
||||
ORCCertificate certificateMoana = importerLocal.getCertificateBySailNumber("GER 5549");
|
||||
ORCCertificate certificateMilan = importerLocal.getCertificateBySailNumber("GER 7323");
|
||||
ORCCertificate certificateTutima = importerLocal.getCertificateBySailNumber("GER 5609");
|
||||
ORCCertificate certificateBank = importerLocal.getCertificateBySailNumber("GER 5555");
|
||||
ORCCertificate certificateHaspa = importerLocal.getCertificateBySailNumber("GER 6300");
|
||||
ORCCertificate certificateHalbtrocken = importerLocal.getCertificateBySailNumber("GER 5564");
|
||||
ORCCertificate certificateMoana = importerLocal.getCertificateById("GER140772GER5549");
|
||||
ORCCertificate certificateMilan = importerLocal.getCertificateById("GER166844GER7323");
|
||||
ORCCertificate certificateTutima = importerLocal.getCertificateById("GER140618GER5609");
|
||||
ORCCertificate certificateBank = importerLocal.getCertificateById("GER140755GER5555");
|
||||
ORCCertificate certificateHaspa = importerLocal.getCertificateById("GER141411GER6300");
|
||||
ORCCertificate certificateHalbtrocken = importerLocal.getCertificateById("GER141432GER5564");
|
||||
ORCPerformanceCurve performanceCurveMoana = new ORCPerformanceCurveImpl(certificateMoana, complexCourse);
|
||||
ORCPerformanceCurve performanceCurveMilan = new ORCPerformanceCurveImpl(certificateMilan, complexCourse);
|
||||
ORCPerformanceCurve performanceCurveTutima = new ORCPerformanceCurveImpl(certificateTutima, complexCourse);
|
||||
|
||||
+3
-19
@@ -1,7 +1,5 @@
|
||||
package com.sap.sailing.domain.orc;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.sap.sailing.domain.common.orc.ORCCertificate;
|
||||
|
||||
/**
|
||||
@@ -13,10 +11,10 @@ import com.sap.sailing.domain.common.orc.ORCCertificate;
|
||||
**/
|
||||
public interface ORCCertificatesCollection {
|
||||
/**
|
||||
* Tells the sail numbers that can be used as key in {@link #getCertificateBySailNumber(String)} and {@link #getCertificates(String[])}
|
||||
* Tells the sail numbers that can be used as key in {@link #getCertificateById(String)} and {@link #getCertificates(String[])}
|
||||
* and for which certificates are available in this object.
|
||||
*/
|
||||
Iterable<String> getSailNumbers();
|
||||
Iterable<String> getCertificateIds();
|
||||
|
||||
/**
|
||||
* Creates an {@link ORCCertificate} object to a given sail number.
|
||||
@@ -27,25 +25,11 @@ public interface ORCCertificatesCollection {
|
||||
* 'X41', ...) and a numerical identification code.
|
||||
* @return {@code null}, if there isn't any data for the given sailnumber. Otherwise an {@link ORCCertificate}.
|
||||
*/
|
||||
ORCCertificate getCertificateBySailNumber(String sailnumber);
|
||||
ORCCertificate getCertificateById(String sailnumber);
|
||||
|
||||
ORCCertificate getCertificateByBoatName(String boatName);
|
||||
|
||||
Iterable<String> getBoatNames();
|
||||
|
||||
Iterable<ORCCertificate> getCertificates();
|
||||
|
||||
/**
|
||||
* Creates an {@link Map} of {@link ORCCertificate} objects to the given sail numbers.
|
||||
* <p>
|
||||
* Same functionality as {@code getCertificate} for a single sailnumber, just for multiple elements.
|
||||
*
|
||||
* @param sailnumbers
|
||||
* represents an array of sailnumbers as specified for the boat of the {@link Competitor) in the ORC
|
||||
* files. The sailnumber commonly consists out of an alphabetical national code (e.g. 'GER', 'GBR', 'SUI', ...) or
|
||||
* an alphanumerical class code (e.g. 'F40', 'X41', ...) and a numerical identification code.
|
||||
* @return {@link Map} of {@link ORCCertificate} values and the sailnumber parameters as keys. The value equals
|
||||
* {@code null}, if there isn't any data for the given sailnumber.
|
||||
*/
|
||||
Map<String, ORCCertificate> getCertificates(String[] sailnumbers);
|
||||
}
|
||||
|
||||
+1
-29
@@ -1,25 +1,10 @@
|
||||
package com.sap.sailing.domain.orc.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sap.sailing.domain.common.orc.ORCCertificate;
|
||||
import com.sap.sailing.domain.common.orc.impl.ORCCertificateImpl;
|
||||
import com.sap.sailing.domain.orc.ORCCertificatesCollection;
|
||||
import com.sap.sse.common.Util;
|
||||
|
||||
public abstract class AbstractORCCertificatesCollection implements ORCCertificatesCollection {
|
||||
|
||||
/**
|
||||
* From a sail number which may contain spaces, also redundantly and repeatedly, as well
|
||||
* as dashes, slashes or other special characters, and where upper and lower case may be mixed,
|
||||
* constructs a canonicalized version such that the chances for producing a match when searching
|
||||
* for a sail number is maximized, while still minimizing the chances for a false match.
|
||||
*/
|
||||
protected String getCanonicalizedSailNumber(String sailNumber) {
|
||||
return sailNumber.replaceAll(" ", "").replaceAll("-", "").toUpperCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Only the first 16 characters after removing spaces and other special characters such as parentheses and dashes
|
||||
* are compared case-insensitively.
|
||||
@@ -29,19 +14,6 @@ public abstract class AbstractORCCertificatesCollection implements ORCCertificat
|
||||
return replaced.substring(0, Math.min(replaced.length(), 16));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@link Map} of {@link ORCCertificateImpl} keyed by the {@link String} sailnumbers, which were given as
|
||||
* an input inside an array.
|
||||
*/
|
||||
@Override
|
||||
public Map<String, ORCCertificate> getCertificates(String[] sailnumbers) {
|
||||
Map<String, ORCCertificate> result = new HashMap<>();
|
||||
for (String sailnumber : sailnumbers) {
|
||||
result.put(sailnumber, getCertificateBySailNumber(sailnumber));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ORCCertificate getCertificateByBoatName(String boatName) {
|
||||
final String canonicalizedBoatNameToSearchFor = getCanonicalizedBoatName(boatName);
|
||||
@@ -55,7 +27,7 @@ public abstract class AbstractORCCertificatesCollection implements ORCCertificat
|
||||
|
||||
@Override
|
||||
public Iterable<ORCCertificate> getCertificates() {
|
||||
return Util.map(getSailNumbers(), sailNumber->getCertificateBySailNumber(sailNumber));
|
||||
return Util.map(getCertificateIds(), certificateId->getCertificateById(certificateId));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ public class FormatProbingORCCertificatesImporter implements ORCCertificatesImpo
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.FINE, "Couldn't read ORC certificates from input stream as JSON: "+e.getMessage());
|
||||
}
|
||||
if (result == null || Util.isEmpty(result.getSailNumbers())) {
|
||||
if (result == null || Util.isEmpty(result.getCertificateIds())) {
|
||||
// nothing from JSON; try RMS
|
||||
try {
|
||||
result = rmsFuture.get();
|
||||
|
||||
+49
-37
@@ -37,7 +37,19 @@ import com.sap.sse.common.impl.SecondsDurationImpl;
|
||||
*
|
||||
*/
|
||||
public class ORCCertificatesCollectionJSON extends AbstractORCCertificatesCollection {
|
||||
private Map<String, JSONObject> data;
|
||||
private static final String GYBE_ANGLE = "GybeAngle";
|
||||
private static final String BEAT_ANGLE = "BeatAngle";
|
||||
private static final String ALLOWANCES = "Allowances";
|
||||
private static final String ISSUE_DATE = "IssueDate";
|
||||
private static final String CDL2 = "CDL";
|
||||
private static final String GPH2 = "GPH";
|
||||
private static final String CLASS = "Class";
|
||||
private static final String YACHT_NAME = "YachtName";
|
||||
private static final String LOA = "LOA";
|
||||
private static final String SAIL_NO = "SailNo";
|
||||
private static final String CERT_NO = "CertNo";
|
||||
private static final String BIN = "BIN";
|
||||
private static final String NAT_AUTH = "NatAuth";
|
||||
private static final String RUN = "Run";
|
||||
private static final String BEAT = "Beat";
|
||||
private static final String WINDWARD_LEEWARD = "WL";
|
||||
@@ -46,18 +58,17 @@ public class ORCCertificatesCollectionJSON extends AbstractORCCertificatesCollec
|
||||
private static final String NON_SPINNAKER = "NS";
|
||||
private static final String EMPTY_CERT_NO = " ";
|
||||
|
||||
private Map<String, JSONObject> certificateJsonObjectsByCertificateId;
|
||||
|
||||
/**
|
||||
* Receives an {@link InputStream} from different possible sources (web, local file, ...) and does parse the
|
||||
* {@code .json} file.
|
||||
*/
|
||||
public ORCCertificatesCollectionJSON(Map<String, JSONObject> data) {
|
||||
this.data = new HashMap<>();
|
||||
for (final Entry<String, JSONObject> e : data.entrySet()) {
|
||||
if (this.data.put(getCanonicalizedSailNumber(e.getKey()), e.getValue()) != null) {
|
||||
throw new IllegalArgumentException(
|
||||
"Certificate sail numbers in collection not unique after canonicalization: " + e.getKey()
|
||||
+ " is canonicalized to " + getCanonicalizedSailNumber(e.getKey())
|
||||
+ " for which a certificate is already in the collection.");
|
||||
public ORCCertificatesCollectionJSON(Iterable<JSONObject> data) {
|
||||
this.certificateJsonObjectsByCertificateId = new HashMap<>();
|
||||
for (final JSONObject o : data) {
|
||||
if (this.certificateJsonObjectsByCertificateId.put(getId(o), o) != null) {
|
||||
throw new IllegalArgumentException("Certificate ID in collection not unique: " + getId(o));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,7 +78,7 @@ public class ORCCertificatesCollectionJSON extends AbstractORCCertificatesCollec
|
||||
* given key, the method returns {@link null}.
|
||||
*/
|
||||
@Override
|
||||
public ORCCertificate getCertificateBySailNumber(String sailnumber) {
|
||||
public ORCCertificate getCertificateById(String certificateId) {
|
||||
String boatName = null;
|
||||
String boatclass = null;
|
||||
Distance length = null;
|
||||
@@ -79,57 +90,48 @@ public class ORCCertificatesCollectionJSON extends AbstractORCCertificatesCollec
|
||||
Map<Speed, Map<Bearing, Speed>> velocityPredictionPerTrueWindSpeedAndAngle = new HashMap<>();
|
||||
Map<Bearing, Map<Speed, Duration>> allowanceDurationsPerTrueWindAngleAndSpeed = new HashMap<>(); //per nautical mile
|
||||
Map<String, Map<Speed, Duration>> predefinedAllowanceDurationsPerTrueWindSpeed = new HashMap<>(); //per nautical mile
|
||||
String searchString = getCanonicalizedSailNumber(sailnumber);
|
||||
JSONObject object = data.get(searchString);
|
||||
JSONObject object = certificateJsonObjectsByCertificateId.get(certificateId);
|
||||
if (object == null) {
|
||||
//TODO Throw Exception for sailnumber not found. InvalidArgumentException?
|
||||
// TODO Throw Exception for certificate by id not found. InvalidArgumentException?
|
||||
return null;
|
||||
}
|
||||
String natAuth = null;
|
||||
String bin = null;
|
||||
String certNo = null;
|
||||
String sailNumber = null;
|
||||
for (Entry<Object, Object> entry : object.entrySet()) {
|
||||
switch ((String) entry.getKey()) {
|
||||
case "NatAuth":
|
||||
natAuth = entry.getValue().toString();
|
||||
case SAIL_NO:
|
||||
sailNumber = entry.getValue() == null ? null : entry.getValue().toString();
|
||||
break;
|
||||
case "BIN":
|
||||
bin = entry.getValue().toString();
|
||||
break;
|
||||
case "CertNo":
|
||||
certNo = entry.getValue() == null ? EMPTY_CERT_NO : entry.getValue().toString();
|
||||
break;
|
||||
case "LOA":
|
||||
case LOA:
|
||||
length = new MeterDistance(((Number) entry.getValue()).doubleValue());
|
||||
break;
|
||||
case "YachtName":
|
||||
case YACHT_NAME:
|
||||
boatName = entry.getValue()==null?null:entry.getValue().toString();
|
||||
break;
|
||||
case "Class":
|
||||
case CLASS:
|
||||
boatclass = (String) entry.getValue();
|
||||
break;
|
||||
case "GPH":
|
||||
case GPH2:
|
||||
gph = new SecondsDurationImpl(((Number) entry.getValue()).doubleValue());
|
||||
break;
|
||||
case "CDL":
|
||||
case CDL2:
|
||||
cdl = ((Number) entry.getValue()).doubleValue();
|
||||
break;
|
||||
case "IssueDate":
|
||||
case ISSUE_DATE:
|
||||
Date date = DatatypeConverter.parseDateTime((String) entry.getValue()).getTime();
|
||||
issueDate = new MillisecondsTimePoint(date);
|
||||
break;
|
||||
case "Allowances":
|
||||
final JSONObject allowances = (JSONObject) object.get("Allowances");
|
||||
case ALLOWANCES:
|
||||
final JSONObject allowances = (JSONObject) object.get(ALLOWANCES);
|
||||
for (final Object aKey : allowances.keySet()) {
|
||||
final JSONArray array = (JSONArray) allowances.get(aKey);
|
||||
if (((String) aKey).equals("BeatAngle")) {
|
||||
if (((String) aKey).equals(BEAT_ANGLE)) {
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
beatAngles.put(ORCCertificateImpl.ALLOWANCES_TRUE_WIND_SPEEDS[i],
|
||||
new DegreeBearingImpl(((Number) array.get(i)).doubleValue()));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (((String) aKey).equals("GybeAngle")) {
|
||||
if (((String) aKey).equals(GYBE_ANGLE)) {
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
gybeAngles.put(ORCCertificateImpl.ALLOWANCES_TRUE_WIND_SPEEDS[i],
|
||||
new DegreeBearingImpl(((Number) array.get(i)).doubleValue()));
|
||||
@@ -201,16 +203,26 @@ public class ORCCertificatesCollectionJSON extends AbstractORCCertificatesCollec
|
||||
nonSpinnakerSpeedPredictionPerTrueWindSpeed.put(tws, ORCCertificateImpl.NAUTICAL_MILE
|
||||
.inTime(predefinedAllowanceDurationsPerTrueWindSpeed.get(NON_SPINNAKER).get(tws)));
|
||||
}
|
||||
return new ORCCertificateImpl(natAuth + certNo + bin, searchString, boatName, boatclass, length, gph, cdl,
|
||||
return new ORCCertificateImpl(getId(object), sailNumber, boatName, boatclass, length, gph, cdl,
|
||||
issueDate, velocityPredictionPerTrueWindSpeedAndAngle, beatAngles, beatVMGPredictionPerTrueWindSpeed,
|
||||
beatAllowancePerTrueWindSpeed, gybeAngles, runVMGPredictionPerTrueWindSpeed,
|
||||
runAllowancePerTrueWindSpeed, windwardLeewardSpeedPredictionPerTrueWindSpeed,
|
||||
longDistanceSpeedPredictionPerTrueWindSpeed, circularRandomSpeedPredictionPerTrueWindSpeed,
|
||||
nonSpinnakerSpeedPredictionPerTrueWindSpeed);
|
||||
}
|
||||
|
||||
private String getId(JSONObject certificateAsJson) {
|
||||
return getIdFromFields(certificateAsJson.get(NAT_AUTH).toString(),
|
||||
certificateAsJson.get(CERT_NO) == null ? EMPTY_CERT_NO : certificateAsJson.get(CERT_NO).toString(),
|
||||
certificateAsJson.get(BIN).toString());
|
||||
}
|
||||
|
||||
private String getIdFromFields(final String natAuth, final String certNo, final String bin) {
|
||||
return natAuth + certNo + bin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<String> getSailNumbers() {
|
||||
return Collections.unmodifiableCollection(data.keySet());
|
||||
public Iterable<String> getCertificateIds() {
|
||||
return Collections.unmodifiableCollection(certificateJsonObjectsByCertificateId.keySet());
|
||||
}
|
||||
}
|
||||
|
||||
+19
-19
@@ -47,6 +47,7 @@ public class ORCCertificatesCollectionRMS extends AbstractORCCertificatesCollect
|
||||
private static final String GPH = "GPH";
|
||||
private static final String LENGTH = "LOA";
|
||||
private static final String BOATNAME = "NAME";
|
||||
private static final String SAILNUMBER = "SAILNUMB";
|
||||
private static final String BOATCLASS = "TYPE";
|
||||
private static final String ISSUEDATE = "DD_MM_yyYY";
|
||||
private static final String RUN_ALLOWANCE = "D";
|
||||
@@ -59,41 +60,40 @@ public class ORCCertificatesCollectionRMS extends AbstractORCCertificatesCollect
|
||||
private static final String NON_SPINNAKER = "NSP";
|
||||
private static final String NATCERTN_FILE_ID = "NATCERTN.FILE_ID";
|
||||
|
||||
private final Map<String, Map<String, String>> certificateValuesBySailnumber;
|
||||
private final Map<String, Map<String, String>> certificateValuesByCertificateId;
|
||||
|
||||
public class ORCCertificateValues {
|
||||
private final String sailnumber;
|
||||
private final String certificateId;
|
||||
|
||||
public ORCCertificateValues(String sailnumber) {
|
||||
public ORCCertificateValues(String certificateId) {
|
||||
super();
|
||||
this.sailnumber = sailnumber;
|
||||
this.certificateId = certificateId;
|
||||
}
|
||||
|
||||
public String getValue(String columnName) {
|
||||
return certificateValuesBySailnumber.get(sailnumber).get(columnName);
|
||||
return certificateValuesByCertificateId.get(certificateId).get(columnName);
|
||||
}
|
||||
}
|
||||
|
||||
public ORCCertificatesCollectionRMS(Map<String, Map<String, String>> certificateValuesBySailnumber) throws IOException {
|
||||
this.certificateValuesBySailnumber = new HashMap<>();
|
||||
for (final Entry<String, Map<String, String>> e : certificateValuesBySailnumber.entrySet()) {
|
||||
this.certificateValuesBySailnumber.put(getCanonicalizedSailNumber(e.getKey()), e.getValue());
|
||||
public ORCCertificatesCollectionRMS(Map<String, Map<String, String>> certificateValuesByCertificateId) throws IOException {
|
||||
this.certificateValuesByCertificateId = new HashMap<>();
|
||||
for (final Entry<String, Map<String, String>> e : certificateValuesByCertificateId.entrySet()) {
|
||||
this.certificateValuesByCertificateId.put(e.getKey(), e.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
public Set<String> getSailnumbers() {
|
||||
return Collections.unmodifiableSet(certificateValuesBySailnumber.keySet());
|
||||
return Collections.unmodifiableSet(certificateValuesByCertificateId.keySet());
|
||||
}
|
||||
|
||||
private ORCCertificateValues getValuesForSailnumber(String sailnumber) {
|
||||
String searchString = getCanonicalizedSailNumber(sailnumber);
|
||||
return certificateValuesBySailnumber.containsKey(searchString) ? new ORCCertificateValues(searchString) : null;
|
||||
private ORCCertificateValues getValuesForCertificateId(String certificateId) {
|
||||
return certificateValuesByCertificateId.containsKey(certificateId) ? new ORCCertificateValues(certificateId) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ORCCertificate getCertificateBySailNumber(String sailnumber) {
|
||||
String searchString = getCanonicalizedSailNumber(sailnumber);
|
||||
ORCCertificateValues certificateValues = getValuesForSailnumber(searchString);
|
||||
public ORCCertificate getCertificateById(String certificateId) {
|
||||
ORCCertificateValues certificateValues = getValuesForCertificateId(certificateId);
|
||||
final String sailNumber = certificateValues.getValue(SAILNUMBER);
|
||||
final String boatclass = certificateValues.getValue(BOATCLASS);
|
||||
final String boatName = certificateValues.getValue(BOATNAME);
|
||||
final Distance length = new MeterDistance(Double.parseDouble(certificateValues.getValue(LENGTH)));
|
||||
@@ -147,7 +147,7 @@ public class ORCCertificatesCollectionRMS extends AbstractORCCertificatesCollect
|
||||
}
|
||||
velocityPredictionsPerTrueWindSpeedAndAngle.put(tws, velocityPredictionPerTrueWindAngle);
|
||||
}
|
||||
return new ORCCertificateImpl(certificateValues.getValue(NATCERTN_FILE_ID), searchString, boatName, boatclass,
|
||||
return new ORCCertificateImpl(certificateValues.getValue(NATCERTN_FILE_ID), sailNumber, boatName, boatclass,
|
||||
length, gph, cdl, issueDate, velocityPredictionsPerTrueWindSpeedAndAngle, beatAngles, beatVMGPredictionPerTrueWindSpeed,
|
||||
beatAllowancePerTrueWindSpeed, runAngles, runVMGPredictionPerTrueWindSpeed,
|
||||
runAllowancePerTrueWindSpeed, windwardLeewardSpeedPredictionPerTrueWindSpeed,
|
||||
@@ -155,7 +155,7 @@ public class ORCCertificatesCollectionRMS extends AbstractORCCertificatesCollect
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<String> getSailNumbers() {
|
||||
return Collections.unmodifiableCollection(certificateValuesBySailnumber.keySet());
|
||||
public Iterable<String> getCertificateIds() {
|
||||
return Collections.unmodifiableCollection(certificateValuesByCertificateId.keySet());
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -3,8 +3,8 @@ package com.sap.sailing.domain.orc.impl;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Reader;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
@@ -35,12 +35,12 @@ public class ORCCertificatesJsonImporter extends AbstractORCCertificatesImporter
|
||||
|
||||
@Override
|
||||
public ORCCertificatesCollectionJSON read(Reader reader) throws IOException, ParseException {
|
||||
Map<String, JSONObject> result = new HashMap<>();
|
||||
List<JSONObject> result = new LinkedList<>();
|
||||
JSONObject parsedJson = (JSONObject) new JSONParser().parse(reader);
|
||||
JSONArray dataArray = (JSONArray) parsedJson.get("rms");
|
||||
for (int i = 0; i < dataArray.size(); i++) {
|
||||
JSONObject object = (JSONObject) dataArray.get(i);
|
||||
result.put((String) object.get("SailNo"), object);
|
||||
result.add(object);
|
||||
}
|
||||
return new ORCCertificatesCollectionJSON(result);
|
||||
}
|
||||
|
||||
+4
-5
@@ -41,15 +41,14 @@ public class ORCCertificatesRmsImporter extends AbstractORCCertificatesImporter
|
||||
final BufferedReader br = new BufferedReader(reader);
|
||||
final LinkedHashMap<String, Integer> columnNamesAndWidths = readColumnWidthsFromFirstLine(br.readLine());
|
||||
final Iterator<String> i = columnNamesAndWidths.keySet().iterator();
|
||||
i.next(); // skip certificate ID column
|
||||
final String sailnumberColumnName = i.next();
|
||||
final Map<String, Map<String, String>> certificateValuesBySailnumber = new HashMap<>();
|
||||
final String certificateIdColumnName = i.next();
|
||||
final Map<String, Map<String, String>> certificateValuesByCertificateId = new HashMap<>();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
final Map<String, String> parsedLine = parseLine(line, columnNamesAndWidths);
|
||||
certificateValuesBySailnumber.put(parsedLine.get(sailnumberColumnName), parsedLine);
|
||||
certificateValuesByCertificateId.put(parsedLine.get(certificateIdColumnName), parsedLine);
|
||||
}
|
||||
return new ORCCertificatesCollectionRMS(certificateValuesBySailnumber);
|
||||
return new ORCCertificatesCollectionRMS(certificateValuesByCertificateId);
|
||||
}
|
||||
|
||||
public ORCCertificatesCollectionRMS read(InputStream in) throws IOException {
|
||||
|
||||
-133
@@ -1,133 +0,0 @@
|
||||
package com.sap.sailing.mongodb.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.bson.Document;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mongodb.MongoException;
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.orc.RaceLogORCCertificateAssignmentEvent;
|
||||
import com.sap.sailing.domain.abstractlog.orc.impl.RaceLogORCCertificateAssignmentEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.base.Boat;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.DomainFactory;
|
||||
import com.sap.sailing.domain.base.impl.BoatClassImpl;
|
||||
import com.sap.sailing.domain.base.impl.BoatImpl;
|
||||
import com.sap.sailing.domain.common.BoatClassMasterdata;
|
||||
import com.sap.sailing.domain.orc.ORCCertificatesCollection;
|
||||
import com.sap.sailing.domain.orc.impl.ORCCertificatesJsonImporter;
|
||||
import com.sap.sailing.domain.persistence.PersistenceFactory;
|
||||
import com.sap.sailing.domain.persistence.impl.DomainObjectFactoryImpl;
|
||||
import com.sap.sailing.domain.persistence.impl.FieldNames;
|
||||
import com.sap.sailing.domain.persistence.impl.MongoObjectFactoryImpl;
|
||||
import com.sap.sailing.domain.racelog.RaceLogIdentifier;
|
||||
import com.sap.sailing.domain.racelog.tracking.test.mock.MockSmartphoneImeiServiceFinderFactory;
|
||||
import com.sap.sailing.server.gateway.deserialization.JsonDeserializationException;
|
||||
import com.sap.sse.common.Speed;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
/**
|
||||
* @author Daniel Lisunkin (i505543)
|
||||
*/
|
||||
public class TestStoringAndLoadingRegattaORCCertificateAssignmengtEvent extends AbstractMongoDBTest {
|
||||
|
||||
public TestStoringAndLoadingRegattaORCCertificateAssignmengtEvent() throws UnknownHostException, MongoException {
|
||||
super();
|
||||
}
|
||||
|
||||
protected TimePoint expectedEventTime = new MillisecondsTimePoint(750);
|
||||
protected Serializable expectedId = UUID.randomUUID();
|
||||
protected List<Competitor> expectedInvolvedBoats = Collections.emptyList();
|
||||
protected int expectedPassId = 42;
|
||||
private AbstractLogEventAuthor author = new LogEventAuthorImpl("Test Author", 1);
|
||||
private final Boat boat = new BoatImpl(UUID.randomUUID(), "My Boat", new BoatClassImpl(BoatClassMasterdata._18Footer.getDisplayName(), BoatClassMasterdata._18Footer), "GER 18");
|
||||
|
||||
protected MongoObjectFactoryImpl mongoFactory = (MongoObjectFactoryImpl) PersistenceFactory.INSTANCE
|
||||
.getMongoObjectFactory(getMongoService(), new MockSmartphoneImeiServiceFinderFactory());
|
||||
protected DomainObjectFactoryImpl domainFactory = (DomainObjectFactoryImpl) PersistenceFactory.INSTANCE
|
||||
.getDomainObjectFactory(getMongoService(), DomainFactory.INSTANCE,
|
||||
new MockSmartphoneImeiServiceFinderFactory());
|
||||
|
||||
protected RaceLogIdentifier logIdentifier;
|
||||
private ORCCertificatesCollection importer;
|
||||
|
||||
@Before
|
||||
public void setUp() throws FileNotFoundException, IOException, ParseException {
|
||||
logIdentifier = mock(RaceLogIdentifier.class);
|
||||
when(logIdentifier.getIdentifier()).thenReturn(
|
||||
new com.sap.sse.common.Util.Triple<String, String, String>("a", "b", UUID.randomUUID().toString()));
|
||||
DomainFactory.INSTANCE.getCompetitorAndBoatStore().clearCompetitors();
|
||||
importer = new ORCCertificatesJsonImporter().read(new FileInputStream(new File("resources/GER2019.json")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test() throws JsonDeserializationException, ParseException {
|
||||
RaceLogORCCertificateAssignmentEvent expectedEvent = new RaceLogORCCertificateAssignmentEventImpl(MillisecondsTimePoint.now(), expectedEventTime, author,
|
||||
expectedId, expectedPassId, importer.getCertificateBySailNumber("GER 5549"), boat);
|
||||
|
||||
Document dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogORCCertificateAssignmentEvent actualEvent = loadEvent(dbObject);
|
||||
|
||||
assertBaseFields(expectedEvent, actualEvent);
|
||||
assertEquals(expectedEvent.getBoatId(), actualEvent.getBoatId());
|
||||
assertEquals(expectedEvent.getCertificate().getSailnumber(), actualEvent.getCertificate().getSailnumber());
|
||||
assertEquals(expectedEvent.getCertificate().getGPHInSecondsToTheMile(), actualEvent.getCertificate().getGPHInSecondsToTheMile(), 0.00001);
|
||||
|
||||
List<Speed> expectedBeatVMGPredictions = new ArrayList<>(expectedEvent.getCertificate().getBeatVMGPredictions().values());
|
||||
List<Double> expectedBeatVMGPredictionsInKnots = expectedBeatVMGPredictions.stream().map(s -> s.getKnots()).collect(Collectors.toList());
|
||||
List<Speed> actualBeatVMGPredictions = new ArrayList<>(actualEvent.getCertificate().getBeatVMGPredictions().values());
|
||||
List<Double> actualBeatVMGPredictionsInKnots = actualBeatVMGPredictions.stream().map(s -> s.getKnots()).collect(Collectors.toList());
|
||||
assertTrue(expectedBeatVMGPredictionsInKnots.equals(actualBeatVMGPredictionsInKnots));
|
||||
}
|
||||
|
||||
public void assertBaseFields(RaceLogEvent expectedEvent, RaceLogEvent actualEvent) {
|
||||
assertNotNull(actualEvent);
|
||||
assertEquals(expectedEvent.getCreatedAt(), actualEvent.getCreatedAt());
|
||||
assertEquals(expectedEvent.getLogicalTimePoint(), actualEvent.getLogicalTimePoint());
|
||||
assertEquals(expectedEvent.getId(), actualEvent.getId());
|
||||
assertEquals(expectedEvent.getInvolvedCompetitors().size(), Util.size(actualEvent.getInvolvedCompetitors()));
|
||||
assertEquals(expectedEvent.getPassId(), actualEvent.getPassId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Will always wait a couple of milliseconds to ensure that {@link RaceLogEvent#getCreatedAt()} has passed.
|
||||
* @throws ParseException
|
||||
* @throws JsonDeserializationException
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T extends RaceLogEvent> T loadEvent(Document dbObject) throws JsonDeserializationException, ParseException {
|
||||
try {
|
||||
Thread.sleep(2);
|
||||
} catch (InterruptedException ie) {
|
||||
fail(ie.toString());
|
||||
}
|
||||
RaceLogEvent dbEvent = domainFactory.loadRaceLogEvent((Document) dbObject.get(FieldNames.RACE_LOG_EVENT.name())).getA();
|
||||
T actualEvent = (T) dbEvent;
|
||||
return actualEvent;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -83,7 +83,7 @@ public class TestStoringAndLoadingRegattaORCCertificateAssignmentEvent extends A
|
||||
@Test
|
||||
public void test() throws JsonDeserializationException, ParseException {
|
||||
RaceLogORCCertificateAssignmentEvent expectedEvent = new RaceLogORCCertificateAssignmentEventImpl(MillisecondsTimePoint.now(), expectedEventTime, author,
|
||||
expectedId, expectedPassId, importer.getCertificateBySailNumber("GER 5549"), competitor);
|
||||
expectedId, expectedPassId, importer.getCertificateById("GER140772GER5549"), competitor);
|
||||
|
||||
Document dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogORCCertificateAssignmentEvent actualEvent = loadEvent(dbObject);
|
||||
|
||||
Reference in New Issue
Block a user