Horizon
Loading...
Searching...
No Matches
board_layers.hpp
1#pragma once
2#include <string>
3#include <vector>
4#include "util/layer_range.hpp"
5
6namespace horizon {
8public:
9 enum Layer {
10 LAST_USER_LAYER = 1007,
11 FIRST_USER_LAYER = 1000,
12 USER1 = FIRST_USER_LAYER + 0,
13 USER2 = FIRST_USER_LAYER + 1,
14 USER3 = FIRST_USER_LAYER + 2,
15 USER4 = FIRST_USER_LAYER + 3,
16 USER5 = FIRST_USER_LAYER + 4,
17 USER6 = FIRST_USER_LAYER + 5,
18 USER7 = FIRST_USER_LAYER + 6,
19 USER8 = FIRST_USER_LAYER + 7,
20 TOP_NOTES = 200,
21 OUTLINE_NOTES = 110,
22 L_OUTLINE = 100,
23 TOP_COURTYARD = 60,
24 TOP_ASSEMBLY = 50,
25 TOP_PACKAGE = 40,
26 TOP_PASTE = 30,
27 TOP_SILKSCREEN = 20,
28 TOP_MASK = 10,
29 TOP_COPPER = 0,
30 IN1_COPPER = -1,
31 IN2_COPPER = -2,
32 IN3_COPPER = -3,
33 IN4_COPPER = -4,
34 IN5_COPPER = -5,
35 IN6_COPPER = -6,
36 IN7_COPPER = -7,
37 IN8_COPPER = -8,
38 BOTTOM_COPPER = -100,
39 BOTTOM_MASK = -110,
40 BOTTOM_SILKSCREEN = -120,
41 BOTTOM_PASTE = -130,
42 BOTTOM_PACKAGE = -140,
43 BOTTOM_ASSEMBLY = -150,
44 BOTTOM_COURTYARD = -160,
45 BOTTOM_NOTES = -200
46 };
47
48 static const unsigned int max_user_layers = LAST_USER_LAYER - FIRST_USER_LAYER + 1;
49
50 static const LayerRange layer_range_through;
51
52 static bool is_copper(int l)
53 {
54 return l <= TOP_COPPER && l >= BOTTOM_COPPER;
55 }
56
57 static bool is_copper(const LayerRange &l)
58 {
59 return is_copper(l.start()) || is_copper(l.end());
60 }
61
62 static bool is_silkscreen(int l)
63 {
64 return l == TOP_SILKSCREEN || l == BOTTOM_SILKSCREEN;
65 }
66
67 static bool is_user(int l)
68 {
69 return l <= LAST_USER_LAYER && l >= FIRST_USER_LAYER;
70 }
71
72 static const unsigned int max_inner_layers;
73
74 static std::string get_layer_name(int l);
75 static const std::vector<int> &get_layers();
76};
77} // namespace horizon
Definition board_layers.hpp:7
Definition layer_range.hpp:11