summaryrefslogtreecommitdiff
path: root/trunk/software/host/src/org/reprap/devices/NullStepperMotor.java
blob: ea5e92cc1c7bd137dd01ea1b84d4a04f34e23ff8 (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
package org.reprap.devices;

import java.io.IOException;
import org.reprap.utilities.Debug;
import org.reprap.AxisMotor;
import org.reprap.ReprapException;
import org.reprap.devices.GenericStepperMotor;

public class NullStepperMotor extends GenericStepperMotor {

	/**
	 * @param motorId
	 */
	public NullStepperMotor(int motorId) {
		super(null, motorId);
	}

	/**
	 * Is the comms working?
	 * @return
	 */
	public boolean isAvailable()
	{
		return true;
	}
	
	public boolean wasAvailable()
	{
		return true;
	}
	

	
	public void refreshPreferences()
	{
	}

	
	/**
	 * Dispose of this object
	 */
	public void dispose() {
	}
	
	
	/**
	 * 
	 *
	 */
	public void waitTillNotBusy() throws IOException
	{
		return;	
	}	
	
	/**
	 * Add an XY point to the firmware buffer for plotting
	 * Only works for recent firmware.
	 * 
	 * @param endX
	 * @param endY
	 * @param movementSpeed
	 * @return
	 */
	public boolean queuePoint(int endX, int endY, int movementSpeed, int control) throws IOException 
	{
		return false;
	}
	
	/**
	 * Set the motor speed (or turn it off) 
	 * @param speed A value between -255 and 255.
	 * @throws ReprapException
	 * @throws IOException
	 */
	public void setSpeed(int speed) throws IOException {
		Debug.d(axis + " axis - setting speed: " + speed);
	}

	/**
	 * @throws IOException
	 */
	public void setIdle() throws IOException {
		Debug.d(axis + " axis - going idle.");
	}
	
	/**
	 * @throws IOException
	 */
	public void stepForward() throws IOException {
		Debug.d(axis + " axis - stepping forward.");		
	}
	
	/**
	 * @throws IOException
	 */
	public void stepBackward() throws IOException {
		Debug.d(axis + " axis - stepping backward.");
	}
	
	/**
	 * @throws IOException
	 */
	public void resetPosition() throws IOException {
		setPosition(0);
	}
	
	/**
	 * @param position
	 * @throws IOException
	 */
	public void setPosition(int position) throws IOException {
		Debug.d(axis + " axis - setting position to: " + position);	
	}
	
	/**
	 * @return current position of the motor
	 * @throws IOException
	 */
	public int getPosition() throws IOException {
		int value = 0;
		Debug.d(axis + " axis - getting position.  It is... ");
		Debug.d("..." + value);		
		return value;
	}
	
	/**
	 * @param speed
	 * @param position
	 * @throws IOException
	 */
	public void seek(int speed, int position) throws IOException {
		Debug.d(axis + " axis - seeking position " + position + " at speed " + speed);
	}

	/**
	 * @param speed
	 * @param position
	 * @throws IOException
	 */
	public void seekBlocking(int speed, int position) throws IOException {
		Debug.d(axis + " axis - seeking-blocking position " + position + " at speed " + speed);
	}

	/**
	 * @param speed
	 * @return range of the motor
	 * @throws IOException
	 * @throws InvalidPayloadException
	 */
	public AxisMotor.Range getRange(int speed) throws IOException {
		Debug.d(axis + " axis - getting range.");
		return new AxisMotor.Range();
	}
	
	/**
	 * @param speed
	 * @throws IOException
	 * @throws InvalidPayloadException
	 */
	public void homeReset(int speed) throws IOException {
		Debug.d(axis + " axis - home reset at speed " + speed);
	}
	
	/**
	 * @param syncType
	 * @throws IOException
	 */
	public void setSync(byte syncType) throws IOException {
		Debug.d(axis + " axis - setting sync to " + syncType);
	}
	
	/**
	 * @param speed
	 * @param x1
	 * @param deltaY
	 * @throws IOException
	 */
	public void dda(int speed, int x1, int deltaY) throws IOException {
		Debug.d(axis + " axis - dda at speed " + speed + ". x1 = " + x1 + ", deltaY = " + deltaY);
	}
	
//	/**
//	 * @throws IOException
//	 */
//	private void setNotification() throws IOException {
//		Debug.d(axis + " axis - setting notification on.");
//	}

//	/**
//	 * @throws IOException
//	 */
//	private void setNotificationOff() throws IOException {
//		Debug.d(axis + " axis - setting notification off.");
//	}

	/**
	 * 
	 * @param maxTorque An integer value 0 to 100 representing the maximum torque percentage
	 * @throws IOException
	 */
	public void setMaxTorque(int maxTorque) throws IOException {
		Debug.d(axis + " axis - setting maximum torque to: " + maxTorque);
	}
	
}