-
Notifications
You must be signed in to change notification settings - Fork 1
/
CafeTop.rb
158 lines (149 loc) · 2.95 KB
/
CafeTop.rb
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
require './PlumPott.rb'
require './Okuda.rb'
$bitwidth = 2.0/25.4
$halfwidth = $bitwidth/2
MARJ=0.05
class CafeTop < PlumPott
@@numero = 0
def a_screw(x,y,r)
looscrew(dx(x),dy(y))
end
def a_bolt(x,y,r)
looscrew(dx(x),dy(y))
end
def ADAMUSB(x,y,r)
fox(dx(x-0.22),dy(y+0.25),dx(x+0.22),dy(y-0.25),0,-@depth,4)
end
def an_omron(x,y,r)
rotabo(dx(x),dy(y),0.5,0.6,0.125,1,r)
rotabox(dx(x),dy(y),0.5,0.5,r)
end
def JOHNSON(x,y,r)
johnson(dx(x),dy(y))
end
def a_punkt(x,y,r)
tubo(dx(x),dy(y),0.1,0,-0.25,2)
drillus(dx(x),dy(y),-0.35,-@depth)
end
def a_pot(x,y,r)
alpspot(dx(x),dy(y),r-180)
end
def a_trimpot(x,y,r)
pipe(dx(x),dy(y),0.06,0,-@depth)
tubo(dx(x),dy(y),0.27,0,-0.44,4)
end
def a_led(x,y,r)
tubo(dx(x),dy(y),mm(4),0,-0.05,1)
tubo(dx(x),dy(y),mm(3),0.05,-0.35,3)
drillus(dx(x),dy(y),-0.35,-@depth)
end
def a_ledrgb(x,y,r)
a_led(x,y,r)
end
def a_sidebutton(x,y,r)
microshallot(dx(x),dy(y),1)
end
def KYCON5P(x,y,r)
shallot(dx(x),dy(y),1)
end
def KYCON3P(x,y,r)
shallot(dx(x),dy(y),-1)
end
def KOBICONDC(x,y,r)
shallot(dx(x),dy(y),-1)
end
def KEMETR82_50 (x,y,r)
rotabo(dx(x),dy(y),0.5,0.2,0.125,1,r+90)
end
def KEMETR82_25 (x,y,r)
rotabo(dx(x),dy(y),0.5,0.2,0.125,1,r+90)
end
def esp30(x,y,r)
box(dx(x-0.8),dy(y+2),dx(x+0.8),dy(y),0,-0.1/0.8,1)
end
#def proc() end
def initialize(starx, stary)
super(starx, stary)
end
def mm(i) return i/25.4 end
def dy(y)
return @stary-y
end
def dx(x)
return @curxo+x
end
def dr(r) return r end
def boxo()
@curxo += MARJ
@curxo += $bitwidth
proc()
@curxo += @width /2
@myOkuda = Okuda.new(@curxo,@stary,@width+MARJ*2+$bitwidth,@heigh+@@lipp*2+$bitwidth,0.4)
@curxo += @width /2
@curxo += MARJ
#@curxo += $bitwidth
return @curxo
end
def ducatop
end
def ducabot
@myOkuda.bokchoy(-@depth,1.0,12,10)
end
def duxo
#@curxo += $bitwidth
return @curxo
end
end
class Digital_cafe < CafeTop
def initialize(starx, stary)
@width = 6
@heigh = 2.5
@@lipp = 0.0
super(starx, stary)
end
end
class Quantum_experiment < CafeTop
def initialize(starx, stary)
@width = 6
@heigh = 5
@@lipp = 0.0
super(starx, stary)
end
end
class Tier_horn < CafeTop
def initialize(starx, stary)
@width = 6
@heigh = 2.5
@@lipp = 0.0
super(starx, stary)
end
end
require './cafe_procs.rb'
$rimmer = 0.01
$rimmer=0.01
def dudderat()
clasz = Object.const_get(String(ARGV[0]))
xarg = yarg = 1
unless ARGV[1].nil? then yarg = Integer(ARGV[1]) end
unless ARGV[2].nil? then xarg = Integer(ARGV[2]) end
broth = clasz.new(0,0).getBrot + $rimmer
curyop = (yarg-1)*broth
curxo = 0
#cursorx = $halfwidth
mystuff = clasz.new(curxo,0)
for i in 1..xarg do
if i == 1 then mystuff.numerize end
curyo = curyop
for j in 1..yarg do
mystuff = clasz.new(curxo,curyo)
mystuff.boxo()
mystuff.ducabot()
curyo -= broth*2
end
curxo = mystuff.duxo() + $rimmer
end
printf "G0 Z0.5\n"
printf "G0 X0 Y0 \n"
return curxo
end
dudderat()