// File: /workspace/github_cpp_makefile_star2_O2/philipperemy[P]digital-setting-circles/Test.cpp
// Function: Test::test_Data()
void Test::test_Data()
{
    setUpErrorMessage("test_Data() - failed");

    StarData starData1;
    StarData starData2;

    starData1.az = 1;
    starData1.el = 2;
    starData1.ra = 3;
    starData1.dec = 4;
    starData1.time = 5;

    starData2.az = 10;
    starData2.el = 3.;
    starData2.ra = 30;
    starData2.dec = 40;
    starData2.time = 5;

    Data data(starData1, starData2);

    data.setEncoderReadRate(100000); //100 Khz
    data.setEncoderResolution(10000, 10000);

    //Set by user.
    //Look up in the dico to find RA and DEC of the target
    data.setTarget(50, 60);
    data.setStarName("target star name");

    data.applyAlignmentData();

    data.updateCurrentAzEl(2000, 3000);
    data.calculateTargetAzEl();

    std::cout << "is aligned " << data.isAligned() << std::endl;
    std::cout << "target AZ = " << data.getTargetAz() << std::endl;
    std::cout << "target EL = " << data.getTargetEl() << std::endl;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movq %rdi, %rbx
leaq 0x8525(%rip), %rsi      # 0x25db1
leaq -0x50(%rbp), %rdi
leaq -0x460(%rbp), %rdx
callq 0x4ce2
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x1df6c
leaq -0x50(%rbp), %rdi
callq 0x3100
leaq -0xb0(%rbp), %rdi
callq 0x1bb80
leaq -0x80(%rbp), %rdi
callq 0x1bb80
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
leaq -0xb0(%rbp), %rsi
movq %rax, 0x8(%rsi)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x10(%rsi)
movabsq $0x4008000000000000, %rax # imm = 0x4008000000000000
movq %rax, 0x18(%rsi)
movabsq $0x4010000000000000, %rcx # imm = 0x4010000000000000
movq %rcx, 0x20(%rsi)
movabsq $0x4014000000000000, %rcx # imm = 0x4014000000000000
movq %rcx, 0x28(%rsi)
movabsq $0x4024000000000000, %rdi # imm = 0x4024000000000000
leaq -0x80(%rbp), %rdx
movq %rdi, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movabsq $0x403e000000000000, %rax # imm = 0x403E000000000000
movq %rax, 0x18(%rdx)
movabsq $0x4044000000000000, %rax # imm = 0x4044000000000000
movq %rax, 0x20(%rdx)
movq %rcx, 0x28(%rdx)
leaq -0x460(%rbp), %rdi
callq 0x4dbc
leaq -0x460(%rbp), %rdi
movl $0x186a0, %esi          # imm = 0x186A0
callq 0x4f4e
leaq -0x460(%rbp), %rdi
movl $0x2710, %esi           # imm = 0x2710
movl $0x2710, %edx           # imm = 0x2710
callq 0x4f3c
leaq -0x460(%rbp), %rdi
movsd 0x82b5(%rip), %xmm0     # 0x25c40
movsd 0x82b5(%rip), %xmm1     # 0x25c48
callq 0x4ea4
leaq 0x8427(%rip), %rsi      # 0x25dc6
leaq -0x30(%rbp), %rdi
leaq -0x9(%rbp), %rdx
callq 0x4ce2
leaq -0x460(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4f2a
leaq -0x30(%rbp), %rdi
callq 0x3100
leaq -0x460(%rbp), %rdi
callq 0x4e5e
leaq -0x460(%rbp), %rdi
movl $0x7d0, %esi            # imm = 0x7D0
movl $0xbb8, %edx            # imm = 0xBB8
callq 0x4f7e
leaq -0x460(%rbp), %rdi
callq 0x5078
movq 0x105ce(%rip), %rdi     # 0x2dfc8
leaq 0x83d6(%rip), %rsi      # 0x25dd7
callq 0x32a0
movq %rax, %rbx
leaq -0x460(%rbp), %rdi
callq 0x4efe
movzbl %al, %esi
movq %rbx, %rdi
callq 0x3420
movq %rax, %rdi
callq 0x3110
movq 0x10599(%rip), %rdi     # 0x2dfc8
leaq 0x83ad(%rip), %rsi      # 0x25de3
callq 0x32a0
movq %rax, %rbx
leaq -0x460(%rbp), %rdi
callq 0x4ee2
movq %rbx, %rdi
callq 0x33e0
movq %rax, %rdi
callq 0x3110
movq 0x10567(%rip), %rdi     # 0x2dfc8
leaq 0x8388(%rip), %rsi      # 0x25df0
callq 0x32a0
movq %rax, %rbx
leaq -0x460(%rbp), %rdi
callq 0x4ef0
movq %rbx, %rdi
callq 0x33e0
movq %rax, %rdi
callq 0x3110
leaq -0x460(%rbp), %rdi
callq 0x4ed0
leaq -0x80(%rbp), %rdi
callq 0x1bba6
leaq -0xb0(%rbp), %rdi
callq 0x1bba6
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3100
jmp 0x1dae7
jmp 0x1dae4
movq %rax, %rbx
jmp 0x1daf3
movq %rax, %rbx
jmp 0x1dafc
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x3100
jmp 0x1db08
movq %rax, %rbx
jmp 0x1db08
movq %rax, %rbx
leaq -0x460(%rbp), %rdi
callq 0x4ed0
leaq -0x80(%rbp), %rdi
callq 0x1bba6
leaq -0xb0(%rbp), %rdi
callq 0x1bba6
movq %rbx, %rdi
callq 0x34a0