-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
91 lines (72 loc) · 1.95 KB
/
main.cpp
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <iomanip>
#include <thread>
#include <mutex>
#include <map>
#include <thread>
#include <unistd.h>
typedef unsigned char byte;
#include "backend/plane.h"
#include <backend/socket.cpp>
#include "window/window.h"
#include "window/params.h"
#include <SFML/Graphics.hpp>
using namespace std;
std::mutex plane_access;
std::map< std::vector<unsigned char>, plane, container_comp<std::vector<unsigned char>> > planes;
std::mutex sat_access;
sat_status status;
sf::ContextSettings s { .antialiasingLevel = 5 };
void packets() {
Socket sock(2008);
sock.loop(plane_access, planes, sat_access, status);
}
int main(int argc, char *argv[]){
cerr << setprecision(20);
std::thread(packets).detach();
windowParams plnparams {
.bar_width = 2,
.bar_offset = 20,
.bar_lenght = 10,
.hei = 400, .wid = 700,
.bg = sf::Color(0,0,0),
.muted = sf::Color(120,120,120),
.secondary = sf::Color(170,210,190),
.tert = sf::Color(170,250,140),
.quadr = sf::Color(170,250,255),
.selection = sf::Color::Red,
.s = s,
.alpha = 255,
.hstart = 51, .hend = 53,
.vstart = 2, .vend = 4,
.label_size = 14, .scale_width = 1,
.shift_factor = 25, .text_offset = 6,
.title = L"Atc board view"
};
windowParams params {
.bar_width = 2,
.bar_offset = 20,
.bar_lenght = 10,
.hei = 400, .wid = 400,
.bg = sf::Color(0,0,0),
.muted = sf::Color(120,120,120),
.secondary = sf::Color(170,210,190),
.tert = sf::Color(170,250,140),
.quadr = sf::Color(170,250,255),
.selection = sf::Color::Red,
.s = s,
.alpha = 255,
.hstart = 51, .hend = 53,
.vstart = 2, .vend = 4,
.label_size = 14, .scale_width = 1,
.shift_factor = 25, .text_offset = 6,
.title = L"Atc radar view"
};
radarWindow radar(params, plnparams, plane_access, planes, sat_access, status);
radar.fillBuffers();
radar.loop();
return 0;
}