summaryrefslogtreecommitdiff
path: root/tags/host/0.8.1/src/org/reprap/Printer.java
blob: fe4401805c115e9092d2b5ec388d9750ccd1918f (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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
package org.reprap;

import java.awt.print.PrinterAbortException;
import java.io.IOException;
import javax.media.j3d.*;
import org.reprap.gui.Previewer;
import org.reprap.devices.GenericExtruder;

public interface Printer {

	/**
	 * Method to calibrate the printer.
	 */
	public void calibrate();

//	public void printSegment(double startX, double startY,
//			double startZ, double endX, double endY, double endZ) throws ReprapException, IOException;
	
	/**
	 * Move the printer carriage to the give x, y and z position <b>while extruding material<b>
	 * 
	 * @param x absolute x position in millimeters relative to the home position. 
	 * Range between [0..???]
	 * @param y absolute y position in millimters relative to the home position. 
	 * Range betwen [0..???]
	 * @param z absolute z position in millimters relative to the home position.
	 * Range between [0..???]
	 * @param startUp ?
	 * @param endUp ?
	 * @throws ReprapException
	 * @throws IOException 
	 */
	public void moveTo(double x, double y, double z, boolean startUp, boolean endUp) throws ReprapException, IOException;
	
	/**
	 * Move the printer carriage to the give x, y and z position <b>while extruding material<b>
	 * 
	 * @param x absolute x position in millimeters relative to the home position. 
	 * Range between [0..???]
	 * @param y absolute y position in millimters relative to the home position. 
	 * Range betwen [0..???]
	 * @param z absolute z position in millimters relative to the home position.
	 * Range between [0..???]
	 * @param turnOff True if extruder should be turned off at end of this segment.
	 * @throws ReprapException
	 * @throws IOException 
	 */
	public void printTo(double x, double y, double z, boolean turnOff) throws ReprapException, IOException;
	
	/**
	 * Fire up the extruder for a lead-in
	 * @param msDelay number of milliseconds
	 */
	public void printStartDelay(long msDelay);	
	
	/**
	 * Sync to zero X location.
	 * @throws ReprapException
	 * @throws IOException
	 */
	public void homeToZeroX() throws ReprapException, IOException;
	
	/**
	 * Sync to zero Y location.
	 * @throws ReprapException
	 * @throws IOException
	 */
	public void homeToZeroY() throws ReprapException, IOException; 
	
	/**
	 * Select a specific material print with
	 * @param materialIndex identifier of the material
	 */
	public void selectMaterial(int materialIndex);
	
	/**
	 * Indicates end of job, homes extruder, powers down etc
	 * @throws Exception
	 */
	public void terminate() throws Exception;
	
	/**
	 * Dispose of the printer
	 */
	public void dispose();
	
	
//	public int getSpeed();
	
	/**
	 * @param speed
	 */
	public void setSpeed(int speed);
	
	/**
	 * @param speed
	 */
	public void setFastSpeed(int speed);
	
	/**
	 * @return the extruder speed
	 */
	public int getSpeedZ();
	
	/**
	 * @param speed
	 */
	public void setSpeedZ(int speed);
	
//	public int getExtruderSpeed();
//	public void setExtruderSpeed(int speed);
	
	/**
	 * @param previewer
	 */
	public void setPreviewer(Previewer previewer);
	
//	public void setTemperature(int temperature) throws Exception;
//	public double getInfillSpeed();
//	public double getOutlineSpeed();
	
	/**
	 * @return is cancelled when ...?
	 */
	public boolean isCancelled();
	
//	public double getAngleSpeedUpLength();
//	public double getAngleSpeedFactor();
	
	/**
	 * @return the extrider fast speed
	 */
	public int getFastSpeed();
	
	/**
	 * @throws Exception
	 */
	public void initialise() throws Exception;
	
	/**
	 * @return current X position
	 */
	public double getX();
	
	/**
	 * @return current Y position
	 */
	public double getY();
	
	/**
	 * @return current Z position
	 */
	public double getZ();

	/**
	 * @return the extruder for the printer
	 */
	public Extruder getExtruder();
	public void stopExtruding() throws IOException;

	/**
	 * Allow the user to manually calibrate the Z axis position to deal
	 * with special circumstances like different extruder sizes, platform
	 * additions or subtractive fabrication.
	 * 
	 * @throws IOException
	 */
	public void setZManual() throws IOException;

	/**
	 * Allow the user to manually calibrate the Z axis position to deal
	 * with special circumstances like different extruder sizes, platform
	 * additions or subtractive fabrication.
	 * 
	 * @param zeroPoint The point the user selects will be treated as the
	 * given Z value rather than 0.0 
	 */
	public void setZManual(double zeroPoint) throws IOException;
	
	/**
	 * Returns the extrusion size for the currently selected material
	 * @return the size in mm
	 */
//	public double getExtrusionSize();
	
	/**
	 * Returns the gap between infill lines
	 * @return the size in mm
	 */
//	public double getInfillWidth();	
	
	/**
	 * Related to the getExtrusionSize, except this is the height
	 * of material that forms after any settling has taken place. 
	 * @return the extrusion height in mm
	 */
//	public double getExtrusionHeight();

	
	/**
	 * Get the total distance moved (whether extruding or not)
	 * @return a double representing the distance travelled (mm)
	 */
	public double getTotalDistanceMoved();
	
	/**
	 * Get the total distance moved while extruding
	 * @return a double representing the distance travelled (mm)
	 */
	public double getTotalDistanceExtruded();
	
	/**
	 * Turn on or off the layer cooling system
	 * @param enable
	 */
//	public void setCooling(boolean enable) throws IOException;
	
	/**
	 * Get the length before the end of a track to turn the extruder off
	 * to allow for the delay in the stream stopping.
	 * @return
	 */
//	public double getOverRun();
	
	/**
	 * Get the number of milliseconds to wait between turning an 
	 * extruder on and starting to move it.
	 * @return
	 */
//	public long getDelay();

	/**
	 * @return total time the extruder has been moving in seconds
	 */
	public double getTotalElapsedTime();
	
	/**
	 * @param ls
	 */
	public void setLowerShell(Shape3D ls);
	
	/**
	 * @param name
	 * @return the extruder for the material called name; null if not found.
	 */
	public Extruder getExtruder(String name);

}