Merge lp:~jeremyrcohen/fabinterpreter/Jeremy_Cohen into lp:fabinterpreter
- Jeremy_Cohen
- Merge into Qt_version
Proposed by
Jeffrey Lipton
Status: | Merged |
---|---|
Approved by: | Jeffrey Lipton |
Approved revision: | 32 |
Merged at revision: | 21 |
Proposed branch: | lp:~jeremyrcohen/fabinterpreter/Jeremy_Cohen |
Merge into: | lp:fabinterpreter |
Diff against target: |
7154 lines (+3700/-1226) 39 files modified
README.txt (+7/-0) software/Common/JrKerr/nmccom.cpp (+49/-33) software/Common/JrKerr/nmccom.h (+2/-2) software/Common/JrKerr/old_path/path.cpp (+650/-0) software/Common/JrKerr/old_path/path.h (+83/-0) software/Common/JrKerr/path.cpp (+11/-12) software/Common/JrKerr/path.h (+10/-10) software/Common/JrKerr/picservo.cpp (+35/-25) software/Common/JrKerr/picservo.h (+17/-17) software/Common/JrKerr/src/Makefile (+1/-1) software/Common/JrKerr/src/Makefile.Debug (+1/-1) software/Common/JrKerr/src/Makefile.Release (+1/-1) software/Common/JrKerr/src/src.pro.user (+178/-37) software/Duel Syringe - Model 2.config (+197/-0) software/FabInterpreter/FabAtHomePrinter.cpp (+44/-122) software/FabInterpreter/FabAtHomePrinter.h (+37/-8) software/FabInterpreter/Interpreter.pro (+5/-3) software/FabInterpreter/Interpreter.pro.user (+132/-121) software/FabInterpreter/Makefile (+29/-38) software/FabInterpreter/Motor.cpp (+116/-118) software/FabInterpreter/Motor.h (+76/-78) software/FabInterpreter/Path_Tester/Makefile (+271/-0) software/FabInterpreter/Path_Tester/Path_Tester.pro (+21/-0) software/FabInterpreter/Path_Tester/Path_Tester.pro.user (+228/-0) software/FabInterpreter/Path_Tester/jrkerr.pro (+18/-0) software/FabInterpreter/Path_Tester/main.cpp (+177/-0) software/FabInterpreter/Util.h (+2/-7) software/FabInterpreter/guicomponentsthread.cpp (+16/-8) software/FabInterpreter/guicomponentsthread.h (+27/-20) software/FabInterpreter/mainwindow.cpp (+140/-77) software/FabInterpreter/mainwindow.h (+12/-9) software/FabInterpreter/mainwindow.ui (+400/-475) software/FabInterpreter/printthread.cpp (+12/-2) software/FabInterpreter/printthread.h (+4/-0) software/Plastic Tool - Model 2.config (+159/-0) software/Valve - Model 2.config (+186/-0) software/XYZ.config (+148/-0) software/hybrid.config (+197/-0) software/sparse_cube.fab (+1/-1) |
To merge this branch: | bzr merge lp:~jeremyrcohen/fabinterpreter/Jeremy_Cohen |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeffrey Lipton | Pending | ||
Review via email: mp+32015@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'README.txt' |
2 | --- README.txt 1970-01-01 00:00:00 +0000 |
3 | +++ README.txt 2010-08-07 00:08:43 +0000 |
4 | @@ -0,0 +1,7 @@ |
5 | +Steps to running interpreter: |
6 | + |
7 | +1.Make sure DYLD_LIBRARY_PATH if using this on a Mac contains the directory of the qextserial libraries. This can be done in the run settings in Qt |
8 | +2.Set the Interpreter project to depend on src.pro (in Common/JrKerr/src/ but src.pro MUST be opened with Interpreter.pro to do this) |
9 | +3.Delete text in “Command” in the “Generate GUI” build step and add in “uic” |
10 | +4.Compile project |
11 | +5.Make sure the executable is set to active in Qt settings (and make sure that Qt has the right executable set) |
12 | |
13 | === modified file 'software/.DS_Store' |
14 | Binary files software/.DS_Store 2010-07-23 20:12:14 +0000 and software/.DS_Store 2010-08-07 00:08:43 +0000 differ |
15 | === modified file 'software/Common/.DS_Store' |
16 | Binary files software/Common/.DS_Store 2010-07-23 20:12:14 +0000 and software/Common/.DS_Store 2010-08-07 00:08:43 +0000 differ |
17 | === modified file 'software/Common/JrKerr/nmccom.cpp' |
18 | --- software/Common/JrKerr/nmccom.cpp 2010-07-23 20:12:14 +0000 |
19 | +++ software/Common/JrKerr/nmccom.cpp 2010-08-07 00:08:43 +0000 |
20 | @@ -44,8 +44,13 @@ |
21 | cstr[1] = addr; |
22 | cstr[2] = HARD_RESET; |
23 | cstr[3] = (byte)(cstr[1] + cstr[2]); //checksum |
24 | - |
25 | - ComPort->write(cstr, 4);//send reset |
26 | + int bytesRead = 0; |
27 | + int totalBytes = 4; |
28 | + for (i = 0; i < 4; i++) |
29 | + { |
30 | + ComPort->write(&(cstr[i]), 1);//send reset |
31 | + bytesRead++; |
32 | + } |
33 | usleep(10000); //wait for reset to execute |
34 | for (i=0; i<nummod_; i++) delete mod[i].p; //delete and prev. declared modules |
35 | nummod_ = 0; |
36 | @@ -54,11 +59,11 @@ |
37 | |
38 | ComPort->setBaudRate(BAUD19200);//Reset the baud rate to the default |
39 | |
40 | - ComPort->flush(); //may not work |
41 | - // SioClrInbuf(ComPort); //clear out any random crap left in buffer |
42 | - |
43 | - |
44 | - return(true); |
45 | + ComPort->flush(); //clear out any random crap left in buffer |
46 | + |
47 | + if (totalBytes != bytesRead) |
48 | + return false; |
49 | + else return true; |
50 | } |
51 | |
52 | //--------------------------------------------------------------------------- |
53 | @@ -134,22 +139,24 @@ |
54 | InitVars(); |
55 | if (ComPort != NULL) |
56 | delete ComPort; |
57 | - ComPort = new QextSerialPort(portname, QextSerialPort::EventDriven); |
58 | + ComPort = new QextSerialPort(portname, QextSerialPort::Polling); |
59 | bool open_status = ComPort->open(QIODevice::ReadWrite); |
60 | ComPort->setBaudRate(BAUD19200); |
61 | ComPort->setFlowControl(FLOW_OFF); |
62 | ComPort->setParity(PAR_NONE); |
63 | ComPort->setDataBits(DATA_8); |
64 | ComPort->setStopBits(STOP_1); |
65 | - ComPort->setTimeout(100); |
66 | + //TODO: see how comport behaves w/out a timeout |
67 | + //ComPort->setTimeout(500); |
68 | if (open_status < 0) return 0; |
69 | |
70 | - printf("Resetting NMC devices\n"); |
71 | - |
72 | - NmcHardReset(0xFF); |
73 | - NmcHardReset(0xFF); |
74 | - |
75 | - printf("NMC reset complete\n"); |
76 | + qDebug() << "Resetting NMC devices"; |
77 | + |
78 | + //TODO: change these reset commands because 0xFF is the wrong group address |
79 | + NmcHardReset(0xFF); |
80 | + NmcHardReset(0xFF); |
81 | + |
82 | + qDebug() << "NMC reset complete"; |
83 | addr = 1; |
84 | while (1) |
85 | { |
86 | @@ -167,13 +174,11 @@ |
87 | numread = ComPort->read(cstr, 2); //get back status, cksum |
88 | //numread = SioGetChars(ComPort, cstr, 2); |
89 | |
90 | - //jrc352: error reading in characters in SioGetChars |
91 | - |
92 | if (numread!=2) break; //if no response, punt out of loop |
93 | |
94 | if (cstr[0] != cstr[1]) |
95 | { |
96 | - printf("Status checksum error - please reset the Network\n"); |
97 | + qDebug() << "Status checksum error - please reset the Network"; |
98 | ComPort->close(); |
99 | return(0); |
100 | } |
101 | @@ -189,7 +194,7 @@ |
102 | |
103 | if (numread!=4) |
104 | { |
105 | - printf("Could not read device type\n"); |
106 | + qDebug() << "Could not read device type"; |
107 | ComPort->close(); |
108 | return(0); |
109 | } |
110 | @@ -201,10 +206,20 @@ |
111 | mod[addr].groupleader = false; |
112 | switch (mod[addr].modtype) |
113 | { |
114 | - case SERVOMODTYPE: mod[addr].p = ServoNewMod(); break; |
115 | - case ADCMODTYPE: mod[addr].p = AdcNewMod(); break; |
116 | - case IOMODTYPE: mod[addr].p = IoNewMod(); break; |
117 | - case STEPMODTYPE: mod[addr].p = StepNewMod(); break; |
118 | + case SERVOMODTYPE: |
119 | + { |
120 | + mod[addr].p = ServoNewMod(); |
121 | + //fix for change in I/O CTRL command |
122 | + if ((mod[addr].modver<10) || (mod[addr].modver>20)) |
123 | + { |
124 | + mod[addr].p = (SERVOMOD *)(mod[addr].p); |
125 | + //mod[addr].p->ioctrl = IO1_IN | IO2_IN; |
126 | + } |
127 | + break; |
128 | + } |
129 | + case ADCMODTYPE: mod[addr].p = AdcNewMod(); break; |
130 | + case IOMODTYPE: mod[addr].p = IoNewMod(); break; |
131 | + case STEPMODTYPE: mod[addr].p = StepNewMod(); break; |
132 | } |
133 | addr++; //increment the address |
134 | } |
135 | @@ -216,12 +231,12 @@ |
136 | if (nummod_ > 0) |
137 | { |
138 | NmcChangeBaud(0xFF, baudrate); |
139 | - if (nummod_>1) printf("%d Modules found\n", nummod_); |
140 | - else printf("%d Module found\n", nummod_); |
141 | + if (nummod_>1) qDebug() << nummod_ << "Modules found"; |
142 | + else qDebug() << nummod_ << "Module found"; |
143 | } |
144 | else |
145 | { |
146 | - printf("No modules found on the network.\nPlease check power and connections.\n"); |
147 | + qDebug() << "No modules found on the network.\nPlease check power and connections."; |
148 | ComPort->close(); |
149 | } |
150 | |
151 | @@ -248,7 +263,6 @@ |
152 | //If too many SIO errors, punt |
153 | if (SioError > MAXSIOERROR) |
154 | { |
155 | - qDebug() << "bad!!!!!"; |
156 | return(false); |
157 | } |
158 | IOBusy = true; |
159 | @@ -259,7 +273,7 @@ |
160 | ( mod[stataddr].modtype==IOMODTYPE) || |
161 | ( mod[stataddr].modtype==STEPMODTYPE) ) ) |
162 | { |
163 | - printf("Module type %d not supported\n",mod[stataddr].modtype); |
164 | + qDebug() << "Module type" << mod[stataddr].modtype << "not supported"; |
165 | return (false); |
166 | } |
167 | |
168 | @@ -280,13 +294,15 @@ |
169 | ComPort->flush(); //Get rid of any old input chars |
170 | |
171 | int bytesWritten = 0; |
172 | + |
173 | for (i = 0; i < n+4; i++) |
174 | { |
175 | - if (ComPort->write(&(char)outstr[i], 1) == 1) bytesWritten++; //Send the command string |
176 | + byte * temp = &(outstr[i]); |
177 | + if(ComPort->write((char *)temp, 1)) bytesWritten++; //Send the command string |
178 | } |
179 | |
180 | if (bytesWritten != n+4) |
181 | - printf("Only wrote %d bytes out of %d bytes.\n",bytesWritten, n+4); |
182 | + qDebug() << "Only wrote " << bytesWritten << " bytes out of " << n+4 << " bytes."; |
183 | |
184 | if (stataddr == 0) //If a group command w/ no leader, add delay then exit |
185 | { |
186 | @@ -325,7 +341,7 @@ |
187 | //If too many errors - prompt to reset |
188 | if (SioError >= MAXSIOERROR) |
189 | { |
190 | - printf("Multiple communication errors - please reset the Network\n"); |
191 | + qDebug() << "Multiple communication errors - please reset the Network"; |
192 | return; |
193 | } |
194 | |
195 | @@ -341,12 +357,12 @@ |
196 | char cmdstr[2]; |
197 | |
198 | if (!(groupaddr & 0x80)) return false; //punt if not valid group address |
199 | - |
200 | cmdstr[0] = addr; |
201 | cmdstr[1] = groupaddr; |
202 | if (leader) cmdstr[1] &= 0x7F; //clear upper bit if a group leader |
203 | mod[addr].groupaddr = groupaddr; |
204 | mod[addr].groupleader = leader; |
205 | + usleep(50000); |
206 | return NmcSendCmd(addr, SET_ADDR, cmdstr, 2, addr); |
207 | } |
208 | //--------------------------------------------------------------------------- |
209 | @@ -366,7 +382,7 @@ |
210 | //--------------------------------------------------------------------------- |
211 | extern "C" BOOL NmcNoOp(byte addr) |
212 | { |
213 | - return NmcSendCmd(addr, NOP, NULL, 0, addr); |
214 | + return NmcSendCmd(addr, NOP, NULL, 0, addr); |
215 | } |
216 | //--------------------------------------------------------------------------- |
217 | extern "C" BOOL NmcReadStatus(byte addr, byte statusitems) |
218 | |
219 | === modified file 'software/Common/JrKerr/nmccom.h' |
220 | --- software/Common/JrKerr/nmccom.h 2010-07-12 18:50:09 +0000 |
221 | +++ software/Common/JrKerr/nmccom.h 2010-08-07 00:08:43 +0000 |
222 | @@ -13,7 +13,7 @@ |
223 | // Non-windows platforms need these too -BR |
224 | //typedef int BOOL; //0=false, <>0 true |
225 | //typedef int HANDLE; |
226 | -//typedef unsigned long DWORD; |
227 | +//typedef unsigned int DWORD; |
228 | //#define INVALID_HANDLE_VALUE -1 |
229 | |
230 | |
231 | @@ -22,7 +22,7 @@ |
232 | //jrc352: below taken from "sioutil.h" |
233 | // Non-windows platforms need these too -BR |
234 | typedef int BOOL; //0=false, <>0 true |
235 | -typedef unsigned long DWORD; |
236 | +typedef unsigned int DWORD; |
237 | #define INVALID_HANDLE_VALUE -1 |
238 | |
239 | typedef struct _NMCMOD { |
240 | |
241 | === added directory 'software/Common/JrKerr/old_path' |
242 | === added file 'software/Common/JrKerr/old_path/path.cpp' |
243 | --- software/Common/JrKerr/old_path/path.cpp 1970-01-01 00:00:00 +0000 |
244 | +++ software/Common/JrKerr/old_path/path.cpp 2010-08-07 00:08:43 +0000 |
245 | @@ -0,0 +1,650 @@ |
246 | +//--------------------------------------------------------------------------- |
247 | +#pragma hdrstop |
248 | + |
249 | +#include <math.h> |
250 | +#include "path.h" |
251 | +#include "nmccom.h" |
252 | +#include "picservo.h" |
253 | +#include <QDebug> |
254 | +//--------------------------------------------------------------------------- |
255 | +//Globals: |
256 | +int pathsize; //local path size |
257 | +segment seglist[MAXSEG]; //list of segments |
258 | +int seglistsize; //number of segments in list |
259 | +int curseg; //current segment number |
260 | +int curppoint; //current pathpoint |
261 | +float tan_tolerance = TAN_3DEGREE; //minimum cos(th) for angle between tangents |
262 | +frame cur_arcframe; //coordinate fram for the current arc |
263 | +float pathlen; //total path length |
264 | +float arclen; //total length of path already downloaded |
265 | +float stublen; //length of path in current segment |
266 | +int pathfreq = P_30HZ; //selected path frequency |
267 | +int bufsize; //max num points to store in the PIC-SERVO buffer |
268 | +float maxvel, vel, acc; //max. velocity, cur velocity & acceleration |
269 | +byte x = 1; //axes addresses |
270 | +byte y = 2; |
271 | +byte z = 3; |
272 | +byte group = 0xFF; //group address for coordinated controllers |
273 | +byte leader = 0x00; //group leader address for coordinated controllers |
274 | +int finaldecel; //flag for when final deceleration has started |
275 | +int at_end; //flags when we are at end of path |
276 | +float xoff, yoff, zoff; //origin offset |
277 | +float UTOCX, UTOCY, UTOCZ; //Units TO Counts conversion factors |
278 | +float tolerance; //small distance tolerance use for near-zero comparisons |
279 | + |
280 | +//--------------------------------------------------------------------------- |
281 | +// Geometric functions |
282 | +//--------------------------------------------------------------------------- |
283 | +//Returns the magnitude of a floating point vector |
284 | +float mag(fp p) |
285 | +{ |
286 | + return(sqrt(p[0]*p[0] + p[1]*p[1] + p[2]*p[2])); |
287 | +} |
288 | +//--------------------------------------------------------------------------- |
289 | +//Returns the dot product of two floating point vectors |
290 | +float dot(fp x, fp y) |
291 | +{ |
292 | + return( x[0]*y[0] + x[1]*y[1] + x[2]*y[2] ); |
293 | +} |
294 | +//--------------------------------------------------------------------------- |
295 | +//Z is returned as the cross product of (x cross y) |
296 | +void cross(fp x, fp y, fp z) |
297 | +{ |
298 | + z[0] = x[1]*y[2] - x[2]*y[1]; |
299 | + z[1] = x[2]*y[0] - x[0]*y[2]; |
300 | + z[2] = x[0]*y[1] - x[1]*y[0]; |
301 | +} |
302 | +//--------------------------------------------------------------------------- |
303 | +//y = normalized x ( normalize(x,x) works OK ) |
304 | +float normalize(fp x, fp y) |
305 | +{ |
306 | + float a; |
307 | + |
308 | + a = mag(x); |
309 | + if (a==0.0) return(a); |
310 | + |
311 | + y[0] /= a; |
312 | + y[1] /= a; |
313 | + y[2] /= a; |
314 | + return(a); |
315 | +} |
316 | +//--------------------------------------------------------------------------- |
317 | +//Cooredinate frame transformation: y = F*x, ( y = F*y OK ) |
318 | +void fvmult(frame *F, fp x, fp y) |
319 | +{ |
320 | + fp xtemp; |
321 | + |
322 | + xtemp[0] = x[0]; |
323 | + xtemp[1] = x[1]; |
324 | + xtemp[2] = x[2]; |
325 | + y[0] = F->x[0]*xtemp[0] + F->y[0]*xtemp[1] + F->z[0]*xtemp[2] + F->p[0]; |
326 | + y[1] = F->x[1]*xtemp[0] + F->y[1]*xtemp[1] + F->z[1]*xtemp[2] + F->p[1]; |
327 | + y[2] = F->x[2]*xtemp[0] + F->y[2]*xtemp[1] + F->z[2]*xtemp[2] + F->p[2]; |
328 | +} |
329 | +//--------------------------------------------------------------------------- |
330 | +// Coordinate frame inversion: *B = inverse(A) |
331 | +void finvert(frame A, frame *B) |
332 | +{ |
333 | + B->x[1] = A.y[0]; |
334 | + B->x[2] = A.z[0]; |
335 | + B->y[2] = A.z[1]; |
336 | + B->y[0] = A.x[1]; |
337 | + B->z[0] = A.x[2]; |
338 | + B->z[1] = A.y[2]; |
339 | + B->x[0] = A.x[0]; |
340 | + B->y[1] = A.y[1]; |
341 | + B->z[2] = A.z[2]; |
342 | + B->p[0] = -A.x[0]*A.p[0] - A.y[0]*A.p[1] - A.z[0]*A.p[2]; |
343 | + B->p[1] = -A.x[1]*A.p[0] - A.y[1]*A.p[1] - A.z[1]*A.p[2]; |
344 | + B->p[2] = -A.x[2]*A.p[0] - A.y[2]*A.p[1] - A.z[2]*A.p[2]; |
345 | +} |
346 | +//--------------------------------------------------------------------------- |
347 | +//Get a normal vector tangent to a segment endpoint (=1 for p1, =2 for p2) |
348 | +//returns -1 if segment length or radius < tolerance, 0 on success |
349 | +int GetTanVect(segment *s, fp p, int endpoint) |
350 | +{ |
351 | + fp q; |
352 | + |
353 | + if (s->type == LINE) |
354 | + { |
355 | + p[0] = s->p2[0] - s->p1[0]; |
356 | + p[1] = s->p2[1] - s->p1[1]; |
357 | + p[2] = s->p2[2] - s->p1[2]; |
358 | + if (normalize(p, p) < tolerance) return(-1); |
359 | + else return(0); |
360 | + } |
361 | + else if (s->type == ARC) |
362 | + { |
363 | + if (endpoint == 1) |
364 | + { |
365 | + q[0] = s->p1[0] - s->c[0]; |
366 | + q[1] = s->p1[1] - s->c[1]; |
367 | + q[2] = s->p1[2] - s->c[2]; |
368 | + } |
369 | + else |
370 | + { |
371 | + q[0] = s->p2[0] - s->c[0]; |
372 | + q[1] = s->p2[1] - s->c[1]; |
373 | + q[2] = s->p2[2] - s->c[2]; |
374 | + } |
375 | + if (normalize(q, q) < tolerance) return(-1); |
376 | + cross(s->norm, q, p); |
377 | + return(0); |
378 | + } |
379 | + |
380 | + return(0); |
381 | +} |
382 | +//--------------------------------------------------------------------------- |
383 | +// Segment list functions |
384 | +//--------------------------------------------------------------------------- |
385 | +//Theta = allowable angle (in degrees) between continuous path segments |
386 | +extern "C" void SetTangentTolerance(float theta) |
387 | +{ |
388 | + tan_tolerance = cos(theta*DTOR); |
389 | +} |
390 | +//--------------------------------------------------------------------------- |
391 | +// Clear the current segment list and initialize the starting point |
392 | +extern "C" void ClearSegList(float xi, float yi, float zi) |
393 | +{ |
394 | + seglistsize = 0; |
395 | + seglist[0].p1[0] = xi; |
396 | + seglist[0].p1[1] = yi; |
397 | + seglist[0].p1[2] = zi; |
398 | +} |
399 | +//--------------------------------------------------------------------------- |
400 | +//Extract the reference frame for an arc |
401 | +//Also fills in the radius and arclength |
402 | +void GetArcFrame(segment *seg, frame *F) |
403 | +{ |
404 | + float q, theta; |
405 | + fp p; |
406 | + |
407 | + if (seg->type != ARC) return; //punt if not an arc |
408 | + |
409 | + F->p[0] = seg->c[0]; //origin is at the center |
410 | + F->p[1] = seg->c[1]; |
411 | + F->p[2] = seg->c[2]; |
412 | + F->x[0] = seg->p1[0] - seg->c[0]; //X vector points from center to P1 |
413 | + F->x[1] = seg->p1[1] - seg->c[1]; |
414 | + F->x[2] = seg->p1[2] - seg->c[2]; |
415 | + seg->r = normalize(F->x, F->x); //extract radius and normalize |
416 | + q = dot(F->x, seg->norm); //make sure normal vector is perp. to X |
417 | + F->z[0] = seg->norm[0] - q*F->x[0]; |
418 | + F->z[1] = seg->norm[1] - q*F->x[1]; |
419 | + F->z[2] = seg->norm[2] - q*F->x[2]; |
420 | + normalize(F->z, F->z); |
421 | + cross(F->z, F->x, F->y); |
422 | + |
423 | + p[0] = seg->p2[0] - seg->c[0]; //get the arclength |
424 | + p[1] = seg->p2[1] - seg->c[1]; |
425 | + p[2] = seg->p2[2] - seg->c[2]; |
426 | + theta = atan2( dot(p,F->y), dot(p,F->x) ); |
427 | + if (theta < 0.0) theta = TWOPI + theta; |
428 | + if (fabs(theta) < 0.001) theta = TWOPI - theta; |
429 | + seg->len = fabs(seg->r * theta); |
430 | +} |
431 | +//--------------------------------------------------------------------------- |
432 | +//Add a line segment to the segment list |
433 | +//Returns: position in segment list if OK |
434 | +// -1 if segment is not tangent |
435 | +// -2 if segment list is full |
436 | +//Function assumes the normal vector of any previous arc segment is accurate |
437 | +extern "C" int AddLineSeg(float x, float y, float z) |
438 | +{ |
439 | + fp pn, qn; |
440 | + |
441 | + if (seglistsize >= MAXSEG) return(-2); |
442 | + |
443 | + seglist[seglistsize].type = LINE; |
444 | + |
445 | + seglist[seglistsize].p2[0] = x; |
446 | + seglist[seglistsize].p2[1] = y; |
447 | + seglist[seglistsize].p2[2] = z; |
448 | + |
449 | + if (seglistsize > 0) //match start point to end point of prev segment |
450 | + { |
451 | + seglist[seglistsize].p1[0] = seglist[seglistsize-1].p2[0]; |
452 | + seglist[seglistsize].p1[1] = seglist[seglistsize-1].p2[1]; |
453 | + seglist[seglistsize].p1[2] = seglist[seglistsize-1].p2[2]; |
454 | + } |
455 | + |
456 | + //Calculate normal vector and length for this segment |
457 | + pn[0] = x - seglist[seglistsize].p1[0]; |
458 | + pn[1] = y - seglist[seglistsize].p1[1]; |
459 | + pn[2] = z - seglist[seglistsize].p1[2]; |
460 | + seglist[seglistsize].len = normalize(pn, pn); |
461 | + |
462 | + //Check tangency with prev. segment for segments > tolerance: |
463 | + if ( (seglist[seglistsize].len > tolerance) && (seglistsize > 0) ) |
464 | + if ( GetTanVect( &(seglist[seglistsize-1]), qn, 2) == 0 ) |
465 | + if (dot(pn,qn) < tan_tolerance) return(-1); |
466 | + |
467 | + seglistsize++; |
468 | + qDebug() << "seglistsize = " << seglistsize - 1; |
469 | + return(seglistsize - 1); |
470 | +} |
471 | +//--------------------------------------------------------------------------- |
472 | +//Add an arc segment to the segment list |
473 | +//Returns: position in segment list if OK |
474 | +// -1 if segment is not tangent |
475 | +// -2 if segment list is full |
476 | +// -3 if arc data invalid |
477 | +//(Invalid arc data - zero len. normal, radius < tolerance, normal not perp.) |
478 | +//Function assumes the normal vector of any previous arc segment is accurate |
479 | +extern "C" int AddArcSeg( float x, float y, float z, //end point |
480 | + float cx, float cy, float cz, //center point |
481 | + float nx, float ny, float nz ) //normal |
482 | +{ |
483 | + fp pn, qn; |
484 | + frame F; |
485 | + |
486 | + if (seglistsize >= MAXSEG) return(-2); |
487 | + |
488 | + seglist[seglistsize].type = ARC; |
489 | + |
490 | + seglist[seglistsize].p2[0] = x; |
491 | + seglist[seglistsize].p2[1] = y; |
492 | + seglist[seglistsize].p2[2] = z; |
493 | + seglist[seglistsize].c[0] = cx; |
494 | + seglist[seglistsize].c[1] = cy; |
495 | + seglist[seglistsize].c[2] = cz; |
496 | + seglist[seglistsize].norm[0] = nx; |
497 | + seglist[seglistsize].norm[1] = ny; |
498 | + seglist[seglistsize].norm[2] = nz; |
499 | + |
500 | + if (seglistsize > 0) //match start point to end point of prev segment |
501 | + { |
502 | + seglist[seglistsize].p1[0] = seglist[seglistsize-1].p2[0]; |
503 | + seglist[seglistsize].p1[1] = seglist[seglistsize-1].p2[1]; |
504 | + seglist[seglistsize].p1[2] = seglist[seglistsize-1].p2[2]; |
505 | + } |
506 | + |
507 | + //Normalize n and punt if too small |
508 | + if ( normalize(seglist[seglistsize].norm, seglist[seglistsize].norm) < tolerance ) |
509 | + return(-3); |
510 | + |
511 | + //Find radius to p2, and punt if too small |
512 | + pn[0] = x - cx; |
513 | + pn[1] = y - cy; |
514 | + pn[2] = z - cz; |
515 | + seglist[seglistsize].r = normalize(pn, pn); |
516 | + if ( seglist[seglistsize].r < tolerance) return(-3); |
517 | + |
518 | + //Check if normal is perp to c->p2 vector and punt if not |
519 | + if ( fabs(dot(seglist[seglistsize].norm, pn)) > 0.001 ) return(-3); |
520 | + |
521 | + //Find radius to p1, and punt if not equal to radius to p2 |
522 | + pn[0] = seglist[seglistsize].p1[0] - cx; |
523 | + pn[1] = seglist[seglistsize].p1[1] - cy; |
524 | + pn[2] = seglist[seglistsize].p1[2] - cz; |
525 | + if ( fabs(seglist[seglistsize].r - normalize(pn, pn)) > tolerance) return(-3); |
526 | + |
527 | + //Check if normal is perp to c->p2 vector and punt if not |
528 | + if ( fabs(dot(seglist[seglistsize].norm, pn)) > 0.001 ) return(-3); |
529 | + |
530 | + //Check for tangency with prev segment |
531 | + if ( seglistsize > 0 ) |
532 | + { |
533 | + GetTanVect( &(seglist[seglistsize]), pn, 1); //get current tangent |
534 | + if ( GetTanVect( &(seglist[seglistsize-1]), qn, 2) == 0 ) //get prev tangent |
535 | + if (dot(pn,qn) < tan_tolerance) return(-1); |
536 | + } |
537 | + |
538 | + GetArcFrame(&(seglist[seglistsize]), &F); //fills in segment length |
539 | + |
540 | + seglistsize++; |
541 | + return(seglistsize - 1); |
542 | +} |
543 | +//--------------------------------------------------------------------------- |
544 | +//Returns a point p which lies on a line segment, and is a distance s from |
545 | +//the start of the line segment |
546 | +void GetLineSegPoint(segment *seg, float s, fp p) |
547 | +{ |
548 | + float r; |
549 | + |
550 | + r = s/seg->len; |
551 | + p[0] = seg->p1[0] + r*(seg->p2[0] - seg->p1[0]); |
552 | + p[1] = seg->p1[1] + r*(seg->p2[1] - seg->p1[1]); |
553 | + p[2] = seg->p1[2] + r*(seg->p2[2] - seg->p1[2]); |
554 | +} |
555 | +//--------------------------------------------------------------------------- |
556 | +//Set feedrate in units per second |
557 | +extern "C" void SetFeedrate(float fr) |
558 | +{ |
559 | + switch (pathfreq) //calculate velocity in units per tick |
560 | + { |
561 | + case P_30HZ: maxvel = fr/30.0; |
562 | + break; |
563 | + case P_60HZ: maxvel = fr/60.0; |
564 | + break; |
565 | + case P_120HZ: maxvel = fr/120.0; |
566 | + break; |
567 | + default: maxvel = fr/30.0; |
568 | + } |
569 | +} |
570 | +//--------------------------------------------------------------------------- |
571 | +//Set the origin to which all segment data is relative |
572 | +extern "C" void SetOrigin(float xoffset, float yoffset, float zoffset) |
573 | +{ |
574 | + xoff = xoffset; //origin offset |
575 | + yoff = yoffset; |
576 | + zoff = zoffset; |
577 | +} |
578 | +//--------------------------------------------------------------------------- |
579 | +//Initialize various parameters for this path generation module |
580 | +//Returns -1 if Status items are not set properly, |
581 | +// -2 if scale facotrs are zero |
582 | +extern "C" int SetPathParams2(int freq, int nbuf, |
583 | + int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr, |
584 | + float xscale, float yscale, float zscale, |
585 | + float accel ) |
586 | +{ |
587 | + byte statitems; |
588 | + byte ioctrl; |
589 | + |
590 | + //SimpleMsgBox(" PIC-SERVO Coordinated Control Example\n\n- FOR EVALUATION PURPOSES ONLY -"); |
591 | + |
592 | + pathfreq = freq; //set to 30 or 60 hz |
593 | + bufsize = nbuf; //max num points to store in the PIC-SERVO buffer |
594 | + x = (byte)xaxis; //axes addresses |
595 | + y = (byte)yaxis; |
596 | + z = (byte)zaxis; |
597 | + group = (byte)groupaddr; |
598 | + leader = (byte)leaderaddr; |
599 | + |
600 | + if (freq == P_120HZ) //set fast path mode if using 120 Hz path |
601 | + { |
602 | + ioctrl = ServoGetIoCtrl(x); |
603 | + ServoSetIoCtrl(x, (byte)(ioctrl | FAST_PATH)); |
604 | + ioctrl = ServoGetIoCtrl(y); |
605 | + ServoSetIoCtrl(y, (byte)(ioctrl | FAST_PATH)); |
606 | + if (z) |
607 | + { |
608 | + ioctrl = ServoGetIoCtrl(z); |
609 | + ServoSetIoCtrl(z, (byte)(ioctrl | FAST_PATH)); |
610 | + } |
611 | + } |
612 | + else //clear fast path bit if using slower modes |
613 | + { |
614 | + ioctrl = ServoGetIoCtrl(x); |
615 | + ServoSetIoCtrl(x, (byte)(ioctrl & ~((byte)(FAST_PATH)) )); |
616 | + ioctrl = ServoGetIoCtrl(y); |
617 | + ServoSetIoCtrl(y, (byte)(ioctrl & ~((byte)(FAST_PATH)) )); |
618 | + if (z) |
619 | + { |
620 | + ioctrl = ServoGetIoCtrl(z); |
621 | + ServoSetIoCtrl(z, (byte)(ioctrl & ~((byte)(FAST_PATH)) )); |
622 | + } |
623 | + } |
624 | + |
625 | + if (fabs(xscale)<1.0 || fabs(yscale)<1.0) return(-2); |
626 | + if ( zaxis && (fabs(zscale)<1.0) ) return(-2); |
627 | + |
628 | + UTOCX = xscale; //Units To X counts |
629 | + UTOCY = yscale; |
630 | + UTOCZ = zscale; |
631 | + |
632 | + //Set the tolerance equivalent to 40 counts of the lowest resolution axis |
633 | + tolerance = fabs(40.0/xscale); |
634 | + if (tolerance < fabs(40.0/yscale)) tolerance = fabs(40.0/yscale); |
635 | + if (zaxis) |
636 | + if (tolerance < fabs(40.0/zscale)) tolerance = fabs(40.0/zscale); |
637 | + |
638 | + switch (pathfreq) //calculate acceleration in units per tick^2 |
639 | + { |
640 | + case P_30HZ: acc = accel/30.0/30.0; |
641 | + break; |
642 | + case P_60HZ: acc = accel/60.0/60.0; |
643 | + break; |
644 | + case P_120HZ: acc = accel/120.0/120.0; |
645 | + break; |
646 | + default: acc = accel/30.0/30.0; |
647 | + } |
648 | + |
649 | + //Check that the required status data will be returned with each command: |
650 | + statitems = SEND_POS | SEND_NPOINTS | SEND_PERROR | SEND_AUX; |
651 | + |
652 | + if ( ( (NmcGetStatItems(x)& statitems) != statitems ) || |
653 | + ( (NmcGetStatItems(y)& statitems) != statitems ) || |
654 | + ( (z && (NmcGetStatItems(z)& statitems) != statitems )) ) |
655 | + { |
656 | + //ErrorMsgBox("Required status items have not been set"); |
657 | + return(-1); |
658 | + } |
659 | + |
660 | + return(0); |
661 | +} |
662 | +//--------------------------------------------------------------------------- |
663 | +//Initialize various parameters for this path generation module |
664 | +//Returns -1 if Status items are not set properly, |
665 | +// -2 if scale facotrs are zero |
666 | +extern "C" int SetPathParams(int freq, int nbuf, |
667 | + int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr, |
668 | + float xscale, float yscale, float zscale, |
669 | + float accel ) |
670 | +{ |
671 | + byte statitems; |
672 | + |
673 | + //SimpleMsgBox(" PIC-SERVO Coordinated Control Example\n\n- FOR EVALUATION PURPOSES ONLY -"); |
674 | + |
675 | + pathfreq = freq; //set to 30 or 60 hz |
676 | + bufsize = nbuf; //max num points to store in the PIC-SERVO buffer |
677 | + x = (byte)xaxis; //axes addresses |
678 | + y = (byte)yaxis; |
679 | + z = (byte)zaxis; |
680 | + group = (byte)groupaddr; |
681 | + leader = (byte)leaderaddr; |
682 | + |
683 | + if (freq == P_120HZ) //set fast path mode if using 120 Hz path |
684 | + { |
685 | + ServoSetIoCtrl(x, IO1_IN | IO2_IN | FAST_PATH); |
686 | + ServoSetIoCtrl(y, IO1_IN | IO2_IN | FAST_PATH); |
687 | + if (z) ServoSetIoCtrl(z, IO1_IN | IO2_IN | FAST_PATH); |
688 | + } |
689 | + else //otherwise, use slow mode |
690 | + { |
691 | + ServoSetIoCtrl(x, IO1_IN | IO2_IN); |
692 | + ServoSetIoCtrl(y, IO1_IN | IO2_IN); |
693 | + if (z) ServoSetIoCtrl(z, IO1_IN | IO2_IN); |
694 | + } |
695 | + |
696 | + if (fabs(xscale)<1.0 || fabs(yscale)<1.0) return(-2); |
697 | + if ( zaxis && (fabs(zscale)<1.0) ) return(-2); |
698 | + |
699 | + UTOCX = xscale; //Units To X counts |
700 | + UTOCY = yscale; |
701 | + UTOCZ = zscale; |
702 | + |
703 | + //Set the tolerance equivalent to 40 counts of the lowest resolution axis |
704 | + tolerance = fabs(40.0/xscale); |
705 | + if (tolerance < fabs(40.0/yscale)) tolerance = fabs(40.0/yscale); |
706 | + if (zaxis) |
707 | + if (tolerance < fabs(40.0/zscale)) tolerance = fabs(40.0/zscale); |
708 | + |
709 | + switch (pathfreq) //calculate acceleration in units per tick^2 |
710 | + { |
711 | + case P_30HZ: acc = accel/30.0/30.0; |
712 | + break; |
713 | + case P_60HZ: acc = accel/60.0/60.0; |
714 | + break; |
715 | + case P_120HZ: acc = accel/120.0/120.0; |
716 | + break; |
717 | + default: acc = accel/30.0/30.0; |
718 | + } |
719 | + |
720 | + //Check that the required status data will be returned with each command: |
721 | + statitems = SEND_POS | SEND_NPOINTS | SEND_PERROR | SEND_AUX; |
722 | + |
723 | + if ( ( (NmcGetStatItems(x)& statitems) != statitems ) || |
724 | + ( (NmcGetStatItems(y)& statitems) != statitems ) || |
725 | + ( (z && (NmcGetStatItems(z)& statitems) != statitems )) ) |
726 | + { |
727 | + //ErrorMsgBox("Required status items have not been set"); |
728 | + return(-1); |
729 | + } |
730 | + |
731 | + return(0); |
732 | +} |
733 | +//--------------------------------------------------------------------------- |
734 | +//Initializes the coordinated path after all of the segments have been added. |
735 | +//This function should be called just before the application starts calling |
736 | +//the function AddPathPoints(). |
737 | +//Returns the overall path length for all of the segments. |
738 | +//Returns 0.0 on communications error |
739 | +extern "C" float InitPath() |
740 | +{ |
741 | + int i; |
742 | + |
743 | + curseg = 0; |
744 | + curppoint = 0; |
745 | + arclen = 0.0; |
746 | + stublen = 0.0; |
747 | + pathlen = 0.0; |
748 | + vel = 0.0; |
749 | + finaldecel = 0; |
750 | + at_end = 0; |
751 | + |
752 | + for (i=0; i<seglistsize; i++) pathlen += seglist[i].len; |
753 | + |
754 | + if (seglist[0].type == ARC) GetArcFrame( &(seglist[0]), &cur_arcframe ); |
755 | + |
756 | + //make sure we exit path mode first |
757 | + if (!ServoStopMotor(x, ServoGetStopCtrl(x) & (byte)AMP_ENABLE)) return(0.0); |
758 | + if (!ServoStopMotor(y, ServoGetStopCtrl(y) & (byte)AMP_ENABLE)) return(0.0); |
759 | + if (z) |
760 | + if (!ServoStopMotor(z, ServoGetStopCtrl(z) & (byte)AMP_ENABLE)) return(0.0); |
761 | + |
762 | + ServoInitPath(x); //set the beginning of the path to the current position |
763 | + ServoInitPath(y); |
764 | + if (z) ServoInitPath(z); |
765 | + |
766 | + return(pathlen); |
767 | +} |
768 | +//--------------------------------------------------------------------------- |
769 | +//Gets the next point in the path. |
770 | +//returns -1 if already at the end of the path |
771 | +//returns 1 if the last point in the path |
772 | +//returns 0 otherwise |
773 | +int GetNextPathpoint(int *xp, int *yp, int *zp) |
774 | +{ |
775 | + fp p; |
776 | + |
777 | + if (at_end) return(-1); |
778 | + |
779 | + //First check if decelerating to the endpoint |
780 | + if (finaldecel || (vel*vel > 2*acc*(pathlen - arclen)) ) |
781 | + { |
782 | + vel -= acc; |
783 | + if (vel<acc) vel = acc; //use acc value as minimum velocity |
784 | + finaldecel = 1; |
785 | + } |
786 | + else if (vel<maxvel) //check for acceleration to current maxvel |
787 | + { |
788 | + vel+=acc; |
789 | + if (vel>maxvel) vel = maxvel; |
790 | + } |
791 | + else if (vel>maxvel) //check for deceleration to current maxvel |
792 | + { |
793 | + vel-=acc; |
794 | + if (vel<maxvel) vel = maxvel; |
795 | + } |
796 | + |
797 | + while (1) //skip over a segment (or more) if necessary |
798 | + { |
799 | + if ( (stublen + vel) > seglist[curseg].len ) //if past end of segment |
800 | + { |
801 | + stublen -= seglist[curseg].len; //subtract off the seg length |
802 | + curseg++; // & move to next segment |
803 | + int cSeg = curseg; |
804 | + int sLen = seglistsize; |
805 | + if (seglist[curseg].type == ARC) //update arcframe if necessary |
806 | + GetArcFrame( &(seglist[curseg]), &cur_arcframe ); |
807 | + if (curseg == seglistsize) |
808 | + { |
809 | + at_end = 1; //check for end of segment list |
810 | + break; |
811 | + } |
812 | + } |
813 | + else |
814 | + { |
815 | + stublen += vel; |
816 | + arclen += vel; |
817 | + int tempArclen = arclen; |
818 | + int tempPathlen = pathlen; |
819 | + if (arclen > pathlen) at_end = 1; |
820 | + break; |
821 | + } |
822 | + } |
823 | + |
824 | + if (at_end) //return the final endpoint |
825 | + { |
826 | + *xp = (int)( (seglist[seglistsize-1].p2[0] + xoff) * UTOCX ); |
827 | + *yp = (int)( (seglist[seglistsize-1].p2[1] + yoff) * UTOCY ); |
828 | + *zp = (int)( (seglist[seglistsize-1].p2[2] + zoff) * UTOCZ ); |
829 | + } |
830 | + else //find the point within the current segment |
831 | + { |
832 | + if (seglist[curseg].type == LINE) |
833 | + { |
834 | + GetLineSegPoint( &(seglist[curseg]), stublen, p ); |
835 | + } |
836 | + else if (seglist[curseg].type == ARC) |
837 | + { |
838 | + p[0] = seglist[curseg].r * cos(stublen/seglist[curseg].r); |
839 | + p[1] = seglist[curseg].r * sin(stublen/seglist[curseg].r); |
840 | + p[2] = 0; |
841 | + fvmult(&cur_arcframe, p, p); |
842 | + } |
843 | + *xp = (int)( (p[0] + xoff) * UTOCX ); |
844 | + *yp = (int)( (p[1] + yoff) * UTOCY ); |
845 | + *zp = (int)( (p[2] + zoff) * UTOCZ ); |
846 | + } |
847 | + |
848 | + return(at_end); |
849 | +} |
850 | +//--------------------------------------------------------------------------- |
851 | +//Adds points to path buffer - should be called at regular intervals which |
852 | +//are shorter than the buffer time (bufsize/pathfreq). |
853 | +// |
854 | +//Returns: -1 if path download is done |
855 | +// curseg if in middle of the path |
856 | +// -2 if communication error |
857 | +extern "C" int AddPathPoints() |
858 | +{ |
859 | + int xp[7], yp[7], zp[7]; //set of up to 7 pathpoints |
860 | + int pcount; |
861 | + |
862 | + //VEL = MAXVEL = 0.0 defines a feedhold condition |
863 | + //Setting MAXVEL to a non-zero value will resume path execution |
864 | + if (maxvel==0.0 && vel == 0.0) return(curseg); |
865 | + |
866 | + while (!at_end) //GetNextPathpoint() sets the global at_end |
867 | + { |
868 | + if (!NmcNoOp(x)) return(-2); //read num points from X |
869 | + |
870 | + //punt when PIC-SERVO buffer is full |
871 | + if ((ServoGetNPoints(x)>bufsize) || (ServoGetNPoints(x)>87)) |
872 | + { |
873 | + if (!NmcNoOp(y)) return(-2); //make sure data is updated even if points are not added |
874 | + if (!NmcNoOp(z)) return(-2); |
875 | + break; |
876 | + } |
877 | + |
878 | + for (pcount=0; pcount<7; pcount++) //get upto 7 new points |
879 | + if ( GetNextPathpoint( xp+pcount, yp+pcount, zp+pcount ) ) break; |
880 | + |
881 | + if (pcount<7) pcount++; |
882 | + |
883 | + if (!ServoAddPathpoints(x, pcount, xp, pathfreq)) return(-2); |
884 | + if (!ServoAddPathpoints(y, pcount, yp, pathfreq)) return(-2); |
885 | + if (z) |
886 | + if (!ServoAddPathpoints(z, pcount, zp, pathfreq)) return(-2); |
887 | + } |
888 | + |
889 | + if ( !(ServoGetAux(x) & PATH_MODE) ) //start path mode when buffer full |
890 | + if (!ServoStartPathMode(group, leader)) return(-2); |
891 | + |
892 | + if (at_end) return(-1); |
893 | + return(curseg); |
894 | +} |
895 | +//--------------------------------------------------------------------------- |
896 | |
897 | === added file 'software/Common/JrKerr/old_path/path.h' |
898 | --- software/Common/JrKerr/old_path/path.h 1970-01-01 00:00:00 +0000 |
899 | +++ software/Common/JrKerr/old_path/path.h 2010-08-07 00:08:43 +0000 |
900 | @@ -0,0 +1,83 @@ |
901 | +//--------------------------------------------------------------------------- |
902 | +#ifndef pathH |
903 | +#define pathH |
904 | +//--------------------------------------------------------------------------- |
905 | +//Defines: |
906 | + |
907 | +//Segment types: |
908 | +#define LINE 0 |
909 | +#define ARC 1 |
910 | + |
911 | +#define MAXSEG 1000 //Maximum number of segments |
912 | +#define PI 3.14159 |
913 | +#define TWOPI 6.28319 |
914 | +#define DTOR 0.017453 |
915 | + |
916 | +//Valuse for tangent tolerance |
917 | +#define TAN_1DEGREE 0.99985 |
918 | +#define TAN_3DEGREE 0.99863 |
919 | +#define TAN_5DEGREE 0.99619 |
920 | +#define TAN_10DEGREE 0.98481 |
921 | +#define TAN_20DEGREE 0.93969 |
922 | +#define TAN_45DEGREE 0.70711 |
923 | + |
924 | +#define ONLINE 1 |
925 | +//--------------------------------------------------------------------------- |
926 | +//Data types: |
927 | + |
928 | +typedef float fp[3]; //floating point 3x1 vector |
929 | + |
930 | +typedef int ip[3]; //integer 3x1 vector |
931 | + |
932 | +typedef struct { //data type for line segments or arc segments |
933 | + int type; //LINE or ARC |
934 | + fp p1; //Starting point |
935 | + fp p2; //Ending point |
936 | + fp c; //Center point (arcs only) |
937 | + fp norm; //Normal vector (arcs only) |
938 | + float len; //Segment length |
939 | + float r; //Radius (arcs only) |
940 | + } segment; |
941 | + |
942 | +typedef struct { //data type for a coordinate frame |
943 | + fp x; |
944 | + fp y; |
945 | + fp z; |
946 | + fp p; |
947 | + } frame; |
948 | + |
949 | +//--------------------------------------------------------------------------- |
950 | +//Function prototypes: |
951 | +float mag(fp p); |
952 | +float dot(fp x, fp y); |
953 | +void cross(fp x, fp y, fp z); |
954 | +float normalize(fp x, fp y); |
955 | +void fvmult(frame *F, fp x, fp y); |
956 | +void finvert(frame A, frame *B); |
957 | +int GetTanVect(segment *s, fp p, int endpoint); |
958 | +void GetArcFrame(segment *seg, frame *F); |
959 | +void GetLineSegPoint(segment *seg, float s, fp p); |
960 | +int GetNextPathpoint(int *xp, int *yp, int *zp); |
961 | + |
962 | +//Path mode API functions: |
963 | +extern "C" void SetTangentTolerance(float theta); |
964 | +extern "C" void ClearSegList(float x, float y, float z); |
965 | +extern "C" int AddLineSeg(float x, float y, float z); |
966 | +extern "C" int AddArcSeg( float x, float y, float z, //end point |
967 | + float cx, float cy, float cz, //center point |
968 | + float nx, float ny, float nz ); //normal |
969 | +extern "C" void SetFeedrate(float fr); |
970 | +extern "C" void SetOrigin(float xoffset, float yoffset, float zoffset); |
971 | +extern "C" int SetPathParams(int freq, int nbuf, |
972 | + int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr, |
973 | + float xscale, float yscale, float zscale, |
974 | + float accel ); |
975 | +extern "C" int SetPathParams2(int freq, int nbuf, |
976 | + int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr, |
977 | + float xscale, float yscale, float zscale, |
978 | + float accel ); |
979 | +extern "C" float InitPath(); |
980 | +extern "C" int AddPathPoints(); |
981 | + |
982 | +//--------------------------------------------------------------------------- |
983 | +#endif |
984 | |
985 | === modified file 'software/Common/JrKerr/path.cpp' |
986 | --- software/Common/JrKerr/path.cpp 2010-07-23 20:12:14 +0000 |
987 | +++ software/Common/JrKerr/path.cpp 2010-08-07 00:08:43 +0000 |
988 | @@ -5,7 +5,7 @@ |
989 | #include "path.h" |
990 | #include "nmccom.h" |
991 | #include "picservo.h" |
992 | -#include <QDebug> |
993 | +#include "qdebug.h" |
994 | //--------------------------------------------------------------------------- |
995 | //Globals: |
996 | int pathsize; //local path size |
997 | @@ -220,7 +220,6 @@ |
998 | if (dot(pn,qn) < tan_tolerance) return(-1); |
999 | |
1000 | seglistsize++; |
1001 | - qDebug() << "seglistsize = " << seglistsize - 1; |
1002 | return(seglistsize - 1); |
1003 | } |
1004 | //--------------------------------------------------------------------------- |
1005 | @@ -408,7 +407,7 @@ |
1006 | ( (NmcGetStatItems(y)& statitems) != statitems ) || |
1007 | ( (z && (NmcGetStatItems(z)& statitems) != statitems )) ) |
1008 | { |
1009 | - //ErrorMsgBox("Required status items have not been set"); |
1010 | + qDebug() << "Required status items have not been set"; |
1011 | return(-1); |
1012 | } |
1013 | |
1014 | @@ -479,7 +478,7 @@ |
1015 | ( (NmcGetStatItems(y)& statitems) != statitems ) || |
1016 | ( (z && (NmcGetStatItems(z)& statitems) != statitems )) ) |
1017 | { |
1018 | - //ErrorMsgBox("Required status items have not been set"); |
1019 | + qDebug() << "Required status items have not been set"; |
1020 | return(-1); |
1021 | } |
1022 | |
1023 | @@ -525,7 +524,7 @@ |
1024 | //returns -1 if already at the end of the path |
1025 | //returns 1 if the last point in the path |
1026 | //returns 0 otherwise |
1027 | -int GetNextPathpoint(long int *xp, long int *yp, long int *zp) |
1028 | +int GetNextPathpoint(int *xp, int *yp, int *zp) |
1029 | { |
1030 | fp p; |
1031 | |
1032 | @@ -574,9 +573,9 @@ |
1033 | |
1034 | if (at_end) //return the final endpoint |
1035 | { |
1036 | - *xp = (long int)( (seglist[seglistsize-1].p2[0] + xoff) * UTOCX ); |
1037 | - *yp = (long int)( (seglist[seglistsize-1].p2[1] + yoff) * UTOCY ); |
1038 | - *zp = (long int)( (seglist[seglistsize-1].p2[2] + zoff) * UTOCZ ); |
1039 | + *xp = (int)( (seglist[seglistsize-1].p2[0] + xoff) * UTOCX ); |
1040 | + *yp = (int)( (seglist[seglistsize-1].p2[1] + yoff) * UTOCY ); |
1041 | + *zp = (int)( (seglist[seglistsize-1].p2[2] + zoff) * UTOCZ ); |
1042 | } |
1043 | else //find the point within the current segment |
1044 | { |
1045 | @@ -591,9 +590,9 @@ |
1046 | p[2] = 0; |
1047 | fvmult(&cur_arcframe, p, p); |
1048 | } |
1049 | - *xp = (long int)( (p[0] + xoff) * UTOCX ); |
1050 | - *yp = (long int)( (p[1] + yoff) * UTOCY ); |
1051 | - *zp = (long int)( (p[2] + zoff) * UTOCZ ); |
1052 | + *xp = (int)( (p[0] + xoff) * UTOCX ); |
1053 | + *yp = (int)( (p[1] + yoff) * UTOCY ); |
1054 | + *zp = (int)( (p[2] + zoff) * UTOCZ ); |
1055 | } |
1056 | |
1057 | return(at_end); |
1058 | @@ -607,7 +606,7 @@ |
1059 | // -2 if communication error |
1060 | extern "C" int AddPathPoints() |
1061 | { |
1062 | - long int xp[7], yp[7], zp[7]; //set of up to 7 pathpoints |
1063 | + int xp[7], yp[7], zp[7]; //set of up to 7 pathpoints |
1064 | int pcount; |
1065 | |
1066 | //VEL = MAXVEL = 0.0 defines a feedhold condition |
1067 | |
1068 | === modified file 'software/Common/JrKerr/path.h' |
1069 | --- software/Common/JrKerr/path.h 2010-07-13 18:44:38 +0000 |
1070 | +++ software/Common/JrKerr/path.h 2010-08-07 00:08:43 +0000 |
1071 | @@ -27,7 +27,7 @@ |
1072 | |
1073 | typedef float fp[3]; //floating point 3x1 vector |
1074 | |
1075 | -typedef long int ip[3]; //integer 3x1 vector |
1076 | +typedef int ip[3]; //integer 3x1 vector |
1077 | |
1078 | typedef struct { //data type for line segments or arc segments |
1079 | int type; //LINE or ARC |
1080 | @@ -57,25 +57,25 @@ |
1081 | int GetTanVect(segment *s, fp p, int endpoint); |
1082 | void GetArcFrame(segment *seg, frame *F); |
1083 | void GetLineSegPoint(segment *seg, float s, fp p); |
1084 | -int GetNextPathpoint(long int *xp, long int *yp, long int *zp); |
1085 | +int GetNextPathpoint(int *xp, int *yp, int *zp); |
1086 | |
1087 | //Path mode API functions: |
1088 | extern "C" void SetTangentTolerance(float theta); |
1089 | extern "C" void ClearSegList(float x, float y, float z); |
1090 | extern "C" int AddLineSeg(float x, float y, float z); |
1091 | extern "C" int AddArcSeg( float x, float y, float z, //end point |
1092 | - float cx, float cy, float cz, //center point |
1093 | - float nx, float ny, float nz ); //normal |
1094 | + float cx, float cy, float cz, //center point |
1095 | + float nx, float ny, float nz ); //normal |
1096 | extern "C" void SetFeedrate(float fr); |
1097 | extern "C" void SetOrigin(float xoffset, float yoffset, float zoffset); |
1098 | extern "C" int SetPathParams(int freq, int nbuf, |
1099 | - int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr, |
1100 | - float xscale, float yscale, float zscale, |
1101 | - float accel ); |
1102 | + int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr, |
1103 | + float xscale, float yscale, float zscale, |
1104 | + float accel ); |
1105 | extern "C" int SetPathParams2(int freq, int nbuf, |
1106 | - int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr, |
1107 | - float xscale, float yscale, float zscale, |
1108 | - float accel ); |
1109 | + int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr, |
1110 | + float xscale, float yscale, float zscale, |
1111 | + float accel ); |
1112 | extern "C" float InitPath(); |
1113 | extern "C" int AddPathPoints(); |
1114 | |
1115 | |
1116 | === modified file 'software/Common/JrKerr/picservo.cpp' |
1117 | --- software/Common/JrKerr/picservo.cpp 2010-07-23 20:12:14 +0000 |
1118 | +++ software/Common/JrKerr/picservo.cpp 2010-08-07 00:08:43 +0000 |
1119 | @@ -5,6 +5,7 @@ |
1120 | #include "qextserialport.h" |
1121 | #include <stdio.h> |
1122 | #include <unistd.h> |
1123 | +#include <QDebug> |
1124 | |
1125 | //--------------------------------------------------------------------------- |
1126 | extern NMCMOD mod[]; //Array of modules |
1127 | @@ -37,9 +38,10 @@ |
1128 | (p->gain).el = 0; |
1129 | (p->gain).sr = 1; |
1130 | (p->gain).dc = 0; |
1131 | +(p->gain).sm = 1; |
1132 | |
1133 | p->stoppos = 0; |
1134 | -p->ioctrl = IO1_IN | IO2_IN; |
1135 | +p->ioctrl = 0; |
1136 | p->homectrl = 0; |
1137 | p->movectrl = 0; |
1138 | p->stopctrl = 0; |
1139 | @@ -72,18 +74,19 @@ |
1140 | if ( (mod[addr].statusitems) & SEND_PERROR ) numbytes +=2; |
1141 | if ( (mod[addr].statusitems) & SEND_NPOINTS ) numbytes +=1; |
1142 | QextSerialPort* ComPort = getComPort(); |
1143 | -//usleep(50000); |
1144 | +//usleep(100000); |
1145 | for (i = 0, numrcvd = 0; i < numbytes; i++) |
1146 | { |
1147 | - if (ComPort->read(&(char)inbuf[i], 1)) numrcvd++; |
1148 | + byte* temp = &inbuf[i]; |
1149 | + if (ComPort->read((char *) temp, 1)) numrcvd++; |
1150 | } |
1151 | |
1152 | |
1153 | //Verify enough data was read |
1154 | if (numrcvd != numbytes) |
1155 | { |
1156 | - printf("ServoGetStat (%d) failed to read chars\n",addr); |
1157 | - printf("Read %d bytes out of %d bytes\n", numrcvd, numbytes); |
1158 | + qDebug() << "ServoGetStat " << addr << " failed to read chars"; |
1159 | + qDebug() << "Read " << numrcvd << " bytes out of " << numbytes << " bytes."; |
1160 | return false; |
1161 | } |
1162 | |
1163 | @@ -92,7 +95,7 @@ |
1164 | for (i=0; i<numbytes-1; i++) cksum = (byte)(cksum + inbuf[i]); |
1165 | if (cksum != inbuf[numbytes-1]) |
1166 | { |
1167 | - printf("ServoGetStat(%d): checksum error\n",addr); |
1168 | + qDebug() << "ServoGetStat" << addr << ": checksum error"; |
1169 | return false; |
1170 | } |
1171 | |
1172 | @@ -100,7 +103,7 @@ |
1173 | mod[addr].stat = inbuf[0]; |
1174 | if (mod[addr].stat & CKSUM_ERROR) |
1175 | { |
1176 | - printf("Command checksum error!\n"); |
1177 | + qDebug() << "Command checksum error!"; |
1178 | return false; |
1179 | } |
1180 | |
1181 | @@ -108,7 +111,7 @@ |
1182 | bytecount = 1; |
1183 | if ( (mod[addr].statusitems) & SEND_POS ) |
1184 | { |
1185 | - p->pos = *( (long *)(inbuf + bytecount) ); |
1186 | + p->pos = *( (int *)(inbuf + bytecount) ); |
1187 | bytecount +=4; |
1188 | } |
1189 | if ( (mod[addr].statusitems) & SEND_AD ) |
1190 | @@ -128,7 +131,7 @@ |
1191 | } |
1192 | if ( (mod[addr].statusitems) & SEND_HOME ) |
1193 | { |
1194 | - p->home = *( (unsigned long *)(inbuf + bytecount) ); |
1195 | + p->home = *( (unsigned int *)(inbuf + bytecount) ); |
1196 | bytecount +=4; |
1197 | } |
1198 | if ( (mod[addr].statusitems) & SEND_ID ) |
1199 | @@ -144,6 +147,7 @@ |
1200 | } |
1201 | if ( (mod[addr].statusitems) & SEND_NPOINTS ) |
1202 | { |
1203 | + byte temp = inbuf[bytecount]; |
1204 | p->npoints = inbuf[bytecount]; |
1205 | //bytecount +=1; |
1206 | } |
1207 | @@ -151,7 +155,7 @@ |
1208 | return(true); |
1209 | } |
1210 | //--------------------------------------------------------------------------- |
1211 | -extern "C" long ServoGetPos(byte addr) |
1212 | +extern "C" int ServoGetPos(byte addr) |
1213 | { |
1214 | SERVOMOD * p; |
1215 | |
1216 | @@ -183,7 +187,7 @@ |
1217 | return p->aux; |
1218 | } |
1219 | //--------------------------------------------------------------------------- |
1220 | -extern "C" long ServoGetHome(byte addr) |
1221 | +extern "C" int ServoGetHome(byte addr) |
1222 | { |
1223 | SERVOMOD * p; |
1224 | |
1225 | @@ -207,7 +211,7 @@ |
1226 | return p->npoints; |
1227 | } |
1228 | //--------------------------------------------------------------------------- |
1229 | -extern "C" long ServoGetCmdPos(byte addr) |
1230 | +extern "C" int ServoGetCmdPos(byte addr) |
1231 | { |
1232 | SERVOMOD * p; |
1233 | |
1234 | @@ -215,7 +219,7 @@ |
1235 | return p->cmdpos; |
1236 | } |
1237 | //--------------------------------------------------------------------------- |
1238 | -extern "C" long ServoGetCmdVel(byte addr) |
1239 | +extern "C" int ServoGetCmdVel(byte addr) |
1240 | { |
1241 | SERVOMOD * p; |
1242 | |
1243 | @@ -223,7 +227,7 @@ |
1244 | return p->cmdvel; |
1245 | } |
1246 | //--------------------------------------------------------------------------- |
1247 | -extern "C" long ServoGetCmdAcc(byte addr) |
1248 | +extern "C" int ServoGetCmdAcc(byte addr) |
1249 | { |
1250 | SERVOMOD * p; |
1251 | |
1252 | @@ -231,7 +235,7 @@ |
1253 | return p->cmdacc; |
1254 | } |
1255 | //--------------------------------------------------------------------------- |
1256 | -extern "C" long ServoGetStopPos(byte addr) |
1257 | +extern "C" int ServoGetStopPos(byte addr) |
1258 | { |
1259 | SERVOMOD * p; |
1260 | |
1261 | @@ -343,6 +347,9 @@ |
1262 | *( (byte *)(cmdstr+13) ) = dc; |
1263 | |
1264 | |
1265 | +usleep(51000); |
1266 | + |
1267 | + |
1268 | return NmcSendCmd(addr, SET_GAIN, cmdstr, 14, addr); |
1269 | } |
1270 | //---------------------------------------------------------------------------// |
1271 | @@ -434,7 +441,7 @@ |
1272 | return NmcSendCmd(addr, SET_GAIN, cmdstr, 15, addr); |
1273 | } |
1274 | //--------------------------------------------------------------------------- |
1275 | -extern "C" BOOL ServoLoadTraj(byte addr, byte mode, long pos, long vel, long acc, byte pwm) |
1276 | +extern "C" BOOL ServoLoadTraj(byte addr, byte mode, int pos, int vel, int acc, byte pwm) |
1277 | { |
1278 | SERVOMOD * p; |
1279 | char cmdstr[16]; |
1280 | @@ -449,9 +456,9 @@ |
1281 | |
1282 | count = 0; |
1283 | *( (byte *)(cmdstr + count) ) = mode; count += 1; |
1284 | -if (mode & LOAD_POS) { *( (long *)(cmdstr + count) ) = pos; count += 4; } |
1285 | -if (mode & LOAD_VEL) { *( (long *)(cmdstr + count) ) = vel; count += 4; } |
1286 | -if (mode & LOAD_ACC) { *( (long *)(cmdstr + count) ) = acc; count += 4; } |
1287 | +if (mode & LOAD_POS) { *( (int *)(cmdstr + count) ) = pos; count += 4; } |
1288 | +if (mode & LOAD_VEL) { *( (int *)(cmdstr + count) ) = vel; count += 4; } |
1289 | +if (mode & LOAD_ACC) { *( (int *)(cmdstr + count) ) = acc; count += 4; } |
1290 | if (mode & LOAD_PWM) { *( (byte *)(cmdstr + count) ) = pwm; count += 1; } |
1291 | |
1292 | return NmcSendCmd(addr, LOAD_TRAJ, cmdstr, (byte)count, addr); |
1293 | @@ -467,14 +474,17 @@ |
1294 | p->last_ppoint = p->pos + p->perror; |
1295 | } |
1296 | //--------------------------------------------------------------------------- |
1297 | -extern "C" BOOL ServoAddPathpoints(byte addr, int npoints, long *path, int freq) |
1298 | +extern "C" BOOL ServoAddPathpoints(byte addr, int npoints, int *path, int freq) |
1299 | { |
1300 | SERVOMOD * p; |
1301 | char cmdstr[16]; |
1302 | -long diff; |
1303 | +int diff; |
1304 | int rev; |
1305 | int i; |
1306 | |
1307 | +//npoints must be greater than 0 |
1308 | +if (npoints <= 0) return 0; |
1309 | + |
1310 | p = (SERVOMOD *)(mod[addr].p); |
1311 | |
1312 | for (i=0; i<npoints; i++) |
1313 | @@ -559,12 +569,12 @@ |
1314 | // pos: position (-2,147,483,648 - +2,147,483,647) // |
1315 | // Description: Sets the module position to the specified value. // |
1316 | //---------------------------------------------------------------------------// |
1317 | -extern "C" BOOL ServoSetPos(byte addr, long pos) |
1318 | +extern "C" BOOL ServoSetPos(byte addr, int pos) |
1319 | { |
1320 | char cmdstr[6]; |
1321 | |
1322 | cmdstr[0] = SET_POS; //mode byte for reset pos |
1323 | - *( (long *)(cmdstr + 1) ) = pos; |
1324 | + *( (int *)(cmdstr + 1) ) = pos; |
1325 | |
1326 | return NmcSendCmd(addr, RESET_POS, cmdstr, 5, addr); |
1327 | } |
1328 | @@ -593,7 +603,7 @@ |
1329 | // pos: unprofiled command position // |
1330 | // Description: Stop the motor at the specified position. // |
1331 | //---------------------------------------------------------------------------// |
1332 | -extern "C" BOOL ServoStopHere(byte addr, byte mode, long pos) |
1333 | +extern "C" BOOL ServoStopHere(byte addr, byte mode, int pos) |
1334 | { |
1335 | SERVOMOD * p; |
1336 | char cmdstr[6]; |
1337 | @@ -603,7 +613,7 @@ |
1338 | p->stopctrl = mode; |
1339 | |
1340 | cmdstr[0] = mode; |
1341 | - *( (long *)(cmdstr + 1) ) = pos; |
1342 | + *( (int *)(cmdstr + 1) ) = pos; |
1343 | |
1344 | return NmcSendCmd(addr, STOP_MOTOR, cmdstr, 5, addr); |
1345 | } |
1346 | |
1347 | === modified file 'software/Common/JrKerr/picservo.h' |
1348 | --- software/Common/JrKerr/picservo.h 2010-07-12 18:50:09 +0000 |
1349 | +++ software/Common/JrKerr/picservo.h 2010-08-07 00:08:43 +0000 |
1350 | @@ -24,28 +24,28 @@ |
1351 | } GAINVECT; |
1352 | |
1353 | typedef struct _SERVOMOD { |
1354 | - long pos; //current position |
1355 | + int pos; //current position |
1356 | byte ad; //a/d value |
1357 | short int vel; //current velocity |
1358 | byte aux; //auxilliary status byte |
1359 | - long home; //home position |
1360 | + int home; //home position |
1361 | short int perror; //position error |
1362 | byte npoints; //number of points in path buffer |
1363 | |
1364 | //The following data is stored locally for reference |
1365 | - long cmdpos; //last commanded position |
1366 | - long cmdvel; //last commanded velocity |
1367 | - long cmdacc; //last commanded acceleration |
1368 | + int cmdpos; //last commanded position |
1369 | + int cmdvel; //last commanded velocity |
1370 | + int cmdacc; //last commanded acceleration |
1371 | byte cmdpwm; //last commanded PWM value |
1372 | GAINVECT gain; |
1373 | - long stoppos; //motor stop position (used by stop command) |
1374 | + int stoppos; //motor stop position (used by stop command) |
1375 | byte stopctrl; //stop control byte |
1376 | byte movectrl; //load_traj control byte |
1377 | byte ioctrl; //I/O control byte |
1378 | byte homectrl; //homing control byte |
1379 | byte ph_adv; //phase advance (for ss-drive modules) |
1380 | byte ph_off; //phase offset (for ss-drive modules) |
1381 | - long last_ppoint; //last path point specified |
1382 | + int last_ppoint; //last path point specified |
1383 | } SERVOMOD; |
1384 | |
1385 | |
1386 | @@ -163,17 +163,17 @@ |
1387 | //Servo module function prototypes: |
1388 | extern "C" SERVOMOD * ServoNewMod(); |
1389 | extern "C" BOOL ServoGetStat(byte addr); |
1390 | -extern "C" long ServoGetPos(byte addr); |
1391 | +extern "C" int ServoGetPos(byte addr); |
1392 | extern "C" byte ServoGetAD(byte addr); |
1393 | extern "C" short int ServoGetVel(byte addr); |
1394 | extern "C" byte ServoGetAux(byte addr); |
1395 | -extern "C" long ServoGetHome(byte addr); |
1396 | +extern "C" int ServoGetHome(byte addr); |
1397 | extern "C" short int ServoGetPError(byte addr); |
1398 | extern "C" byte ServoGetNPoints(byte addr); |
1399 | -extern "C" long ServoGetCmdPos(byte addr); |
1400 | -extern "C" long ServoGetCmdVel(byte addr); |
1401 | -extern "C" long ServoGetCmdAcc(byte addr); |
1402 | -extern "C" long ServoGetStopPos(byte addr); |
1403 | +extern "C" int ServoGetCmdPos(byte addr); |
1404 | +extern "C" int ServoGetCmdVel(byte addr); |
1405 | +extern "C" int ServoGetCmdAcc(byte addr); |
1406 | +extern "C" int ServoGetStopPos(byte addr); |
1407 | extern "C" byte ServoGetCmdPwm(byte addr); |
1408 | extern "C" byte ServoGetMoveCtrl(byte addr); |
1409 | extern "C" byte ServoGetStopCtrl(byte addr); |
1410 | @@ -198,15 +198,15 @@ |
1411 | extern "C" BOOL ServoResetPos(byte addr); |
1412 | extern "C" BOOL ServoResetRelHome(byte addr); |
1413 | //added |
1414 | -extern "C" BOOL ServoSetPos(byte addr, long pos); |
1415 | +extern "C" BOOL ServoSetPos(byte addr, int pos); |
1416 | extern "C" BOOL ServoClearBits(byte addr); |
1417 | extern "C" BOOL ServoStopMotor(byte addr, byte mode); |
1418 | //added |
1419 | -extern "C" BOOL ServoStopHere(byte addr, byte mode, long pos); |
1420 | +extern "C" BOOL ServoStopHere(byte addr, byte mode, int pos); |
1421 | extern "C" BOOL ServoSetIoCtrl(byte addr, byte mode); |
1422 | -extern "C" BOOL ServoLoadTraj(byte addr, byte mode, long pos, long vel, long acc, byte pwm); |
1423 | +extern "C" BOOL ServoLoadTraj(byte addr, byte mode, int pos, int vel, int acc, byte pwm); |
1424 | extern "C" void ServoInitPath(byte addr); |
1425 | -extern "C" BOOL ServoAddPathpoints(byte addr, int npoints, long *path, int freq); |
1426 | +extern "C" BOOL ServoAddPathpoints(byte addr, int npoints, int *path, int freq); |
1427 | extern "C" BOOL ServoStartPathMode(byte groupaddr, byte groupleader); |
1428 | //added |
1429 | extern "C" BOOL ServoStartMove(byte groupaddr, byte groupleader); |
1430 | |
1431 | === modified file 'software/Common/JrKerr/src/.DS_Store' |
1432 | Binary files software/Common/JrKerr/src/.DS_Store 2010-07-23 20:12:14 +0000 and software/Common/JrKerr/src/.DS_Store 2010-08-07 00:08:43 +0000 differ |
1433 | === modified file 'software/Common/JrKerr/src/Makefile' |
1434 | --- software/Common/JrKerr/src/Makefile 2010-07-22 15:32:37 +0000 |
1435 | +++ software/Common/JrKerr/src/Makefile 2010-08-07 00:08:43 +0000 |
1436 | @@ -1,6 +1,6 @@ |
1437 | ############################################################################# |
1438 | # Makefile for building: libqextserialportd.1.0.0.dylib |
1439 | -# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Jul 20 14:13:07 2010 |
1440 | +# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Aug 3 22:47:38 2010 |
1441 | # Project: src.pro |
1442 | # Template: lib |
1443 | # Command: /usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile src.pro |
1444 | |
1445 | === modified file 'software/Common/JrKerr/src/Makefile.Debug' |
1446 | --- software/Common/JrKerr/src/Makefile.Debug 2010-07-22 15:32:37 +0000 |
1447 | +++ software/Common/JrKerr/src/Makefile.Debug 2010-08-07 00:08:43 +0000 |
1448 | @@ -1,6 +1,6 @@ |
1449 | ############################################################################# |
1450 | # Makefile for building: libqextserialportd.1.0.0.dylib |
1451 | -# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Jul 20 14:13:07 2010 |
1452 | +# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Aug 3 22:47:38 2010 |
1453 | # Project: src.pro |
1454 | # Template: lib |
1455 | ############################################################################# |
1456 | |
1457 | === modified file 'software/Common/JrKerr/src/Makefile.Release' |
1458 | --- software/Common/JrKerr/src/Makefile.Release 2010-07-22 15:32:37 +0000 |
1459 | +++ software/Common/JrKerr/src/Makefile.Release 2010-08-07 00:08:43 +0000 |
1460 | @@ -1,6 +1,6 @@ |
1461 | ############################################################################# |
1462 | # Makefile for building: libqextserialport.1.0.0.dylib |
1463 | -# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Jul 20 14:13:07 2010 |
1464 | +# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Aug 3 22:47:38 2010 |
1465 | # Project: src.pro |
1466 | # Template: lib |
1467 | ############################################################################# |
1468 | |
1469 | === modified file 'software/Common/JrKerr/src/src.pro.user' |
1470 | --- software/Common/JrKerr/src/src.pro.user 2010-07-23 20:12:14 +0000 |
1471 | +++ software/Common/JrKerr/src/src.pro.user 2010-08-07 00:08:43 +0000 |
1472 | @@ -22,9 +22,7 @@ |
1473 | </data> |
1474 | <data> |
1475 | <variable>RunConfiguration0-UserEnvironmentChanges</variable> |
1476 | - <valuelist type="QVariantList"> |
1477 | - <value type="QString">DYLD_LIBRARY_PATH=$(qextserialport)/src/build</value> |
1478 | - </valuelist> |
1479 | + <valuelist type="QVariantList"/> |
1480 | </data> |
1481 | <data> |
1482 | <variable>RunConfiguration0-UserName</variable> |
1483 | @@ -61,32 +59,42 @@ |
1484 | </valuemap> |
1485 | </data> |
1486 | <data> |
1487 | + <variable>buildConfiguration-Release</variable> |
1488 | + <valuemap type="QVariantMap"> |
1489 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value> |
1490 | + <value key="QtVersionId" type="int">0</value> |
1491 | + <value key="ToolChain" type="int">0</value> |
1492 | + <value key="addQDumper" type=""></value> |
1493 | + <value key="buildConfiguration" type="int">2</value> |
1494 | + </valuemap> |
1495 | + </data> |
1496 | + <data> |
1497 | <variable>buildconfiguration-Debug-buildstep0</variable> |
1498 | <valuemap type="QVariantMap"> |
1499 | <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
1500 | <valuelist key="abstractProcess.Environment" type="QVariantList"> |
1501 | - <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-4XNpfV/Render</value> |
1502 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
1503 | <value type="QString">COMMAND_MODE=unix2003</value> |
1504 | - <value type="QString">DISPLAY=/tmp/launch-s7Hnnm/:0</value> |
1505 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
1506 | <value type="QString">HOME=/Users/jcman912</value> |
1507 | <value type="QString">LOGNAME=jcman912</value> |
1508 | <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
1509 | <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
1510 | <value type="QString">SHELL=/bin/bash</value> |
1511 | - <value type="QString">SSH_AUTH_SOCK=/tmp/launch-jV3RpK/Listeners</value> |
1512 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
1513 | <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
1514 | <value type="QString">USER=jcman912</value> |
1515 | <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
1516 | </valuelist> |
1517 | <valuelist key="abstractProcess.arguments" type="QVariantList"> |
1518 | - <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src/src.pro</value> |
1519 | + <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src/src.pro</value> |
1520 | <value type="QString">-spec</value> |
1521 | <value type="QString">macx-g++</value> |
1522 | <value type="QString">-r</value> |
1523 | </valuelist> |
1524 | <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value> |
1525 | <value key="abstractProcess.enabled" type="bool">false</value> |
1526 | - <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src</value> |
1527 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src</value> |
1528 | </valuemap> |
1529 | </data> |
1530 | <data> |
1531 | @@ -94,15 +102,15 @@ |
1532 | <valuemap type="QVariantMap"> |
1533 | <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
1534 | <valuelist key="abstractProcess.Environment" type="QVariantList"> |
1535 | - <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-4XNpfV/Render</value> |
1536 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
1537 | <value type="QString">COMMAND_MODE=unix2003</value> |
1538 | - <value type="QString">DISPLAY=/tmp/launch-s7Hnnm/:0</value> |
1539 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
1540 | <value type="QString">HOME=/Users/jcman912</value> |
1541 | <value type="QString">LOGNAME=jcman912</value> |
1542 | <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
1543 | <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
1544 | <value type="QString">SHELL=/bin/bash</value> |
1545 | - <value type="QString">SSH_AUTH_SOCK=/tmp/launch-jV3RpK/Listeners</value> |
1546 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
1547 | <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
1548 | <value type="QString">USER=jcman912</value> |
1549 | <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
1550 | @@ -113,7 +121,7 @@ |
1551 | </valuelist> |
1552 | <value key="abstractProcess.command" type="QString">/usr/bin/make</value> |
1553 | <value key="abstractProcess.enabled" type="bool">true</value> |
1554 | - <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src</value> |
1555 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src</value> |
1556 | </valuemap> |
1557 | </data> |
1558 | <data> |
1559 | @@ -121,37 +129,163 @@ |
1560 | <valuemap type="QVariantMap"> |
1561 | <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
1562 | <valuelist key="abstractProcess.Environment" type="QVariantList"> |
1563 | - <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-D74XdB/Render</value> |
1564 | - <value type="QString">COMMAND_MODE=unix2003</value> |
1565 | - <value type="QString">DISPLAY=/tmp/launch-NT9FlI/:0</value> |
1566 | - <value type="QString">HOME=/Users/jcman912</value> |
1567 | - <value type="QString">LOGNAME=jcman912</value> |
1568 | - <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
1569 | - <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
1570 | - <value type="QString">SHELL=/bin/bash</value> |
1571 | - <value type="QString">SSH_AUTH_SOCK=/tmp/launch-8Wa6tg/Listeners</value> |
1572 | - <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
1573 | - <value type="QString">USER=jcman912</value> |
1574 | - <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
1575 | - </valuelist> |
1576 | - <value key="abstractProcess.IgnoreReturnValue" type="bool">true</value> |
1577 | - <valuelist key="abstractProcess.arguments" type="QVariantList"> |
1578 | - <value type="QString">clean</value> |
1579 | - <value type="QString">-w</value> |
1580 | - </valuelist> |
1581 | - <value key="abstractProcess.command" type="QString">/usr/bin/make</value> |
1582 | - <value key="abstractProcess.enabled" type="bool">true</value> |
1583 | - <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src</value> |
1584 | - <value key="cleanConfig" type="bool">true</value> |
1585 | - <valuelist key="makeargs" type="QVariantList"> |
1586 | - <value type="QString">clean</value> |
1587 | - </valuelist> |
1588 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
1589 | + <value type="QString">COMMAND_MODE=unix2003</value> |
1590 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
1591 | + <value type="QString">HOME=/Users/jcman912</value> |
1592 | + <value type="QString">LOGNAME=jcman912</value> |
1593 | + <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
1594 | + <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
1595 | + <value type="QString">SHELL=/bin/bash</value> |
1596 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
1597 | + <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
1598 | + <value type="QString">USER=jcman912</value> |
1599 | + <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
1600 | + </valuelist> |
1601 | + <value key="abstractProcess.IgnoreReturnValue" type="bool">true</value> |
1602 | + <valuelist key="abstractProcess.arguments" type="QVariantList"> |
1603 | + <value type="QString">clean</value> |
1604 | + <value type="QString">-w</value> |
1605 | + </valuelist> |
1606 | + <value key="abstractProcess.command" type="QString">/usr/bin/make</value> |
1607 | + <value key="abstractProcess.enabled" type="bool">true</value> |
1608 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src</value> |
1609 | + <value key="cleanConfig" type="bool">true</value> |
1610 | + <valuelist key="makeargs" type="QVariantList"> |
1611 | + <value type="QString">clean</value> |
1612 | + </valuelist> |
1613 | + </valuemap> |
1614 | + </data> |
1615 | + <data> |
1616 | + <variable>buildconfiguration-Debug-cleanstep1</variable> |
1617 | + <valuemap type="QVariantMap"> |
1618 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
1619 | + <valuelist key="abstractProcess.Environment" type="QVariantList"> |
1620 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
1621 | + <value type="QString">COMMAND_MODE=unix2003</value> |
1622 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
1623 | + <value type="QString">HOME=/Users/jcman912</value> |
1624 | + <value type="QString">LOGNAME=jcman912</value> |
1625 | + <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
1626 | + <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
1627 | + <value type="QString">SHELL=/bin/bash</value> |
1628 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
1629 | + <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
1630 | + <value type="QString">USER=jcman912</value> |
1631 | + <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
1632 | + </valuelist> |
1633 | + <valuelist key="abstractProcess.arguments" type="QVariantList"> |
1634 | + <value type="QString">*</value> |
1635 | + </valuelist> |
1636 | + <value key="abstractProcess.command" type="QString">/bin/rm</value> |
1637 | + <value key="abstractProcess.enabled" type="bool">false</value> |
1638 | + <value key="abstractProcess.workingDirectory" type="QString">BUILDDIR</value> |
1639 | + <value key="workingDirectory" type="QString">BUILDDIR</value> |
1640 | + </valuemap> |
1641 | + </data> |
1642 | + <data> |
1643 | + <variable>buildconfiguration-Release-buildstep0</variable> |
1644 | + <valuemap type="QVariantMap"> |
1645 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
1646 | + <valuelist key="abstractProcess.Environment" type="QVariantList"> |
1647 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
1648 | + <value type="QString">COMMAND_MODE=unix2003</value> |
1649 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
1650 | + <value type="QString">HOME=/Users/jcman912</value> |
1651 | + <value type="QString">LOGNAME=jcman912</value> |
1652 | + <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
1653 | + <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
1654 | + <value type="QString">SHELL=/bin/bash</value> |
1655 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
1656 | + <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
1657 | + <value type="QString">USER=jcman912</value> |
1658 | + <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
1659 | + </valuelist> |
1660 | + <valuelist key="abstractProcess.arguments" type="QVariantList"> |
1661 | + <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src/src.pro</value> |
1662 | + <value type="QString">-spec</value> |
1663 | + <value type="QString">macx-g++</value> |
1664 | + <value type="QString">-r</value> |
1665 | + <value type="QString">CONFIG+=release</value> |
1666 | + </valuelist> |
1667 | + <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value> |
1668 | + <value key="abstractProcess.enabled" type="bool">true</value> |
1669 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src</value> |
1670 | + <valuelist key="qmakeArgs" type="QVariantList"> |
1671 | + <value type="QString">CONFIG+=release</value> |
1672 | + </valuelist> |
1673 | + </valuemap> |
1674 | + </data> |
1675 | + <data> |
1676 | + <variable>buildconfiguration-Release-buildstep1</variable> |
1677 | + <valuemap type="QVariantMap"> |
1678 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
1679 | + <valuelist key="abstractProcess.Environment" type="QVariantList"> |
1680 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
1681 | + <value type="QString">COMMAND_MODE=unix2003</value> |
1682 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
1683 | + <value type="QString">HOME=/Users/jcman912</value> |
1684 | + <value type="QString">LOGNAME=jcman912</value> |
1685 | + <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
1686 | + <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
1687 | + <value type="QString">SHELL=/bin/bash</value> |
1688 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
1689 | + <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
1690 | + <value type="QString">USER=jcman912</value> |
1691 | + <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
1692 | + </valuelist> |
1693 | + <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value> |
1694 | + <valuelist key="abstractProcess.arguments" type="QVariantList"> |
1695 | + <value type="QString">-w</value> |
1696 | + </valuelist> |
1697 | + <value key="abstractProcess.command" type="QString">/usr/bin/make</value> |
1698 | + <value key="abstractProcess.enabled" type="bool">true</value> |
1699 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src</value> |
1700 | + </valuemap> |
1701 | + </data> |
1702 | + <data> |
1703 | + <variable>buildconfiguration-Release-cleanstep0</variable> |
1704 | + <valuemap type="QVariantMap"> |
1705 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
1706 | + <valuelist key="abstractProcess.Environment" type="QVariantList"> |
1707 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
1708 | + <value type="QString">COMMAND_MODE=unix2003</value> |
1709 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
1710 | + <value type="QString">HOME=/Users/jcman912</value> |
1711 | + <value type="QString">LOGNAME=jcman912</value> |
1712 | + <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
1713 | + <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
1714 | + <value type="QString">SHELL=/bin/bash</value> |
1715 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
1716 | + <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
1717 | + <value type="QString">USER=jcman912</value> |
1718 | + <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
1719 | + </valuelist> |
1720 | + <value key="abstractProcess.IgnoreReturnValue" type="bool">true</value> |
1721 | + <valuelist key="abstractProcess.arguments" type="QVariantList"> |
1722 | + <value type="QString">clean</value> |
1723 | + <value type="QString">-w</value> |
1724 | + </valuelist> |
1725 | + <value key="abstractProcess.command" type="QString">/usr/bin/make</value> |
1726 | + <value key="abstractProcess.enabled" type="bool">true</value> |
1727 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src</value> |
1728 | + <value key="cleanConfig" type="bool">true</value> |
1729 | + <valuelist key="makeargs" type="QVariantList"> |
1730 | + <value type="QString">clean</value> |
1731 | + </valuelist> |
1732 | + </valuemap> |
1733 | + </data> |
1734 | + <data> |
1735 | + <variable>buildconfiguration-Release-cleanstep1</variable> |
1736 | + <valuemap type="QVariantMap"> |
1737 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value> |
1738 | </valuemap> |
1739 | </data> |
1740 | <data> |
1741 | <variable>buildconfigurations</variable> |
1742 | <valuelist type="QVariantList"> |
1743 | <value type="QString">Debug</value> |
1744 | + <value type="QString">Release</value> |
1745 | </valuelist> |
1746 | </data> |
1747 | <data> |
1748 | @@ -182,9 +316,16 @@ |
1749 | </valuemap> |
1750 | </data> |
1751 | <data> |
1752 | + <variable>cleanstep1</variable> |
1753 | + <valuemap type="QVariantMap"> |
1754 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value> |
1755 | + </valuemap> |
1756 | + </data> |
1757 | + <data> |
1758 | <variable>cleansteps</variable> |
1759 | <valuelist type="QVariantList"> |
1760 | <value type="QString">trolltech.qt4projectmanager.make</value> |
1761 | + <value type="QString">projectexplorer.processstep</value> |
1762 | </valuelist> |
1763 | </data> |
1764 | <data> |
1765 | |
1766 | === added file 'software/Common/POSIX LIBNMC.zip' |
1767 | Binary files software/Common/POSIX LIBNMC.zip 1970-01-01 00:00:00 +0000 and software/Common/POSIX LIBNMC.zip 2010-08-07 00:08:43 +0000 differ |
1768 | === added file 'software/Duel Syringe - Model 2.config' |
1769 | --- software/Duel Syringe - Model 2.config 1970-01-01 00:00:00 +0000 |
1770 | +++ software/Duel Syringe - Model 2.config 2010-08-07 00:08:43 +0000 |
1771 | @@ -0,0 +1,197 @@ |
1772 | +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> |
1773 | +<fabAtHomePrinter> |
1774 | + <!--Unit of distance is mm for all values.--> |
1775 | + <axis> |
1776 | + <!--The name of the axis. Must be unique among axes. Must be X.--> |
1777 | + <name>X</name> |
1778 | + <!--The name of the motor that controls this axis.--> |
1779 | + <motorName>motor0</motorName> |
1780 | + </axis> |
1781 | + <axis> |
1782 | + <!--The name of the axis. Must be unique among axes. Must be Y.--> |
1783 | + <name>Y</name> |
1784 | + <!--The name of the motor that controls this axis.--> |
1785 | + <motorName>motor1</motorName> |
1786 | + </axis> |
1787 | + <axis> |
1788 | + <!--The name of the axis. Must be unique among axes. Must be Z.--> |
1789 | + <name>Z</name> |
1790 | + <!--The name of the motor that controls this axis.--> |
1791 | + <motorName>motor2</motorName> |
1792 | + </axis> |
1793 | + <tool> |
1794 | + <bay> |
1795 | + <!--The name of the bay. Must be unique among bays. Must be Bay 0.--> |
1796 | + <name>Bay 0</name> |
1797 | + <!--The name of the motor that controls this bay or blank if no motor controls this bay.--> |
1798 | + <motorName>motor3</motorName> |
1799 | + <location> |
1800 | + <x>0</x> |
1801 | + <y>0</y> |
1802 | + <z>0</z> |
1803 | + </location> |
1804 | + </bay> |
1805 | + <bay> |
1806 | + <!--The name of the bay. Must be unique among bays. Must be Bay 0.--> |
1807 | + <name>Bay 1</name> |
1808 | + <!--The name of the motor that controls this bay or blank if no motor controls this bay.--> |
1809 | + <motorName>motor4</motorName> |
1810 | + <location> |
1811 | + <x>0</x> |
1812 | + <y>33</y> |
1813 | + <z>0</z> |
1814 | + </location> |
1815 | + </bay> |
1816 | + </tool> |
1817 | + <motion> |
1818 | + <!--Distance that platform moves downwards when pause, cancel, or complete print.--> |
1819 | + <platformDelta>40</platformDelta> |
1820 | + <!--Magic constant from line 58 of FabAtHomeParameters.h in model 1 code. Used to calculate values for pushout and suckback.--> |
1821 | + <oldMsps>5000</oldMsps> |
1822 | + </motion> |
1823 | + <electronics> |
1824 | + <!--Number of modules that are connected to printer.--> |
1825 | + <numModules>5</numModules> |
1826 | + <!--COM port that printer is connected to.--> |
1827 | + <comPort>4</comPort> |
1828 | + <!--Baud rate.--> |
1829 | + <baudRate>19200</baudRate> |
1830 | + <!--Group address of motors that control axes.--> |
1831 | + <xyzGroupAddress>128</xyzGroupAddress> |
1832 | + <motor> |
1833 | + <name>motor0</name> |
1834 | + <!--Address of the motor.--> |
1835 | + <address>1</address> |
1836 | + <!--Counts to move one unit of distance.--> |
1837 | + <countsPerDistanceUnit>236.239</countsPerDistanceUnit> |
1838 | + <!--Kp value of motor gains.--> |
1839 | + <kp>2200</kp> |
1840 | + <!--Kd value of motor gains.--> |
1841 | + <kd>30000</kd> |
1842 | + <!--Ki value of motor gains.--> |
1843 | + <ki>0</ki> |
1844 | + <!--IL value of motor gains.--> |
1845 | + <il>16000</il> |
1846 | + <!--OL value of motor gains.--> |
1847 | + <ol>255</ol> |
1848 | + <!--CL value of motor gains.--> |
1849 | + <cl>0</cl> |
1850 | + <!--EL value of motor gains.--> |
1851 | + <el>32767</el> |
1852 | + <!--SR value of motor gains.--> |
1853 | + <sr>1</sr> |
1854 | + <!--DB value of motor gains.--> |
1855 | + <db>0</db> |
1856 | + <!--Ticks per second.--> |
1857 | + <ticksPerSecond>1953.125</ticksPerSecond> |
1858 | + </motor> |
1859 | + <motor> |
1860 | + <name>motor1</name> |
1861 | + <!--Address of the motor.--> |
1862 | + <address>2</address> |
1863 | + <!--Counts to move one unit of distance.--> |
1864 | + <countsPerDistanceUnit>285.714</countsPerDistanceUnit> |
1865 | + <!--Kp value of motor gains.--> |
1866 | + <kp>1200</kp> |
1867 | + <!--Kd value of motor gains.--> |
1868 | + <kd>23000</kd> |
1869 | + <!--Ki value of motor gains.--> |
1870 | + <ki>0</ki> |
1871 | + <!--IL value of motor gains.--> |
1872 | + <il>16000</il> |
1873 | + <!--OL value of motor gains.--> |
1874 | + <ol>255</ol> |
1875 | + <!--CL value of motor gains.--> |
1876 | + <cl>0</cl> |
1877 | + <!--EL value of motor gains.--> |
1878 | + <el>32767</el> |
1879 | + <!--SR value of motor gains.--> |
1880 | + <sr>1</sr> |
1881 | + <!--DB value of motor gains.--> |
1882 | + <db>0</db> |
1883 | + <!--Ticks per second.--> |
1884 | + <ticksPerSecond>1953.125</ticksPerSecond> |
1885 | + </motor> |
1886 | + <motor> |
1887 | + <name>motor2</name> |
1888 | + <!--Address of the motor.--> |
1889 | + <address>3</address> |
1890 | + <!--Counts to move one unit of distance.--> |
1891 | + <countsPerDistanceUnit>284.900</countsPerDistanceUnit> |
1892 | + <!--Kp value of motor gains.--> |
1893 | + <kp>1000</kp> |
1894 | + <!--Kd value of motor gains.--> |
1895 | + <kd>20000</kd> |
1896 | + <!--Ki value of motor gains.--> |
1897 | + <ki>0</ki> |
1898 | + <!--IL value of motor gains.--> |
1899 | + <il>16000</il> |
1900 | + <!--OL value of motor gains.--> |
1901 | + <ol>255</ol> |
1902 | + <!--CL value of motor gains.--> |
1903 | + <cl>0</cl> |
1904 | + <!--EL value of motor gains.--> |
1905 | + <el>32767</el> |
1906 | + <!--SR value of motor gains.--> |
1907 | + <sr>1</sr> |
1908 | + <!--DB value of motor gains.--> |
1909 | + <db>0</db> |
1910 | + <!--Ticks per second.--> |
1911 | + <ticksPerSecond>1953.125</ticksPerSecond> |
1912 | + </motor> |
1913 | + <motor> |
1914 | + <name>motor3</name> |
1915 | + <!--Address of the motor.--> |
1916 | + <address>4</address> |
1917 | + <!--Counts to move one unit of distance.--> |
1918 | + <countsPerDistanceUnit>17409.1142</countsPerDistanceUnit> |
1919 | + <!--Kp value of motor gains.--> |
1920 | + <kp>1800</kp> |
1921 | + <!--Kd value of motor gains.--> |
1922 | + <kd>16000</kd> |
1923 | + <!--Ki value of motor gains.--> |
1924 | + <ki>0</ki> |
1925 | + <!--IL value of motor gains.--> |
1926 | + <il>0</il> |
1927 | + <!--OL value of motor gains.--> |
1928 | + <ol>255</ol> |
1929 | + <!--CL value of motor gains.--> |
1930 | + <cl>0</cl> |
1931 | + <!--EL value of motor gains.--> |
1932 | + <el>32767</el> |
1933 | + <!--SR value of motor gains.--> |
1934 | + <sr>1</sr> |
1935 | + <!--DB value of motor gains.--> |
1936 | + <db>0</db> |
1937 | + <!--Ticks per second.--> |
1938 | + <ticksPerSecond>1953.125</ticksPerSecond> |
1939 | + </motor> |
1940 | + <motor> |
1941 | + <name>motor4</name> |
1942 | + <!--Address of the motor.--> |
1943 | + <address>5</address> |
1944 | + <!--Counts to move one unit of distance.--> |
1945 | + <countsPerDistanceUnit>17409.1142</countsPerDistanceUnit> |
1946 | + <!--Kp value of motor gains.--> |
1947 | + <kp>1800</kp> |
1948 | + <!--Kd value of motor gains.--> |
1949 | + <kd>16000</kd> |
1950 | + <!--Ki value of motor gains.--> |
1951 | + <ki>0</ki> |
1952 | + <!--IL value of motor gains.--> |
1953 | + <il>0</il> |
1954 | + <!--OL value of motor gains.--> |
1955 | + <ol>255</ol> |
1956 | + <!--CL value of motor gains.--> |
1957 | + <cl>0</cl> |
1958 | + <!--EL value of motor gains.--> |
1959 | + <el>32767</el> |
1960 | + <!--SR value of motor gains.--> |
1961 | + <sr>1</sr> |
1962 | + <!--DB value of motor gains.--> |
1963 | + <db>0</db> |
1964 | + <!--Ticks per second.--> |
1965 | + <ticksPerSecond>1953.125</ticksPerSecond> |
1966 | + </motor> |
1967 | + </electronics> |
1968 | +</fabAtHomePrinter> |
1969 | \ No newline at end of file |
1970 | |
1971 | === modified file 'software/FabInterpreter/.DS_Store' |
1972 | Binary files software/FabInterpreter/.DS_Store 2010-07-12 23:00:59 +0000 and software/FabInterpreter/.DS_Store 2010-08-07 00:08:43 +0000 differ |
1973 | === modified file 'software/FabInterpreter/FabAtHomePrinter.cpp' |
1974 | --- software/FabInterpreter/FabAtHomePrinter.cpp 2010-07-23 20:12:14 +0000 |
1975 | +++ software/FabInterpreter/FabAtHomePrinter.cpp 2010-08-07 00:08:43 +0000 |
1976 | @@ -1,5 +1,4 @@ |
1977 | #include "FabAtHomePrinter.h" |
1978 | -#include <QDebug> |
1979 | |
1980 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
1981 | FabAtHomePrinter::FabAtHomePrinter(): |
1982 | @@ -9,6 +8,7 @@ |
1983 | initialized(false), |
1984 | printing(false), |
1985 | paused(false), |
1986 | + pauseSemaphore(0), |
1987 | displayText((string)"") |
1988 | { |
1989 | } |
1990 | @@ -26,8 +26,6 @@ |
1991 | //Connect to printer. |
1992 | stringstream ss; |
1993 | |
1994 | - //TODO: change this so you can read in from posix |
1995 | - //ss << "COM" << COM_PORT; |
1996 | ss << portLocation; |
1997 | unsigned int numModulesFound = NmcInit(const_cast<char*>(ss.str().c_str()), BAUD_RATE); |
1998 | if(numModulesFound < NUM_MODULES) |
1999 | @@ -52,7 +50,10 @@ |
2000 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
2001 | void FabAtHomePrinter::pausePrint() |
2002 | { |
2003 | - pausePrintFlag = true; |
2004 | + if (this->state().compare("PAUSED") == 0) |
2005 | + pauseSemaphore.release(); |
2006 | + else |
2007 | + pausePrintFlag = true; |
2008 | } |
2009 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
2010 | void FabAtHomePrinter::cancelPrint() |
2011 | @@ -94,7 +95,6 @@ |
2012 | { |
2013 | i->second.resetPosition(); |
2014 | } |
2015 | - qDebug() << "acceleration: " << (float) PRINT_ACCELERATION; |
2016 | return |
2017 | axes["X"].motor->setGroup(X_Y_Z_GROUP_ADDRESS, true) |
2018 | && axes["Y"].motor->setGroup(X_Y_Z_GROUP_ADDRESS, false) |
2019 | @@ -165,11 +165,18 @@ |
2020 | string base = "fabAtHomePrinter 0\\axis "+Util::toString(i)+"\\"; |
2021 | string name = parser.text(base+"name 0"); |
2022 | string motorName = parser.text(base+"motorName 0"); |
2023 | + map<string, Motor, LessThanString>::iterator motor = motors.find(motorName); |
2024 | if(motors.find(motorName) == motors.end()) |
2025 | { |
2026 | return "Axis "+name+" references motor "+motorName+" which has not been loaded."; |
2027 | } |
2028 | - axes[name] = Axis(name,&(motors.find(motorName)->second)); |
2029 | + |
2030 | + //THIS IS WHERE YOU REVERSE THE AXIS |
2031 | + if(name.compare("Y") == 0 /*|| name.compare("Z") == 0 */) //CHANGE MADE in v0.1 z should now be pos for down neg for up |
2032 | + { |
2033 | + motor->second.setReversed(true); |
2034 | + } |
2035 | + axes[name] = Axis(name,&(motor->second)); |
2036 | } |
2037 | |
2038 | //Check that axes named X, Y, and Z were loaded. |
2039 | @@ -209,6 +216,10 @@ |
2040 | return "Must load at least one bay."; |
2041 | } |
2042 | |
2043 | + //if the total number of axis motors and bay motors does not equal NUM_MODULES declared in the config file |
2044 | + if (tool.bays.size() + axes.size() != NUM_MODULES) |
2045 | + return "Invalid number of motors"; |
2046 | + |
2047 | return ""; |
2048 | } |
2049 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
2050 | @@ -241,66 +252,7 @@ |
2051 | PRINT_ACCELERATION = Util::assertType<double>(child->FirstChild()->Value()); |
2052 | } |
2053 | } |
2054 | - |
2055 | return ""; |
2056 | -/* |
2057 | - XMLParser parser; |
2058 | - string result = parser.load(filePath); |
2059 | - if(result.compare("") != 0) |
2060 | - { |
2061 | - return result; |
2062 | - } |
2063 | - |
2064 | - //Clear previously loaded data. |
2065 | - materialCalibrations.clear(); |
2066 | - model.paths.clear(); |
2067 | - |
2068 | - PRINT_ACCELERATION = Util::assertType<double>(parser.text("fabAtHomePrinter 0\\printAcceleration 0")); |
2069 | - |
2070 | - //Load material calibrations. |
2071 | - unsigned int count = parser.count("fabAtHomePrinter 0\\materialCalibration"); |
2072 | - for(unsigned int i = 0; i < count; ++i) |
2073 | - { |
2074 | - string base = "fabAtHomePrinter 0\\materialCalibration "+Util::toString(i)+"\\"; |
2075 | - string name = parser.text(base+"name 0"); |
2076 | - double pathSpeed = Util::assertType<double>(parser.text(base+"pathSpeed 0")); |
2077 | - double pathWidth = Util::assertType<double>(parser.text(base+"pathWidth 0")); |
2078 | - double depositionRate = Util::assertType<double>(parser.text(base+"depositionRate 0")); |
2079 | - double pushout = Util::assertType<double>(parser.text(base+"pushout 0")); |
2080 | - double suckback = Util::assertType<double>(parser.text(base+"suckback 0")); |
2081 | - double suckbackDelay = Util::assertType<double>(parser.text(base+"suckbackDelay 0")); |
2082 | - double clearance = Util::assertType<double>(parser.text(base+"clearance 0")); |
2083 | - int pausePaths = Util::assertType<int>(parser.text(base+"pausePaths 0")); |
2084 | - double pitch = Util::assertType<double>(parser.text(base+"pitch 0")); |
2085 | - materialCalibrations[name] = MaterialCalibration(name,pathSpeed,pathWidth,depositionRate,pushout,suckback,suckbackDelay,clearance,pausePaths,pitch); |
2086 | - } |
2087 | - |
2088 | - //Load paths. |
2089 | - unsigned int pathCount = parser.count("fabAtHomePrinter 0\\path"); |
2090 | - for(unsigned int i = 0; i < pathCount; ++i) |
2091 | - { |
2092 | - string iBase = "fabAtHomePrinter 0\\path "+Util::toString(i)+"\\"; |
2093 | - string materialCalibrationName = parser.text(iBase+"materialCalibrationName 0"); |
2094 | - if(materialCalibrations.find(materialCalibrationName) == materialCalibrations.end()) |
2095 | - { |
2096 | - return "A path references material calibration "+materialCalibrationName+" which has not been loaded."; |
2097 | - } |
2098 | - vector<Point> points; |
2099 | - unsigned int pointCount = parser.count(iBase+"point"); |
2100 | - for(unsigned int j = 0; j < pointCount; ++j) |
2101 | - { |
2102 | - string jBase = iBase+"point "+Util::toString(j)+"\\"; |
2103 | - double x = Util::assertType<double>(parser.text(jBase+"x 0")); |
2104 | - double y = Util::assertType<double>(parser.text(jBase+"y 0")); |
2105 | - double z = Util::assertType<double>(parser.text(jBase+"z 0")); |
2106 | - points.push_back(Point(x,y,z)); |
2107 | - } |
2108 | - model.paths.push_back(Path(&(materialCalibrations[materialCalibrationName]),points)); |
2109 | - } |
2110 | - |
2111 | - return ""; |
2112 | - */ |
2113 | - |
2114 | } |
2115 | string FabAtHomePrinter::state() |
2116 | { |
2117 | @@ -362,7 +314,7 @@ |
2118 | if(strcmp(child->Value(), "point") == 0) |
2119 | { |
2120 | double x = Util::assertType<double>(child->FirstChild("x")->FirstChild()->Value()); |
2121 | - double y = Util::assertType<double>(child->FirstChild("y")->FirstChild()->Value()); |
2122 | + double y = -Util::assertType<double>(child->FirstChild("y")->FirstChild()->Value()); |
2123 | double z = Util::assertType<double>(child->FirstChild("z")->FirstChild()->Value()); |
2124 | points.push_back(Point(x,y,z)); |
2125 | } |
2126 | @@ -392,7 +344,10 @@ |
2127 | pausePathPoints.push_back(Point(start.x, start.y, start.z + PLATFORM_DELTA)); |
2128 | executePath(Path(NULL,pausePathPoints),NULL,false); |
2129 | paused = true; |
2130 | + printing = false; |
2131 | callWarning("Execution has been paused. Press OK to resume execution."); |
2132 | + pauseSemaphore.acquire(); |
2133 | + printing = true; |
2134 | paused = false; |
2135 | //Move the platform up. |
2136 | pausePathPoints.clear(); |
2137 | @@ -415,21 +370,20 @@ |
2138 | |
2139 | void FabAtHomePrinter::print() |
2140 | { |
2141 | - paused = false; |
2142 | + //Timer t; |
2143 | + //t.start(); |
2144 | printing = true; |
2145 | pausePrintFlag = false; |
2146 | cancelPrintFlag = false; |
2147 | redoPathFlag = false; |
2148 | - if (!initializePathMode()) |
2149 | - qDebug() << "failed to initialize path parameters"; |
2150 | - unsigned int i = 0; |
2151 | - reportProgress(i, displayText.c_str()); |
2152 | - |
2153 | + initializePathMode(); |
2154 | + int currentPath = 0; |
2155 | + reportProgress(currentPath, displayText.c_str()); |
2156 | |
2157 | //Iterate through the loaded paths and execute them. |
2158 | - while(i < model.paths.size()) |
2159 | + while(currentPath < model.paths.size()) |
2160 | { |
2161 | - Path path = model.paths[i]; //Copy construct the path to be executed. |
2162 | + Path path = model.paths[currentPath]; //Copy construct the path to be executed. |
2163 | |
2164 | |
2165 | //Find a bay with the required material calibration. |
2166 | @@ -454,7 +408,7 @@ |
2167 | //Update the display text. |
2168 | |
2169 | displayText = "Executing setup path."; |
2170 | - reportProgress(i, displayText.c_str()); |
2171 | + reportProgress(currentPath, displayText.c_str()); |
2172 | |
2173 | //Move from the current position to the beginning of the current path. |
2174 | Point start(axes["X"].motor->getPosition(), axes["Y"].motor->getPosition(), axes["Z"].motor->getPosition()); //The current position. |
2175 | @@ -463,8 +417,8 @@ |
2176 | |
2177 | //Update the display text. |
2178 | |
2179 | - displayText = "Executing path "+Util::toString<int>(i+1)+" of "+Util::toString<int>(model.paths.size())+"."; |
2180 | - reportProgress(i, displayText.c_str()); |
2181 | + displayText = "Executing path "+Util::toString<int>(currentPath+1)+" of "+Util::toString<int>(model.paths.size())+"."; |
2182 | + reportProgress(currentPath, displayText.c_str()); |
2183 | |
2184 | |
2185 | //Execute the current path. |
2186 | @@ -496,8 +450,8 @@ |
2187 | else |
2188 | { |
2189 | //Move on to the next path. |
2190 | - ++i; |
2191 | - reportProgress(i, displayText.c_str()); |
2192 | + currentPath++; |
2193 | + reportProgress(currentPath, displayText.c_str()); |
2194 | } |
2195 | } |
2196 | |
2197 | @@ -511,18 +465,22 @@ |
2198 | { |
2199 | displayText = "Fabrication successfully completed."; |
2200 | } |
2201 | - reportProgress(i, displayText.c_str()); |
2202 | + reportProgress(currentPath, displayText.c_str()); |
2203 | //Execution has stopped. Move the platform down. |
2204 | Point start(axes["X"].motor->getPosition(), axes["Y"].motor->getPosition(), axes["Z"].motor->getPosition()); //The current position. |
2205 | Point end(start.x, start.y, start.z + PLATFORM_DELTA); |
2206 | executeSetupPath(start,end,0); |
2207 | printing = false; |
2208 | + resetPos(); |
2209 | + finishedPrinting(); |
2210 | + //clock_t endTime = std::clock(); |
2211 | + //t.stop(); |
2212 | + //qDebug() << t.getTime() << " seconds"; |
2213 | } |
2214 | |
2215 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
2216 | void FabAtHomePrinter::executePath(const Path& path, Bay* bay, const bool flowDuringPath) |
2217 | { |
2218 | - qDebug() << "executing path"; |
2219 | if(flowDuringPath) |
2220 | { |
2221 | //Want to achieve a steady state during path execution so scale the path speed if necessary. Copied from model 1 code. |
2222 | @@ -588,12 +546,10 @@ |
2223 | axes["Y"].motor->waitMove(); |
2224 | axes["Z"].motor->waitMove(); |
2225 | } |
2226 | - qDebug() << "done executing path"; |
2227 | } |
2228 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
2229 | void FabAtHomePrinter::executePoints(const vector<Point>& points, Bay* bay, const bool flowDuringPath, double pushoutDistance, double pushoutVelocity, double standardDistance, double standardVelocity, double suckbackDistance, double suckbackVelocity, const Point& suckbackPoint) |
2230 | { |
2231 | - qDebug() << "executing points"; |
2232 | int currIndex = 0; |
2233 | int res = -1; |
2234 | bool flowStarted = false; |
2235 | @@ -608,7 +564,6 @@ |
2236 | //The next index to be added to the segment list is the most recent index that was added to the segment list. |
2237 | currIndex = res; |
2238 | } |
2239 | - qDebug() << "done executing points"; |
2240 | } |
2241 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
2242 | int FabAtHomePrinter::fillSegmentList(const vector<Point>& points, const int startIndex) |
2243 | @@ -637,40 +592,9 @@ |
2244 | return points.size()-1; |
2245 | } |
2246 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
2247 | -//TODO: change mode so that the motor is set to "pathing" mode |
2248 | void FabAtHomePrinter::downloadSegmentList(Bay* bay, const bool startFlow, bool startSuckback, double pushoutDistance, double pushoutVelocity, double standardDistance, double standardVelocity, double suckbackDistance, double suckbackVelocity, const Point& suckbackPoint) |
2249 | { |
2250 | - qDebug() << "downloading seg list"; |
2251 | - /* |
2252 | - InitPath(); |
2253 | - if(startFlow) |
2254 | - { |
2255 | - bay->motor->moveAbsolute(bay->motor->getCommandedPosition()-pushoutDistance,pushoutVelocity,PRINT_ACCELERATION); //Start pushout. |
2256 | - } |
2257 | - while(AddPathPoints() == -2) //Start movement. |
2258 | - { |
2259 | - } |
2260 | - if(startFlow) |
2261 | - { |
2262 | - bay->motor->waitMove(); //Wait for bay movement to finish. |
2263 | - bay->motor->moveAbsolute(bay->motor->getCommandedPosition()-standardDistance,standardVelocity,PRINT_ACCELERATION); //Start standard flow. |
2264 | - } |
2265 | - double xDiff, yDiff; |
2266 | - //Move points to the path pointer buffer while handling suckback. |
2267 | - while(AddPathPoints() != -1 || startSuckback) |
2268 | - { |
2269 | - if(startSuckback) |
2270 | - { |
2271 | - xDiff = suckbackPoint.x - axes["X"].motor->getPosition(); |
2272 | - yDiff = suckbackPoint.y - axes["Y"].motor->getPosition(); |
2273 | - if(xDiff*xDiff+yDiff*yDiff < 0.25) |
2274 | - { |
2275 | - bay->motor->moveAbsolute(bay->motor->getCommandedPosition()+suckbackDistance,suckbackVelocity,PRINT_ACCELERATION); //Start suckback. |
2276 | - startSuckback = false; |
2277 | - } |
2278 | - } |
2279 | - } |
2280 | - */ |
2281 | + |
2282 | InitPath(); |
2283 | if(startFlow) |
2284 | { |
2285 | @@ -687,13 +611,11 @@ |
2286 | //Move points to the path pointer buffer while handling suckback. |
2287 | double currX, currY, xDiff, yDiff; |
2288 | bool doneAddingPoints = false; |
2289 | - qDebug() << "adding points "; |
2290 | while(!doneAddingPoints || startSuckback) |
2291 | { |
2292 | if(!doneAddingPoints && AddPathPoints() == -1) |
2293 | { |
2294 | doneAddingPoints = true; |
2295 | - qDebug() << "done adding points"; |
2296 | } |
2297 | if(startSuckback) |
2298 | { |
2299 | @@ -701,23 +623,22 @@ |
2300 | currY = axes["Y"].motor->getPosition(); |
2301 | xDiff = suckbackPoint.x - currX; |
2302 | yDiff = suckbackPoint.y - currY; |
2303 | + |
2304 | if(xDiff*xDiff+yDiff*yDiff < 0.25) |
2305 | { |
2306 | bay->motor->moveAbsolute(bay->motor->getCommandedPosition()+suckbackDistance,suckbackVelocity,PRINT_ACCELERATION); //Start suckback. |
2307 | startSuckback = false; |
2308 | - qDebug() << "suckback done"; |
2309 | } |
2310 | + |
2311 | } |
2312 | if(startSuckback && !axes["X"].motor->moving() && !axes["Y"].motor->moving() && !axes["Z"].motor->moving()) |
2313 | { |
2314 | //We have not started suckback and have reached end of path so we may have tunneled through the suckback circle. Just do the suckback now. |
2315 | bay->motor->moveAbsolute(bay->motor->getCommandedPosition()+suckbackDistance,suckbackVelocity,PRINT_ACCELERATION); //Start suckback. |
2316 | startSuckback = false; |
2317 | - qDebug() << "suckback done"; |
2318 | } |
2319 | |
2320 | } |
2321 | - qDebug() << "done download segment"; |
2322 | } |
2323 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
2324 | bool FabAtHomePrinter::cleanUp() |
2325 | @@ -733,6 +654,7 @@ |
2326 | } |
2327 | if(result) |
2328 | { |
2329 | + NmcShutdown(); |
2330 | initialized = false; |
2331 | } |
2332 | } |
2333 | @@ -792,7 +714,7 @@ |
2334 | } |
2335 | void FabAtHomePrinter::reset() |
2336 | { |
2337 | - NmcHardReset(0xFF); |
2338 | + NmcHardReset(X_Y_Z_GROUP_ADDRESS); |
2339 | } |
2340 | |
2341 | bool FabAtHomePrinter::isInitialized() |
2342 | |
2343 | === modified file 'software/FabInterpreter/FabAtHomePrinter.h' |
2344 | --- software/FabInterpreter/FabAtHomePrinter.h 2010-07-23 20:12:14 +0000 |
2345 | +++ software/FabInterpreter/FabAtHomePrinter.h 2010-08-07 00:08:43 +0000 |
2346 | @@ -8,10 +8,13 @@ |
2347 | #include "Tool.h" |
2348 | //PIC-SERVO path header files |
2349 | #include "path.h" |
2350 | +#include "qdebug.h" |
2351 | +#include <QSemaphore> |
2352 | |
2353 | class FabAtHomePrinter : public QObject |
2354 | { |
2355 | Q_OBJECT |
2356 | + |
2357 | //CONSTANTS///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
2358 | private: |
2359 | byte X_Y_Z_GROUP_ADDRESS; |
2360 | @@ -20,6 +23,7 @@ |
2361 | double PLATFORM_DELTA; |
2362 | double PRINT_ACCELERATION; //The acceleration that is used while printing. The unit of PRINT_ACCELERATION is U/(second^2). |
2363 | double OLD_MSPS; //Magic constant from line 58 of FabAtHomeParameters.h in model 1 code. Used to calculate values for pushout and suckback. |
2364 | + QSemaphore pauseSemaphore; //A QSemaphore that is triggered once the current path has ended and the pause button was pressed |
2365 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
2366 | private: |
2367 | Model model; |
2368 | @@ -97,8 +101,12 @@ |
2369 | //Returns: "" iff successful or an error message. |
2370 | string loadFabFile(string filePath); |
2371 | |
2372 | + /** |
2373 | + Returns the current state the printer is in out of "PRINTING," "IDLE," and "PAUSED" |
2374 | + */ |
2375 | string state(); |
2376 | |
2377 | + |
2378 | //Initialize the printer. |
2379 | //Returns: "" if successful or an error message if failed. |
2380 | string initialize(const string& configFilePath, string portLocation); |
2381 | @@ -117,12 +125,19 @@ |
2382 | //Returns: True iff successful. |
2383 | bool cleanUp(void); |
2384 | |
2385 | + /** |
2386 | + Performs a "hard reset" with the current motors under the XYZ group address |
2387 | + */ |
2388 | void reset(); |
2389 | |
2390 | + /** |
2391 | + Checks to see if the current printer configuration is initialized with a valid configuration |
2392 | + @return true if initialized, false otherwise |
2393 | + */ |
2394 | bool isInitialized(); |
2395 | |
2396 | //The destructor. |
2397 | - ~FabAtHomePrinter(void); |
2398 | + ~FabAtHomePrinter(void); |
2399 | |
2400 | public slots: |
2401 | |
2402 | @@ -141,17 +156,31 @@ |
2403 | //Force stops motors |
2404 | void stopMotors(); |
2405 | |
2406 | + /** |
2407 | + Resets the positions of the axis motors |
2408 | + */ |
2409 | void resetPos(); |
2410 | |
2411 | signals: |
2412 | |
2413 | - void GUI_reportProgress(); |
2414 | - |
2415 | - void reportProgress(int, QString); |
2416 | - |
2417 | - void callWarning(QString); |
2418 | - |
2419 | -friend class GUIComponentsThread; |
2420 | + /** |
2421 | + A signal that is issued throughout the print job to update the status of the printer |
2422 | + @param i The current path |
2423 | + @param str The current status of the printer to be printed to the screen |
2424 | + */ |
2425 | + void reportProgress(int i, QString str); |
2426 | + |
2427 | + /** |
2428 | + Triggers a signal to call a message box to the screen |
2429 | + @param str The text to be displayed in the message box |
2430 | + */ |
2431 | + void callWarning(QString str); |
2432 | + |
2433 | + /** |
2434 | + Issues a signal to mainwindow.cpp when done printing |
2435 | + */ |
2436 | + void finishedPrinting(); |
2437 | + |
2438 | }; |
2439 | |
2440 | #endif //ndef FABATHOMEPRINTER_H |
2441 | |
2442 | === added file 'software/FabInterpreter/Interpreter' |
2443 | Binary files software/FabInterpreter/Interpreter 1970-01-01 00:00:00 +0000 and software/FabInterpreter/Interpreter 2010-08-07 00:08:43 +0000 differ |
2444 | === modified file 'software/FabInterpreter/Interpreter.app/Contents/MacOS/Interpreter' |
2445 | Binary files software/FabInterpreter/Interpreter.app/Contents/MacOS/Interpreter 2010-07-23 20:12:14 +0000 and software/FabInterpreter/Interpreter.app/Contents/MacOS/Interpreter 2010-08-07 00:08:43 +0000 differ |
2446 | === modified file 'software/FabInterpreter/Interpreter.pro' |
2447 | --- software/FabInterpreter/Interpreter.pro 2010-07-23 20:12:14 +0000 |
2448 | +++ software/FabInterpreter/Interpreter.pro 2010-08-07 00:08:43 +0000 |
2449 | @@ -3,9 +3,10 @@ |
2450 | # ------------------------------------------------- |
2451 | TARGET = Interpreter |
2452 | TEMPLATE = app |
2453 | -INCLUDEPATH += ../Common/JrKerr |
2454 | -TARGETDEPS = |
2455 | -#UI_DIR = ../ |
2456 | +INCLUDEPATH += ../Common/JrKerr \ |
2457 | + ../Common/tinyxml |
2458 | +DESTDIR = . |
2459 | +# UI_DIR = ../ |
2460 | HEADERS += mainwindow.h \ |
2461 | Point.h \ |
2462 | InterpreterPath.h \ |
2463 | @@ -34,5 +35,6 @@ |
2464 | printthread.cpp \ |
2465 | guicomponentsthread.cpp |
2466 | FORMS += mainwindow.ui |
2467 | +include("win_jrkerr.pro") |
2468 | include("jrkerr.pro") |
2469 | include("tinyxml.pro") |
2470 | |
2471 | === modified file 'software/FabInterpreter/Interpreter.pro.user' |
2472 | --- software/FabInterpreter/Interpreter.pro.user 2010-07-23 20:12:14 +0000 |
2473 | +++ software/FabInterpreter/Interpreter.pro.user 2010-08-07 00:08:43 +0000 |
2474 | @@ -1,20 +1,24 @@ |
2475 | <!DOCTYPE QtCreatorProject> |
2476 | <qtcreator> |
2477 | <data> |
2478 | - <variable>RunConfiguration0-Arguments</variable> |
2479 | - <valuelist type="QVariantList"/> |
2480 | - </data> |
2481 | - <data> |
2482 | <variable>RunConfiguration0-BaseEnvironmentBase</variable> |
2483 | - <value type="int">1</value> |
2484 | - </data> |
2485 | - <data> |
2486 | - <variable>RunConfiguration0-Executable</variable> |
2487 | - <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter/Interpreter.app</value> |
2488 | + <value type="int">2</value> |
2489 | + </data> |
2490 | + <data> |
2491 | + <variable>RunConfiguration0-CommandLineArguments</variable> |
2492 | + <valuelist type="QVariantList"/> |
2493 | + </data> |
2494 | + <data> |
2495 | + <variable>RunConfiguration0-ProFile</variable> |
2496 | + <value type="QString">Interpreter.pro</value> |
2497 | </data> |
2498 | <data> |
2499 | <variable>RunConfiguration0-RunConfiguration.name</variable> |
2500 | - <value type="QString">Run /Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter/Interpreter.app</value> |
2501 | + <value type="QString">Interpreter</value> |
2502 | + </data> |
2503 | + <data> |
2504 | + <variable>RunConfiguration0-UseDyldImageSuffix</variable> |
2505 | + <value type="bool">false</value> |
2506 | </data> |
2507 | <data> |
2508 | <variable>RunConfiguration0-UseTerminal</variable> |
2509 | @@ -23,69 +27,23 @@ |
2510 | <data> |
2511 | <variable>RunConfiguration0-UserEnvironmentChanges</variable> |
2512 | <valuelist type="QVariantList"> |
2513 | - <value type="QString">DYLD_LIBRARY_PATH=/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src/build/</value> |
2514 | + <value type="QString">DYLD_LIBRARY_PATH=/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src/build/</value> |
2515 | </valuelist> |
2516 | </data> |
2517 | <data> |
2518 | - <variable>RunConfiguration0-UserName</variable> |
2519 | - <value type="QString"></value> |
2520 | - </data> |
2521 | - <data> |
2522 | <variable>RunConfiguration0-UserSetName</variable> |
2523 | <value type="bool">false</value> |
2524 | </data> |
2525 | <data> |
2526 | - <variable>RunConfiguration0-WorkingDirectory</variable> |
2527 | - <value type="QString">$BUILDDIR</value> |
2528 | + <variable>RunConfiguration0-UserSetWorkingDirectory</variable> |
2529 | + <value type="bool">false</value> |
2530 | + </data> |
2531 | + <data> |
2532 | + <variable>RunConfiguration0-UserWorkingDirectory</variable> |
2533 | + <value type="QString"></value> |
2534 | </data> |
2535 | <data> |
2536 | <variable>RunConfiguration0-type</variable> |
2537 | - <value type="QString">ProjectExplorer.CustomExecutableRunConfiguration</value> |
2538 | - </data> |
2539 | - <data> |
2540 | - <variable>RunConfiguration1-BaseEnvironmentBase</variable> |
2541 | - <value type="int">2</value> |
2542 | - </data> |
2543 | - <data> |
2544 | - <variable>RunConfiguration1-CommandLineArguments</variable> |
2545 | - <valuelist type="QVariantList"/> |
2546 | - </data> |
2547 | - <data> |
2548 | - <variable>RunConfiguration1-ProFile</variable> |
2549 | - <value type="QString">Interpreter.pro</value> |
2550 | - </data> |
2551 | - <data> |
2552 | - <variable>RunConfiguration1-RunConfiguration.name</variable> |
2553 | - <value type="QString">Interpreter</value> |
2554 | - </data> |
2555 | - <data> |
2556 | - <variable>RunConfiguration1-UseDyldImageSuffix</variable> |
2557 | - <value type="bool">false</value> |
2558 | - </data> |
2559 | - <data> |
2560 | - <variable>RunConfiguration1-UseTerminal</variable> |
2561 | - <value type="bool">false</value> |
2562 | - </data> |
2563 | - <data> |
2564 | - <variable>RunConfiguration1-UserEnvironmentChanges</variable> |
2565 | - <valuelist type="QVariantList"> |
2566 | - <value type="QString">DYLD_LIBRARY_PATH=/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src/build</value> |
2567 | - </valuelist> |
2568 | - </data> |
2569 | - <data> |
2570 | - <variable>RunConfiguration1-UserSetName</variable> |
2571 | - <value type="bool">false</value> |
2572 | - </data> |
2573 | - <data> |
2574 | - <variable>RunConfiguration1-UserSetWorkingDirectory</variable> |
2575 | - <value type="bool">false</value> |
2576 | - </data> |
2577 | - <data> |
2578 | - <variable>RunConfiguration1-UserWorkingDirectory</variable> |
2579 | - <value type="QString"></value> |
2580 | - </data> |
2581 | - <data> |
2582 | - <variable>RunConfiguration1-type</variable> |
2583 | <value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value> |
2584 | </data> |
2585 | <data> |
2586 | @@ -122,28 +80,28 @@ |
2587 | <valuemap type="QVariantMap"> |
2588 | <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
2589 | <valuelist key="abstractProcess.Environment" type="QVariantList"> |
2590 | - <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-Qfrwoi/Render</value> |
2591 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
2592 | <value type="QString">COMMAND_MODE=unix2003</value> |
2593 | - <value type="QString">DISPLAY=/tmp/launch-KgZP25/:0</value> |
2594 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
2595 | <value type="QString">HOME=/Users/jcman912</value> |
2596 | <value type="QString">LOGNAME=jcman912</value> |
2597 | <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
2598 | <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
2599 | <value type="QString">SHELL=/bin/bash</value> |
2600 | - <value type="QString">SSH_AUTH_SOCK=/tmp/launch-baFiI1/Listeners</value> |
2601 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
2602 | <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
2603 | <value type="QString">USER=jcman912</value> |
2604 | <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
2605 | </valuelist> |
2606 | <valuelist key="abstractProcess.arguments" type="QVariantList"> |
2607 | - <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter/Interpreter.pro</value> |
2608 | + <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter/Interpreter.pro</value> |
2609 | <value type="QString">-spec</value> |
2610 | <value type="QString">macx-g++</value> |
2611 | <value type="QString">-r</value> |
2612 | </valuelist> |
2613 | <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value> |
2614 | <value key="abstractProcess.enabled" type="bool">false</value> |
2615 | - <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter</value> |
2616 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value> |
2617 | <valuelist key="qmakeArgs" type="QVariantList"/> |
2618 | </valuemap> |
2619 | </data> |
2620 | @@ -152,15 +110,15 @@ |
2621 | <valuemap type="QVariantMap"> |
2622 | <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
2623 | <valuelist key="abstractProcess.Environment" type="QVariantList"> |
2624 | - <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-Qfrwoi/Render</value> |
2625 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
2626 | <value type="QString">COMMAND_MODE=unix2003</value> |
2627 | - <value type="QString">DISPLAY=/tmp/launch-KgZP25/:0</value> |
2628 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
2629 | <value type="QString">HOME=/Users/jcman912</value> |
2630 | <value type="QString">LOGNAME=jcman912</value> |
2631 | <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
2632 | <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
2633 | <value type="QString">SHELL=/bin/bash</value> |
2634 | - <value type="QString">SSH_AUTH_SOCK=/tmp/launch-baFiI1/Listeners</value> |
2635 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
2636 | <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
2637 | <value type="QString">USER=jcman912</value> |
2638 | <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
2639 | @@ -172,7 +130,7 @@ |
2640 | </valuelist> |
2641 | <value key="abstractProcess.command" type="QString">/Developer/Tools/Qt/uic</value> |
2642 | <value key="abstractProcess.enabled" type="bool">true</value> |
2643 | - <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter</value> |
2644 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value> |
2645 | <value key="workingDirectory" type="QString">$BUILDDIR</value> |
2646 | </valuemap> |
2647 | </data> |
2648 | @@ -181,15 +139,15 @@ |
2649 | <valuemap type="QVariantMap"> |
2650 | <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
2651 | <valuelist key="abstractProcess.Environment" type="QVariantList"> |
2652 | - <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-Qfrwoi/Render</value> |
2653 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
2654 | <value type="QString">COMMAND_MODE=unix2003</value> |
2655 | - <value type="QString">DISPLAY=/tmp/launch-KgZP25/:0</value> |
2656 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
2657 | <value type="QString">HOME=/Users/jcman912</value> |
2658 | <value type="QString">LOGNAME=jcman912</value> |
2659 | <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
2660 | <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
2661 | <value type="QString">SHELL=/bin/bash</value> |
2662 | - <value type="QString">SSH_AUTH_SOCK=/tmp/launch-baFiI1/Listeners</value> |
2663 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
2664 | <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
2665 | <value type="QString">USER=jcman912</value> |
2666 | <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
2667 | @@ -200,7 +158,7 @@ |
2668 | </valuelist> |
2669 | <value key="abstractProcess.command" type="QString">/usr/bin/make</value> |
2670 | <value key="abstractProcess.enabled" type="bool">true</value> |
2671 | - <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter</value> |
2672 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value> |
2673 | <valuelist key="makeargs" type="QVariantList"/> |
2674 | </valuemap> |
2675 | </data> |
2676 | @@ -209,15 +167,15 @@ |
2677 | <valuemap type="QVariantMap"> |
2678 | <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
2679 | <valuelist key="abstractProcess.Environment" type="QVariantList"> |
2680 | - <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-Qfrwoi/Render</value> |
2681 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
2682 | <value type="QString">COMMAND_MODE=unix2003</value> |
2683 | - <value type="QString">DISPLAY=/tmp/launch-KgZP25/:0</value> |
2684 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
2685 | <value type="QString">HOME=/Users/jcman912</value> |
2686 | <value type="QString">LOGNAME=jcman912</value> |
2687 | <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
2688 | <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
2689 | <value type="QString">SHELL=/bin/bash</value> |
2690 | - <value type="QString">SSH_AUTH_SOCK=/tmp/launch-baFiI1/Listeners</value> |
2691 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
2692 | <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
2693 | <value type="QString">USER=jcman912</value> |
2694 | <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
2695 | @@ -229,7 +187,7 @@ |
2696 | </valuelist> |
2697 | <value key="abstractProcess.command" type="QString">/usr/bin/make</value> |
2698 | <value key="abstractProcess.enabled" type="bool">true</value> |
2699 | - <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter</value> |
2700 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value> |
2701 | <value key="makeCmd" type="QString"></value> |
2702 | <valuelist key="makeargs" type="QVariantList"> |
2703 | <value type="QString">clean</value> |
2704 | @@ -237,61 +195,121 @@ |
2705 | </valuemap> |
2706 | </data> |
2707 | <data> |
2708 | - <variable>buildconfiguration-Debug-cleanstep1</variable> |
2709 | - <valuemap type="QVariantMap"> |
2710 | - <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
2711 | - <valuelist key="abstractProcess.Environment" type="QVariantList"> |
2712 | - <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-Qfrwoi/Render</value> |
2713 | - <value type="QString">COMMAND_MODE=unix2003</value> |
2714 | - <value type="QString">DISPLAY=/tmp/launch-KgZP25/:0</value> |
2715 | - <value type="QString">HOME=/Users/jcman912</value> |
2716 | - <value type="QString">LOGNAME=jcman912</value> |
2717 | - <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
2718 | - <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
2719 | - <value type="QString">SHELL=/bin/bash</value> |
2720 | - <value type="QString">SSH_AUTH_SOCK=/tmp/launch-baFiI1/Listeners</value> |
2721 | - <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
2722 | - <value type="QString">USER=jcman912</value> |
2723 | - <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
2724 | - </valuelist> |
2725 | - <valuelist key="abstractProcess.arguments" type="QVariantList"> |
2726 | - <value type="QString">-f</value> |
2727 | - <value type="QString">*</value> |
2728 | - </valuelist> |
2729 | - <value key="abstractProcess.command" type="QString">/bin/rm</value> |
2730 | - <value key="abstractProcess.enabled" type="bool">true</value> |
2731 | - <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src/build</value> |
2732 | - <value key="workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src/build</value> |
2733 | - </valuemap> |
2734 | - </data> |
2735 | - <data> |
2736 | <variable>buildconfiguration-Release-buildstep0</variable> |
2737 | <valuemap type="QVariantMap"> |
2738 | <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value> |
2739 | + <valuelist key="abstractProcess.Environment" type="QVariantList"> |
2740 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
2741 | + <value type="QString">COMMAND_MODE=unix2003</value> |
2742 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
2743 | + <value type="QString">HOME=/Users/jcman912</value> |
2744 | + <value type="QString">LOGNAME=jcman912</value> |
2745 | + <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
2746 | + <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
2747 | + <value type="QString">SHELL=/bin/bash</value> |
2748 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
2749 | + <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
2750 | + <value type="QString">USER=jcman912</value> |
2751 | + <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
2752 | + </valuelist> |
2753 | + <valuelist key="abstractProcess.arguments" type="QVariantList"> |
2754 | + <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter/Interpreter.pro</value> |
2755 | + <value type="QString">-spec</value> |
2756 | + <value type="QString">macx-g++</value> |
2757 | + <value type="QString">-r</value> |
2758 | + <value type="QString">CONFIG+=release</value> |
2759 | + </valuelist> |
2760 | + <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value> |
2761 | + <value key="abstractProcess.enabled" type="bool">false</value> |
2762 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value> |
2763 | </valuemap> |
2764 | </data> |
2765 | <data> |
2766 | <variable>buildconfiguration-Release-buildstep1</variable> |
2767 | <valuemap type="QVariantMap"> |
2768 | <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value> |
2769 | + <valuelist key="abstractProcess.Environment" type="QVariantList"> |
2770 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
2771 | + <value type="QString">COMMAND_MODE=unix2003</value> |
2772 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
2773 | + <value type="QString">HOME=/Users/jcman912</value> |
2774 | + <value type="QString">LOGNAME=jcman912</value> |
2775 | + <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
2776 | + <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
2777 | + <value type="QString">SHELL=/bin/bash</value> |
2778 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
2779 | + <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
2780 | + <value type="QString">USER=jcman912</value> |
2781 | + <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
2782 | + </valuelist> |
2783 | + <valuelist key="abstractProcess.arguments" type="QVariantList"> |
2784 | + <value type="QString">mainwindow.ui</value> |
2785 | + <value type="QString">-o</value> |
2786 | + <value type="QString">ui_mainwindow.h</value> |
2787 | + </valuelist> |
2788 | + <value key="abstractProcess.command" type="QString">/Developer/Tools/Qt/uic</value> |
2789 | + <value key="abstractProcess.enabled" type="bool">true</value> |
2790 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value> |
2791 | + <value key="workingDirectory" type="QString">$BUILDDIR</value> |
2792 | </valuemap> |
2793 | </data> |
2794 | <data> |
2795 | <variable>buildconfiguration-Release-buildstep2</variable> |
2796 | <valuemap type="QVariantMap"> |
2797 | <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value> |
2798 | + <valuelist key="abstractProcess.Environment" type="QVariantList"> |
2799 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value> |
2800 | + <value type="QString">COMMAND_MODE=unix2003</value> |
2801 | + <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value> |
2802 | + <value type="QString">HOME=/Users/jcman912</value> |
2803 | + <value type="QString">LOGNAME=jcman912</value> |
2804 | + <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
2805 | + <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
2806 | + <value type="QString">SHELL=/bin/bash</value> |
2807 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value> |
2808 | + <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
2809 | + <value type="QString">USER=jcman912</value> |
2810 | + <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
2811 | + </valuelist> |
2812 | + <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value> |
2813 | + <valuelist key="abstractProcess.arguments" type="QVariantList"> |
2814 | + <value type="QString">-w</value> |
2815 | + </valuelist> |
2816 | + <value key="abstractProcess.command" type="QString">/usr/bin/make</value> |
2817 | + <value key="abstractProcess.enabled" type="bool">true</value> |
2818 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value> |
2819 | </valuemap> |
2820 | </data> |
2821 | <data> |
2822 | <variable>buildconfiguration-Release-cleanstep0</variable> |
2823 | <valuemap type="QVariantMap"> |
2824 | <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value> |
2825 | - </valuemap> |
2826 | - </data> |
2827 | - <data> |
2828 | - <variable>buildconfiguration-Release-cleanstep1</variable> |
2829 | - <valuemap type="QVariantMap"> |
2830 | - <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value> |
2831 | + <valuelist key="abstractProcess.Environment" type="QVariantList"> |
2832 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-yszs7Y/Render</value> |
2833 | + <value type="QString">COMMAND_MODE=unix2003</value> |
2834 | + <value type="QString">DISPLAY=/tmp/launch-KnoFzX/:0</value> |
2835 | + <value type="QString">HOME=/Users/jcman912</value> |
2836 | + <value type="QString">LOGNAME=jcman912</value> |
2837 | + <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
2838 | + <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
2839 | + <value type="QString">SHELL=/bin/bash</value> |
2840 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-qLeScv/Listeners</value> |
2841 | + <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
2842 | + <value type="QString">USER=jcman912</value> |
2843 | + <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
2844 | + </valuelist> |
2845 | + <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value> |
2846 | + <valuelist key="abstractProcess.arguments" type="QVariantList"> |
2847 | + <value type="QString">clean</value> |
2848 | + <value type="QString">-w</value> |
2849 | + </valuelist> |
2850 | + <value key="abstractProcess.command" type="QString">/usr/bin/make</value> |
2851 | + <value key="abstractProcess.enabled" type="bool">true</value> |
2852 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value> |
2853 | + <value key="makeCmd" type="QString"></value> |
2854 | + <valuelist key="makeargs" type="QVariantList"> |
2855 | + <value type="QString">clean</value> |
2856 | + </valuelist> |
2857 | </valuemap> |
2858 | </data> |
2859 | <data> |
2860 | @@ -336,16 +354,9 @@ |
2861 | </valuemap> |
2862 | </data> |
2863 | <data> |
2864 | - <variable>cleanstep1</variable> |
2865 | - <valuemap type="QVariantMap"> |
2866 | - <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value> |
2867 | - </valuemap> |
2868 | - </data> |
2869 | - <data> |
2870 | <variable>cleansteps</variable> |
2871 | <valuelist type="QVariantList"> |
2872 | <value type="QString">trolltech.qt4projectmanager.make</value> |
2873 | - <value type="QString">projectexplorer.processstep</value> |
2874 | </valuelist> |
2875 | </data> |
2876 | <data> |
2877 | |
2878 | === modified file 'software/FabInterpreter/Makefile' |
2879 | --- software/FabInterpreter/Makefile 2010-07-23 20:12:14 +0000 |
2880 | +++ software/FabInterpreter/Makefile 2010-08-07 00:08:43 +0000 |
2881 | @@ -1,6 +1,6 @@ |
2882 | ############################################################################# |
2883 | # Makefile for building: Interpreter.app/Contents/MacOS/Interpreter |
2884 | -# Generated by qmake (2.01a) (Qt 4.6.3) on: Fri Jul 23 10:28:33 2010 |
2885 | +# Generated by qmake (2.01a) (Qt 4.6.3) on: Thu Aug 5 14:50:42 2010 |
2886 | # Project: Interpreter.pro |
2887 | # Template: app |
2888 | # Command: /usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile Interpreter.pro |
2889 | @@ -13,7 +13,7 @@ |
2890 | DEFINES = -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED |
2891 | CFLAGS = -pipe -g -gdwarf-2 -arch i386 -Wall -W $(DEFINES) |
2892 | CXXFLAGS = -pipe -g -gdwarf-2 -arch i386 -Wall -W $(DEFINES) |
2893 | -INCPATH = -I/usr/local/Qt4.6/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I../Common/JrKerr -I../Common/JrKerr/src -I. -I. -F/Library/Frameworks |
2894 | +INCPATH = -I/usr/local/Qt4.6/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I../Common/JrKerr -I../Common/tinyxml -I../Common/JrKerr/src -I. -I. -F/Library/Frameworks |
2895 | LINK = g++ |
2896 | LFLAGS = -headerpad_max_install_names -arch i386 |
2897 | LIBS = $(SUBLIBS) -F/Library/Frameworks -L../Common/JrKerr/src/build -L/Library/Frameworks -lqextserialportd -framework QtGui -framework QtCore |
2898 | @@ -66,7 +66,8 @@ |
2899 | ../Common/tinyxml/tinyxml.cpp \ |
2900 | ../Common/tinyxml/tinyxmlerror.cpp \ |
2901 | ../Common/tinyxml/tinyxmlparser.cpp moc_mainwindow.cpp \ |
2902 | - moc_FabAtHomePrinter.cpp |
2903 | + moc_FabAtHomePrinter.cpp \ |
2904 | + moc_guicomponentsthread.cpp |
2905 | OBJECTS = main.o \ |
2906 | Point.o \ |
2907 | InterpreterPath.o \ |
2908 | @@ -90,7 +91,8 @@ |
2909 | tinyxmlerror.o \ |
2910 | tinyxmlparser.o \ |
2911 | moc_mainwindow.o \ |
2912 | - moc_FabAtHomePrinter.o |
2913 | + moc_FabAtHomePrinter.o \ |
2914 | + moc_guicomponentsthread.o |
2915 | DIST = /usr/local/Qt4.6/mkspecs/common/unix.conf \ |
2916 | /usr/local/Qt4.6/mkspecs/common/mac.conf \ |
2917 | /usr/local/Qt4.6/mkspecs/common/mac-g++.conf \ |
2918 | @@ -263,13 +265,11 @@ |
2919 | |
2920 | compiler_objective_c_make_all: |
2921 | compiler_objective_c_clean: |
2922 | -compiler_moc_header_make_all: moc_mainwindow.cpp moc_FabAtHomePrinter.cpp |
2923 | +compiler_moc_header_make_all: moc_mainwindow.cpp moc_FabAtHomePrinter.cpp moc_guicomponentsthread.cpp |
2924 | compiler_moc_header_clean: |
2925 | - -$(DEL_FILE) moc_mainwindow.cpp moc_FabAtHomePrinter.cpp |
2926 | + -$(DEL_FILE) moc_mainwindow.cpp moc_FabAtHomePrinter.cpp moc_guicomponentsthread.cpp |
2927 | moc_mainwindow.cpp: Util.h \ |
2928 | ../Common/JrKerr/nmccom.h \ |
2929 | - ../Common/tinyxml/tinyxml.h \ |
2930 | - ../Common/tinyxml/tinystr.h \ |
2931 | Axis.h \ |
2932 | Motor.h \ |
2933 | ../Common/JrKerr/path.h \ |
2934 | @@ -291,8 +291,6 @@ |
2935 | Motor.h \ |
2936 | Util.h \ |
2937 | ../Common/JrKerr/nmccom.h \ |
2938 | - ../Common/tinyxml/tinyxml.h \ |
2939 | - ../Common/tinyxml/tinystr.h \ |
2940 | ../Common/JrKerr/path.h \ |
2941 | ../Common/JrKerr/picservo.h \ |
2942 | Model.h \ |
2943 | @@ -304,6 +302,22 @@ |
2944 | FabAtHomePrinter.h |
2945 | /Developer/Tools/Qt/moc $(DEFINES) $(INCPATH) -D__APPLE__ -D__GNUC__ FabAtHomePrinter.h -o moc_FabAtHomePrinter.cpp |
2946 | |
2947 | +moc_guicomponentsthread.cpp: FabAtHomePrinter.h \ |
2948 | + Axis.h \ |
2949 | + Motor.h \ |
2950 | + Util.h \ |
2951 | + ../Common/JrKerr/nmccom.h \ |
2952 | + ../Common/JrKerr/path.h \ |
2953 | + ../Common/JrKerr/picservo.h \ |
2954 | + Model.h \ |
2955 | + InterpreterPath.h \ |
2956 | + Point.h \ |
2957 | + Tool.h \ |
2958 | + Bay.h \ |
2959 | + MaterialCalibration.h \ |
2960 | + guicomponentsthread.h |
2961 | + /Developer/Tools/Qt/moc $(DEFINES) $(INCPATH) -D__APPLE__ -D__GNUC__ guicomponentsthread.h -o moc_guicomponentsthread.cpp |
2962 | + |
2963 | compiler_rcc_make_all: |
2964 | compiler_rcc_clean: |
2965 | compiler_image_collection_make_all: qmake_image_collection.cpp |
2966 | @@ -332,8 +346,6 @@ |
2967 | main.o: main.cpp mainwindow.h \ |
2968 | Util.h \ |
2969 | ../Common/JrKerr/nmccom.h \ |
2970 | - ../Common/tinyxml/tinyxml.h \ |
2971 | - ../Common/tinyxml/tinystr.h \ |
2972 | Axis.h \ |
2973 | Motor.h \ |
2974 | ../Common/JrKerr/path.h \ |
2975 | @@ -352,16 +364,12 @@ |
2976 | |
2977 | Point.o: Point.cpp Point.h \ |
2978 | Util.h \ |
2979 | - ../Common/JrKerr/nmccom.h \ |
2980 | - ../Common/tinyxml/tinyxml.h \ |
2981 | - ../Common/tinyxml/tinystr.h |
2982 | + ../Common/JrKerr/nmccom.h |
2983 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Point.o Point.cpp |
2984 | |
2985 | InterpreterPath.o: InterpreterPath.cpp InterpreterPath.h \ |
2986 | Util.h \ |
2987 | ../Common/JrKerr/nmccom.h \ |
2988 | - ../Common/tinyxml/tinyxml.h \ |
2989 | - ../Common/tinyxml/tinystr.h \ |
2990 | Point.h \ |
2991 | Tool.h \ |
2992 | Bay.h \ |
2993 | @@ -374,8 +382,6 @@ |
2994 | Motor.o: Motor.cpp Motor.h \ |
2995 | Util.h \ |
2996 | ../Common/JrKerr/nmccom.h \ |
2997 | - ../Common/tinyxml/tinyxml.h \ |
2998 | - ../Common/tinyxml/tinystr.h \ |
2999 | ../Common/JrKerr/path.h \ |
3000 | ../Common/JrKerr/picservo.h |
3001 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Motor.o Motor.cpp |
3002 | @@ -383,8 +389,6 @@ |
3003 | Model.o: Model.cpp Model.h \ |
3004 | Util.h \ |
3005 | ../Common/JrKerr/nmccom.h \ |
3006 | - ../Common/tinyxml/tinyxml.h \ |
3007 | - ../Common/tinyxml/tinystr.h \ |
3008 | InterpreterPath.h \ |
3009 | Point.h \ |
3010 | Tool.h \ |
3011 | @@ -397,9 +401,7 @@ |
3012 | |
3013 | MaterialCalibration.o: MaterialCalibration.cpp MaterialCalibration.h \ |
3014 | Util.h \ |
3015 | - ../Common/JrKerr/nmccom.h \ |
3016 | - ../Common/tinyxml/tinyxml.h \ |
3017 | - ../Common/tinyxml/tinystr.h |
3018 | + ../Common/JrKerr/nmccom.h |
3019 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o MaterialCalibration.o MaterialCalibration.cpp |
3020 | |
3021 | FabAtHomePrinter.o: FabAtHomePrinter.cpp FabAtHomePrinter.h \ |
3022 | @@ -407,8 +409,6 @@ |
3023 | Motor.h \ |
3024 | Util.h \ |
3025 | ../Common/JrKerr/nmccom.h \ |
3026 | - ../Common/tinyxml/tinyxml.h \ |
3027 | - ../Common/tinyxml/tinystr.h \ |
3028 | ../Common/JrKerr/path.h \ |
3029 | ../Common/JrKerr/picservo.h \ |
3030 | Model.h \ |
3031 | @@ -423,8 +423,6 @@ |
3032 | Motor.h \ |
3033 | Util.h \ |
3034 | ../Common/JrKerr/nmccom.h \ |
3035 | - ../Common/tinyxml/tinyxml.h \ |
3036 | - ../Common/tinyxml/tinystr.h \ |
3037 | ../Common/JrKerr/path.h \ |
3038 | ../Common/JrKerr/picservo.h \ |
3039 | Point.h \ |
3040 | @@ -435,8 +433,6 @@ |
3041 | Motor.h \ |
3042 | Util.h \ |
3043 | ../Common/JrKerr/nmccom.h \ |
3044 | - ../Common/tinyxml/tinyxml.h \ |
3045 | - ../Common/tinyxml/tinystr.h \ |
3046 | ../Common/JrKerr/path.h \ |
3047 | ../Common/JrKerr/picservo.h |
3048 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Axis.o Axis.cpp |
3049 | @@ -444,8 +440,6 @@ |
3050 | Tool.o: Tool.cpp Tool.h \ |
3051 | Util.h \ |
3052 | ../Common/JrKerr/nmccom.h \ |
3053 | - ../Common/tinyxml/tinyxml.h \ |
3054 | - ../Common/tinyxml/tinystr.h \ |
3055 | Bay.h \ |
3056 | Motor.h \ |
3057 | ../Common/JrKerr/path.h \ |
3058 | @@ -457,8 +451,6 @@ |
3059 | mainwindow.o: mainwindow.cpp mainwindow.h \ |
3060 | Util.h \ |
3061 | ../Common/JrKerr/nmccom.h \ |
3062 | - ../Common/tinyxml/tinyxml.h \ |
3063 | - ../Common/tinyxml/tinystr.h \ |
3064 | Axis.h \ |
3065 | Motor.h \ |
3066 | ../Common/JrKerr/path.h \ |
3067 | @@ -481,8 +473,6 @@ |
3068 | Motor.h \ |
3069 | Util.h \ |
3070 | ../Common/JrKerr/nmccom.h \ |
3071 | - ../Common/tinyxml/tinyxml.h \ |
3072 | - ../Common/tinyxml/tinystr.h \ |
3073 | ../Common/JrKerr/path.h \ |
3074 | ../Common/JrKerr/picservo.h \ |
3075 | Model.h \ |
3076 | @@ -499,8 +489,6 @@ |
3077 | Motor.h \ |
3078 | Util.h \ |
3079 | ../Common/JrKerr/nmccom.h \ |
3080 | - ../Common/tinyxml/tinyxml.h \ |
3081 | - ../Common/tinyxml/tinystr.h \ |
3082 | ../Common/JrKerr/path.h \ |
3083 | ../Common/JrKerr/picservo.h \ |
3084 | Model.h \ |
3085 | @@ -555,6 +543,9 @@ |
3086 | moc_FabAtHomePrinter.o: moc_FabAtHomePrinter.cpp |
3087 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_FabAtHomePrinter.o moc_FabAtHomePrinter.cpp |
3088 | |
3089 | +moc_guicomponentsthread.o: moc_guicomponentsthread.cpp |
3090 | + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_guicomponentsthread.o moc_guicomponentsthread.cpp |
3091 | + |
3092 | ####### Install |
3093 | |
3094 | install: FORCE |
3095 | |
3096 | === modified file 'software/FabInterpreter/Motor.cpp' |
3097 | --- software/FabInterpreter/Motor.cpp 2010-07-23 20:12:14 +0000 |
3098 | +++ software/FabInterpreter/Motor.cpp 2010-08-07 00:08:43 +0000 |
3099 | @@ -1,194 +1,192 @@ |
3100 | #include "Motor.h" |
3101 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3102 | Motor::Motor(string name,const byte& address, const double countsPerU, const double ticksPerSecond, short kp, short kd, short ki, short il, byte ol, byte cl, short int el, byte sr, byte db): |
3103 | -initialized(false), |
3104 | -commandedPosition(0.0), |
3105 | -isReversed(false), |
3106 | -NAME(name), |
3107 | -ADDRESS(address), |
3108 | -COUNTS_PER_U(countsPerU), |
3109 | -TICKS_PER_SECOND(ticksPerSecond), |
3110 | -KP(kp), |
3111 | -KD(kd), |
3112 | -KI(ki), |
3113 | -IL(il), |
3114 | -OL(ol), |
3115 | -CL(cl), |
3116 | -EL(el), |
3117 | -SR(sr), |
3118 | -DB(db), |
3119 | -MIN_COMMANDED_POSITION(-2147483648.0/countsPerU), |
3120 | -MAX_COMMANDED_POSITION(2147483647.0/countsPerU), |
3121 | -MIN_COMMANDED_VELOCITY(0.0), |
3122 | -MAX_COMMANDED_VELOCITY(2500000.0/countsPerU), |
3123 | -MIN_COMMANDED_ACCELERATION(0.0), |
3124 | -MAX_COMMANDED_ACCELERATION(125000000000.0/countsPerU) |
3125 | + initialized(false), |
3126 | + commandedPosition(0.0), |
3127 | + isReversed(false), |
3128 | + NAME(name), |
3129 | + ADDRESS(address), |
3130 | + COUNTS_PER_U(countsPerU), |
3131 | + TICKS_PER_SECOND(ticksPerSecond), |
3132 | + KP(kp), |
3133 | + KD(kd), |
3134 | + KI(ki), |
3135 | + IL(il), |
3136 | + OL(ol), |
3137 | + CL(cl), |
3138 | + EL(el), |
3139 | + SR(sr), |
3140 | + DB(db), |
3141 | + MIN_COMMANDED_POSITION(-2147483648.0/countsPerU), |
3142 | + MAX_COMMANDED_POSITION(2147483647.0/countsPerU), |
3143 | + MIN_COMMANDED_VELOCITY(0.0), |
3144 | + MAX_COMMANDED_VELOCITY(2500000.0/countsPerU), |
3145 | + MIN_COMMANDED_ACCELERATION(0.0), |
3146 | + MAX_COMMANDED_ACCELERATION(125000000000.0/countsPerU) |
3147 | { |
3148 | } |
3149 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3150 | Motor::Motor(): |
3151 | -initialized(false) |
3152 | + initialized(false) |
3153 | { |
3154 | } |
3155 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3156 | void Motor::updateData() |
3157 | { |
3158 | - NmcNoOp(ADDRESS); |
3159 | + NmcNoOp(ADDRESS); |
3160 | } |
3161 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3162 | void Motor::setReversed(bool isReversed) |
3163 | { |
3164 | - this->isReversed = isReversed; |
3165 | + this->isReversed = isReversed; |
3166 | } |
3167 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3168 | double Motor::getPosition() |
3169 | { |
3170 | - updateData(); |
3171 | - return (isReversed ? -1 : 1) * ServoGetPos(ADDRESS) / COUNTS_PER_U; //Translate count to U. |
3172 | + updateData(); |
3173 | + return (isReversed ? -1 : 1) * ServoGetPos(ADDRESS) / COUNTS_PER_U; //Translate count to U. |
3174 | } |
3175 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3176 | double Motor::getCommandedPosition() |
3177 | { |
3178 | - return commandedPosition; |
3179 | + return commandedPosition; |
3180 | } |
3181 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3182 | bool Motor::moveAbsolute(double position, double velocity, double acceleration) |
3183 | { |
3184 | - //if reversed then switches position |
3185 | - if(isReversed) |
3186 | - { |
3187 | - position *= -1; |
3188 | - } |
3189 | - |
3190 | - //Checks command againsts given constraints |
3191 | - Util::assertTrue |
3192 | - ( |
3193 | - position >= MIN_COMMANDED_POSITION |
3194 | - && position <= MAX_COMMANDED_POSITION |
3195 | - && velocity >= MIN_COMMANDED_VELOCITY |
3196 | - && velocity <= MAX_COMMANDED_VELOCITY |
3197 | - && acceleration >= MIN_COMMANDED_ACCELERATION |
3198 | - && acceleration <= MAX_COMMANDED_ACCELERATION, |
3199 | - "Tried to issue a movement command with arguments that are out of bounds.", |
3200 | - __LINE__,__FILE__ |
3201 | - ); |
3202 | - |
3203 | - //sets the commanded position to the given position |
3204 | - commandedPosition = position; |
3205 | - |
3206 | - return ServoLoadTraj |
3207 | - ( |
3208 | - ADDRESS, |
3209 | - LOAD_POS | LOAD_VEL | LOAD_ACC | ENABLE_SERVO | START_NOW, |
3210 | - (long)(position * COUNTS_PER_U), //Translate U to count. |
3211 | - (long)(velocity * COUNTS_PER_U / TICKS_PER_SECOND * 65536), //Translate U/second to count/tick * 2^16. |
3212 | - (long)(acceleration * COUNTS_PER_U / (TICKS_PER_SECOND * TICKS_PER_SECOND) * 65536), //Translate U/(second^2) to count/(ticks^2) * 2^16. |
3213 | - 0 //pwm (no effect if not in pwm mode) |
3214 | - ) == 1; |
3215 | + //if reversed then switches position |
3216 | + if(isReversed) |
3217 | + { |
3218 | + position *= -1; |
3219 | + } |
3220 | + |
3221 | + //Checks command againsts given constraints |
3222 | + Util::assertTrue |
3223 | + ( |
3224 | + position >= MIN_COMMANDED_POSITION |
3225 | + && position <= MAX_COMMANDED_POSITION |
3226 | + && velocity >= MIN_COMMANDED_VELOCITY |
3227 | + && velocity <= MAX_COMMANDED_VELOCITY |
3228 | + && acceleration >= MIN_COMMANDED_ACCELERATION |
3229 | + && acceleration <= MAX_COMMANDED_ACCELERATION, |
3230 | + "Tried to issue a movement command with arguments that are out of bounds.", |
3231 | + __LINE__,__FILE__ |
3232 | + ); |
3233 | + |
3234 | + //sets the commanded position to the given position |
3235 | + commandedPosition = position; |
3236 | + |
3237 | + return ServoLoadTraj |
3238 | + ( |
3239 | + ADDRESS, |
3240 | + LOAD_POS | LOAD_VEL | LOAD_ACC | ENABLE_SERVO | START_NOW, |
3241 | + (int)(position * COUNTS_PER_U), //Translate U to count. |
3242 | + (int)(velocity * COUNTS_PER_U / TICKS_PER_SECOND * 65536), //Translate U/second to count/tick * 2^16. |
3243 | + (int)(acceleration * COUNTS_PER_U / (TICKS_PER_SECOND * TICKS_PER_SECOND) * 65536), //Translate U/(second^2) to count/(ticks^2) * 2^16. |
3244 | + 0 //pwm (no effect if not in pwm mode) |
3245 | + ) == 1; |
3246 | } |
3247 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3248 | bool Motor::moveRelative(double positionDelta, double velocity, double acceleration) |
3249 | { |
3250 | - return moveAbsolute(getPosition()+positionDelta, velocity, acceleration); |
3251 | + return moveAbsolute(getPosition()+positionDelta, velocity, acceleration); |
3252 | } |
3253 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3254 | bool Motor::stop() |
3255 | { |
3256 | - return cleanUp(); |
3257 | + return cleanUp(); |
3258 | } |
3259 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3260 | bool Motor::setGroup(byte groupAddress, bool isLeader) |
3261 | { |
3262 | - return NmcSetGroupAddr(ADDRESS, groupAddress, isLeader) == 1; |
3263 | + return NmcSetGroupAddr(ADDRESS, groupAddress, isLeader) == 1; |
3264 | } |
3265 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3266 | bool Motor::resetPosition() |
3267 | { |
3268 | - ServoResetPos(ADDRESS); |
3269 | - commandedPosition = 0.0; |
3270 | - return true; |
3271 | + ServoResetPos(ADDRESS); |
3272 | + commandedPosition = 0.0; |
3273 | + return true; |
3274 | } |
3275 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3276 | bool Motor::moving() |
3277 | { |
3278 | - updateData(); //updates the motor info |
3279 | - byte auxByte = ServoGetAux(ADDRESS); |
3280 | - bool pathMoving = (auxByte & PATH_MODE) != (char)0; |
3281 | - byte statbyte = NmcGetStat(ADDRESS); |
3282 | - bool nonPathMoving = !(statbyte & MOVE_DONE); |
3283 | - return pathMoving || nonPathMoving; |
3284 | + updateData(); //updates the motor info |
3285 | + byte auxByte = ServoGetAux(ADDRESS); |
3286 | + bool pathMoving = (auxByte & PATH_MODE) != 0; |
3287 | + byte statbyte = NmcGetStat(ADDRESS); |
3288 | + bool nonPathMoving = !(statbyte & MOVE_DONE); |
3289 | + return pathMoving || nonPathMoving; |
3290 | } |
3291 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3292 | void Motor::waitMove() |
3293 | { |
3294 | - qDebug() << "waiting on " << ADDRESS; |
3295 | - while(moving()) |
3296 | - { |
3297 | - } |
3298 | + while(moving()) |
3299 | + { |
3300 | + } |
3301 | } |
3302 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3303 | string Motor::initialize() |
3304 | { |
3305 | |
3306 | - if(!initialized) |
3307 | - { |
3308 | - stringstream ss; |
3309 | - if(NmcGetModType(ADDRESS) != SERVOMODTYPE) |
3310 | - { |
3311 | - ss << "Motor with address " << ADDRESS << " is not a PIC-SERVO motor."; |
3312 | - return ss.str(); |
3313 | - } |
3314 | - usleep(51000); |
3315 | - if(ServoSetGain(ADDRESS,KP,KD,KI,IL,OL,CL,EL,SR,DB) != 1) |
3316 | - { |
3317 | - ss << "Failed to set gains for motor with address " << ADDRESS << "."; |
3318 | - return ss.str(); |
3319 | - } |
3320 | - |
3321 | - ServoStopMotor(ADDRESS, AMP_ENABLE | STOP_ABRUPT | ADV_FEATURE); |
3322 | - NmcDefineStatus(ADDRESS, SEND_POS | SEND_NPOINTS | SEND_PERROR | SEND_AUX); |
3323 | - |
3324 | - if(!resetPosition()) |
3325 | - { |
3326 | - ss << "Could not reset position for motor with address " << ADDRESS << "."; |
3327 | - return ss.str(); |
3328 | - } |
3329 | - initialized = true; |
3330 | - } |
3331 | - return ""; |
3332 | + if(!initialized) |
3333 | + { |
3334 | + stringstream ss; |
3335 | + if(NmcGetModType(ADDRESS) != SERVOMODTYPE) |
3336 | + { |
3337 | + ss << "Motor with address " << ADDRESS << " is not a PIC-SERVO motor."; |
3338 | + return ss.str(); |
3339 | + } |
3340 | + if(ServoSetGain(ADDRESS,KP,KD,KI,IL,OL,CL,EL,SR,DB) != 1) |
3341 | + { |
3342 | + ss << "Failed to set gains for motor with address " << ADDRESS << "."; |
3343 | + return ss.str(); |
3344 | + } |
3345 | + |
3346 | + ServoStopMotor(ADDRESS, AMP_ENABLE | STOP_ABRUPT | ADV_FEATURE); |
3347 | + NmcDefineStatus(ADDRESS, SEND_POS | SEND_NPOINTS | SEND_PERROR | SEND_AUX); |
3348 | + |
3349 | + if(!resetPosition()) |
3350 | + { |
3351 | + ss << "Could not reset position for motor with address " << ADDRESS << "."; |
3352 | + return ss.str(); |
3353 | + } |
3354 | + initialized = true; |
3355 | + } |
3356 | + return ""; |
3357 | } |
3358 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3359 | bool Motor::cleanUp() |
3360 | { |
3361 | - bool result; |
3362 | - if(initialized) |
3363 | - { |
3364 | - result = ServoStopMotor(ADDRESS, STOP_ABRUPT | MOTOR_OFF) == 1 && NmcHardReset(ADDRESS) == 1; |
3365 | - if(result) |
3366 | - { |
3367 | - initialized = false; |
3368 | - } |
3369 | - } |
3370 | - else |
3371 | - { |
3372 | - result = true; |
3373 | - } |
3374 | - return result; |
3375 | + bool result; |
3376 | + if(initialized) |
3377 | + { |
3378 | + result = ServoStopMotor(ADDRESS, STOP_ABRUPT | MOTOR_OFF) == 1 && NmcHardReset(ADDRESS) == 1; |
3379 | + if(result) |
3380 | + { |
3381 | + initialized = false; |
3382 | + } |
3383 | + } |
3384 | + else |
3385 | + { |
3386 | + result = true; |
3387 | + } |
3388 | + return result; |
3389 | } |
3390 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3391 | byte Motor::getAddress(void) |
3392 | { |
3393 | - return ADDRESS; |
3394 | + return ADDRESS; |
3395 | } |
3396 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3397 | double Motor::getCountsPerU(void) |
3398 | { |
3399 | - return (isReversed ? -1 : 1) * COUNTS_PER_U; |
3400 | + return (isReversed ? -1 : 1) * COUNTS_PER_U; |
3401 | } |
3402 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3403 | Motor::~Motor() |
3404 | { |
3405 | - cleanUp(); |
3406 | + cleanUp(); |
3407 | } |
3408 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3409 | double Motor::getMinPosition() |
3410 | |
3411 | === modified file 'software/FabInterpreter/Motor.h' |
3412 | --- software/FabInterpreter/Motor.h 2010-07-23 20:12:14 +0000 |
3413 | +++ software/FabInterpreter/Motor.h 2010-08-07 00:08:43 +0000 |
3414 | @@ -6,94 +6,92 @@ |
3415 | #include "path.h" |
3416 | #include "picservo.h" |
3417 | |
3418 | -#include <QDebug> |
3419 | - |
3420 | |
3421 | class Motor |
3422 | { |
3423 | -//CONSTANTS///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3424 | + //CONSTANTS///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3425 | private: |
3426 | - string NAME; |
3427 | - byte ADDRESS; //The number of the motor port that this motor is plugged in. |
3428 | + string NAME; |
3429 | + byte ADDRESS; //The number of the motor port that this motor is plugged in. |
3430 | double COUNTS_PER_U; //Number of counts for 1 U of motion. |
3431 | - double TICKS_PER_SECOND; //Number of ticks that a motor makes per second. |
3432 | + double TICKS_PER_SECOND; //Number of ticks that a motor makes per second. |
3433 | double MIN_COMMANDED_POSITION; //The minimum position that the motor can go to |
3434 | - double MAX_COMMANDED_POSITION; //The maxiumum position that the motor can go to |
3435 | - double MIN_COMMANDED_VELOCITY; //The minumum velocity the motor can travel at |
3436 | - double MAX_COMMANDED_VELOCITY; //The maximum velocity the motor can travel at |
3437 | - double MIN_COMMANDED_ACCELERATION; //The minimum acceleration of the motor |
3438 | - double MAX_COMMANDED_ACCELERATION; //The maxiumum acceleration of the motor |
3439 | - short KP, KD, KI, IL, EL; //Damping contraints (look up procedure for critically damping motors for more details, also JKerr has documentation) |
3440 | - byte OL, CL, SR, DB; //See JKerr's Document for more details on his motor bytes |
3441 | -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3442 | + double MAX_COMMANDED_POSITION; //The maxiumum position that the motor can go to |
3443 | + double MIN_COMMANDED_VELOCITY; //The minumum velocity the motor can travel at |
3444 | + double MAX_COMMANDED_VELOCITY; //The maximum velocity the motor can travel at |
3445 | + double MIN_COMMANDED_ACCELERATION; //The minimum acceleration of the motor |
3446 | + double MAX_COMMANDED_ACCELERATION; //The maxiumum acceleration of the motor |
3447 | + short KP, KD, KI, IL, EL; //Damping contraints (look up procedure for critically damping motors for more details, also JKerr has documentation) |
3448 | + byte OL, CL, SR, DB; //See JKerr's Document for more details on his motor bytes |
3449 | + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
3450 | private: |
3451 | - double commandedPosition; //desired position of the motor |
3452 | - bool initialized; //true is motor is initialized and ready for us, false otherwise |
3453 | - bool isReversed; //true if motor direction is to be reversed from default values on controller board |
3454 | + double commandedPosition; //desired position of the motor |
3455 | + bool initialized; //true is motor is initialized and ready for us, false otherwise |
3456 | + bool isReversed; //true if motor direction is to be reversed from default values on controller board |
3457 | |
3458 | - //Tell hardware to send updated data for this motor to the DLL. |
3459 | - void updateData(void); |
3460 | + //Tell hardware to send updated data for this motor to the DLL. |
3461 | + void updateData(void); |
3462 | |
3463 | public: |
3464 | - Motor(void); |
3465 | - |
3466 | - //Creates a motor with all of the given values (described above) |
3467 | - Motor(string name,const byte& address, const double countsPerU, const double ticksPerSecond, short kp, short kd, short ki, short il, byte ol, byte cl, short int el, byte sr, byte db); |
3468 | - |
3469 | - //Returns: The current position of the motor. The unit of position is U. |
3470 | - double getPosition(void); |
3471 | - |
3472 | - double getMinPosition(); |
3473 | - |
3474 | - double getMaxPosition(); |
3475 | - |
3476 | - //Returns: The most recent position that the motor was commanded to move to by moveAbsolute, moveRelative, and resetPosition functions. The unit of position is U. |
3477 | - double getCommandedPosition(void); |
3478 | - |
3479 | - //Move to a position at a specified velocity and acceleration. |
3480 | - //The unit of position is U, the unit of velocity is U/second, and the unit of acceleration is U/(second^2). |
3481 | - //Requires MIN_COMMANDED_POSITION <= position <= MAX_COMMANDED_POSITION, MIN_COMMANDED_VELOCITY <= velocity <= MAX_COMMANDED_VELOCITY, MIN_COMMANDED_ACCELERATION <= acceleration <= MAX_COMMANDED_ACCELERATION |
3482 | - //Returns true iff command was issued successfully. |
3483 | - bool moveAbsolute(double position, double velocity, double acceleration); |
3484 | - |
3485 | - //Move relative to the current position at a specified velocity and acceleration. |
3486 | - //Returns true iff command was issued successfully. |
3487 | - bool moveRelative(double positionDelta, double velocity, double acceleration); |
3488 | - |
3489 | - //Returns: True iff motor is currently moving. |
3490 | - bool moving(void); |
3491 | - |
3492 | - //This function returns as soon as possible after the motor has finished moving. |
3493 | - void waitMove(void); |
3494 | - |
3495 | - //Stops the motor |
3496 | - bool stop(void); |
3497 | - |
3498 | - //Set whether this motor is reversed. If a motor is reversed, movement commands will cause the motor to move in the opposite direction. |
3499 | - void setReversed(bool); |
3500 | - |
3501 | - //sets the address of the motor on the controller board, see JKerr documentation for more details |
3502 | - bool setGroup(byte groupAddress, bool isLeader); |
3503 | - |
3504 | - //The motors current position is considered to be 0 and the motors commanded position is set to 0. |
3505 | - bool resetPosition(void); |
3506 | - |
3507 | - //Initialize the motor. |
3508 | - //Returns: "" if successful or an error message if failed. |
3509 | - string initialize(void); |
3510 | - |
3511 | - //gets the motor address from the controller board |
3512 | - byte getAddress(void); |
3513 | - |
3514 | - //gets the ratio of counts of motor movement per real unit of measurement |
3515 | - double getCountsPerU(void); |
3516 | - |
3517 | - //Perform cleanup when done using motor. |
3518 | - //Returns: True iff successful. |
3519 | - bool cleanUp(void); |
3520 | - |
3521 | - //The destructor. |
3522 | - ~Motor(void); |
3523 | + Motor(void); |
3524 | + |
3525 | + //Creates a motor with all of the given values (described above) |
3526 | + Motor(string name,const byte& address, const double countsPerU, const double ticksPerSecond, short kp, short kd, short ki, short il, byte ol, byte cl, short int el, byte sr, byte db); |
3527 | + |
3528 | + //Returns: The current position of the motor. The unit of position is U. |
3529 | + double getPosition(void); |
3530 | + |
3531 | + double getMinPosition(); |
3532 | + |
3533 | + double getMaxPosition(); |
3534 | + |
3535 | + //Returns: The most recent position that the motor was commanded to move to by moveAbsolute, moveRelative, and resetPosition functions. The unit of position is U. |
3536 | + double getCommandedPosition(void); |
3537 | + |
3538 | + //Move to a position at a specified velocity and acceleration. |
3539 | + //The unit of position is U, the unit of velocity is U/second, and the unit of acceleration is U/(second^2). |
3540 | + //Requires MIN_COMMANDED_POSITION <= position <= MAX_COMMANDED_POSITION, MIN_COMMANDED_VELOCITY <= velocity <= MAX_COMMANDED_VELOCITY, MIN_COMMANDED_ACCELERATION <= acceleration <= MAX_COMMANDED_ACCELERATION |
3541 | + //Returns true iff command was issued successfully. |
3542 | + bool moveAbsolute(double position, double velocity, double acceleration); |
3543 | + |
3544 | + //Move relative to the current position at a specified velocity and acceleration. |
3545 | + //Returns true iff command was issued successfully. |
3546 | + bool moveRelative(double positionDelta, double velocity, double acceleration); |
3547 | + |
3548 | + //Returns: True iff motor is currently moving. |
3549 | + bool moving(void); |
3550 | + |
3551 | + //This function returns as soon as possible after the motor has finished moving. |
3552 | + void waitMove(void); |
3553 | + |
3554 | + //Stops the motor |
3555 | + bool stop(void); |
3556 | + |
3557 | + //Set whether this motor is reversed. If a motor is reversed, movement commands will cause the motor to move in the opposite direction. |
3558 | + void setReversed(bool); |
3559 | + |
3560 | + //sets the address of the motor on the controller board, see JKerr documentation for more details |
3561 | + bool setGroup(byte groupAddress, bool isLeader); |
3562 | + |
3563 | + //The motors current position is considered to be 0 and the motors commanded position is set to 0. |
3564 | + bool resetPosition(void); |
3565 | + |
3566 | + //Initialize the motor. |
3567 | + //Returns: "" if successful or an error message if failed. |
3568 | + string initialize(void); |
3569 | + |
3570 | + //gets the motor address from the controller board |
3571 | + byte getAddress(void); |
3572 | + |
3573 | + //gets the ratio of counts of motor movement per real unit of measurement |
3574 | + double getCountsPerU(void); |
3575 | + |
3576 | + //Perform cleanup when done using motor. |
3577 | + //Returns: True iff successful. |
3578 | + bool cleanUp(void); |
3579 | + |
3580 | + //The destructor. |
3581 | + ~Motor(void); |
3582 | |
3583 | }; |
3584 | |
3585 | |
3586 | === added directory 'software/FabInterpreter/Path_Tester' |
3587 | === added file 'software/FabInterpreter/Path_Tester/.DS_Store' |
3588 | Binary files software/FabInterpreter/Path_Tester/.DS_Store 1970-01-01 00:00:00 +0000 and software/FabInterpreter/Path_Tester/.DS_Store 2010-08-07 00:08:43 +0000 differ |
3589 | === added file 'software/FabInterpreter/Path_Tester/Makefile' |
3590 | --- software/FabInterpreter/Path_Tester/Makefile 1970-01-01 00:00:00 +0000 |
3591 | +++ software/FabInterpreter/Path_Tester/Makefile 2010-08-07 00:08:43 +0000 |
3592 | @@ -0,0 +1,271 @@ |
3593 | +############################################################################# |
3594 | +# Makefile for building: Path_Tester |
3595 | +# Generated by qmake (2.01a) (Qt 4.6.3) on: Wed Jul 28 14:08:54 2010 |
3596 | +# Project: Path_Tester.pro |
3597 | +# Template: app |
3598 | +# Command: /usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile Path_Tester.pro |
3599 | +############################################################################# |
3600 | + |
3601 | +####### Compiler, tools and options |
3602 | + |
3603 | +CC = gcc |
3604 | +CXX = g++ |
3605 | +DEFINES = -DQT_CORE_LIB -DQT_SHARED |
3606 | +CFLAGS = -pipe -g -gdwarf-2 -arch i386 -Wall -W $(DEFINES) |
3607 | +CXXFLAGS = -pipe -g -gdwarf-2 -arch i386 -Wall -W $(DEFINES) |
3608 | +INCPATH = -I/usr/local/Qt4.6/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/usr/include -I../../Common/JrKerr -I../../Common/JrKerr/src -I. -F/Library/Frameworks |
3609 | +LINK = g++ |
3610 | +LFLAGS = -headerpad_max_install_names -arch i386 |
3611 | +LIBS = $(SUBLIBS) -F/Library/Frameworks -L../../Common/JrKerr/src/build -L/Library/Frameworks -lqextserialportd -framework QtCore |
3612 | +AR = ar cq |
3613 | +RANLIB = ranlib -s |
3614 | +QMAKE = /usr/bin/qmake |
3615 | +TAR = tar -cf |
3616 | +COMPRESS = gzip -9f |
3617 | +COPY = cp -f |
3618 | +SED = sed |
3619 | +COPY_FILE = cp -f |
3620 | +COPY_DIR = cp -f -R |
3621 | +STRIP = |
3622 | +INSTALL_FILE = $(COPY_FILE) |
3623 | +INSTALL_DIR = $(COPY_DIR) |
3624 | +INSTALL_PROGRAM = $(COPY_FILE) |
3625 | +DEL_FILE = rm -f |
3626 | +SYMLINK = ln -f -s |
3627 | +DEL_DIR = rmdir |
3628 | +MOVE = mv -f |
3629 | +CHK_DIR_EXISTS= test -d |
3630 | +MKDIR = mkdir -p |
3631 | +export MACOSX_DEPLOYMENT_TARGET = 10.4 |
3632 | + |
3633 | +####### Output directory |
3634 | + |
3635 | +OBJECTS_DIR = ./ |
3636 | + |
3637 | +####### Files |
3638 | + |
3639 | +SOURCES = main.cpp \ |
3640 | + ../../Common/JrKerr/nmccom.cpp \ |
3641 | + ../../Common/JrKerr/picio.cpp \ |
3642 | + ../../Common/JrKerr/picservo.cpp \ |
3643 | + ../../Common/JrKerr/picstep.cpp \ |
3644 | + ../../Common/JrKerr/path.cpp |
3645 | +OBJECTS = main.o \ |
3646 | + nmccom.o \ |
3647 | + picio.o \ |
3648 | + picservo.o \ |
3649 | + picstep.o \ |
3650 | + path.o |
3651 | +DIST = /usr/local/Qt4.6/mkspecs/common/unix.conf \ |
3652 | + /usr/local/Qt4.6/mkspecs/common/mac.conf \ |
3653 | + /usr/local/Qt4.6/mkspecs/common/mac-g++.conf \ |
3654 | + /usr/local/Qt4.6/mkspecs/qconfig.pri \ |
3655 | + /usr/local/Qt4.6/mkspecs/features/qt_functions.prf \ |
3656 | + /usr/local/Qt4.6/mkspecs/features/qt_config.prf \ |
3657 | + /usr/local/Qt4.6/mkspecs/features/exclusive_builds.prf \ |
3658 | + /usr/local/Qt4.6/mkspecs/features/default_pre.prf \ |
3659 | + /usr/local/Qt4.6/mkspecs/features/mac/default_pre.prf \ |
3660 | + jrkerr.pro \ |
3661 | + /usr/local/Qt4.6/mkspecs/features/mac/dwarf2.prf \ |
3662 | + /usr/local/Qt4.6/mkspecs/features/debug.prf \ |
3663 | + /usr/local/Qt4.6/mkspecs/features/default_post.prf \ |
3664 | + /usr/local/Qt4.6/mkspecs/features/mac/default_post.prf \ |
3665 | + /usr/local/Qt4.6/mkspecs/features/mac/x86.prf \ |
3666 | + /usr/local/Qt4.6/mkspecs/features/mac/objective_c.prf \ |
3667 | + /usr/local/Qt4.6/mkspecs/features/warn_on.prf \ |
3668 | + /usr/local/Qt4.6/mkspecs/features/qt.prf \ |
3669 | + /usr/local/Qt4.6/mkspecs/features/unix/thread.prf \ |
3670 | + /usr/local/Qt4.6/mkspecs/features/moc.prf \ |
3671 | + /usr/local/Qt4.6/mkspecs/features/mac/rez.prf \ |
3672 | + /usr/local/Qt4.6/mkspecs/features/mac/sdk.prf \ |
3673 | + /usr/local/Qt4.6/mkspecs/features/resources.prf \ |
3674 | + /usr/local/Qt4.6/mkspecs/features/uic.prf \ |
3675 | + /usr/local/Qt4.6/mkspecs/features/yacc.prf \ |
3676 | + /usr/local/Qt4.6/mkspecs/features/lex.prf \ |
3677 | + /usr/local/Qt4.6/mkspecs/features/include_source_dir.prf \ |
3678 | + Path_Tester.pro |
3679 | +QMAKE_TARGET = Path_Tester |
3680 | +DESTDIR = |
3681 | +TARGET = Path_Tester |
3682 | + |
3683 | +####### Custom Compiler Variables |
3684 | +QMAKE_COMP_QMAKE_OBJECTIVE_CFLAGS = -pipe \ |
3685 | + -g \ |
3686 | + -gdwarf-2 \ |
3687 | + -arch \ |
3688 | + i386 \ |
3689 | + -Wall \ |
3690 | + -W |
3691 | + |
3692 | + |
3693 | +first: all |
3694 | +####### Implicit rules |
3695 | + |
3696 | +.SUFFIXES: .o .c .cpp .cc .cxx .C |
3697 | + |
3698 | +.cpp.o: |
3699 | + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
3700 | + |
3701 | +.cc.o: |
3702 | + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
3703 | + |
3704 | +.cxx.o: |
3705 | + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
3706 | + |
3707 | +.C.o: |
3708 | + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
3709 | + |
3710 | +.c.o: |
3711 | + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" |
3712 | + |
3713 | +####### Build rules |
3714 | + |
3715 | +all: Makefile $(TARGET) |
3716 | + |
3717 | +$(TARGET): $(OBJECTS) |
3718 | + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) |
3719 | + |
3720 | +Makefile: Path_Tester.pro /usr/local/Qt4.6/mkspecs/macx-g++/qmake.conf /usr/local/Qt4.6/mkspecs/common/unix.conf \ |
3721 | + /usr/local/Qt4.6/mkspecs/common/mac.conf \ |
3722 | + /usr/local/Qt4.6/mkspecs/common/mac-g++.conf \ |
3723 | + /usr/local/Qt4.6/mkspecs/qconfig.pri \ |
3724 | + /usr/local/Qt4.6/mkspecs/features/qt_functions.prf \ |
3725 | + /usr/local/Qt4.6/mkspecs/features/qt_config.prf \ |
3726 | + /usr/local/Qt4.6/mkspecs/features/exclusive_builds.prf \ |
3727 | + /usr/local/Qt4.6/mkspecs/features/default_pre.prf \ |
3728 | + /usr/local/Qt4.6/mkspecs/features/mac/default_pre.prf \ |
3729 | + jrkerr.pro \ |
3730 | + /usr/local/Qt4.6/mkspecs/features/mac/dwarf2.prf \ |
3731 | + /usr/local/Qt4.6/mkspecs/features/debug.prf \ |
3732 | + /usr/local/Qt4.6/mkspecs/features/default_post.prf \ |
3733 | + /usr/local/Qt4.6/mkspecs/features/mac/default_post.prf \ |
3734 | + /usr/local/Qt4.6/mkspecs/features/mac/x86.prf \ |
3735 | + /usr/local/Qt4.6/mkspecs/features/mac/objective_c.prf \ |
3736 | + /usr/local/Qt4.6/mkspecs/features/warn_on.prf \ |
3737 | + /usr/local/Qt4.6/mkspecs/features/qt.prf \ |
3738 | + /usr/local/Qt4.6/mkspecs/features/unix/thread.prf \ |
3739 | + /usr/local/Qt4.6/mkspecs/features/moc.prf \ |
3740 | + /usr/local/Qt4.6/mkspecs/features/mac/rez.prf \ |
3741 | + /usr/local/Qt4.6/mkspecs/features/mac/sdk.prf \ |
3742 | + /usr/local/Qt4.6/mkspecs/features/resources.prf \ |
3743 | + /usr/local/Qt4.6/mkspecs/features/uic.prf \ |
3744 | + /usr/local/Qt4.6/mkspecs/features/yacc.prf \ |
3745 | + /usr/local/Qt4.6/mkspecs/features/lex.prf \ |
3746 | + /usr/local/Qt4.6/mkspecs/features/include_source_dir.prf \ |
3747 | + /Library/Frameworks/QtCore.framework/QtCore.prl |
3748 | + $(QMAKE) -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile Path_Tester.pro |
3749 | +/usr/local/Qt4.6/mkspecs/common/unix.conf: |
3750 | +/usr/local/Qt4.6/mkspecs/common/mac.conf: |
3751 | +/usr/local/Qt4.6/mkspecs/common/mac-g++.conf: |
3752 | +/usr/local/Qt4.6/mkspecs/qconfig.pri: |
3753 | +/usr/local/Qt4.6/mkspecs/features/qt_functions.prf: |
3754 | +/usr/local/Qt4.6/mkspecs/features/qt_config.prf: |
3755 | +/usr/local/Qt4.6/mkspecs/features/exclusive_builds.prf: |
3756 | +/usr/local/Qt4.6/mkspecs/features/default_pre.prf: |
3757 | +/usr/local/Qt4.6/mkspecs/features/mac/default_pre.prf: |
3758 | +jrkerr.pro: |
3759 | +/usr/local/Qt4.6/mkspecs/features/mac/dwarf2.prf: |
3760 | +/usr/local/Qt4.6/mkspecs/features/debug.prf: |
3761 | +/usr/local/Qt4.6/mkspecs/features/default_post.prf: |
3762 | +/usr/local/Qt4.6/mkspecs/features/mac/default_post.prf: |
3763 | +/usr/local/Qt4.6/mkspecs/features/mac/x86.prf: |
3764 | +/usr/local/Qt4.6/mkspecs/features/mac/objective_c.prf: |
3765 | +/usr/local/Qt4.6/mkspecs/features/warn_on.prf: |
3766 | +/usr/local/Qt4.6/mkspecs/features/qt.prf: |
3767 | +/usr/local/Qt4.6/mkspecs/features/unix/thread.prf: |
3768 | +/usr/local/Qt4.6/mkspecs/features/moc.prf: |
3769 | +/usr/local/Qt4.6/mkspecs/features/mac/rez.prf: |
3770 | +/usr/local/Qt4.6/mkspecs/features/mac/sdk.prf: |
3771 | +/usr/local/Qt4.6/mkspecs/features/resources.prf: |
3772 | +/usr/local/Qt4.6/mkspecs/features/uic.prf: |
3773 | +/usr/local/Qt4.6/mkspecs/features/yacc.prf: |
3774 | +/usr/local/Qt4.6/mkspecs/features/lex.prf: |
3775 | +/usr/local/Qt4.6/mkspecs/features/include_source_dir.prf: |
3776 | +/Library/Frameworks/QtCore.framework/QtCore.prl: |
3777 | +qmake: FORCE |
3778 | + @$(QMAKE) -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile Path_Tester.pro |
3779 | + |
3780 | +dist: |
3781 | + @$(CHK_DIR_EXISTS) .tmp/Path_Tester1.0.0 || $(MKDIR) .tmp/Path_Tester1.0.0 |
3782 | + $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/Path_Tester1.0.0/ && $(COPY_FILE) --parents ../../Common/JrKerr/nmccom.h ../../Common/JrKerr/picio.h ../../Common/JrKerr/picservo.h ../../Common/JrKerr/picstep.h ../../Common/JrKerr/path.h .tmp/Path_Tester1.0.0/ && $(COPY_FILE) --parents main.cpp ../../Common/JrKerr/nmccom.cpp ../../Common/JrKerr/picio.cpp ../../Common/JrKerr/picservo.cpp ../../Common/JrKerr/picstep.cpp ../../Common/JrKerr/path.cpp .tmp/Path_Tester1.0.0/ && (cd `dirname .tmp/Path_Tester1.0.0` && $(TAR) Path_Tester1.0.0.tar Path_Tester1.0.0 && $(COMPRESS) Path_Tester1.0.0.tar) && $(MOVE) `dirname .tmp/Path_Tester1.0.0`/Path_Tester1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/Path_Tester1.0.0 |
3783 | + |
3784 | + |
3785 | +clean:compiler_clean |
3786 | + -$(DEL_FILE) $(OBJECTS) |
3787 | + -$(DEL_FILE) *~ core *.core |
3788 | + |
3789 | + |
3790 | +####### Sub-libraries |
3791 | + |
3792 | +distclean: clean |
3793 | + -$(DEL_FILE) $(TARGET) |
3794 | + -$(DEL_FILE) Makefile |
3795 | + |
3796 | + |
3797 | +check: first |
3798 | + |
3799 | +mocclean: compiler_moc_header_clean compiler_moc_source_clean |
3800 | + |
3801 | +mocables: compiler_moc_header_make_all compiler_moc_source_make_all |
3802 | + |
3803 | +compiler_objective_c_make_all: |
3804 | +compiler_objective_c_clean: |
3805 | +compiler_moc_header_make_all: |
3806 | +compiler_moc_header_clean: |
3807 | +compiler_rcc_make_all: |
3808 | +compiler_rcc_clean: |
3809 | +compiler_image_collection_make_all: qmake_image_collection.cpp |
3810 | +compiler_image_collection_clean: |
3811 | + -$(DEL_FILE) qmake_image_collection.cpp |
3812 | +compiler_moc_source_make_all: |
3813 | +compiler_moc_source_clean: |
3814 | +compiler_rez_source_make_all: |
3815 | +compiler_rez_source_clean: |
3816 | +compiler_uic_make_all: |
3817 | +compiler_uic_clean: |
3818 | +compiler_yacc_decl_make_all: |
3819 | +compiler_yacc_decl_clean: |
3820 | +compiler_yacc_impl_make_all: |
3821 | +compiler_yacc_impl_clean: |
3822 | +compiler_lex_make_all: |
3823 | +compiler_lex_clean: |
3824 | +compiler_clean: |
3825 | + |
3826 | +####### Compile |
3827 | + |
3828 | +main.o: main.cpp ../../Common/JrKerr/path.h \ |
3829 | + ../../Common/JrKerr/picservo.h \ |
3830 | + ../../Common/JrKerr/nmccom.h |
3831 | + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp |
3832 | + |
3833 | +nmccom.o: ../../Common/JrKerr/nmccom.cpp ../../Common/JrKerr/nmccom.h \ |
3834 | + ../../Common/JrKerr/picio.h \ |
3835 | + ../../Common/JrKerr/picservo.h \ |
3836 | + ../../Common/JrKerr/picstep.h |
3837 | + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o nmccom.o ../../Common/JrKerr/nmccom.cpp |
3838 | + |
3839 | +picio.o: ../../Common/JrKerr/picio.cpp ../../Common/JrKerr/nmccom.h \ |
3840 | + ../../Common/JrKerr/picio.h |
3841 | + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o picio.o ../../Common/JrKerr/picio.cpp |
3842 | + |
3843 | +picservo.o: ../../Common/JrKerr/picservo.cpp ../../Common/JrKerr/nmccom.h \ |
3844 | + ../../Common/JrKerr/picservo.h |
3845 | + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o picservo.o ../../Common/JrKerr/picservo.cpp |
3846 | + |
3847 | +picstep.o: ../../Common/JrKerr/picstep.cpp ../../Common/JrKerr/nmccom.h \ |
3848 | + ../../Common/JrKerr/picstep.h |
3849 | + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o picstep.o ../../Common/JrKerr/picstep.cpp |
3850 | + |
3851 | +path.o: ../../Common/JrKerr/path.cpp ../../Common/JrKerr/path.h \ |
3852 | + ../../Common/JrKerr/nmccom.h \ |
3853 | + ../../Common/JrKerr/picservo.h |
3854 | + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o path.o ../../Common/JrKerr/path.cpp |
3855 | + |
3856 | +####### Install |
3857 | + |
3858 | +install: FORCE |
3859 | + |
3860 | +uninstall: FORCE |
3861 | + |
3862 | +FORCE: |
3863 | + |
3864 | |
3865 | === added file 'software/FabInterpreter/Path_Tester/Path_Tester' |
3866 | Binary files software/FabInterpreter/Path_Tester/Path_Tester 1970-01-01 00:00:00 +0000 and software/FabInterpreter/Path_Tester/Path_Tester 2010-08-07 00:08:43 +0000 differ |
3867 | === added file 'software/FabInterpreter/Path_Tester/Path_Tester.pro' |
3868 | --- software/FabInterpreter/Path_Tester/Path_Tester.pro 1970-01-01 00:00:00 +0000 |
3869 | +++ software/FabInterpreter/Path_Tester/Path_Tester.pro 2010-08-07 00:08:43 +0000 |
3870 | @@ -0,0 +1,21 @@ |
3871 | +#------------------------------------------------- |
3872 | +# |
3873 | +# Project created by QtCreator 2010-07-28T12:10:08 |
3874 | +# |
3875 | +#------------------------------------------------- |
3876 | + |
3877 | +QT -= gui |
3878 | + |
3879 | +TARGET = Path_Tester |
3880 | +CONFIG += console |
3881 | +CONFIG -= app_bundle |
3882 | + |
3883 | +INCLUDEPATH += ../../Common/JrKerr |
3884 | + |
3885 | + |
3886 | +TEMPLATE = app |
3887 | + |
3888 | + |
3889 | +SOURCES += main.cpp |
3890 | + |
3891 | +include("jrkerr.pro") |
3892 | |
3893 | === added file 'software/FabInterpreter/Path_Tester/Path_Tester.pro.user' |
3894 | --- software/FabInterpreter/Path_Tester/Path_Tester.pro.user 1970-01-01 00:00:00 +0000 |
3895 | +++ software/FabInterpreter/Path_Tester/Path_Tester.pro.user 2010-08-07 00:08:43 +0000 |
3896 | @@ -0,0 +1,228 @@ |
3897 | +<!DOCTYPE QtCreatorProject> |
3898 | +<qtcreator> |
3899 | + <data> |
3900 | + <variable>RunConfiguration0-BaseEnvironmentBase</variable> |
3901 | + <value type="int">2</value> |
3902 | + </data> |
3903 | + <data> |
3904 | + <variable>RunConfiguration0-CommandLineArguments</variable> |
3905 | + <valuelist type="QVariantList"/> |
3906 | + </data> |
3907 | + <data> |
3908 | + <variable>RunConfiguration0-ProFile</variable> |
3909 | + <value type="QString">Path_Tester.pro</value> |
3910 | + </data> |
3911 | + <data> |
3912 | + <variable>RunConfiguration0-RunConfiguration.name</variable> |
3913 | + <value type="QString">Path_Tester</value> |
3914 | + </data> |
3915 | + <data> |
3916 | + <variable>RunConfiguration0-UseDyldImageSuffix</variable> |
3917 | + <value type="bool">false</value> |
3918 | + </data> |
3919 | + <data> |
3920 | + <variable>RunConfiguration0-UseTerminal</variable> |
3921 | + <value type="bool">false</value> |
3922 | + </data> |
3923 | + <data> |
3924 | + <variable>RunConfiguration0-UserEnvironmentChanges</variable> |
3925 | + <valuelist type="QVariantList"> |
3926 | + <value type="QString">DYLD_LIBRARY_PATH=/Users/jcman912/Documents/Fab@Home/Interpreter_Experimental/software/Common/JrKerr/src/build/</value> |
3927 | + </valuelist> |
3928 | + </data> |
3929 | + <data> |
3930 | + <variable>RunConfiguration0-UserSetName</variable> |
3931 | + <value type="bool">false</value> |
3932 | + </data> |
3933 | + <data> |
3934 | + <variable>RunConfiguration0-UserSetWorkingDirectory</variable> |
3935 | + <value type="bool">false</value> |
3936 | + </data> |
3937 | + <data> |
3938 | + <variable>RunConfiguration0-UserWorkingDirectory</variable> |
3939 | + <value type="QString"></value> |
3940 | + </data> |
3941 | + <data> |
3942 | + <variable>RunConfiguration0-type</variable> |
3943 | + <value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value> |
3944 | + </data> |
3945 | + <data> |
3946 | + <variable>activeRunConfiguration</variable> |
3947 | + <value type="int">0</value> |
3948 | + </data> |
3949 | + <data> |
3950 | + <variable>activebuildconfiguration</variable> |
3951 | + <value type="QString">Debug</value> |
3952 | + </data> |
3953 | + <data> |
3954 | + <variable>buildConfiguration-Debug</variable> |
3955 | + <valuemap type="QVariantMap"> |
3956 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
3957 | + <value key="QtVersionId" type="int">0</value> |
3958 | + <value key="ToolChain" type="int">0</value> |
3959 | + <value key="buildConfiguration" type="int">2</value> |
3960 | + </valuemap> |
3961 | + </data> |
3962 | + <data> |
3963 | + <variable>buildConfiguration-Release</variable> |
3964 | + <valuemap type="QVariantMap"> |
3965 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value> |
3966 | + <value key="QtVersionId" type="int">0</value> |
3967 | + <value key="buildConfiguration" type="int">0</value> |
3968 | + </valuemap> |
3969 | + </data> |
3970 | + <data> |
3971 | + <variable>buildconfiguration-Debug-buildstep0</variable> |
3972 | + <valuemap type="QVariantMap"> |
3973 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
3974 | + <valuelist key="abstractProcess.Environment" type="QVariantList"> |
3975 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-4YVcSb/Render</value> |
3976 | + <value type="QString">COMMAND_MODE=unix2003</value> |
3977 | + <value type="QString">DISPLAY=/tmp/launch-2sCJnY/:0</value> |
3978 | + <value type="QString">HOME=/Users/jcman912</value> |
3979 | + <value type="QString">LOGNAME=jcman912</value> |
3980 | + <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
3981 | + <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
3982 | + <value type="QString">SHELL=/bin/bash</value> |
3983 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-CtydgP/Listeners</value> |
3984 | + <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
3985 | + <value type="QString">USER=jcman912</value> |
3986 | + <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
3987 | + </valuelist> |
3988 | + <valuelist key="abstractProcess.arguments" type="QVariantList"> |
3989 | + <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Experimental/software/FabInterpreter/Path_Tester/Path_Tester.pro</value> |
3990 | + <value type="QString">-spec</value> |
3991 | + <value type="QString">macx-g++</value> |
3992 | + <value type="QString">-r</value> |
3993 | + </valuelist> |
3994 | + <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value> |
3995 | + <value key="abstractProcess.enabled" type="bool">false</value> |
3996 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Experimental/software/FabInterpreter/Path_Tester</value> |
3997 | + </valuemap> |
3998 | + </data> |
3999 | + <data> |
4000 | + <variable>buildconfiguration-Debug-buildstep1</variable> |
4001 | + <valuemap type="QVariantMap"> |
4002 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
4003 | + <valuelist key="abstractProcess.Environment" type="QVariantList"> |
4004 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-4YVcSb/Render</value> |
4005 | + <value type="QString">COMMAND_MODE=unix2003</value> |
4006 | + <value type="QString">DISPLAY=/tmp/launch-2sCJnY/:0</value> |
4007 | + <value type="QString">HOME=/Users/jcman912</value> |
4008 | + <value type="QString">LOGNAME=jcman912</value> |
4009 | + <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
4010 | + <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
4011 | + <value type="QString">SHELL=/bin/bash</value> |
4012 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-CtydgP/Listeners</value> |
4013 | + <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
4014 | + <value type="QString">USER=jcman912</value> |
4015 | + <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
4016 | + </valuelist> |
4017 | + <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value> |
4018 | + <valuelist key="abstractProcess.arguments" type="QVariantList"> |
4019 | + <value type="QString">-w</value> |
4020 | + </valuelist> |
4021 | + <value key="abstractProcess.command" type="QString">/usr/bin/make</value> |
4022 | + <value key="abstractProcess.enabled" type="bool">true</value> |
4023 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Experimental/software/FabInterpreter/Path_Tester</value> |
4024 | + </valuemap> |
4025 | + </data> |
4026 | + <data> |
4027 | + <variable>buildconfiguration-Debug-cleanstep0</variable> |
4028 | + <valuemap type="QVariantMap"> |
4029 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value> |
4030 | + <valuelist key="abstractProcess.Environment" type="QVariantList"> |
4031 | + <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-4YVcSb/Render</value> |
4032 | + <value type="QString">COMMAND_MODE=unix2003</value> |
4033 | + <value type="QString">DISPLAY=/tmp/launch-2sCJnY/:0</value> |
4034 | + <value type="QString">HOME=/Users/jcman912</value> |
4035 | + <value type="QString">LOGNAME=jcman912</value> |
4036 | + <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value> |
4037 | + <value type="QString">QTDIR=/usr/local/Qt4.6</value> |
4038 | + <value type="QString">SHELL=/bin/bash</value> |
4039 | + <value type="QString">SSH_AUTH_SOCK=/tmp/launch-CtydgP/Listeners</value> |
4040 | + <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value> |
4041 | + <value type="QString">USER=jcman912</value> |
4042 | + <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value> |
4043 | + </valuelist> |
4044 | + <value key="abstractProcess.IgnoreReturnValue" type="bool">true</value> |
4045 | + <valuelist key="abstractProcess.arguments" type="QVariantList"> |
4046 | + <value type="QString">clean</value> |
4047 | + <value type="QString">-w</value> |
4048 | + </valuelist> |
4049 | + <value key="abstractProcess.command" type="QString">/usr/bin/make</value> |
4050 | + <value key="abstractProcess.enabled" type="bool">true</value> |
4051 | + <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Experimental/software/FabInterpreter/Path_Tester</value> |
4052 | + <value key="cleanConfig" type="bool">true</value> |
4053 | + <valuelist key="makeargs" type="QVariantList"> |
4054 | + <value type="QString">clean</value> |
4055 | + </valuelist> |
4056 | + </valuemap> |
4057 | + </data> |
4058 | + <data> |
4059 | + <variable>buildconfiguration-Release-buildstep0</variable> |
4060 | + <valuemap type="QVariantMap"> |
4061 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value> |
4062 | + </valuemap> |
4063 | + </data> |
4064 | + <data> |
4065 | + <variable>buildconfiguration-Release-buildstep1</variable> |
4066 | + <valuemap type="QVariantMap"> |
4067 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value> |
4068 | + </valuemap> |
4069 | + </data> |
4070 | + <data> |
4071 | + <variable>buildconfiguration-Release-cleanstep0</variable> |
4072 | + <valuemap type="QVariantMap"> |
4073 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value> |
4074 | + </valuemap> |
4075 | + </data> |
4076 | + <data> |
4077 | + <variable>buildconfigurations</variable> |
4078 | + <valuelist type="QVariantList"> |
4079 | + <value type="QString">Debug</value> |
4080 | + <value type="QString">Release</value> |
4081 | + </valuelist> |
4082 | + </data> |
4083 | + <data> |
4084 | + <variable>buildstep0</variable> |
4085 | + <valuemap type="QVariantMap"> |
4086 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value> |
4087 | + <value key="mkspec" type="QString"></value> |
4088 | + </valuemap> |
4089 | + </data> |
4090 | + <data> |
4091 | + <variable>buildstep1</variable> |
4092 | + <valuemap type="QVariantMap"> |
4093 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value> |
4094 | + </valuemap> |
4095 | + </data> |
4096 | + <data> |
4097 | + <variable>buildsteps</variable> |
4098 | + <valuelist type="QVariantList"> |
4099 | + <value type="QString">trolltech.qt4projectmanager.qmake</value> |
4100 | + <value type="QString">trolltech.qt4projectmanager.make</value> |
4101 | + </valuelist> |
4102 | + </data> |
4103 | + <data> |
4104 | + <variable>cleanstep0</variable> |
4105 | + <valuemap type="QVariantMap"> |
4106 | + <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value> |
4107 | + <value key="clean" type="bool">true</value> |
4108 | + </valuemap> |
4109 | + </data> |
4110 | + <data> |
4111 | + <variable>cleansteps</variable> |
4112 | + <valuelist type="QVariantList"> |
4113 | + <value type="QString">trolltech.qt4projectmanager.make</value> |
4114 | + </valuelist> |
4115 | + </data> |
4116 | + <data> |
4117 | + <variable>defaultFileEncoding</variable> |
4118 | + <value type="QByteArray">System</value> |
4119 | + </data> |
4120 | + <data> |
4121 | + <variable>project</variable> |
4122 | + <valuemap type="QVariantMap"/> |
4123 | + </data> |
4124 | +</qtcreator> |
4125 | |
4126 | === added file 'software/FabInterpreter/Path_Tester/jrkerr.pro' |
4127 | --- software/FabInterpreter/Path_Tester/jrkerr.pro 1970-01-01 00:00:00 +0000 |
4128 | +++ software/FabInterpreter/Path_Tester/jrkerr.pro 2010-08-07 00:08:43 +0000 |
4129 | @@ -0,0 +1,18 @@ |
4130 | +DEPENDPATH += ../../Common/JrKerr |
4131 | +INCLUDEPATH += ../../Common/JrKerr/src |
4132 | +QMAKE_LIBDIR += ../../Common/JrKerr/src/build |
4133 | + |
4134 | +HEADERS += ../../Common/JrKerr/nmccom.h \ |
4135 | + ../../Common/JrKerr/picio.h \ |
4136 | + ../../Common/JrKerr/picservo.h\ |
4137 | + ../../Common/JrKerr/picstep.h \ |
4138 | + ../../Common/JrKerr/path.h |
4139 | + |
4140 | +SOURCES += ../../Common/JrKerr/nmccom.cpp \ |
4141 | + ../../Common/JrKerr/picio.cpp \ |
4142 | + ../../Common/JrKerr/picservo.cpp\ |
4143 | + ../../Common/JrKerr/picstep.cpp \ |
4144 | + ../../Common/JrKerr/path.cpp |
4145 | + |
4146 | +CONFIG(debug, debug|release):LIBS += -lqextserialportd |
4147 | +else:LIBS += -lqextserialport |
4148 | |
4149 | === added file 'software/FabInterpreter/Path_Tester/main.cpp' |
4150 | --- software/FabInterpreter/Path_Tester/main.cpp 1970-01-01 00:00:00 +0000 |
4151 | +++ software/FabInterpreter/Path_Tester/main.cpp 2010-08-07 00:08:43 +0000 |
4152 | @@ -0,0 +1,177 @@ |
4153 | +#include <QtCore/QCoreApplication> |
4154 | +#include "path.h" |
4155 | +#include "picservo.h" |
4156 | +#include "nmccom.h" |
4157 | +#include <unistd.h> |
4158 | +#include <qdebug.h> |
4159 | + |
4160 | +void initialize(); |
4161 | +void execute(); |
4162 | +void ExecutePath(); |
4163 | +void ReportError(int); |
4164 | + |
4165 | +void initialize() |
4166 | +{ |
4167 | + qDebug() << "Please turn on Servo Controller Power"; |
4168 | + |
4169 | + int nummod = NmcInit("/dev/tty.usbserial-A9003UF2", 19200); //Controllers on COM1, use 115200 baud |
4170 | + |
4171 | + if (nummod < 2) |
4172 | + { |
4173 | + qDebug() << "2 servos not found"; |
4174 | + qDebug() << "exiting..."; |
4175 | + } |
4176 | + |
4177 | + //Set the group address for both controllers to 128 |
4178 | + NmcSetGroupAddr(1, 128, true); //x axis is the group leader |
4179 | + NmcSetGroupAddr(2, 128, false); //y axis is a group member |
4180 | + |
4181 | + ServoSetGain(2, //Axis = 2 |
4182 | + 100, //Kp = 100 |
4183 | + 1000, //Kd = 1000 |
4184 | + 0, //Ki = 0 |
4185 | + 0, //IL = 0 |
4186 | + 255, //OL = 255 |
4187 | + 0, //CL = 0 |
4188 | + 2000, //EL = 2000 |
4189 | + 1, //SR = 1 |
4190 | + 0); //DC = 0; |
4191 | + |
4192 | + //Initialize the servos |
4193 | + ServoStopMotor(1, AMP_ENABLE | STOP_ABRUPT | ADV_FEATURE); |
4194 | + ServoStopMotor(2, AMP_ENABLE | STOP_ABRUPT | ADV_FEATURE); |
4195 | + |
4196 | + //Reset the current motor positions to zero |
4197 | + ServoResetPos(1); |
4198 | + ServoResetPos(2); |
4199 | + |
4200 | + //Set the required status items for the path control module |
4201 | + NmcDefineStatus(1, SEND_POS | SEND_NPOINTS | SEND_PERROR | SEND_AUX); |
4202 | + NmcDefineStatus(2, SEND_POS | SEND_NPOINTS | SEND_PERROR | SEND_AUX); |
4203 | + |
4204 | + ServoSetIoCtrl(1, THREE_PHASE); |
4205 | + ServoSetIoCtrl(2, THREE_PHASE); |
4206 | + |
4207 | + //Initialize path control module parameters |
4208 | + SetPathParams2(P_30HZ, //path frequency = 30 Hz |
4209 | + 10, //Store a minimum of 45 points in the path point buffer |
4210 | + 1, //X axis is module address 1 |
4211 | + 2, //Y axis is module address 2 |
4212 | + 0, //Z axis not used = set address to 0 |
4213 | + 128, //group address = 128 |
4214 | + 1, //x axis is group leader |
4215 | + 20000.0, //X scale - 20000.0 counts per inch |
4216 | + 20000.0, //Y scale - 20000.0 counts per inch |
4217 | + 1.0, //Z scale - 1.0 counts per inch - not used |
4218 | + 1.0); //acceleration = 1.0 inch/second/second |
4219 | + |
4220 | + SetOrigin(0.0, 0.0, 0.0); //set the origin to X = 0, Y = 0, Z = 0 |
4221 | + SetFeedrate(1.0); //feedrate = 1.0 inches/second |
4222 | + SetTangentTolerance(10.0); //continuous path tangent tolerence = 10 degrees |
4223 | + |
4224 | +} |
4225 | +void ExecutePath() |
4226 | +{ |
4227 | + // |
4228 | + //Initialize the path just before execution |
4229 | + // |
4230 | + InitPath(); |
4231 | + |
4232 | + // |
4233 | + //Download path points to the PIC-SERVO CMC modules until all points are |
4234 | + // downloaded. Motion will begin automatically when the minimum number |
4235 | + // of path points have been loaded. |
4236 | + // |
4237 | + while ( AddPathPoints() != -1 ) ; |
4238 | + |
4239 | + // |
4240 | + //Poll the X axis module to detect when the path is complete |
4241 | + // |
4242 | + do |
4243 | + { |
4244 | + NmcNoOp(1); //retrieve current status data |
4245 | + } |
4246 | + while ( ServoGetAux(1) & PATH_MODE ); //poll while still in path mode |
4247 | +} |
4248 | + |
4249 | +void execute() |
4250 | +{ |
4251 | + // |
4252 | + //Clear the segment list and initialize the starting point for the path |
4253 | + // |
4254 | + ClearSegList(0.0, 0.0, 0.0); //Clear the segment list and set the |
4255 | + // starting point for the path |
4256 | + // at X = 0, Y = 1, Z = 0 |
4257 | + |
4258 | + // |
4259 | + //Add line and arc segments to the path module's segment list for first move |
4260 | + // |
4261 | + int res = AddLineSeg(0.0, 2.0, 0.0); //Add a segment to move to x=0, y=2, z=0 |
4262 | + if (res<0) ReportError(res); |
4263 | + |
4264 | + res = AddArcSeg( 1.0, 3.0, 0.0, //end point of arc: x=1, y=3, z=0 |
4265 | + 1.0, 2.0, 0.0, //center point of arc: x=1, y=2, z = 0 |
4266 | + 0.0, 0.0, -1.0 ); //normal vector to arc plane: x = 0, y = 0, z = -1 |
4267 | + if (res<0) ReportError(res); |
4268 | + |
4269 | + res = AddLineSeg(4.0, 3.0, 0.0); //line segment endpoint: x=4, y=3, z=0 |
4270 | + if (res<0) ReportError(res); |
4271 | + |
4272 | + |
4273 | + res = AddArcSeg( 5.0, 2.0, 0.0, //end point of arc: x=5, y=2, z=0 |
4274 | + 4.0, 2.0, 0.0, //center point of arc: x=4, y=2, z = 0 |
4275 | + 0.0, 0.0, -1.0 ); //normal vector to arc plane: x = 0, y = 0, z = -1 |
4276 | + if (res<0) ReportError(res); |
4277 | + |
4278 | + res = AddLineSeg(5.0, 0.0, 0.0); //line segment endpoint: x=5, y=0, z=0 |
4279 | + if (res<0) ReportError(res); |
4280 | + |
4281 | + // |
4282 | + //Run path and wait for completion |
4283 | + // |
4284 | + ExecutePath(); |
4285 | + |
4286 | + // |
4287 | + //Clear the segment list and initialize the starting point for the second path |
4288 | + //back to the origin |
4289 | + // |
4290 | + ClearSegList(5.0, 0.0, 0.0); //Clear the segment list and set the |
4291 | + // starting point for the path |
4292 | + // at X = 5, Y = 0, Z = 0 |
4293 | + |
4294 | + // |
4295 | + //Add line segment to move back to the origin |
4296 | + // |
4297 | + res = AddLineSeg(0.0, 0.0, 0.0); //Add a segment to move to x=0, y=0, z=0 |
4298 | + if (res<0) ReportError(res); |
4299 | + |
4300 | + ExecutePath(); //Runs path and waits for completion |
4301 | +} |
4302 | + |
4303 | +void ReportError(int errnum) |
4304 | +{ |
4305 | + switch (errnum) |
4306 | + { |
4307 | + case -1: qDebug() << "Segment added is not tangent to the previous segment"; |
4308 | + break; |
4309 | + case -2: qDebug() << "Too many segments in the segment list"; |
4310 | + break; |
4311 | + case -3: qDebug() << "Values given do not define a correct arc"; |
4312 | + break; |
4313 | + } |
4314 | + qDebug() << "Exit now"; |
4315 | +} |
4316 | + |
4317 | +int main(int argc, char *argv[]) |
4318 | +{ |
4319 | + QCoreApplication a(argc, argv); |
4320 | + |
4321 | + initialize(); |
4322 | + |
4323 | + sleep(1); |
4324 | + |
4325 | + execute(); |
4326 | + |
4327 | + |
4328 | + return a.exec(); |
4329 | +} |
4330 | |
4331 | === modified file 'software/FabInterpreter/Util.h' |
4332 | --- software/FabInterpreter/Util.h 2010-07-22 15:32:37 +0000 |
4333 | +++ software/FabInterpreter/Util.h 2010-08-07 00:08:43 +0000 |
4334 | @@ -12,7 +12,7 @@ |
4335 | #include <time.h> |
4336 | #include <algorithm> |
4337 | #include <QMessageBox> |
4338 | -#include "../Common/tinyxml/tinyxml.h" |
4339 | +#include "tinyxml.h" |
4340 | using namespace std; |
4341 | |
4342 | |
4343 | @@ -109,12 +109,7 @@ |
4344 | |
4345 | public: static void messageBox(const string& message) |
4346 | { |
4347 | - /* |
4348 | - QMessageBox:; |
4349 | - QString str(message.c_str()); |
4350 | - msgBox.setText(str); |
4351 | - msgBox.exec(); |
4352 | - */ |
4353 | + QMessageBox::warning(0, "", message.c_str()); |
4354 | printf(message.c_str()); |
4355 | printf("\n"); |
4356 | } |
4357 | |
4358 | === modified file 'software/FabInterpreter/guicomponentsthread.cpp' |
4359 | --- software/FabInterpreter/guicomponentsthread.cpp 2010-07-22 15:32:37 +0000 |
4360 | +++ software/FabInterpreter/guicomponentsthread.cpp 2010-08-07 00:08:43 +0000 |
4361 | @@ -1,24 +1,27 @@ |
4362 | #include "guicomponentsthread.h" |
4363 | |
4364 | -GUIComponentsThread::GUIComponentsThread() |
4365 | + |
4366 | +GUIComponentsThread::GUIComponentsThread(QObject* parent) : QThread(parent) |
4367 | { |
4368 | } |
4369 | |
4370 | -GUIComponentsThread::GUIComponentsThread(FabAtHomePrinter* newPrinter) : printer(newPrinter) {} |
4371 | - |
4372 | -long posDisplayPeriod = 1; //Number of seconds between position updates in user interface. |
4373 | +int posDisplayPeriod = 1; //Number of seconds between position updates in user interface. |
4374 | bool enablePosDisplay; |
4375 | |
4376 | +GUIComponentsThread::~GUIComponentsThread() |
4377 | +{ |
4378 | +} |
4379 | + |
4380 | + |
4381 | void GUIComponentsThread::run() |
4382 | { |
4383 | - int c = 0; |
4384 | //updates position display |
4385 | while (enablePosDisplay) |
4386 | { |
4387 | - c = (c == 0 ? 1 : 0); |
4388 | - printer->GUI_reportProgress(); |
4389 | - sleep(posDisplayPeriod * 1000); |
4390 | + reportProgress(); |
4391 | + sleep(posDisplayPeriod); |
4392 | } |
4393 | + finished(); |
4394 | } |
4395 | |
4396 | void GUIComponentsThread::enablePositionDisplay() |
4397 | @@ -31,3 +34,8 @@ |
4398 | { |
4399 | enablePosDisplay = false; |
4400 | } |
4401 | + |
4402 | +bool GUIComponentsThread::isEnabled() |
4403 | +{ |
4404 | + return enablePosDisplay; |
4405 | +} |
4406 | |
4407 | === modified file 'software/FabInterpreter/guicomponentsthread.h' |
4408 | --- software/FabInterpreter/guicomponentsthread.h 2010-07-22 15:32:37 +0000 |
4409 | +++ software/FabInterpreter/guicomponentsthread.h 2010-08-07 00:08:43 +0000 |
4410 | @@ -1,28 +1,35 @@ |
4411 | #ifndef GUICOMPONENTSTHREAD_H |
4412 | #define GUICOMPONENTSTHREAD_H |
4413 | |
4414 | -#include <QThread> |
4415 | +#include <qthread.h> |
4416 | #include "FabAtHomePrinter.h" |
4417 | |
4418 | + |
4419 | class GUIComponentsThread : public QThread |
4420 | -{ |
4421 | - |
4422 | -public: |
4423 | - GUIComponentsThread(); |
4424 | - |
4425 | - GUIComponentsThread(FabAtHomePrinter* newPrinter); |
4426 | - |
4427 | - void enablePositionDisplay(); |
4428 | - |
4429 | - void disablePositionDisplay(); |
4430 | - |
4431 | - void run(); |
4432 | - |
4433 | -private: |
4434 | - |
4435 | - FabAtHomePrinter* printer; |
4436 | - |
4437 | -}; |
4438 | - |
4439 | + { |
4440 | + |
4441 | + Q_OBJECT |
4442 | + |
4443 | + public: |
4444 | + GUIComponentsThread(QObject* parent = 0); |
4445 | + |
4446 | + ~GUIComponentsThread(); |
4447 | + |
4448 | + void enablePositionDisplay(); |
4449 | + |
4450 | + void run(); |
4451 | + |
4452 | + bool isEnabled(); |
4453 | + |
4454 | + public slots: |
4455 | + |
4456 | + void disablePositionDisplay(); |
4457 | + |
4458 | + signals: |
4459 | + |
4460 | + void reportProgress(); |
4461 | + void finished(); |
4462 | + |
4463 | + }; |
4464 | |
4465 | #endif // GUICOMPONENTSTHREAD_H |
4466 | |
4467 | === modified file 'software/FabInterpreter/mainwindow.cpp' |
4468 | --- software/FabInterpreter/mainwindow.cpp 2010-07-23 20:12:14 +0000 |
4469 | +++ software/FabInterpreter/mainwindow.cpp 2010-08-07 00:08:43 +0000 |
4470 | @@ -4,6 +4,7 @@ |
4471 | MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) |
4472 | { |
4473 | setupUi(this); |
4474 | + initialized = false; |
4475 | this->connectFunctions(); |
4476 | } |
4477 | |
4478 | @@ -15,7 +16,6 @@ |
4479 | void MainWindow::connectFunctions() |
4480 | { |
4481 | connect(LoadConfigButton, SIGNAL(clicked()), this, SLOT(loadConfig())); |
4482 | - connect(MoveButton, SIGNAL(clicked()), this, SLOT(move())); |
4483 | connect(ResetPosButton, SIGNAL(clicked()), this, SLOT(resetValues())); |
4484 | connect(LoadModelButton, SIGNAL(clicked()), this, SLOT(loadModel())); |
4485 | connect(this, SIGNAL(destroyed()), this, SLOT(closeProgram())); |
4486 | @@ -25,68 +25,73 @@ |
4487 | connect(bayCommandedPosition0, SIGNAL(editingFinished()), this, SLOT(bayCommandedPosition0_valueChanged())); |
4488 | connect(bayCommandedPosition1, SIGNAL(editingFinished()), this, SLOT(bayCommandedPosition1_valueChanged())); |
4489 | connect(bayCommandedPosition2, SIGNAL(editingFinished()), this, SLOT(bayCommandedPosition2_valueChanged())); |
4490 | - connect( bayMaterialCalibration0, SIGNAL(currentIndexChanged(int)), this, SLOT( bayMaterialCalibration0_SelectedIndexChanged(int) ) ); |
4491 | - connect( bayMaterialCalibration1, SIGNAL(currentIndexChanged(int)), this, SLOT( bayMaterialCalibration1_SelectedIndexChanged(int) ) ); |
4492 | - connect( bayMaterialCalibration2, SIGNAL(currentIndexChanged(int)), this, SLOT( bayMaterialCalibration2_SelectedIndexChanged(int) ) ); |
4493 | + connect(bayMaterialCalibration0, SIGNAL(currentIndexChanged(int)), this, SLOT(bayMaterialCalibration0_SelectedIndexChanged(int) ) ); |
4494 | + connect(bayMaterialCalibration1, SIGNAL(currentIndexChanged(int)), this, SLOT(bayMaterialCalibration1_SelectedIndexChanged(int) ) ); |
4495 | + connect(bayMaterialCalibration2, SIGNAL(currentIndexChanged(int)), this, SLOT(bayMaterialCalibration2_SelectedIndexChanged(int) ) ); |
4496 | connect(ExecuteButton, SIGNAL(clicked()), this, SLOT(print())); |
4497 | - initializePrinter(); |
4498 | + connect(LoadModelButton, SIGNAL(clicked()), this, SLOT(resetProgressBar())); |
4499 | + connect(PauseFabButton, SIGNAL(clicked()), this, SLOT(pausePrintHandler())); |
4500 | //add move changes |
4501 | - //connect(XCommandedField, SIGNAL()) |
4502 | - //connect(printer, SIGNAL(progressChanged()), printThread, SLOT(update())) |
4503 | - |
4504 | - |
4505 | - //connect(XCommandedField, SIGNAL(valueChanged(double), printer, SLOT() |
4506 | - //TO_DO: add signal/slots for position boxes |
4507 | + |
4508 | } |
4509 | |
4510 | void MainWindow::initializePrinter() |
4511 | { |
4512 | + //NOTE: for every connect added here you must add a disconnect to the slot |
4513 | printer = new FabAtHomePrinter(); |
4514 | pThread = new PrintThread(printer); |
4515 | - gcThread = new GUIComponentsThread(printer); |
4516 | + gcThread = new GUIComponentsThread(); |
4517 | connect(PauseFabButton, SIGNAL(clicked()), printer, SLOT(pausePrint())); |
4518 | connect(CancelFabButton, SIGNAL(clicked()), printer, SLOT(cancelPrint())); |
4519 | connect(RedoPathButton, SIGNAL(clicked()), printer, SLOT(redoPath())); |
4520 | connect(ForceStopButton, SIGNAL(clicked()), printer, SLOT(stopMotors())); |
4521 | connect(ResetPosButton, SIGNAL(clicked()), printer, SLOT(resetPos())); |
4522 | connect(printer, SIGNAL(reportProgress(int, QString)), this, SLOT(printer_reportProgress(int, QString))); |
4523 | - connect(printer, SIGNAL(GUI_reportProgress()), this, SLOT(GUI_reportProgress())); |
4524 | + connect(gcThread, SIGNAL(reportProgress()), this, SLOT(GUI_reportProgress())); |
4525 | + connect(gcThread, SIGNAL(finished()), this, SLOT(GUI_disabled())); |
4526 | connect(printer, SIGNAL(callWarning(QString)), this, SLOT(callWarning(QString))); |
4527 | + connect(printer, SIGNAL(finishedPrinting()), this, SLOT(resetValues())); |
4528 | + connect(DeletePrinterConfig, SIGNAL(clicked()), gcThread, SLOT(disablePositionDisplay())); |
4529 | } |
4530 | |
4531 | -void MainWindow::reconnectPrinterFunctions() |
4532 | +void MainWindow::disconnectPrinterFunctions() |
4533 | { |
4534 | - disconnect(PauseFabButton, SIGNAL(clicked()), printer, SLOT(pausePrint())); |
4535 | - disconnect(CancelFabButton, SIGNAL(clicked()), printer, SLOT(cancelPrint())); |
4536 | - disconnect(RedoPathButton, SIGNAL(clicked()), printer, SLOT(redoPath())); |
4537 | - disconnect(ForceStopButton, SIGNAL(clicked()), printer, SLOT(stopMotors())); |
4538 | - disconnect(ResetPosButton, SIGNAL(clicked()), printer, SLOT(resetPos())); |
4539 | - disconnect(printer, SIGNAL(GUI_reportProgress()), this, SLOT(GUI_reportProgress())); |
4540 | - disconnect(printer, SIGNAL(reportProgress(int, QString)), this, SLOT(printer_reportProgress(int, QString))); |
4541 | + disconnect(printer, 0, 0, 0); |
4542 | + disconnect(gcThread, 0, 0, 0); |
4543 | + disconnect(printer, SLOT(cancelPrint())); |
4544 | + disconnect(printer, SLOT(deleteLater())); |
4545 | + disconnect(printer, SLOT(pausePrint())); |
4546 | + disconnect(printer, SLOT(redoPath())); |
4547 | + disconnect(printer, SLOT(resetPos())); |
4548 | + disconnect(printer, SLOT(stopMotors())); |
4549 | + disconnect(gcThread, SLOT(disablePositionDisplay())); |
4550 | + if (gcThread != NULL) |
4551 | + { |
4552 | + gcThread->disablePositionDisplay(); |
4553 | + while (gcThread->isRunning()); |
4554 | + delete gcThread; |
4555 | + } |
4556 | + if (pThread != NULL) |
4557 | + { |
4558 | + delete pThread; |
4559 | + } |
4560 | if (printer != NULL) |
4561 | { |
4562 | - printer->cancelPrint(); |
4563 | - while (!printer->cleanUp()); |
4564 | - //if (printer->isInitialized()) |
4565 | - //printer->reset(); |
4566 | + previousPrinter = printer; |
4567 | + if (printer->isInitialized()) |
4568 | + while (!printer->cleanUp()); |
4569 | delete printer; |
4570 | } |
4571 | - if (pThread != NULL) |
4572 | - { |
4573 | - delete pThread; |
4574 | - } |
4575 | - if (gcThread != NULL) |
4576 | - { |
4577 | - delete gcThread; |
4578 | - } |
4579 | - initializePrinter(); |
4580 | } |
4581 | |
4582 | void MainWindow::loadConfig() |
4583 | { |
4584 | //Open file dialog |
4585 | - reconnectPrinterFunctions(); |
4586 | - QString str = QFileDialog::getOpenFileName(this,"Config File Loader", "../../media/Printer Configs/", "*.config"); |
4587 | + QString str = QFileDialog::getOpenFileName(this,"Config File Loader", "/Users/jcman912/Documents/Fab@Home/Interpreter_Experimental/software", "*.config"); |
4588 | + |
4589 | + if (!initialized) |
4590 | + initialized = true; |
4591 | + initializePrinter(); |
4592 | string result = printer->initialize(str.toStdString(), PortName->text().toStdString()); |
4593 | if(result.compare("") == 0) |
4594 | { |
4595 | @@ -109,6 +114,12 @@ |
4596 | XCommandedField->setValue(0); |
4597 | YCommandedField->setValue(0); |
4598 | ZCommandedField->setValue(0); |
4599 | + XCommandedField->setSingleStep(XIncrementField->text().toDouble()); |
4600 | + YCommandedField->setSingleStep(YIncrementField->text().toDouble()); |
4601 | + ZCommandedField->setSingleStep(ZIncrementField->text().toDouble()); |
4602 | + bayCommandedPosition0->setSingleStep(bayIncrementField0->text().toDouble()); |
4603 | + bayCommandedPosition1->setSingleStep(bayIncrementField1->text().toDouble()); |
4604 | + bayCommandedPosition2->setSingleStep(bayIncrementField2->text().toDouble()); |
4605 | int numLoadedBays = printer->numLoadedBays(); |
4606 | if(numLoadedBays >= 1) |
4607 | { |
4608 | @@ -135,22 +146,17 @@ |
4609 | |
4610 | //FabAtHomePrinter::savePreviousConfigName(filePath); |
4611 | |
4612 | - |
4613 | - //Modify buttons. |
4614 | - |
4615 | - //LoadConfigButton->setEnabled(false); |
4616 | - |
4617 | - //LoadModelButton->focusWidget(); |
4618 | - //LoadModelButton->Focus(); |
4619 | - |
4620 | //Start live position display |
4621 | + LoadConfigButton->setEnabled(false); |
4622 | gcThread->enablePositionDisplay(); |
4623 | } |
4624 | else |
4625 | { |
4626 | + disconnectPrinterFunctions(); |
4627 | callWarning(result.c_str()); |
4628 | } |
4629 | |
4630 | + previousPrinter = printer; |
4631 | |
4632 | } |
4633 | |
4634 | @@ -163,7 +169,7 @@ |
4635 | int numLoadedBays = printer->numLoadedBays(); |
4636 | if(numLoadedBays >= 1) |
4637 | { |
4638 | - bayCommandedPosition0->setValue(0.00000); |
4639 | + bayCommandedPosition0->setValue(0.000000); |
4640 | } |
4641 | if(numLoadedBays >= 2) |
4642 | { |
4643 | @@ -236,11 +242,6 @@ |
4644 | } |
4645 | } |
4646 | |
4647 | -void MainWindow::disablePositionDisplay() |
4648 | -{ |
4649 | - enablePosDisplay = false; |
4650 | -} |
4651 | - |
4652 | void MainWindow::toggleAxes(bool enabled) |
4653 | { |
4654 | XVelocityField->setEnabled(enabled); |
4655 | @@ -269,7 +270,7 @@ |
4656 | { |
4657 | bayVelocity0->setEnabled(enabled); |
4658 | bayAcceleration0->setEnabled(enabled); |
4659 | - bayPositionIncrement0->setEnabled(enabled); |
4660 | + bayIncrementField0->setEnabled(enabled); |
4661 | bayMotorPosition0->setEnabled(enabled); |
4662 | bayCommandedPosition0->setEnabled(enabled); |
4663 | bayMaterialCalibration0->setEnabled(enabled); |
4664 | @@ -280,7 +281,7 @@ |
4665 | { |
4666 | bayVelocity1->setEnabled(enabled); |
4667 | bayAcceleration1->setEnabled(enabled); |
4668 | - bayPositionIncrement1->setEnabled(enabled); |
4669 | + bayIncrementField1->setEnabled(enabled); |
4670 | bayMotorPosition1->setEnabled(enabled); |
4671 | bayCommandedPosition1->setEnabled(enabled); |
4672 | bayMaterialCalibration1->setEnabled(enabled); |
4673 | @@ -291,7 +292,7 @@ |
4674 | { |
4675 | bayVelocity2->setEnabled(enabled); |
4676 | bayAcceleration2->setEnabled(enabled); |
4677 | - bayPositionIncrement2->setEnabled(enabled); |
4678 | + bayIncrementField2->setEnabled(enabled); |
4679 | bayMotorPosition2->setEnabled(enabled); |
4680 | bayCommandedPosition2->setEnabled(enabled); |
4681 | bayMaterialCalibration2->setEnabled(enabled); |
4682 | @@ -312,6 +313,7 @@ |
4683 | if(numLoadedBays >= 1) |
4684 | { |
4685 | temp = Util::toString<double>(printer->tool.bays["Bay 0"].motor->getPosition()); |
4686 | + bayMotorPosition0->setText(temp.c_str()); |
4687 | } |
4688 | if(numLoadedBays >= 2) |
4689 | { |
4690 | @@ -337,8 +339,6 @@ |
4691 | PathProgressBar->update(); |
4692 | } |
4693 | |
4694 | -//TODO: implement this |
4695 | - |
4696 | void MainWindow::GUI_reportProgress() |
4697 | { |
4698 | static string prevState; |
4699 | @@ -356,11 +356,11 @@ |
4700 | ZCommandedField->setValue(ZDisplay->text().toDouble()); |
4701 | bayCommandedPosition0->setValue(bayMotorPosition0->text().toDouble()); |
4702 | bayCommandedPosition1->setValue(bayMotorPosition1->text().toDouble()); |
4703 | + bayCommandedPosition2->setValue(bayMotorPosition2->text().toDouble()); |
4704 | } |
4705 | toggleBays(true); |
4706 | toggleAxes(false); |
4707 | ResetPosButton->setEnabled(false); |
4708 | - MoveButton->setEnabled(false); |
4709 | LoadModelButton->setEnabled(false); |
4710 | ExecuteButton->setEnabled(false); |
4711 | PauseFabButton->setEnabled(true); |
4712 | @@ -373,9 +373,9 @@ |
4713 | toggleBays(false); |
4714 | toggleAxes(false); |
4715 | ResetPosButton->setEnabled(false); |
4716 | - MoveButton->setEnabled(false); |
4717 | LoadModelButton->setEnabled(false); |
4718 | ExecuteButton->setEnabled(false); |
4719 | + DeletePrinterConfig->setEnabled(false); |
4720 | PauseFabButton->setEnabled(true); |
4721 | CancelFabButton->setEnabled(true); |
4722 | ForceStopButton->setEnabled(true); |
4723 | @@ -391,12 +391,13 @@ |
4724 | XCommandedField->setValue(XDisplay->text().toDouble()); |
4725 | bayCommandedPosition0->setValue(bayMotorPosition0->text().toDouble()); |
4726 | bayCommandedPosition1->setValue(bayMotorPosition1->text().toDouble()); |
4727 | + bayCommandedPosition2->setValue(bayMotorPosition2->text().toDouble()); |
4728 | } |
4729 | toggleBays(true); |
4730 | toggleAxes(true); |
4731 | ResetPosButton->setEnabled(true); |
4732 | - MoveButton->setEnabled(true); |
4733 | LoadModelButton->setEnabled(true); |
4734 | + DeletePrinterConfig->setEnabled(true); |
4735 | PauseFabButton->setEnabled(false); |
4736 | CancelFabButton->setEnabled(false); |
4737 | ForceStopButton->setEnabled(false); |
4738 | @@ -406,6 +407,34 @@ |
4739 | } |
4740 | |
4741 | |
4742 | +void MainWindow::GUI_disabled() |
4743 | +{ |
4744 | + toggleBays(false); |
4745 | + toggleAxes(false); |
4746 | + ResetPosButton->setEnabled(false); |
4747 | + LoadModelButton->setEnabled(false); |
4748 | + ExecuteButton->setEnabled(false); |
4749 | + DeletePrinterConfig->setEnabled(false); |
4750 | + PauseFabButton->setEnabled(false); |
4751 | + CancelFabButton->setEnabled(false); |
4752 | + ForceStopButton->setEnabled(false); |
4753 | + RedoPathButton->setEnabled(false); |
4754 | + LoadConfigButton->setEnabled(true); |
4755 | + XLabel->setText("Not Loaded"); |
4756 | + YLabel->setText("Not Loaded"); |
4757 | + ZLabel->setText("Not Loaded"); |
4758 | + bayLabel0->setText("Not Loaded"); |
4759 | + bayLabel1->setText("Not Loaded"); |
4760 | + bayLabel2->setText("Not Loaded"); |
4761 | + resetValues(); |
4762 | + if (printer->isInitialized()) |
4763 | + printer->resetPos(); |
4764 | + bayMaterialCalibration0->clear(); |
4765 | + bayMaterialCalibration1->clear(); |
4766 | + bayMaterialCalibration2->clear(); |
4767 | + disconnectPrinterFunctions(); |
4768 | +} |
4769 | + |
4770 | void MainWindow::print() |
4771 | { |
4772 | |
4773 | @@ -416,65 +445,70 @@ |
4774 | |
4775 | void MainWindow::bayMaterialCalibration1_SelectedIndexChanged(int i) |
4776 | { |
4777 | - string materialCalibrationName = bayMaterialCalibration1->currentText().toStdString(); |
4778 | - string bayName = bayLabel1->text().toStdString(); |
4779 | - printer->equipBay(bayName, materialCalibrationName); |
4780 | + if (bayMaterialCalibration1->isEnabled()) |
4781 | + { |
4782 | + string materialCalibrationName = bayMaterialCalibration1->currentText().toStdString(); |
4783 | + string bayName = bayLabel1->text().toStdString(); |
4784 | + printer->equipBay(bayName, materialCalibrationName); |
4785 | + } |
4786 | } |
4787 | void MainWindow::bayMaterialCalibration2_SelectedIndexChanged(int i) { |
4788 | - string materialCalibrationName = bayMaterialCalibration2->currentText().toStdString(); |
4789 | - string bayName = bayLabel2->text().toStdString(); |
4790 | - printer->equipBay(bayName, materialCalibrationName); |
4791 | + if (bayMaterialCalibration2->isEnabled()) |
4792 | + { |
4793 | + string materialCalibrationName = bayMaterialCalibration2->currentText().toStdString(); |
4794 | + string bayName = bayLabel2->text().toStdString(); |
4795 | + printer->equipBay(bayName, materialCalibrationName); |
4796 | + } |
4797 | } |
4798 | |
4799 | void MainWindow::bayMaterialCalibration0_SelectedIndexChanged(int i) |
4800 | { |
4801 | - string materialCalibrationName = bayMaterialCalibration0->currentText().toStdString(); |
4802 | - string bayName = bayLabel0->text().toStdString(); |
4803 | - printer->equipBay(bayName, materialCalibrationName); |
4804 | + if (bayMaterialCalibration0->isEnabled()) |
4805 | + { |
4806 | + string materialCalibrationName = bayMaterialCalibration0->currentText().toStdString(); |
4807 | + string bayName = bayLabel0->text().toStdString(); |
4808 | + printer->equipBay(bayName, materialCalibrationName); |
4809 | + } |
4810 | } |
4811 | |
4812 | void MainWindow::closeProgram() |
4813 | { |
4814 | gcThread->disablePositionDisplay(); |
4815 | - printer->cleanUp(); |
4816 | - delete pThread; |
4817 | - delete gcThread; |
4818 | - delete printer; |
4819 | } |
4820 | |
4821 | void MainWindow::XCommandedField_valueChanged() |
4822 | { |
4823 | - if (printer->isInitialized()) |
4824 | + if (printer->isInitialized() && printer->state().compare("PRINTING") != 0) |
4825 | printer->axes["X"].motor->moveAbsolute(XCommandedField->value(), XVelocityField->text().toDouble(), XAccelerationField->text().toDouble()); |
4826 | } |
4827 | |
4828 | void MainWindow::YCommandedField_valueChanged() |
4829 | { |
4830 | - if (printer->isInitialized()) |
4831 | + if (printer->isInitialized() && printer->state().compare("PRINTING") != 0) |
4832 | printer->axes["Y"].motor->moveAbsolute(YCommandedField->value(), YVelocityField->text().toDouble(), YAccelerationField->text().toDouble()); |
4833 | } |
4834 | |
4835 | void MainWindow::ZCommandedField_valueChanged() |
4836 | { |
4837 | - if (printer->isInitialized()) |
4838 | + if (printer->isInitialized() && printer->state().compare("PRINTING") != 0) |
4839 | printer->axes["Z"].motor->moveAbsolute(ZCommandedField->value(), ZVelocityField->text().toDouble(), ZAccelerationField->text().toDouble()); |
4840 | } |
4841 | |
4842 | void MainWindow::bayCommandedPosition0_valueChanged() |
4843 | { |
4844 | - if (printer->isInitialized()) |
4845 | + if (printer->isInitialized() && printer->state().compare("PRINTING") != 0) |
4846 | printer->tool.bays["Bay 0"].motor->moveAbsolute(bayCommandedPosition0->value(), bayVelocity0->text().toDouble(), bayAcceleration0->text().toDouble()); |
4847 | } |
4848 | |
4849 | void MainWindow::bayCommandedPosition1_valueChanged() |
4850 | { |
4851 | - if (printer->isInitialized()) |
4852 | + if (printer->isInitialized() && printer->state().compare("PRINTING") != 0) |
4853 | printer->tool.bays["Bay 1"].motor->moveAbsolute(bayCommandedPosition1->value(), bayVelocity1->text().toDouble(), bayAcceleration1->text().toDouble()); |
4854 | } |
4855 | |
4856 | void MainWindow::bayCommandedPosition2_valueChanged() |
4857 | { |
4858 | - if (printer->isInitialized()) |
4859 | + if (printer->isInitialized() && printer->state().compare("PRINTING") != 0) |
4860 | printer->tool.bays["Bay 2"].motor->moveAbsolute(bayCommandedPosition2->value(), bayVelocity2->text().toDouble(), bayAcceleration2->text().toDouble()); |
4861 | } |
4862 | |
4863 | @@ -482,3 +516,32 @@ |
4864 | { |
4865 | QMessageBox::warning(this, "Warning", msg); |
4866 | } |
4867 | + |
4868 | +void MainWindow::resetProgressBar() |
4869 | +{ |
4870 | + PathProgressBar->setValue(0); |
4871 | +} |
4872 | + |
4873 | +void MainWindow::closeEvent(QCloseEvent *event) |
4874 | +{ |
4875 | + if (!initialized || !printer->isInitialized()) |
4876 | + event->accept(); |
4877 | + else if (printer->state().compare("PRINTING") == 0) |
4878 | + { |
4879 | + callWarning("Cannot close during a print job."); |
4880 | + event->ignore(); |
4881 | + } |
4882 | + else |
4883 | + { |
4884 | + closeProgram(); |
4885 | + event->accept(); |
4886 | + } |
4887 | +} |
4888 | + |
4889 | +void MainWindow::pausePrintHandler() |
4890 | +{ |
4891 | + if (printer->state().compare("PRINTING") == 0) |
4892 | + PauseFabButton->setText("Resume"); |
4893 | + else |
4894 | + PauseFabButton->setText("Pause"); |
4895 | +} |
4896 | |
4897 | === modified file 'software/FabInterpreter/mainwindow.h' |
4898 | --- software/FabInterpreter/mainwindow.h 2010-07-22 15:32:37 +0000 |
4899 | +++ software/FabInterpreter/mainwindow.h 2010-08-07 00:08:43 +0000 |
4900 | @@ -11,7 +11,8 @@ |
4901 | #include "guicomponentsthread.h" |
4902 | #include <vector> |
4903 | #include <QFileDialog> |
4904 | - |
4905 | +#include <QMessageBox> |
4906 | +#include <QCloseEvent> |
4907 | |
4908 | |
4909 | namespace Ui |
4910 | @@ -19,8 +20,6 @@ |
4911 | class MainWindow; |
4912 | } |
4913 | |
4914 | - |
4915 | - |
4916 | class MainWindow : |
4917 | public QMainWindow, public Ui::MainWindow |
4918 | { |
4919 | @@ -31,17 +30,16 @@ |
4920 | ~MainWindow(); |
4921 | |
4922 | private: |
4923 | + |
4924 | bool initialized; |
4925 | FabAtHomePrinter* printer; //The printer. |
4926 | FabAtHomePrinter* previousPrinter; |
4927 | GUIComponentsThread *gcThread; |
4928 | PrintThread *pThread; |
4929 | - void disablePositionDisplay(); |
4930 | void toggleAxes(bool); |
4931 | void toggleBays(bool); |
4932 | void updatePosDisplay(); |
4933 | void connectFunctions(); |
4934 | - void reconnectPrinterFunctions(); |
4935 | void initializePrinter(); |
4936 | |
4937 | //variables for controller |
4938 | @@ -56,12 +54,12 @@ |
4939 | //timer variables |
4940 | int numTicks; |
4941 | //TODO: initialize above in constructor |
4942 | - |
4943 | -public slots: |
4944 | + |
4945 | +private slots: |
4946 | + void disconnectPrinterFunctions(); |
4947 | void printer_reportProgress(int, QString); |
4948 | void GUI_reportProgress(); |
4949 | - |
4950 | -private slots: |
4951 | + void GUI_disabled(); |
4952 | void loadConfig(); |
4953 | void loadModel(); |
4954 | void resetValues(); |
4955 | @@ -78,6 +76,11 @@ |
4956 | void bayCommandedPosition1_valueChanged(); |
4957 | void bayCommandedPosition2_valueChanged(); |
4958 | void callWarning(QString); |
4959 | + void resetProgressBar(); |
4960 | + void pausePrintHandler(); |
4961 | + |
4962 | +protected: |
4963 | + void closeEvent(QCloseEvent *event); |
4964 | }; |
4965 | |
4966 | #endif // MAINWINDOW_H |
4967 | |
4968 | === modified file 'software/FabInterpreter/mainwindow.ui' |
4969 | --- software/FabInterpreter/mainwindow.ui 2010-07-23 20:12:14 +0000 |
4970 | +++ software/FabInterpreter/mainwindow.ui 2010-08-07 00:08:43 +0000 |
4971 | @@ -6,12 +6,24 @@ |
4972 | <rect> |
4973 | <x>0</x> |
4974 | <y>0</y> |
4975 | - <width>910</width> |
4976 | - <height>461</height> |
4977 | + <width>932</width> |
4978 | + <height>467</height> |
4979 | </rect> |
4980 | </property> |
4981 | <property name="windowTitle"> |
4982 | - <string>FAB@Home Interpreter</string> |
4983 | + <string>Fab@Home Interpreter</string> |
4984 | + </property> |
4985 | + <property name="autoFillBackground"> |
4986 | + <bool>false</bool> |
4987 | + </property> |
4988 | + <property name="animated"> |
4989 | + <bool>true</bool> |
4990 | + </property> |
4991 | + <property name="dockNestingEnabled"> |
4992 | + <bool>false</bool> |
4993 | + </property> |
4994 | + <property name="unifiedTitleAndToolBarOnMac"> |
4995 | + <bool>false</bool> |
4996 | </property> |
4997 | <widget class="QWidget" name="centralWidget"> |
4998 | <widget class="QGroupBox" name="gridGroupBox"> |
4999 | @@ -19,10 +31,16 @@ |
5000 | <rect> |
The diff has been truncated for viewing.