aboutsummaryrefslogtreecommitdiff
path: root/testing/four_scan_40_80px_hfarcan.cpp
blob: 5d0cd91bc7fed0dfc17bc9884c12c491c4f5fb9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include <iomanip> // For output formatting


// FOUR_SCAN_40_80PX_HFARCAN test
struct Coords {
    int x;
    int y;
};

int main() {
    int panel_pixel_base = 16; // Updated pixel base
    Coords coords;

    // Header for easy Excel copying (Pipe-delimited format)
    std::cout << "Input X|Input Y|Output X|Output Y" << std::endl;

    // Loop for testing multiple inputs
    for (int y = 0; y < 40; y += 3) { // Updated y increment to 3
        for (int x = 0; x < 80; x += 10) {
            coords.x = x;
            coords.y = y;

            // Store original coordinates for display
            int input_x = coords.x;
            int input_y = coords.y;

            // Mapping logic
            int panel_local_x = coords.x % 80; // Compensate for chain of panels

            if ((((coords.y) / 10) % 2) ^ ((panel_local_x / panel_pixel_base) % 2)) {
                coords.x += ((coords.x / panel_pixel_base) * panel_pixel_base);
            } else {
                coords.x += (((coords.x / panel_pixel_base) + 1) * panel_pixel_base);
            }

            coords.y = (coords.y % 10) + 10 * ((coords.y / 20) % 2);

            // Output results in pipe-delimited format for easy Excel import
            std::cout << input_x << "|" << input_y << "|" << coords.x << "|" << coords.y << std::endl;
        }
    }

    return 0;
}