circuitdata 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/circuitdata/exposed_area.rb +23 -36
- data/lib/circuitdata/product.rb +3 -3
- data/lib/circuitdata/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c49e6b15e75ca8c402c0807a9d241ba30cd9dd207c125fe3f1f6ae87da303960
|
4
|
+
data.tar.gz: cd912f52fb9c29398623954865938385f44a20fe0e1135d439d1a99e667c85f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 547b8febd516827f0c4c91b4d5849d7f36d0b5683a5ea2bed706c33a882568ad05859a88c049fc788e0a99d90dd37df215f75bdd6c9b9e0bc577a133102804f9
|
7
|
+
data.tar.gz: a052c9c068b168c7316c4763a17bde9d2298c15484a4502f870e292ca4bb51e342d04a12cbdcd668886cd1d4b8b2e89f4dcc01aabb43aad186fb5d757213d20c
|
@@ -5,30 +5,20 @@ module Circuitdata
|
|
5
5
|
@product = product
|
6
6
|
end
|
7
7
|
|
8
|
-
def
|
8
|
+
def final_finish_total_area
|
9
9
|
return nil if board_area.nil?
|
10
|
-
|
10
|
+
layer_final_finish_area+barrel_area
|
11
11
|
end
|
12
12
|
|
13
13
|
def barrel_area
|
14
14
|
return 0 if board_thickness.nil?
|
15
|
-
|
15
|
+
plated_holes.map{ |hole| sum_holes_area(hole)}.sum
|
16
16
|
end
|
17
17
|
|
18
18
|
private
|
19
19
|
|
20
|
-
def
|
21
|
-
coverage = []
|
22
|
-
unless top_final_finish.nil?
|
23
|
-
if top_final_finish[:coverage].is_a? Numeric
|
24
|
-
coverage << top_final_finish[:coverage]
|
25
|
-
end
|
26
|
-
end
|
27
|
-
unless bottom_final_finish.nil?
|
28
|
-
if bottom_final_finish[:coverage].is_a? Numeric
|
29
|
-
coverage << bottom_final_finish[:coverage]
|
30
|
-
end
|
31
|
-
end
|
20
|
+
def layer_final_finish_area
|
21
|
+
coverage = final_finish_layers.map{ |layer| layer[:coverage]}.compact
|
32
22
|
coverage.map{ |percent| percent/100.0*board_area}.sum
|
33
23
|
end
|
34
24
|
|
@@ -50,35 +40,32 @@ module Circuitdata
|
|
50
40
|
@product.question_answer([:metrics, :board, :area])
|
51
41
|
end
|
52
42
|
|
53
|
-
def
|
54
|
-
|
55
|
-
.select{|process| process
|
56
|
-
.select{|process| process[:function_attributes][:plated] == true}
|
57
|
-
.select{|process| process[:function_attributes][:hole_type] == "through"}
|
58
|
-
.select{|process| process[:function_attributes][:number_of_holes].present?}
|
59
|
-
.select{|process| process[:function_attributes][:finished_size].present?}
|
43
|
+
def plated_holes
|
44
|
+
holes.select{ |process| requires_final_finish?(process) }
|
45
|
+
.select{ |process| has_necessary_data?(process) }
|
60
46
|
end
|
61
47
|
|
62
|
-
def
|
63
|
-
|
48
|
+
def requires_final_finish?(process)
|
49
|
+
process[:function_attributes][:plated] == true &&
|
50
|
+
process[:function_attributes][:covered] == false
|
51
|
+
end
|
52
|
+
|
53
|
+
def has_necessary_data?(process)
|
54
|
+
process[:function_attributes][:number_of_holes].present? &&
|
55
|
+
process[:function_attributes][:finished_size].present?
|
64
56
|
end
|
65
57
|
|
66
|
-
def
|
67
|
-
|
68
|
-
|
69
|
-
conductive_final_finish_layers.first
|
58
|
+
def holes
|
59
|
+
@product.processes
|
60
|
+
.select{|process| process[:function] == "holes"}
|
70
61
|
end
|
71
62
|
|
72
|
-
def
|
73
|
-
|
74
|
-
return nil if conductive_final_finish_layers.last[:function] != "final_finish"
|
75
|
-
conductive_final_finish_layers.last
|
63
|
+
def layers
|
64
|
+
@product.layers
|
76
65
|
end
|
77
66
|
|
78
|
-
|
79
|
-
|
80
|
-
def conductive_final_finish_layers
|
81
|
-
layers.select{ |layer| ["conductive", "final_finish"].include?(layer[:function]) }
|
67
|
+
def final_finish_layers
|
68
|
+
layers.select{ |layer| layer[:function] == "final_finish" }
|
82
69
|
end
|
83
70
|
end
|
84
71
|
end
|
data/lib/circuitdata/product.rb
CHANGED
@@ -90,10 +90,10 @@ module Circuitdata
|
|
90
90
|
product_data.fetch(:metrics, {})
|
91
91
|
end
|
92
92
|
|
93
|
-
def
|
94
|
-
exposed_area.
|
93
|
+
def final_finish_total_area
|
94
|
+
exposed_area.final_finish_total_area
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
def product_data_path
|
98
98
|
[:open_trade_transfer_package, :products, id.to_sym, :circuitdata]
|
99
99
|
end
|
data/lib/circuitdata/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: circuitdata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Lydersen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-02-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json-schema
|