Merge lp:~jeremyrcohen/fabinterpreter/Jeremy_Cohen into lp:fabinterpreter

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
Reviewer Review Type Date Requested Status
Jeffrey Lipton Pending
Review via email: mp+32015@code.launchpad.net
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
=== added file 'README.txt'
--- README.txt 1970-01-01 00:00:00 +0000
+++ README.txt 2010-08-07 00:08:43 +0000
@@ -0,0 +1,7 @@
1Steps to running interpreter:
2
31.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
42.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)
53.Delete text in “Command” in the “Generate GUI” build step and add in “uic”
64.Compile project
75.Make sure the executable is set to active in Qt settings (and make sure that Qt has the right executable set)
08
=== modified file 'software/.DS_Store'
1Binary files software/.DS_Store 2010-07-23 20:12:14 +0000 and software/.DS_Store 2010-08-07 00:08:43 +0000 differ9Binary files software/.DS_Store 2010-07-23 20:12:14 +0000 and software/.DS_Store 2010-08-07 00:08:43 +0000 differ
=== modified file 'software/Common/.DS_Store'
2Binary files software/Common/.DS_Store 2010-07-23 20:12:14 +0000 and software/Common/.DS_Store 2010-08-07 00:08:43 +0000 differ10Binary 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
=== modified file 'software/Common/JrKerr/nmccom.cpp'
--- software/Common/JrKerr/nmccom.cpp 2010-07-23 20:12:14 +0000
+++ software/Common/JrKerr/nmccom.cpp 2010-08-07 00:08:43 +0000
@@ -44,8 +44,13 @@
44 cstr[1] = addr;44 cstr[1] = addr;
45 cstr[2] = HARD_RESET;45 cstr[2] = HARD_RESET;
46 cstr[3] = (byte)(cstr[1] + cstr[2]); //checksum46 cstr[3] = (byte)(cstr[1] + cstr[2]); //checksum
4747 int bytesRead = 0;
48 ComPort->write(cstr, 4);//send reset48 int totalBytes = 4;
49 for (i = 0; i < 4; i++)
50 {
51 ComPort->write(&(cstr[i]), 1);//send reset
52 bytesRead++;
53 }
49 usleep(10000); //wait for reset to execute54 usleep(10000); //wait for reset to execute
50 for (i=0; i<nummod_; i++) delete mod[i].p; //delete and prev. declared modules55 for (i=0; i<nummod_; i++) delete mod[i].p; //delete and prev. declared modules
51 nummod_ = 0;56 nummod_ = 0;
@@ -54,11 +59,11 @@
5459
55 ComPort->setBaudRate(BAUD19200);//Reset the baud rate to the default60 ComPort->setBaudRate(BAUD19200);//Reset the baud rate to the default
5661
57 ComPort->flush(); //may not work62 ComPort->flush(); //clear out any random crap left in buffer
58 // SioClrInbuf(ComPort); //clear out any random crap left in buffer63
5964 if (totalBytes != bytesRead)
6065 return false;
61 return(true);66 else return true;
62}67}
6368
64//---------------------------------------------------------------------------69//---------------------------------------------------------------------------
@@ -134,22 +139,24 @@
134 InitVars();139 InitVars();
135 if (ComPort != NULL)140 if (ComPort != NULL)
136 delete ComPort;141 delete ComPort;
137 ComPort = new QextSerialPort(portname, QextSerialPort::EventDriven);142 ComPort = new QextSerialPort(portname, QextSerialPort::Polling);
138 bool open_status = ComPort->open(QIODevice::ReadWrite);143 bool open_status = ComPort->open(QIODevice::ReadWrite);
139 ComPort->setBaudRate(BAUD19200);144 ComPort->setBaudRate(BAUD19200);
140 ComPort->setFlowControl(FLOW_OFF);145 ComPort->setFlowControl(FLOW_OFF);
141 ComPort->setParity(PAR_NONE);146 ComPort->setParity(PAR_NONE);
142 ComPort->setDataBits(DATA_8);147 ComPort->setDataBits(DATA_8);
143 ComPort->setStopBits(STOP_1);148 ComPort->setStopBits(STOP_1);
144 ComPort->setTimeout(100);149 //TODO: see how comport behaves w/out a timeout
150 //ComPort->setTimeout(500);
145 if (open_status < 0) return 0;151 if (open_status < 0) return 0;
146152
147 printf("Resetting NMC devices\n");153 qDebug() << "Resetting NMC devices";
148154
149 NmcHardReset(0xFF);155 //TODO: change these reset commands because 0xFF is the wrong group address
150 NmcHardReset(0xFF);156 NmcHardReset(0xFF);
151157 NmcHardReset(0xFF);
152 printf("NMC reset complete\n");158
159 qDebug() << "NMC reset complete";
153 addr = 1;160 addr = 1;
154 while (1)161 while (1)
155 {162 {
@@ -167,13 +174,11 @@
167 numread = ComPort->read(cstr, 2); //get back status, cksum174 numread = ComPort->read(cstr, 2); //get back status, cksum
168 //numread = SioGetChars(ComPort, cstr, 2);175 //numread = SioGetChars(ComPort, cstr, 2);
169176
170 //jrc352: error reading in characters in SioGetChars
171
172 if (numread!=2) break; //if no response, punt out of loop177 if (numread!=2) break; //if no response, punt out of loop
173178
174 if (cstr[0] != cstr[1])179 if (cstr[0] != cstr[1])
175 {180 {
176 printf("Status checksum error - please reset the Network\n");181 qDebug() << "Status checksum error - please reset the Network";
177 ComPort->close();182 ComPort->close();
178 return(0);183 return(0);
179 }184 }
@@ -189,7 +194,7 @@
189194
190 if (numread!=4)195 if (numread!=4)
191 {196 {
192 printf("Could not read device type\n");197 qDebug() << "Could not read device type";
193 ComPort->close();198 ComPort->close();
194 return(0);199 return(0);
195 }200 }
@@ -201,10 +206,20 @@
201 mod[addr].groupleader = false;206 mod[addr].groupleader = false;
202 switch (mod[addr].modtype)207 switch (mod[addr].modtype)
203 {208 {
204 case SERVOMODTYPE: mod[addr].p = ServoNewMod(); break;209 case SERVOMODTYPE:
205 case ADCMODTYPE: mod[addr].p = AdcNewMod(); break;210 {
206 case IOMODTYPE: mod[addr].p = IoNewMod(); break;211 mod[addr].p = ServoNewMod();
207 case STEPMODTYPE: mod[addr].p = StepNewMod(); break;212 //fix for change in I/O CTRL command
213 if ((mod[addr].modver<10) || (mod[addr].modver>20))
214 {
215 mod[addr].p = (SERVOMOD *)(mod[addr].p);
216 //mod[addr].p->ioctrl = IO1_IN | IO2_IN;
217 }
218 break;
219 }
220 case ADCMODTYPE: mod[addr].p = AdcNewMod(); break;
221 case IOMODTYPE: mod[addr].p = IoNewMod(); break;
222 case STEPMODTYPE: mod[addr].p = StepNewMod(); break;
208 }223 }
209 addr++; //increment the address224 addr++; //increment the address
210 }225 }
@@ -216,12 +231,12 @@
216 if (nummod_ > 0)231 if (nummod_ > 0)
217 {232 {
218 NmcChangeBaud(0xFF, baudrate);233 NmcChangeBaud(0xFF, baudrate);
219 if (nummod_>1) printf("%d Modules found\n", nummod_);234 if (nummod_>1) qDebug() << nummod_ << "Modules found";
220 else printf("%d Module found\n", nummod_);235 else qDebug() << nummod_ << "Module found";
221 }236 }
222 else237 else
223 {238 {
224 printf("No modules found on the network.\nPlease check power and connections.\n");239 qDebug() << "No modules found on the network.\nPlease check power and connections.";
225 ComPort->close();240 ComPort->close();
226 }241 }
227242
@@ -248,7 +263,6 @@
248 //If too many SIO errors, punt263 //If too many SIO errors, punt
249 if (SioError > MAXSIOERROR)264 if (SioError > MAXSIOERROR)
250 {265 {
251 qDebug() << "bad!!!!!";
252 return(false);266 return(false);
253 }267 }
254 IOBusy = true;268 IOBusy = true;
@@ -259,7 +273,7 @@
259 ( mod[stataddr].modtype==IOMODTYPE) ||273 ( mod[stataddr].modtype==IOMODTYPE) ||
260 ( mod[stataddr].modtype==STEPMODTYPE) ) )274 ( mod[stataddr].modtype==STEPMODTYPE) ) )
261 {275 {
262 printf("Module type %d not supported\n",mod[stataddr].modtype);276 qDebug() << "Module type" << mod[stataddr].modtype << "not supported";
263 return (false);277 return (false);
264 }278 }
265279
@@ -280,13 +294,15 @@
280 ComPort->flush(); //Get rid of any old input chars294 ComPort->flush(); //Get rid of any old input chars
281295
282 int bytesWritten = 0;296 int bytesWritten = 0;
297
283 for (i = 0; i < n+4; i++)298 for (i = 0; i < n+4; i++)
284 {299 {
285 if (ComPort->write(&(char)outstr[i], 1) == 1) bytesWritten++; //Send the command string300 byte * temp = &(outstr[i]);
301 if(ComPort->write((char *)temp, 1)) bytesWritten++; //Send the command string
286 }302 }
287303
288 if (bytesWritten != n+4)304 if (bytesWritten != n+4)
289 printf("Only wrote %d bytes out of %d bytes.\n",bytesWritten, n+4);305 qDebug() << "Only wrote " << bytesWritten << " bytes out of " << n+4 << " bytes.";
290306
291 if (stataddr == 0) //If a group command w/ no leader, add delay then exit307 if (stataddr == 0) //If a group command w/ no leader, add delay then exit
292 {308 {
@@ -325,7 +341,7 @@
325 //If too many errors - prompt to reset341 //If too many errors - prompt to reset
326 if (SioError >= MAXSIOERROR)342 if (SioError >= MAXSIOERROR)
327 {343 {
328 printf("Multiple communication errors - please reset the Network\n");344 qDebug() << "Multiple communication errors - please reset the Network";
329 return;345 return;
330 }346 }
331347
@@ -341,12 +357,12 @@
341 char cmdstr[2];357 char cmdstr[2];
342358
343 if (!(groupaddr & 0x80)) return false; //punt if not valid group address359 if (!(groupaddr & 0x80)) return false; //punt if not valid group address
344
345 cmdstr[0] = addr;360 cmdstr[0] = addr;
346 cmdstr[1] = groupaddr;361 cmdstr[1] = groupaddr;
347 if (leader) cmdstr[1] &= 0x7F; //clear upper bit if a group leader362 if (leader) cmdstr[1] &= 0x7F; //clear upper bit if a group leader
348 mod[addr].groupaddr = groupaddr;363 mod[addr].groupaddr = groupaddr;
349 mod[addr].groupleader = leader;364 mod[addr].groupleader = leader;
365 usleep(50000);
350 return NmcSendCmd(addr, SET_ADDR, cmdstr, 2, addr);366 return NmcSendCmd(addr, SET_ADDR, cmdstr, 2, addr);
351}367}
352//---------------------------------------------------------------------------368//---------------------------------------------------------------------------
@@ -366,7 +382,7 @@
366//---------------------------------------------------------------------------382//---------------------------------------------------------------------------
367extern "C" BOOL NmcNoOp(byte addr)383extern "C" BOOL NmcNoOp(byte addr)
368{384{
369 return NmcSendCmd(addr, NOP, NULL, 0, addr);385 return NmcSendCmd(addr, NOP, NULL, 0, addr);
370}386}
371//---------------------------------------------------------------------------387//---------------------------------------------------------------------------
372extern "C" BOOL NmcReadStatus(byte addr, byte statusitems)388extern "C" BOOL NmcReadStatus(byte addr, byte statusitems)
373389
=== modified file 'software/Common/JrKerr/nmccom.h'
--- software/Common/JrKerr/nmccom.h 2010-07-12 18:50:09 +0000
+++ software/Common/JrKerr/nmccom.h 2010-08-07 00:08:43 +0000
@@ -13,7 +13,7 @@
13// Non-windows platforms need these too -BR13// Non-windows platforms need these too -BR
14//typedef int BOOL; //0=false, <>0 true 14//typedef int BOOL; //0=false, <>0 true
15//typedef int HANDLE;15//typedef int HANDLE;
16//typedef unsigned long DWORD;16//typedef unsigned int DWORD;
17//#define INVALID_HANDLE_VALUE -117//#define INVALID_HANDLE_VALUE -1
1818
1919
@@ -22,7 +22,7 @@
22//jrc352: below taken from "sioutil.h"22//jrc352: below taken from "sioutil.h"
23// Non-windows platforms need these too -BR23// Non-windows platforms need these too -BR
24typedef int BOOL; //0=false, <>0 true24typedef int BOOL; //0=false, <>0 true
25typedef unsigned long DWORD;25typedef unsigned int DWORD;
26#define INVALID_HANDLE_VALUE -126#define INVALID_HANDLE_VALUE -1
2727
28typedef struct _NMCMOD {28typedef struct _NMCMOD {
2929
=== added directory 'software/Common/JrKerr/old_path'
=== added file 'software/Common/JrKerr/old_path/path.cpp'
--- software/Common/JrKerr/old_path/path.cpp 1970-01-01 00:00:00 +0000
+++ software/Common/JrKerr/old_path/path.cpp 2010-08-07 00:08:43 +0000
@@ -0,0 +1,650 @@
1//---------------------------------------------------------------------------
2#pragma hdrstop
3
4#include <math.h>
5#include "path.h"
6#include "nmccom.h"
7#include "picservo.h"
8#include <QDebug>
9//---------------------------------------------------------------------------
10//Globals:
11int pathsize; //local path size
12segment seglist[MAXSEG]; //list of segments
13int seglistsize; //number of segments in list
14int curseg; //current segment number
15int curppoint; //current pathpoint
16float tan_tolerance = TAN_3DEGREE; //minimum cos(th) for angle between tangents
17frame cur_arcframe; //coordinate fram for the current arc
18float pathlen; //total path length
19float arclen; //total length of path already downloaded
20float stublen; //length of path in current segment
21int pathfreq = P_30HZ; //selected path frequency
22int bufsize; //max num points to store in the PIC-SERVO buffer
23float maxvel, vel, acc; //max. velocity, cur velocity & acceleration
24byte x = 1; //axes addresses
25byte y = 2;
26byte z = 3;
27byte group = 0xFF; //group address for coordinated controllers
28byte leader = 0x00; //group leader address for coordinated controllers
29int finaldecel; //flag for when final deceleration has started
30int at_end; //flags when we are at end of path
31float xoff, yoff, zoff; //origin offset
32float UTOCX, UTOCY, UTOCZ; //Units TO Counts conversion factors
33float tolerance; //small distance tolerance use for near-zero comparisons
34
35//---------------------------------------------------------------------------
36// Geometric functions
37//---------------------------------------------------------------------------
38//Returns the magnitude of a floating point vector
39float mag(fp p)
40{
41 return(sqrt(p[0]*p[0] + p[1]*p[1] + p[2]*p[2]));
42}
43//---------------------------------------------------------------------------
44//Returns the dot product of two floating point vectors
45float dot(fp x, fp y)
46{
47 return( x[0]*y[0] + x[1]*y[1] + x[2]*y[2] );
48}
49//---------------------------------------------------------------------------
50//Z is returned as the cross product of (x cross y)
51void cross(fp x, fp y, fp z)
52{
53 z[0] = x[1]*y[2] - x[2]*y[1];
54 z[1] = x[2]*y[0] - x[0]*y[2];
55 z[2] = x[0]*y[1] - x[1]*y[0];
56}
57//---------------------------------------------------------------------------
58//y = normalized x ( normalize(x,x) works OK )
59float normalize(fp x, fp y)
60{
61 float a;
62
63 a = mag(x);
64 if (a==0.0) return(a);
65
66 y[0] /= a;
67 y[1] /= a;
68 y[2] /= a;
69 return(a);
70}
71//---------------------------------------------------------------------------
72//Cooredinate frame transformation: y = F*x, ( y = F*y OK )
73void fvmult(frame *F, fp x, fp y)
74{
75 fp xtemp;
76
77 xtemp[0] = x[0];
78 xtemp[1] = x[1];
79 xtemp[2] = x[2];
80 y[0] = F->x[0]*xtemp[0] + F->y[0]*xtemp[1] + F->z[0]*xtemp[2] + F->p[0];
81 y[1] = F->x[1]*xtemp[0] + F->y[1]*xtemp[1] + F->z[1]*xtemp[2] + F->p[1];
82 y[2] = F->x[2]*xtemp[0] + F->y[2]*xtemp[1] + F->z[2]*xtemp[2] + F->p[2];
83}
84//---------------------------------------------------------------------------
85// Coordinate frame inversion: *B = inverse(A)
86void finvert(frame A, frame *B)
87{
88 B->x[1] = A.y[0];
89 B->x[2] = A.z[0];
90 B->y[2] = A.z[1];
91 B->y[0] = A.x[1];
92 B->z[0] = A.x[2];
93 B->z[1] = A.y[2];
94 B->x[0] = A.x[0];
95 B->y[1] = A.y[1];
96 B->z[2] = A.z[2];
97 B->p[0] = -A.x[0]*A.p[0] - A.y[0]*A.p[1] - A.z[0]*A.p[2];
98 B->p[1] = -A.x[1]*A.p[0] - A.y[1]*A.p[1] - A.z[1]*A.p[2];
99 B->p[2] = -A.x[2]*A.p[0] - A.y[2]*A.p[1] - A.z[2]*A.p[2];
100}
101//---------------------------------------------------------------------------
102//Get a normal vector tangent to a segment endpoint (=1 for p1, =2 for p2)
103//returns -1 if segment length or radius < tolerance, 0 on success
104int GetTanVect(segment *s, fp p, int endpoint)
105{
106 fp q;
107
108 if (s->type == LINE)
109 {
110 p[0] = s->p2[0] - s->p1[0];
111 p[1] = s->p2[1] - s->p1[1];
112 p[2] = s->p2[2] - s->p1[2];
113 if (normalize(p, p) < tolerance) return(-1);
114 else return(0);
115 }
116 else if (s->type == ARC)
117 {
118 if (endpoint == 1)
119 {
120 q[0] = s->p1[0] - s->c[0];
121 q[1] = s->p1[1] - s->c[1];
122 q[2] = s->p1[2] - s->c[2];
123 }
124 else
125 {
126 q[0] = s->p2[0] - s->c[0];
127 q[1] = s->p2[1] - s->c[1];
128 q[2] = s->p2[2] - s->c[2];
129 }
130 if (normalize(q, q) < tolerance) return(-1);
131 cross(s->norm, q, p);
132 return(0);
133 }
134
135 return(0);
136}
137//---------------------------------------------------------------------------
138// Segment list functions
139//---------------------------------------------------------------------------
140//Theta = allowable angle (in degrees) between continuous path segments
141extern "C" void SetTangentTolerance(float theta)
142{
143 tan_tolerance = cos(theta*DTOR);
144}
145//---------------------------------------------------------------------------
146// Clear the current segment list and initialize the starting point
147extern "C" void ClearSegList(float xi, float yi, float zi)
148{
149 seglistsize = 0;
150 seglist[0].p1[0] = xi;
151 seglist[0].p1[1] = yi;
152 seglist[0].p1[2] = zi;
153}
154//---------------------------------------------------------------------------
155//Extract the reference frame for an arc
156//Also fills in the radius and arclength
157void GetArcFrame(segment *seg, frame *F)
158{
159 float q, theta;
160 fp p;
161
162 if (seg->type != ARC) return; //punt if not an arc
163
164 F->p[0] = seg->c[0]; //origin is at the center
165 F->p[1] = seg->c[1];
166 F->p[2] = seg->c[2];
167 F->x[0] = seg->p1[0] - seg->c[0]; //X vector points from center to P1
168 F->x[1] = seg->p1[1] - seg->c[1];
169 F->x[2] = seg->p1[2] - seg->c[2];
170 seg->r = normalize(F->x, F->x); //extract radius and normalize
171 q = dot(F->x, seg->norm); //make sure normal vector is perp. to X
172 F->z[0] = seg->norm[0] - q*F->x[0];
173 F->z[1] = seg->norm[1] - q*F->x[1];
174 F->z[2] = seg->norm[2] - q*F->x[2];
175 normalize(F->z, F->z);
176 cross(F->z, F->x, F->y);
177
178 p[0] = seg->p2[0] - seg->c[0]; //get the arclength
179 p[1] = seg->p2[1] - seg->c[1];
180 p[2] = seg->p2[2] - seg->c[2];
181 theta = atan2( dot(p,F->y), dot(p,F->x) );
182 if (theta < 0.0) theta = TWOPI + theta;
183 if (fabs(theta) < 0.001) theta = TWOPI - theta;
184 seg->len = fabs(seg->r * theta);
185}
186//---------------------------------------------------------------------------
187//Add a line segment to the segment list
188//Returns: position in segment list if OK
189// -1 if segment is not tangent
190// -2 if segment list is full
191//Function assumes the normal vector of any previous arc segment is accurate
192extern "C" int AddLineSeg(float x, float y, float z)
193{
194 fp pn, qn;
195
196 if (seglistsize >= MAXSEG) return(-2);
197
198 seglist[seglistsize].type = LINE;
199
200 seglist[seglistsize].p2[0] = x;
201 seglist[seglistsize].p2[1] = y;
202 seglist[seglistsize].p2[2] = z;
203
204 if (seglistsize > 0) //match start point to end point of prev segment
205 {
206 seglist[seglistsize].p1[0] = seglist[seglistsize-1].p2[0];
207 seglist[seglistsize].p1[1] = seglist[seglistsize-1].p2[1];
208 seglist[seglistsize].p1[2] = seglist[seglistsize-1].p2[2];
209 }
210
211 //Calculate normal vector and length for this segment
212 pn[0] = x - seglist[seglistsize].p1[0];
213 pn[1] = y - seglist[seglistsize].p1[1];
214 pn[2] = z - seglist[seglistsize].p1[2];
215 seglist[seglistsize].len = normalize(pn, pn);
216
217 //Check tangency with prev. segment for segments > tolerance:
218 if ( (seglist[seglistsize].len > tolerance) && (seglistsize > 0) )
219 if ( GetTanVect( &(seglist[seglistsize-1]), qn, 2) == 0 )
220 if (dot(pn,qn) < tan_tolerance) return(-1);
221
222 seglistsize++;
223 qDebug() << "seglistsize = " << seglistsize - 1;
224 return(seglistsize - 1);
225}
226//---------------------------------------------------------------------------
227//Add an arc segment to the segment list
228//Returns: position in segment list if OK
229// -1 if segment is not tangent
230// -2 if segment list is full
231// -3 if arc data invalid
232//(Invalid arc data - zero len. normal, radius < tolerance, normal not perp.)
233//Function assumes the normal vector of any previous arc segment is accurate
234extern "C" int AddArcSeg( float x, float y, float z, //end point
235 float cx, float cy, float cz, //center point
236 float nx, float ny, float nz ) //normal
237{
238 fp pn, qn;
239 frame F;
240
241 if (seglistsize >= MAXSEG) return(-2);
242
243 seglist[seglistsize].type = ARC;
244
245 seglist[seglistsize].p2[0] = x;
246 seglist[seglistsize].p2[1] = y;
247 seglist[seglistsize].p2[2] = z;
248 seglist[seglistsize].c[0] = cx;
249 seglist[seglistsize].c[1] = cy;
250 seglist[seglistsize].c[2] = cz;
251 seglist[seglistsize].norm[0] = nx;
252 seglist[seglistsize].norm[1] = ny;
253 seglist[seglistsize].norm[2] = nz;
254
255 if (seglistsize > 0) //match start point to end point of prev segment
256 {
257 seglist[seglistsize].p1[0] = seglist[seglistsize-1].p2[0];
258 seglist[seglistsize].p1[1] = seglist[seglistsize-1].p2[1];
259 seglist[seglistsize].p1[2] = seglist[seglistsize-1].p2[2];
260 }
261
262 //Normalize n and punt if too small
263 if ( normalize(seglist[seglistsize].norm, seglist[seglistsize].norm) < tolerance )
264 return(-3);
265
266 //Find radius to p2, and punt if too small
267 pn[0] = x - cx;
268 pn[1] = y - cy;
269 pn[2] = z - cz;
270 seglist[seglistsize].r = normalize(pn, pn);
271 if ( seglist[seglistsize].r < tolerance) return(-3);
272
273 //Check if normal is perp to c->p2 vector and punt if not
274 if ( fabs(dot(seglist[seglistsize].norm, pn)) > 0.001 ) return(-3);
275
276 //Find radius to p1, and punt if not equal to radius to p2
277 pn[0] = seglist[seglistsize].p1[0] - cx;
278 pn[1] = seglist[seglistsize].p1[1] - cy;
279 pn[2] = seglist[seglistsize].p1[2] - cz;
280 if ( fabs(seglist[seglistsize].r - normalize(pn, pn)) > tolerance) return(-3);
281
282 //Check if normal is perp to c->p2 vector and punt if not
283 if ( fabs(dot(seglist[seglistsize].norm, pn)) > 0.001 ) return(-3);
284
285 //Check for tangency with prev segment
286 if ( seglistsize > 0 )
287 {
288 GetTanVect( &(seglist[seglistsize]), pn, 1); //get current tangent
289 if ( GetTanVect( &(seglist[seglistsize-1]), qn, 2) == 0 ) //get prev tangent
290 if (dot(pn,qn) < tan_tolerance) return(-1);
291 }
292
293 GetArcFrame(&(seglist[seglistsize]), &F); //fills in segment length
294
295 seglistsize++;
296 return(seglistsize - 1);
297}
298//---------------------------------------------------------------------------
299//Returns a point p which lies on a line segment, and is a distance s from
300//the start of the line segment
301void GetLineSegPoint(segment *seg, float s, fp p)
302{
303 float r;
304
305 r = s/seg->len;
306 p[0] = seg->p1[0] + r*(seg->p2[0] - seg->p1[0]);
307 p[1] = seg->p1[1] + r*(seg->p2[1] - seg->p1[1]);
308 p[2] = seg->p1[2] + r*(seg->p2[2] - seg->p1[2]);
309}
310//---------------------------------------------------------------------------
311//Set feedrate in units per second
312extern "C" void SetFeedrate(float fr)
313{
314 switch (pathfreq) //calculate velocity in units per tick
315 {
316 case P_30HZ: maxvel = fr/30.0;
317 break;
318 case P_60HZ: maxvel = fr/60.0;
319 break;
320 case P_120HZ: maxvel = fr/120.0;
321 break;
322 default: maxvel = fr/30.0;
323 }
324}
325//---------------------------------------------------------------------------
326//Set the origin to which all segment data is relative
327extern "C" void SetOrigin(float xoffset, float yoffset, float zoffset)
328{
329 xoff = xoffset; //origin offset
330 yoff = yoffset;
331 zoff = zoffset;
332}
333//---------------------------------------------------------------------------
334//Initialize various parameters for this path generation module
335//Returns -1 if Status items are not set properly,
336// -2 if scale facotrs are zero
337extern "C" int SetPathParams2(int freq, int nbuf,
338 int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr,
339 float xscale, float yscale, float zscale,
340 float accel )
341{
342 byte statitems;
343 byte ioctrl;
344
345 //SimpleMsgBox(" PIC-SERVO Coordinated Control Example\n\n- FOR EVALUATION PURPOSES ONLY -");
346
347 pathfreq = freq; //set to 30 or 60 hz
348 bufsize = nbuf; //max num points to store in the PIC-SERVO buffer
349 x = (byte)xaxis; //axes addresses
350 y = (byte)yaxis;
351 z = (byte)zaxis;
352 group = (byte)groupaddr;
353 leader = (byte)leaderaddr;
354
355 if (freq == P_120HZ) //set fast path mode if using 120 Hz path
356 {
357 ioctrl = ServoGetIoCtrl(x);
358 ServoSetIoCtrl(x, (byte)(ioctrl | FAST_PATH));
359 ioctrl = ServoGetIoCtrl(y);
360 ServoSetIoCtrl(y, (byte)(ioctrl | FAST_PATH));
361 if (z)
362 {
363 ioctrl = ServoGetIoCtrl(z);
364 ServoSetIoCtrl(z, (byte)(ioctrl | FAST_PATH));
365 }
366 }
367 else //clear fast path bit if using slower modes
368 {
369 ioctrl = ServoGetIoCtrl(x);
370 ServoSetIoCtrl(x, (byte)(ioctrl & ~((byte)(FAST_PATH)) ));
371 ioctrl = ServoGetIoCtrl(y);
372 ServoSetIoCtrl(y, (byte)(ioctrl & ~((byte)(FAST_PATH)) ));
373 if (z)
374 {
375 ioctrl = ServoGetIoCtrl(z);
376 ServoSetIoCtrl(z, (byte)(ioctrl & ~((byte)(FAST_PATH)) ));
377 }
378 }
379
380 if (fabs(xscale)<1.0 || fabs(yscale)<1.0) return(-2);
381 if ( zaxis && (fabs(zscale)<1.0) ) return(-2);
382
383 UTOCX = xscale; //Units To X counts
384 UTOCY = yscale;
385 UTOCZ = zscale;
386
387 //Set the tolerance equivalent to 40 counts of the lowest resolution axis
388 tolerance = fabs(40.0/xscale);
389 if (tolerance < fabs(40.0/yscale)) tolerance = fabs(40.0/yscale);
390 if (zaxis)
391 if (tolerance < fabs(40.0/zscale)) tolerance = fabs(40.0/zscale);
392
393 switch (pathfreq) //calculate acceleration in units per tick^2
394 {
395 case P_30HZ: acc = accel/30.0/30.0;
396 break;
397 case P_60HZ: acc = accel/60.0/60.0;
398 break;
399 case P_120HZ: acc = accel/120.0/120.0;
400 break;
401 default: acc = accel/30.0/30.0;
402 }
403
404 //Check that the required status data will be returned with each command:
405 statitems = SEND_POS | SEND_NPOINTS | SEND_PERROR | SEND_AUX;
406
407 if ( ( (NmcGetStatItems(x)& statitems) != statitems ) ||
408 ( (NmcGetStatItems(y)& statitems) != statitems ) ||
409 ( (z && (NmcGetStatItems(z)& statitems) != statitems )) )
410 {
411 //ErrorMsgBox("Required status items have not been set");
412 return(-1);
413 }
414
415 return(0);
416}
417//---------------------------------------------------------------------------
418//Initialize various parameters for this path generation module
419//Returns -1 if Status items are not set properly,
420// -2 if scale facotrs are zero
421extern "C" int SetPathParams(int freq, int nbuf,
422 int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr,
423 float xscale, float yscale, float zscale,
424 float accel )
425{
426 byte statitems;
427
428 //SimpleMsgBox(" PIC-SERVO Coordinated Control Example\n\n- FOR EVALUATION PURPOSES ONLY -");
429
430 pathfreq = freq; //set to 30 or 60 hz
431 bufsize = nbuf; //max num points to store in the PIC-SERVO buffer
432 x = (byte)xaxis; //axes addresses
433 y = (byte)yaxis;
434 z = (byte)zaxis;
435 group = (byte)groupaddr;
436 leader = (byte)leaderaddr;
437
438 if (freq == P_120HZ) //set fast path mode if using 120 Hz path
439 {
440 ServoSetIoCtrl(x, IO1_IN | IO2_IN | FAST_PATH);
441 ServoSetIoCtrl(y, IO1_IN | IO2_IN | FAST_PATH);
442 if (z) ServoSetIoCtrl(z, IO1_IN | IO2_IN | FAST_PATH);
443 }
444 else //otherwise, use slow mode
445 {
446 ServoSetIoCtrl(x, IO1_IN | IO2_IN);
447 ServoSetIoCtrl(y, IO1_IN | IO2_IN);
448 if (z) ServoSetIoCtrl(z, IO1_IN | IO2_IN);
449 }
450
451 if (fabs(xscale)<1.0 || fabs(yscale)<1.0) return(-2);
452 if ( zaxis && (fabs(zscale)<1.0) ) return(-2);
453
454 UTOCX = xscale; //Units To X counts
455 UTOCY = yscale;
456 UTOCZ = zscale;
457
458 //Set the tolerance equivalent to 40 counts of the lowest resolution axis
459 tolerance = fabs(40.0/xscale);
460 if (tolerance < fabs(40.0/yscale)) tolerance = fabs(40.0/yscale);
461 if (zaxis)
462 if (tolerance < fabs(40.0/zscale)) tolerance = fabs(40.0/zscale);
463
464 switch (pathfreq) //calculate acceleration in units per tick^2
465 {
466 case P_30HZ: acc = accel/30.0/30.0;
467 break;
468 case P_60HZ: acc = accel/60.0/60.0;
469 break;
470 case P_120HZ: acc = accel/120.0/120.0;
471 break;
472 default: acc = accel/30.0/30.0;
473 }
474
475 //Check that the required status data will be returned with each command:
476 statitems = SEND_POS | SEND_NPOINTS | SEND_PERROR | SEND_AUX;
477
478 if ( ( (NmcGetStatItems(x)& statitems) != statitems ) ||
479 ( (NmcGetStatItems(y)& statitems) != statitems ) ||
480 ( (z && (NmcGetStatItems(z)& statitems) != statitems )) )
481 {
482 //ErrorMsgBox("Required status items have not been set");
483 return(-1);
484 }
485
486 return(0);
487}
488//---------------------------------------------------------------------------
489//Initializes the coordinated path after all of the segments have been added.
490//This function should be called just before the application starts calling
491//the function AddPathPoints().
492//Returns the overall path length for all of the segments.
493//Returns 0.0 on communications error
494extern "C" float InitPath()
495{
496 int i;
497
498 curseg = 0;
499 curppoint = 0;
500 arclen = 0.0;
501 stublen = 0.0;
502 pathlen = 0.0;
503 vel = 0.0;
504 finaldecel = 0;
505 at_end = 0;
506
507 for (i=0; i<seglistsize; i++) pathlen += seglist[i].len;
508
509 if (seglist[0].type == ARC) GetArcFrame( &(seglist[0]), &cur_arcframe );
510
511 //make sure we exit path mode first
512 if (!ServoStopMotor(x, ServoGetStopCtrl(x) & (byte)AMP_ENABLE)) return(0.0);
513 if (!ServoStopMotor(y, ServoGetStopCtrl(y) & (byte)AMP_ENABLE)) return(0.0);
514 if (z)
515 if (!ServoStopMotor(z, ServoGetStopCtrl(z) & (byte)AMP_ENABLE)) return(0.0);
516
517 ServoInitPath(x); //set the beginning of the path to the current position
518 ServoInitPath(y);
519 if (z) ServoInitPath(z);
520
521 return(pathlen);
522}
523//---------------------------------------------------------------------------
524//Gets the next point in the path.
525//returns -1 if already at the end of the path
526//returns 1 if the last point in the path
527//returns 0 otherwise
528int GetNextPathpoint(int *xp, int *yp, int *zp)
529{
530 fp p;
531
532 if (at_end) return(-1);
533
534 //First check if decelerating to the endpoint
535 if (finaldecel || (vel*vel > 2*acc*(pathlen - arclen)) )
536 {
537 vel -= acc;
538 if (vel<acc) vel = acc; //use acc value as minimum velocity
539 finaldecel = 1;
540 }
541 else if (vel<maxvel) //check for acceleration to current maxvel
542 {
543 vel+=acc;
544 if (vel>maxvel) vel = maxvel;
545 }
546 else if (vel>maxvel) //check for deceleration to current maxvel
547 {
548 vel-=acc;
549 if (vel<maxvel) vel = maxvel;
550 }
551
552 while (1) //skip over a segment (or more) if necessary
553 {
554 if ( (stublen + vel) > seglist[curseg].len ) //if past end of segment
555 {
556 stublen -= seglist[curseg].len; //subtract off the seg length
557 curseg++; // & move to next segment
558 int cSeg = curseg;
559 int sLen = seglistsize;
560 if (seglist[curseg].type == ARC) //update arcframe if necessary
561 GetArcFrame( &(seglist[curseg]), &cur_arcframe );
562 if (curseg == seglistsize)
563 {
564 at_end = 1; //check for end of segment list
565 break;
566 }
567 }
568 else
569 {
570 stublen += vel;
571 arclen += vel;
572 int tempArclen = arclen;
573 int tempPathlen = pathlen;
574 if (arclen > pathlen) at_end = 1;
575 break;
576 }
577 }
578
579 if (at_end) //return the final endpoint
580 {
581 *xp = (int)( (seglist[seglistsize-1].p2[0] + xoff) * UTOCX );
582 *yp = (int)( (seglist[seglistsize-1].p2[1] + yoff) * UTOCY );
583 *zp = (int)( (seglist[seglistsize-1].p2[2] + zoff) * UTOCZ );
584 }
585 else //find the point within the current segment
586 {
587 if (seglist[curseg].type == LINE)
588 {
589 GetLineSegPoint( &(seglist[curseg]), stublen, p );
590 }
591 else if (seglist[curseg].type == ARC)
592 {
593 p[0] = seglist[curseg].r * cos(stublen/seglist[curseg].r);
594 p[1] = seglist[curseg].r * sin(stublen/seglist[curseg].r);
595 p[2] = 0;
596 fvmult(&cur_arcframe, p, p);
597 }
598 *xp = (int)( (p[0] + xoff) * UTOCX );
599 *yp = (int)( (p[1] + yoff) * UTOCY );
600 *zp = (int)( (p[2] + zoff) * UTOCZ );
601 }
602
603 return(at_end);
604}
605//---------------------------------------------------------------------------
606//Adds points to path buffer - should be called at regular intervals which
607//are shorter than the buffer time (bufsize/pathfreq).
608//
609//Returns: -1 if path download is done
610// curseg if in middle of the path
611// -2 if communication error
612extern "C" int AddPathPoints()
613{
614 int xp[7], yp[7], zp[7]; //set of up to 7 pathpoints
615 int pcount;
616
617 //VEL = MAXVEL = 0.0 defines a feedhold condition
618 //Setting MAXVEL to a non-zero value will resume path execution
619 if (maxvel==0.0 && vel == 0.0) return(curseg);
620
621 while (!at_end) //GetNextPathpoint() sets the global at_end
622 {
623 if (!NmcNoOp(x)) return(-2); //read num points from X
624
625 //punt when PIC-SERVO buffer is full
626 if ((ServoGetNPoints(x)>bufsize) || (ServoGetNPoints(x)>87))
627 {
628 if (!NmcNoOp(y)) return(-2); //make sure data is updated even if points are not added
629 if (!NmcNoOp(z)) return(-2);
630 break;
631 }
632
633 for (pcount=0; pcount<7; pcount++) //get upto 7 new points
634 if ( GetNextPathpoint( xp+pcount, yp+pcount, zp+pcount ) ) break;
635
636 if (pcount<7) pcount++;
637
638 if (!ServoAddPathpoints(x, pcount, xp, pathfreq)) return(-2);
639 if (!ServoAddPathpoints(y, pcount, yp, pathfreq)) return(-2);
640 if (z)
641 if (!ServoAddPathpoints(z, pcount, zp, pathfreq)) return(-2);
642 }
643
644 if ( !(ServoGetAux(x) & PATH_MODE) ) //start path mode when buffer full
645 if (!ServoStartPathMode(group, leader)) return(-2);
646
647 if (at_end) return(-1);
648 return(curseg);
649}
650//---------------------------------------------------------------------------
0651
=== added file 'software/Common/JrKerr/old_path/path.h'
--- software/Common/JrKerr/old_path/path.h 1970-01-01 00:00:00 +0000
+++ software/Common/JrKerr/old_path/path.h 2010-08-07 00:08:43 +0000
@@ -0,0 +1,83 @@
1//---------------------------------------------------------------------------
2#ifndef pathH
3#define pathH
4//---------------------------------------------------------------------------
5//Defines:
6
7//Segment types:
8#define LINE 0
9#define ARC 1
10
11#define MAXSEG 1000 //Maximum number of segments
12#define PI 3.14159
13#define TWOPI 6.28319
14#define DTOR 0.017453
15
16//Valuse for tangent tolerance
17#define TAN_1DEGREE 0.99985
18#define TAN_3DEGREE 0.99863
19#define TAN_5DEGREE 0.99619
20#define TAN_10DEGREE 0.98481
21#define TAN_20DEGREE 0.93969
22#define TAN_45DEGREE 0.70711
23
24#define ONLINE 1
25//---------------------------------------------------------------------------
26//Data types:
27
28typedef float fp[3]; //floating point 3x1 vector
29
30typedef int ip[3]; //integer 3x1 vector
31
32typedef struct { //data type for line segments or arc segments
33 int type; //LINE or ARC
34 fp p1; //Starting point
35 fp p2; //Ending point
36 fp c; //Center point (arcs only)
37 fp norm; //Normal vector (arcs only)
38 float len; //Segment length
39 float r; //Radius (arcs only)
40 } segment;
41
42typedef struct { //data type for a coordinate frame
43 fp x;
44 fp y;
45 fp z;
46 fp p;
47 } frame;
48
49//---------------------------------------------------------------------------
50//Function prototypes:
51float mag(fp p);
52float dot(fp x, fp y);
53void cross(fp x, fp y, fp z);
54float normalize(fp x, fp y);
55void fvmult(frame *F, fp x, fp y);
56void finvert(frame A, frame *B);
57int GetTanVect(segment *s, fp p, int endpoint);
58void GetArcFrame(segment *seg, frame *F);
59void GetLineSegPoint(segment *seg, float s, fp p);
60int GetNextPathpoint(int *xp, int *yp, int *zp);
61
62//Path mode API functions:
63extern "C" void SetTangentTolerance(float theta);
64extern "C" void ClearSegList(float x, float y, float z);
65extern "C" int AddLineSeg(float x, float y, float z);
66extern "C" int AddArcSeg( float x, float y, float z, //end point
67 float cx, float cy, float cz, //center point
68 float nx, float ny, float nz ); //normal
69extern "C" void SetFeedrate(float fr);
70extern "C" void SetOrigin(float xoffset, float yoffset, float zoffset);
71extern "C" int SetPathParams(int freq, int nbuf,
72 int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr,
73 float xscale, float yscale, float zscale,
74 float accel );
75extern "C" int SetPathParams2(int freq, int nbuf,
76 int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr,
77 float xscale, float yscale, float zscale,
78 float accel );
79extern "C" float InitPath();
80extern "C" int AddPathPoints();
81
82//---------------------------------------------------------------------------
83#endif
084
=== modified file 'software/Common/JrKerr/path.cpp'
--- software/Common/JrKerr/path.cpp 2010-07-23 20:12:14 +0000
+++ software/Common/JrKerr/path.cpp 2010-08-07 00:08:43 +0000
@@ -5,7 +5,7 @@
5#include "path.h"5#include "path.h"
6#include "nmccom.h"6#include "nmccom.h"
7#include "picservo.h"7#include "picservo.h"
8#include <QDebug>8#include "qdebug.h"
9//---------------------------------------------------------------------------9//---------------------------------------------------------------------------
10//Globals:10//Globals:
11int pathsize; //local path size11int pathsize; //local path size
@@ -220,7 +220,6 @@
220 if (dot(pn,qn) < tan_tolerance) return(-1);220 if (dot(pn,qn) < tan_tolerance) return(-1);
221221
222 seglistsize++;222 seglistsize++;
223 qDebug() << "seglistsize = " << seglistsize - 1;
224 return(seglistsize - 1);223 return(seglistsize - 1);
225}224}
226//---------------------------------------------------------------------------225//---------------------------------------------------------------------------
@@ -408,7 +407,7 @@
408 ( (NmcGetStatItems(y)& statitems) != statitems ) ||407 ( (NmcGetStatItems(y)& statitems) != statitems ) ||
409 ( (z && (NmcGetStatItems(z)& statitems) != statitems )) )408 ( (z && (NmcGetStatItems(z)& statitems) != statitems )) )
410 {409 {
411 //ErrorMsgBox("Required status items have not been set");410 qDebug() << "Required status items have not been set";
412 return(-1);411 return(-1);
413 }412 }
414413
@@ -479,7 +478,7 @@
479 ( (NmcGetStatItems(y)& statitems) != statitems ) ||478 ( (NmcGetStatItems(y)& statitems) != statitems ) ||
480 ( (z && (NmcGetStatItems(z)& statitems) != statitems )) )479 ( (z && (NmcGetStatItems(z)& statitems) != statitems )) )
481 {480 {
482 //ErrorMsgBox("Required status items have not been set");481 qDebug() << "Required status items have not been set";
483 return(-1);482 return(-1);
484 }483 }
485484
@@ -525,7 +524,7 @@
525//returns -1 if already at the end of the path524//returns -1 if already at the end of the path
526//returns 1 if the last point in the path525//returns 1 if the last point in the path
527//returns 0 otherwise526//returns 0 otherwise
528int GetNextPathpoint(long int *xp, long int *yp, long int *zp)527int GetNextPathpoint(int *xp, int *yp, int *zp)
529{528{
530 fp p;529 fp p;
531530
@@ -574,9 +573,9 @@
574573
575 if (at_end) //return the final endpoint574 if (at_end) //return the final endpoint
576 {575 {
577 *xp = (long int)( (seglist[seglistsize-1].p2[0] + xoff) * UTOCX );576 *xp = (int)( (seglist[seglistsize-1].p2[0] + xoff) * UTOCX );
578 *yp = (long int)( (seglist[seglistsize-1].p2[1] + yoff) * UTOCY );577 *yp = (int)( (seglist[seglistsize-1].p2[1] + yoff) * UTOCY );
579 *zp = (long int)( (seglist[seglistsize-1].p2[2] + zoff) * UTOCZ );578 *zp = (int)( (seglist[seglistsize-1].p2[2] + zoff) * UTOCZ );
580 }579 }
581 else //find the point within the current segment580 else //find the point within the current segment
582 {581 {
@@ -591,9 +590,9 @@
591 p[2] = 0;590 p[2] = 0;
592 fvmult(&cur_arcframe, p, p);591 fvmult(&cur_arcframe, p, p);
593 }592 }
594 *xp = (long int)( (p[0] + xoff) * UTOCX );593 *xp = (int)( (p[0] + xoff) * UTOCX );
595 *yp = (long int)( (p[1] + yoff) * UTOCY );594 *yp = (int)( (p[1] + yoff) * UTOCY );
596 *zp = (long int)( (p[2] + zoff) * UTOCZ );595 *zp = (int)( (p[2] + zoff) * UTOCZ );
597 }596 }
598597
599 return(at_end);598 return(at_end);
@@ -607,7 +606,7 @@
607// -2 if communication error606// -2 if communication error
608extern "C" int AddPathPoints()607extern "C" int AddPathPoints()
609{608{
610 long int xp[7], yp[7], zp[7]; //set of up to 7 pathpoints609 int xp[7], yp[7], zp[7]; //set of up to 7 pathpoints
611 int pcount;610 int pcount;
612611
613 //VEL = MAXVEL = 0.0 defines a feedhold condition612 //VEL = MAXVEL = 0.0 defines a feedhold condition
614613
=== modified file 'software/Common/JrKerr/path.h'
--- software/Common/JrKerr/path.h 2010-07-13 18:44:38 +0000
+++ software/Common/JrKerr/path.h 2010-08-07 00:08:43 +0000
@@ -27,7 +27,7 @@
2727
28typedef float fp[3]; //floating point 3x1 vector28typedef float fp[3]; //floating point 3x1 vector
2929
30typedef long int ip[3]; //integer 3x1 vector30typedef int ip[3]; //integer 3x1 vector
3131
32typedef struct { //data type for line segments or arc segments32typedef struct { //data type for line segments or arc segments
33 int type; //LINE or ARC33 int type; //LINE or ARC
@@ -57,25 +57,25 @@
57int GetTanVect(segment *s, fp p, int endpoint);57int GetTanVect(segment *s, fp p, int endpoint);
58void GetArcFrame(segment *seg, frame *F);58void GetArcFrame(segment *seg, frame *F);
59void GetLineSegPoint(segment *seg, float s, fp p);59void GetLineSegPoint(segment *seg, float s, fp p);
60int GetNextPathpoint(long int *xp, long int *yp, long int *zp);60int GetNextPathpoint(int *xp, int *yp, int *zp);
6161
62//Path mode API functions:62//Path mode API functions:
63extern "C" void SetTangentTolerance(float theta);63extern "C" void SetTangentTolerance(float theta);
64extern "C" void ClearSegList(float x, float y, float z);64extern "C" void ClearSegList(float x, float y, float z);
65extern "C" int AddLineSeg(float x, float y, float z);65extern "C" int AddLineSeg(float x, float y, float z);
66extern "C" int AddArcSeg( float x, float y, float z, //end point66extern "C" int AddArcSeg( float x, float y, float z, //end point
67 float cx, float cy, float cz, //center point67 float cx, float cy, float cz, //center point
68 float nx, float ny, float nz ); //normal68 float nx, float ny, float nz ); //normal
69extern "C" void SetFeedrate(float fr);69extern "C" void SetFeedrate(float fr);
70extern "C" void SetOrigin(float xoffset, float yoffset, float zoffset);70extern "C" void SetOrigin(float xoffset, float yoffset, float zoffset);
71extern "C" int SetPathParams(int freq, int nbuf,71extern "C" int SetPathParams(int freq, int nbuf,
72 int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr,72 int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr,
73 float xscale, float yscale, float zscale,73 float xscale, float yscale, float zscale,
74 float accel );74 float accel );
75extern "C" int SetPathParams2(int freq, int nbuf,75extern "C" int SetPathParams2(int freq, int nbuf,
76 int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr,76 int xaxis, int yaxis, int zaxis, int groupaddr, int leaderaddr,
77 float xscale, float yscale, float zscale,77 float xscale, float yscale, float zscale,
78 float accel );78 float accel );
79extern "C" float InitPath();79extern "C" float InitPath();
80extern "C" int AddPathPoints();80extern "C" int AddPathPoints();
8181
8282
=== modified file 'software/Common/JrKerr/picservo.cpp'
--- software/Common/JrKerr/picservo.cpp 2010-07-23 20:12:14 +0000
+++ software/Common/JrKerr/picservo.cpp 2010-08-07 00:08:43 +0000
@@ -5,6 +5,7 @@
5#include "qextserialport.h"5#include "qextserialport.h"
6#include <stdio.h>6#include <stdio.h>
7#include <unistd.h>7#include <unistd.h>
8#include <QDebug>
89
9//---------------------------------------------------------------------------10//---------------------------------------------------------------------------
10extern NMCMOD mod[]; //Array of modules11extern NMCMOD mod[]; //Array of modules
@@ -37,9 +38,10 @@
37(p->gain).el = 0;38(p->gain).el = 0;
38(p->gain).sr = 1;39(p->gain).sr = 1;
39(p->gain).dc = 0;40(p->gain).dc = 0;
41(p->gain).sm = 1;
4042
41p->stoppos = 0;43p->stoppos = 0;
42p->ioctrl = IO1_IN | IO2_IN;44p->ioctrl = 0;
43p->homectrl = 0;45p->homectrl = 0;
44p->movectrl = 0;46p->movectrl = 0;
45p->stopctrl = 0;47p->stopctrl = 0;
@@ -72,18 +74,19 @@
72if ( (mod[addr].statusitems) & SEND_PERROR ) numbytes +=2;74if ( (mod[addr].statusitems) & SEND_PERROR ) numbytes +=2;
73if ( (mod[addr].statusitems) & SEND_NPOINTS ) numbytes +=1;75if ( (mod[addr].statusitems) & SEND_NPOINTS ) numbytes +=1;
74QextSerialPort* ComPort = getComPort();76QextSerialPort* ComPort = getComPort();
75//usleep(50000);77//usleep(100000);
76for (i = 0, numrcvd = 0; i < numbytes; i++)78for (i = 0, numrcvd = 0; i < numbytes; i++)
77{79{
78 if (ComPort->read(&(char)inbuf[i], 1)) numrcvd++;80 byte* temp = &inbuf[i];
81 if (ComPort->read((char *) temp, 1)) numrcvd++;
79}82}
8083
8184
82//Verify enough data was read85//Verify enough data was read
83if (numrcvd != numbytes)86if (numrcvd != numbytes)
84 {87 {
85 printf("ServoGetStat (%d) failed to read chars\n",addr);88 qDebug() << "ServoGetStat " << addr << " failed to read chars";
86 printf("Read %d bytes out of %d bytes\n", numrcvd, numbytes);89 qDebug() << "Read " << numrcvd << " bytes out of " << numbytes << " bytes.";
87 return false;90 return false;
88 }91 }
8992
@@ -92,7 +95,7 @@
92for (i=0; i<numbytes-1; i++) cksum = (byte)(cksum + inbuf[i]);95for (i=0; i<numbytes-1; i++) cksum = (byte)(cksum + inbuf[i]);
93if (cksum != inbuf[numbytes-1])96if (cksum != inbuf[numbytes-1])
94 {97 {
95 printf("ServoGetStat(%d): checksum error\n",addr);98 qDebug() << "ServoGetStat" << addr << ": checksum error";
96 return false;99 return false;
97 }100 }
98101
@@ -100,7 +103,7 @@
100mod[addr].stat = inbuf[0];103mod[addr].stat = inbuf[0];
101if (mod[addr].stat & CKSUM_ERROR)104if (mod[addr].stat & CKSUM_ERROR)
102 {105 {
103 printf("Command checksum error!\n");106 qDebug() << "Command checksum error!";
104 return false;107 return false;
105 }108 }
106109
@@ -108,7 +111,7 @@
108bytecount = 1;111bytecount = 1;
109if ( (mod[addr].statusitems) & SEND_POS )112if ( (mod[addr].statusitems) & SEND_POS )
110 {113 {
111 p->pos = *( (long *)(inbuf + bytecount) );114 p->pos = *( (int *)(inbuf + bytecount) );
112 bytecount +=4;115 bytecount +=4;
113 }116 }
114if ( (mod[addr].statusitems) & SEND_AD )117if ( (mod[addr].statusitems) & SEND_AD )
@@ -128,7 +131,7 @@
128 }131 }
129if ( (mod[addr].statusitems) & SEND_HOME )132if ( (mod[addr].statusitems) & SEND_HOME )
130 {133 {
131 p->home = *( (unsigned long *)(inbuf + bytecount) );134 p->home = *( (unsigned int *)(inbuf + bytecount) );
132 bytecount +=4;135 bytecount +=4;
133 }136 }
134if ( (mod[addr].statusitems) & SEND_ID )137if ( (mod[addr].statusitems) & SEND_ID )
@@ -144,6 +147,7 @@
144 }147 }
145if ( (mod[addr].statusitems) & SEND_NPOINTS )148if ( (mod[addr].statusitems) & SEND_NPOINTS )
146 {149 {
150 byte temp = inbuf[bytecount];
147 p->npoints = inbuf[bytecount];151 p->npoints = inbuf[bytecount];
148 //bytecount +=1;152 //bytecount +=1;
149 }153 }
@@ -151,7 +155,7 @@
151return(true);155return(true);
152}156}
153//---------------------------------------------------------------------------157//---------------------------------------------------------------------------
154extern "C" long ServoGetPos(byte addr)158extern "C" int ServoGetPos(byte addr)
155{159{
156SERVOMOD * p;160SERVOMOD * p;
157161
@@ -183,7 +187,7 @@
183return p->aux;187return p->aux;
184}188}
185//---------------------------------------------------------------------------189//---------------------------------------------------------------------------
186extern "C" long ServoGetHome(byte addr)190extern "C" int ServoGetHome(byte addr)
187{191{
188SERVOMOD * p;192SERVOMOD * p;
189193
@@ -207,7 +211,7 @@
207return p->npoints;211return p->npoints;
208}212}
209//---------------------------------------------------------------------------213//---------------------------------------------------------------------------
210extern "C" long ServoGetCmdPos(byte addr)214extern "C" int ServoGetCmdPos(byte addr)
211{215{
212SERVOMOD * p;216SERVOMOD * p;
213217
@@ -215,7 +219,7 @@
215return p->cmdpos;219return p->cmdpos;
216}220}
217//---------------------------------------------------------------------------221//---------------------------------------------------------------------------
218extern "C" long ServoGetCmdVel(byte addr)222extern "C" int ServoGetCmdVel(byte addr)
219{223{
220SERVOMOD * p;224SERVOMOD * p;
221225
@@ -223,7 +227,7 @@
223return p->cmdvel;227return p->cmdvel;
224}228}
225//---------------------------------------------------------------------------229//---------------------------------------------------------------------------
226extern "C" long ServoGetCmdAcc(byte addr)230extern "C" int ServoGetCmdAcc(byte addr)
227{231{
228SERVOMOD * p;232SERVOMOD * p;
229233
@@ -231,7 +235,7 @@
231return p->cmdacc;235return p->cmdacc;
232}236}
233//---------------------------------------------------------------------------237//---------------------------------------------------------------------------
234extern "C" long ServoGetStopPos(byte addr)238extern "C" int ServoGetStopPos(byte addr)
235{239{
236SERVOMOD * p;240SERVOMOD * p;
237241
@@ -343,6 +347,9 @@
343*( (byte *)(cmdstr+13) ) = dc;347*( (byte *)(cmdstr+13) ) = dc;
344348
345349
350usleep(51000);
351
352
346return NmcSendCmd(addr, SET_GAIN, cmdstr, 14, addr);353return NmcSendCmd(addr, SET_GAIN, cmdstr, 14, addr);
347}354}
348//---------------------------------------------------------------------------//355//---------------------------------------------------------------------------//
@@ -434,7 +441,7 @@
434 return NmcSendCmd(addr, SET_GAIN, cmdstr, 15, addr);441 return NmcSendCmd(addr, SET_GAIN, cmdstr, 15, addr);
435}442}
436//---------------------------------------------------------------------------443//---------------------------------------------------------------------------
437extern "C" BOOL ServoLoadTraj(byte addr, byte mode, long pos, long vel, long acc, byte pwm)444extern "C" BOOL ServoLoadTraj(byte addr, byte mode, int pos, int vel, int acc, byte pwm)
438{445{
439SERVOMOD * p;446SERVOMOD * p;
440char cmdstr[16];447char cmdstr[16];
@@ -449,9 +456,9 @@
449456
450count = 0;457count = 0;
451*( (byte *)(cmdstr + count) ) = mode; count += 1;458*( (byte *)(cmdstr + count) ) = mode; count += 1;
452if (mode & LOAD_POS) { *( (long *)(cmdstr + count) ) = pos; count += 4; }459if (mode & LOAD_POS) { *( (int *)(cmdstr + count) ) = pos; count += 4; }
453if (mode & LOAD_VEL) { *( (long *)(cmdstr + count) ) = vel; count += 4; }460if (mode & LOAD_VEL) { *( (int *)(cmdstr + count) ) = vel; count += 4; }
454if (mode & LOAD_ACC) { *( (long *)(cmdstr + count) ) = acc; count += 4; }461if (mode & LOAD_ACC) { *( (int *)(cmdstr + count) ) = acc; count += 4; }
455if (mode & LOAD_PWM) { *( (byte *)(cmdstr + count) ) = pwm; count += 1; }462if (mode & LOAD_PWM) { *( (byte *)(cmdstr + count) ) = pwm; count += 1; }
456463
457return NmcSendCmd(addr, LOAD_TRAJ, cmdstr, (byte)count, addr);464return NmcSendCmd(addr, LOAD_TRAJ, cmdstr, (byte)count, addr);
@@ -467,14 +474,17 @@
467p->last_ppoint = p->pos + p->perror;474p->last_ppoint = p->pos + p->perror;
468}475}
469//---------------------------------------------------------------------------476//---------------------------------------------------------------------------
470extern "C" BOOL ServoAddPathpoints(byte addr, int npoints, long *path, int freq)477extern "C" BOOL ServoAddPathpoints(byte addr, int npoints, int *path, int freq)
471{478{
472SERVOMOD * p;479SERVOMOD * p;
473char cmdstr[16];480char cmdstr[16];
474long diff;481int diff;
475int rev;482int rev;
476int i;483int i;
477484
485//npoints must be greater than 0
486if (npoints <= 0) return 0;
487
478p = (SERVOMOD *)(mod[addr].p);488p = (SERVOMOD *)(mod[addr].p);
479489
480for (i=0; i<npoints; i++)490for (i=0; i<npoints; i++)
@@ -559,12 +569,12 @@
559// pos: position (-2,147,483,648 - +2,147,483,647) //569// pos: position (-2,147,483,648 - +2,147,483,647) //
560// Description: Sets the module position to the specified value. //570// Description: Sets the module position to the specified value. //
561//---------------------------------------------------------------------------//571//---------------------------------------------------------------------------//
562extern "C" BOOL ServoSetPos(byte addr, long pos)572extern "C" BOOL ServoSetPos(byte addr, int pos)
563{573{
564 char cmdstr[6];574 char cmdstr[6];
565 575
566 cmdstr[0] = SET_POS; //mode byte for reset pos576 cmdstr[0] = SET_POS; //mode byte for reset pos
567 *( (long *)(cmdstr + 1) ) = pos;577 *( (int *)(cmdstr + 1) ) = pos;
568 578
569 return NmcSendCmd(addr, RESET_POS, cmdstr, 5, addr);579 return NmcSendCmd(addr, RESET_POS, cmdstr, 5, addr);
570}580}
@@ -593,7 +603,7 @@
593// pos: unprofiled command position //603// pos: unprofiled command position //
594// Description: Stop the motor at the specified position. //604// Description: Stop the motor at the specified position. //
595//---------------------------------------------------------------------------//605//---------------------------------------------------------------------------//
596extern "C" BOOL ServoStopHere(byte addr, byte mode, long pos)606extern "C" BOOL ServoStopHere(byte addr, byte mode, int pos)
597{607{
598 SERVOMOD * p;608 SERVOMOD * p;
599 char cmdstr[6];609 char cmdstr[6];
@@ -603,7 +613,7 @@
603 p->stopctrl = mode;613 p->stopctrl = mode;
604 614
605 cmdstr[0] = mode;615 cmdstr[0] = mode;
606 *( (long *)(cmdstr + 1) ) = pos;616 *( (int *)(cmdstr + 1) ) = pos;
607 617
608 return NmcSendCmd(addr, STOP_MOTOR, cmdstr, 5, addr);618 return NmcSendCmd(addr, STOP_MOTOR, cmdstr, 5, addr);
609}619}
610620
=== modified file 'software/Common/JrKerr/picservo.h'
--- software/Common/JrKerr/picservo.h 2010-07-12 18:50:09 +0000
+++ software/Common/JrKerr/picservo.h 2010-08-07 00:08:43 +0000
@@ -24,28 +24,28 @@
24 } GAINVECT;24 } GAINVECT;
2525
26typedef struct _SERVOMOD {26typedef struct _SERVOMOD {
27 long pos; //current position27 int pos; //current position
28 byte ad; //a/d value28 byte ad; //a/d value
29 short int vel; //current velocity29 short int vel; //current velocity
30 byte aux; //auxilliary status byte30 byte aux; //auxilliary status byte
31 long home; //home position31 int home; //home position
32 short int perror; //position error32 short int perror; //position error
33 byte npoints; //number of points in path buffer33 byte npoints; //number of points in path buffer
3434
35 //The following data is stored locally for reference35 //The following data is stored locally for reference
36 long cmdpos; //last commanded position36 int cmdpos; //last commanded position
37 long cmdvel; //last commanded velocity37 int cmdvel; //last commanded velocity
38 long cmdacc; //last commanded acceleration38 int cmdacc; //last commanded acceleration
39 byte cmdpwm; //last commanded PWM value39 byte cmdpwm; //last commanded PWM value
40 GAINVECT gain;40 GAINVECT gain;
41 long stoppos; //motor stop position (used by stop command)41 int stoppos; //motor stop position (used by stop command)
42 byte stopctrl; //stop control byte42 byte stopctrl; //stop control byte
43 byte movectrl; //load_traj control byte43 byte movectrl; //load_traj control byte
44 byte ioctrl; //I/O control byte44 byte ioctrl; //I/O control byte
45 byte homectrl; //homing control byte45 byte homectrl; //homing control byte
46 byte ph_adv; //phase advance (for ss-drive modules)46 byte ph_adv; //phase advance (for ss-drive modules)
47 byte ph_off; //phase offset (for ss-drive modules)47 byte ph_off; //phase offset (for ss-drive modules)
48 long last_ppoint; //last path point specified48 int last_ppoint; //last path point specified
49 } SERVOMOD;49 } SERVOMOD;
5050
5151
@@ -163,17 +163,17 @@
163//Servo module function prototypes:163//Servo module function prototypes:
164extern "C" SERVOMOD * ServoNewMod();164extern "C" SERVOMOD * ServoNewMod();
165extern "C" BOOL ServoGetStat(byte addr);165extern "C" BOOL ServoGetStat(byte addr);
166extern "C" long ServoGetPos(byte addr);166extern "C" int ServoGetPos(byte addr);
167extern "C" byte ServoGetAD(byte addr);167extern "C" byte ServoGetAD(byte addr);
168extern "C" short int ServoGetVel(byte addr);168extern "C" short int ServoGetVel(byte addr);
169extern "C" byte ServoGetAux(byte addr);169extern "C" byte ServoGetAux(byte addr);
170extern "C" long ServoGetHome(byte addr);170extern "C" int ServoGetHome(byte addr);
171extern "C" short int ServoGetPError(byte addr);171extern "C" short int ServoGetPError(byte addr);
172extern "C" byte ServoGetNPoints(byte addr);172extern "C" byte ServoGetNPoints(byte addr);
173extern "C" long ServoGetCmdPos(byte addr);173extern "C" int ServoGetCmdPos(byte addr);
174extern "C" long ServoGetCmdVel(byte addr);174extern "C" int ServoGetCmdVel(byte addr);
175extern "C" long ServoGetCmdAcc(byte addr);175extern "C" int ServoGetCmdAcc(byte addr);
176extern "C" long ServoGetStopPos(byte addr);176extern "C" int ServoGetStopPos(byte addr);
177extern "C" byte ServoGetCmdPwm(byte addr);177extern "C" byte ServoGetCmdPwm(byte addr);
178extern "C" byte ServoGetMoveCtrl(byte addr);178extern "C" byte ServoGetMoveCtrl(byte addr);
179extern "C" byte ServoGetStopCtrl(byte addr);179extern "C" byte ServoGetStopCtrl(byte addr);
@@ -198,15 +198,15 @@
198extern "C" BOOL ServoResetPos(byte addr);198extern "C" BOOL ServoResetPos(byte addr);
199extern "C" BOOL ServoResetRelHome(byte addr);199extern "C" BOOL ServoResetRelHome(byte addr);
200//added200//added
201extern "C" BOOL ServoSetPos(byte addr, long pos);201extern "C" BOOL ServoSetPos(byte addr, int pos);
202extern "C" BOOL ServoClearBits(byte addr);202extern "C" BOOL ServoClearBits(byte addr);
203extern "C" BOOL ServoStopMotor(byte addr, byte mode);203extern "C" BOOL ServoStopMotor(byte addr, byte mode);
204//added204//added
205extern "C" BOOL ServoStopHere(byte addr, byte mode, long pos);205extern "C" BOOL ServoStopHere(byte addr, byte mode, int pos);
206extern "C" BOOL ServoSetIoCtrl(byte addr, byte mode);206extern "C" BOOL ServoSetIoCtrl(byte addr, byte mode);
207extern "C" BOOL ServoLoadTraj(byte addr, byte mode, long pos, long vel, long acc, byte pwm);207extern "C" BOOL ServoLoadTraj(byte addr, byte mode, int pos, int vel, int acc, byte pwm);
208extern "C" void ServoInitPath(byte addr);208extern "C" void ServoInitPath(byte addr);
209extern "C" BOOL ServoAddPathpoints(byte addr, int npoints, long *path, int freq);209extern "C" BOOL ServoAddPathpoints(byte addr, int npoints, int *path, int freq);
210extern "C" BOOL ServoStartPathMode(byte groupaddr, byte groupleader);210extern "C" BOOL ServoStartPathMode(byte groupaddr, byte groupleader);
211//added211//added
212extern "C" BOOL ServoStartMove(byte groupaddr, byte groupleader);212extern "C" BOOL ServoStartMove(byte groupaddr, byte groupleader);
213213
=== modified file 'software/Common/JrKerr/src/.DS_Store'
214Binary 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 differ214Binary 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
=== modified file 'software/Common/JrKerr/src/Makefile'
--- software/Common/JrKerr/src/Makefile 2010-07-22 15:32:37 +0000
+++ software/Common/JrKerr/src/Makefile 2010-08-07 00:08:43 +0000
@@ -1,6 +1,6 @@
1#############################################################################1#############################################################################
2# Makefile for building: libqextserialportd.1.0.0.dylib2# Makefile for building: libqextserialportd.1.0.0.dylib
3# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Jul 20 14:13:07 20103# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Aug 3 22:47:38 2010
4# Project: src.pro4# Project: src.pro
5# Template: lib5# Template: lib
6# Command: /usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile src.pro6# Command: /usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile src.pro
77
=== modified file 'software/Common/JrKerr/src/Makefile.Debug'
--- software/Common/JrKerr/src/Makefile.Debug 2010-07-22 15:32:37 +0000
+++ software/Common/JrKerr/src/Makefile.Debug 2010-08-07 00:08:43 +0000
@@ -1,6 +1,6 @@
1#############################################################################1#############################################################################
2# Makefile for building: libqextserialportd.1.0.0.dylib2# Makefile for building: libqextserialportd.1.0.0.dylib
3# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Jul 20 14:13:07 20103# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Aug 3 22:47:38 2010
4# Project: src.pro4# Project: src.pro
5# Template: lib5# Template: lib
6#############################################################################6#############################################################################
77
=== modified file 'software/Common/JrKerr/src/Makefile.Release'
--- software/Common/JrKerr/src/Makefile.Release 2010-07-22 15:32:37 +0000
+++ software/Common/JrKerr/src/Makefile.Release 2010-08-07 00:08:43 +0000
@@ -1,6 +1,6 @@
1#############################################################################1#############################################################################
2# Makefile for building: libqextserialport.1.0.0.dylib2# Makefile for building: libqextserialport.1.0.0.dylib
3# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Jul 20 14:13:07 20103# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Aug 3 22:47:38 2010
4# Project: src.pro4# Project: src.pro
5# Template: lib5# Template: lib
6#############################################################################6#############################################################################
77
=== modified file 'software/Common/JrKerr/src/src.pro.user'
--- software/Common/JrKerr/src/src.pro.user 2010-07-23 20:12:14 +0000
+++ software/Common/JrKerr/src/src.pro.user 2010-08-07 00:08:43 +0000
@@ -22,9 +22,7 @@
22 </data>22 </data>
23 <data>23 <data>
24 <variable>RunConfiguration0-UserEnvironmentChanges</variable>24 <variable>RunConfiguration0-UserEnvironmentChanges</variable>
25 <valuelist type="QVariantList">25 <valuelist type="QVariantList"/>
26 <value type="QString">DYLD_LIBRARY_PATH=$(qextserialport)/src/build</value>
27 </valuelist>
28 </data>26 </data>
29 <data>27 <data>
30 <variable>RunConfiguration0-UserName</variable>28 <variable>RunConfiguration0-UserName</variable>
@@ -61,32 +59,42 @@
61 </valuemap>59 </valuemap>
62 </data>60 </data>
63 <data>61 <data>
62 <variable>buildConfiguration-Release</variable>
63 <valuemap type="QVariantMap">
64 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
65 <value key="QtVersionId" type="int">0</value>
66 <value key="ToolChain" type="int">0</value>
67 <value key="addQDumper" type=""></value>
68 <value key="buildConfiguration" type="int">2</value>
69 </valuemap>
70 </data>
71 <data>
64 <variable>buildconfiguration-Debug-buildstep0</variable>72 <variable>buildconfiguration-Debug-buildstep0</variable>
65 <valuemap type="QVariantMap">73 <valuemap type="QVariantMap">
66 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>74 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
67 <valuelist key="abstractProcess.Environment" type="QVariantList">75 <valuelist key="abstractProcess.Environment" type="QVariantList">
68 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-4XNpfV/Render</value>76 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
69 <value type="QString">COMMAND_MODE=unix2003</value>77 <value type="QString">COMMAND_MODE=unix2003</value>
70 <value type="QString">DISPLAY=/tmp/launch-s7Hnnm/:0</value>78 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
71 <value type="QString">HOME=/Users/jcman912</value>79 <value type="QString">HOME=/Users/jcman912</value>
72 <value type="QString">LOGNAME=jcman912</value>80 <value type="QString">LOGNAME=jcman912</value>
73 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>81 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
74 <value type="QString">QTDIR=/usr/local/Qt4.6</value>82 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
75 <value type="QString">SHELL=/bin/bash</value>83 <value type="QString">SHELL=/bin/bash</value>
76 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-jV3RpK/Listeners</value>84 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
77 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>85 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
78 <value type="QString">USER=jcman912</value>86 <value type="QString">USER=jcman912</value>
79 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>87 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
80 </valuelist>88 </valuelist>
81 <valuelist key="abstractProcess.arguments" type="QVariantList">89 <valuelist key="abstractProcess.arguments" type="QVariantList">
82 <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src/src.pro</value>90 <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src/src.pro</value>
83 <value type="QString">-spec</value>91 <value type="QString">-spec</value>
84 <value type="QString">macx-g++</value>92 <value type="QString">macx-g++</value>
85 <value type="QString">-r</value>93 <value type="QString">-r</value>
86 </valuelist>94 </valuelist>
87 <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value>95 <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value>
88 <value key="abstractProcess.enabled" type="bool">false</value>96 <value key="abstractProcess.enabled" type="bool">false</value>
89 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src</value>97 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src</value>
90 </valuemap>98 </valuemap>
91 </data>99 </data>
92 <data>100 <data>
@@ -94,15 +102,15 @@
94 <valuemap type="QVariantMap">102 <valuemap type="QVariantMap">
95 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>103 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
96 <valuelist key="abstractProcess.Environment" type="QVariantList">104 <valuelist key="abstractProcess.Environment" type="QVariantList">
97 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-4XNpfV/Render</value>105 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
98 <value type="QString">COMMAND_MODE=unix2003</value>106 <value type="QString">COMMAND_MODE=unix2003</value>
99 <value type="QString">DISPLAY=/tmp/launch-s7Hnnm/:0</value>107 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
100 <value type="QString">HOME=/Users/jcman912</value>108 <value type="QString">HOME=/Users/jcman912</value>
101 <value type="QString">LOGNAME=jcman912</value>109 <value type="QString">LOGNAME=jcman912</value>
102 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>110 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
103 <value type="QString">QTDIR=/usr/local/Qt4.6</value>111 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
104 <value type="QString">SHELL=/bin/bash</value>112 <value type="QString">SHELL=/bin/bash</value>
105 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-jV3RpK/Listeners</value>113 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
106 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>114 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
107 <value type="QString">USER=jcman912</value>115 <value type="QString">USER=jcman912</value>
108 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>116 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
@@ -113,7 +121,7 @@
113 </valuelist>121 </valuelist>
114 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>122 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
115 <value key="abstractProcess.enabled" type="bool">true</value>123 <value key="abstractProcess.enabled" type="bool">true</value>
116 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src</value>124 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src</value>
117 </valuemap>125 </valuemap>
118 </data>126 </data>
119 <data>127 <data>
@@ -121,37 +129,163 @@
121 <valuemap type="QVariantMap">129 <valuemap type="QVariantMap">
122 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>130 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
123 <valuelist key="abstractProcess.Environment" type="QVariantList">131 <valuelist key="abstractProcess.Environment" type="QVariantList">
124 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-D74XdB/Render</value>132 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
125 <value type="QString">COMMAND_MODE=unix2003</value>133 <value type="QString">COMMAND_MODE=unix2003</value>
126 <value type="QString">DISPLAY=/tmp/launch-NT9FlI/:0</value>134 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
127 <value type="QString">HOME=/Users/jcman912</value>135 <value type="QString">HOME=/Users/jcman912</value>
128 <value type="QString">LOGNAME=jcman912</value>136 <value type="QString">LOGNAME=jcman912</value>
129 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>137 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
130 <value type="QString">QTDIR=/usr/local/Qt4.6</value>138 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
131 <value type="QString">SHELL=/bin/bash</value>139 <value type="QString">SHELL=/bin/bash</value>
132 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-8Wa6tg/Listeners</value>140 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
133 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>141 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
134 <value type="QString">USER=jcman912</value>142 <value type="QString">USER=jcman912</value>
135 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>143 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
136 </valuelist>144 </valuelist>
137 <value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>145 <value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
138 <valuelist key="abstractProcess.arguments" type="QVariantList">146 <valuelist key="abstractProcess.arguments" type="QVariantList">
139 <value type="QString">clean</value>147 <value type="QString">clean</value>
140 <value type="QString">-w</value>148 <value type="QString">-w</value>
141 </valuelist>149 </valuelist>
142 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>150 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
143 <value key="abstractProcess.enabled" type="bool">true</value>151 <value key="abstractProcess.enabled" type="bool">true</value>
144 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src</value>152 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src</value>
145 <value key="cleanConfig" type="bool">true</value>153 <value key="cleanConfig" type="bool">true</value>
146 <valuelist key="makeargs" type="QVariantList">154 <valuelist key="makeargs" type="QVariantList">
147 <value type="QString">clean</value>155 <value type="QString">clean</value>
148 </valuelist>156 </valuelist>
157 </valuemap>
158 </data>
159 <data>
160 <variable>buildconfiguration-Debug-cleanstep1</variable>
161 <valuemap type="QVariantMap">
162 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
163 <valuelist key="abstractProcess.Environment" type="QVariantList">
164 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
165 <value type="QString">COMMAND_MODE=unix2003</value>
166 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
167 <value type="QString">HOME=/Users/jcman912</value>
168 <value type="QString">LOGNAME=jcman912</value>
169 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
170 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
171 <value type="QString">SHELL=/bin/bash</value>
172 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
173 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
174 <value type="QString">USER=jcman912</value>
175 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
176 </valuelist>
177 <valuelist key="abstractProcess.arguments" type="QVariantList">
178 <value type="QString">*</value>
179 </valuelist>
180 <value key="abstractProcess.command" type="QString">/bin/rm</value>
181 <value key="abstractProcess.enabled" type="bool">false</value>
182 <value key="abstractProcess.workingDirectory" type="QString">BUILDDIR</value>
183 <value key="workingDirectory" type="QString">BUILDDIR</value>
184 </valuemap>
185 </data>
186 <data>
187 <variable>buildconfiguration-Release-buildstep0</variable>
188 <valuemap type="QVariantMap">
189 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
190 <valuelist key="abstractProcess.Environment" type="QVariantList">
191 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
192 <value type="QString">COMMAND_MODE=unix2003</value>
193 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
194 <value type="QString">HOME=/Users/jcman912</value>
195 <value type="QString">LOGNAME=jcman912</value>
196 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
197 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
198 <value type="QString">SHELL=/bin/bash</value>
199 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
200 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
201 <value type="QString">USER=jcman912</value>
202 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
203 </valuelist>
204 <valuelist key="abstractProcess.arguments" type="QVariantList">
205 <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src/src.pro</value>
206 <value type="QString">-spec</value>
207 <value type="QString">macx-g++</value>
208 <value type="QString">-r</value>
209 <value type="QString">CONFIG+=release</value>
210 </valuelist>
211 <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value>
212 <value key="abstractProcess.enabled" type="bool">true</value>
213 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src</value>
214 <valuelist key="qmakeArgs" type="QVariantList">
215 <value type="QString">CONFIG+=release</value>
216 </valuelist>
217 </valuemap>
218 </data>
219 <data>
220 <variable>buildconfiguration-Release-buildstep1</variable>
221 <valuemap type="QVariantMap">
222 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
223 <valuelist key="abstractProcess.Environment" type="QVariantList">
224 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
225 <value type="QString">COMMAND_MODE=unix2003</value>
226 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
227 <value type="QString">HOME=/Users/jcman912</value>
228 <value type="QString">LOGNAME=jcman912</value>
229 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
230 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
231 <value type="QString">SHELL=/bin/bash</value>
232 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
233 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
234 <value type="QString">USER=jcman912</value>
235 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
236 </valuelist>
237 <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
238 <valuelist key="abstractProcess.arguments" type="QVariantList">
239 <value type="QString">-w</value>
240 </valuelist>
241 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
242 <value key="abstractProcess.enabled" type="bool">true</value>
243 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src</value>
244 </valuemap>
245 </data>
246 <data>
247 <variable>buildconfiguration-Release-cleanstep0</variable>
248 <valuemap type="QVariantMap">
249 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
250 <valuelist key="abstractProcess.Environment" type="QVariantList">
251 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
252 <value type="QString">COMMAND_MODE=unix2003</value>
253 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
254 <value type="QString">HOME=/Users/jcman912</value>
255 <value type="QString">LOGNAME=jcman912</value>
256 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
257 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
258 <value type="QString">SHELL=/bin/bash</value>
259 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
260 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
261 <value type="QString">USER=jcman912</value>
262 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
263 </valuelist>
264 <value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
265 <valuelist key="abstractProcess.arguments" type="QVariantList">
266 <value type="QString">clean</value>
267 <value type="QString">-w</value>
268 </valuelist>
269 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
270 <value key="abstractProcess.enabled" type="bool">true</value>
271 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src</value>
272 <value key="cleanConfig" type="bool">true</value>
273 <valuelist key="makeargs" type="QVariantList">
274 <value type="QString">clean</value>
275 </valuelist>
276 </valuemap>
277 </data>
278 <data>
279 <variable>buildconfiguration-Release-cleanstep1</variable>
280 <valuemap type="QVariantMap">
281 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
149 </valuemap>282 </valuemap>
150 </data>283 </data>
151 <data>284 <data>
152 <variable>buildconfigurations</variable>285 <variable>buildconfigurations</variable>
153 <valuelist type="QVariantList">286 <valuelist type="QVariantList">
154 <value type="QString">Debug</value>287 <value type="QString">Debug</value>
288 <value type="QString">Release</value>
155 </valuelist>289 </valuelist>
156 </data>290 </data>
157 <data>291 <data>
@@ -182,9 +316,16 @@
182 </valuemap>316 </valuemap>
183 </data>317 </data>
184 <data>318 <data>
319 <variable>cleanstep1</variable>
320 <valuemap type="QVariantMap">
321 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
322 </valuemap>
323 </data>
324 <data>
185 <variable>cleansteps</variable>325 <variable>cleansteps</variable>
186 <valuelist type="QVariantList">326 <valuelist type="QVariantList">
187 <value type="QString">trolltech.qt4projectmanager.make</value>327 <value type="QString">trolltech.qt4projectmanager.make</value>
328 <value type="QString">projectexplorer.processstep</value>
188 </valuelist>329 </valuelist>
189 </data>330 </data>
190 <data>331 <data>
191332
=== added file 'software/Common/POSIX LIBNMC.zip'
192Binary 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 differ333Binary 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
=== added file 'software/Duel Syringe - Model 2.config'
--- software/Duel Syringe - Model 2.config 1970-01-01 00:00:00 +0000
+++ software/Duel Syringe - Model 2.config 2010-08-07 00:08:43 +0000
@@ -0,0 +1,197 @@
1<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2<fabAtHomePrinter>
3 <!--Unit of distance is mm for all values.-->
4 <axis>
5 <!--The name of the axis. Must be unique among axes. Must be X.-->
6 <name>X</name>
7 <!--The name of the motor that controls this axis.-->
8 <motorName>motor0</motorName>
9 </axis>
10 <axis>
11 <!--The name of the axis. Must be unique among axes. Must be Y.-->
12 <name>Y</name>
13 <!--The name of the motor that controls this axis.-->
14 <motorName>motor1</motorName>
15 </axis>
16 <axis>
17 <!--The name of the axis. Must be unique among axes. Must be Z.-->
18 <name>Z</name>
19 <!--The name of the motor that controls this axis.-->
20 <motorName>motor2</motorName>
21 </axis>
22 <tool>
23 <bay>
24 <!--The name of the bay. Must be unique among bays. Must be Bay 0.-->
25 <name>Bay 0</name>
26 <!--The name of the motor that controls this bay or blank if no motor controls this bay.-->
27 <motorName>motor3</motorName>
28 <location>
29 <x>0</x>
30 <y>0</y>
31 <z>0</z>
32 </location>
33 </bay>
34 <bay>
35 <!--The name of the bay. Must be unique among bays. Must be Bay 0.-->
36 <name>Bay 1</name>
37 <!--The name of the motor that controls this bay or blank if no motor controls this bay.-->
38 <motorName>motor4</motorName>
39 <location>
40 <x>0</x>
41 <y>33</y>
42 <z>0</z>
43 </location>
44 </bay>
45 </tool>
46 <motion>
47 <!--Distance that platform moves downwards when pause, cancel, or complete print.-->
48 <platformDelta>40</platformDelta>
49 <!--Magic constant from line 58 of FabAtHomeParameters.h in model 1 code. Used to calculate values for pushout and suckback.-->
50 <oldMsps>5000</oldMsps>
51 </motion>
52 <electronics>
53 <!--Number of modules that are connected to printer.-->
54 <numModules>5</numModules>
55 <!--COM port that printer is connected to.-->
56 <comPort>4</comPort>
57 <!--Baud rate.-->
58 <baudRate>19200</baudRate>
59 <!--Group address of motors that control axes.-->
60 <xyzGroupAddress>128</xyzGroupAddress>
61 <motor>
62 <name>motor0</name>
63 <!--Address of the motor.-->
64 <address>1</address>
65 <!--Counts to move one unit of distance.-->
66 <countsPerDistanceUnit>236.239</countsPerDistanceUnit>
67 <!--Kp value of motor gains.-->
68 <kp>2200</kp>
69 <!--Kd value of motor gains.-->
70 <kd>30000</kd>
71 <!--Ki value of motor gains.-->
72 <ki>0</ki>
73 <!--IL value of motor gains.-->
74 <il>16000</il>
75 <!--OL value of motor gains.-->
76 <ol>255</ol>
77 <!--CL value of motor gains.-->
78 <cl>0</cl>
79 <!--EL value of motor gains.-->
80 <el>32767</el>
81 <!--SR value of motor gains.-->
82 <sr>1</sr>
83 <!--DB value of motor gains.-->
84 <db>0</db>
85 <!--Ticks per second.-->
86 <ticksPerSecond>1953.125</ticksPerSecond>
87 </motor>
88 <motor>
89 <name>motor1</name>
90 <!--Address of the motor.-->
91 <address>2</address>
92 <!--Counts to move one unit of distance.-->
93 <countsPerDistanceUnit>285.714</countsPerDistanceUnit>
94 <!--Kp value of motor gains.-->
95 <kp>1200</kp>
96 <!--Kd value of motor gains.-->
97 <kd>23000</kd>
98 <!--Ki value of motor gains.-->
99 <ki>0</ki>
100 <!--IL value of motor gains.-->
101 <il>16000</il>
102 <!--OL value of motor gains.-->
103 <ol>255</ol>
104 <!--CL value of motor gains.-->
105 <cl>0</cl>
106 <!--EL value of motor gains.-->
107 <el>32767</el>
108 <!--SR value of motor gains.-->
109 <sr>1</sr>
110 <!--DB value of motor gains.-->
111 <db>0</db>
112 <!--Ticks per second.-->
113 <ticksPerSecond>1953.125</ticksPerSecond>
114 </motor>
115 <motor>
116 <name>motor2</name>
117 <!--Address of the motor.-->
118 <address>3</address>
119 <!--Counts to move one unit of distance.-->
120 <countsPerDistanceUnit>284.900</countsPerDistanceUnit>
121 <!--Kp value of motor gains.-->
122 <kp>1000</kp>
123 <!--Kd value of motor gains.-->
124 <kd>20000</kd>
125 <!--Ki value of motor gains.-->
126 <ki>0</ki>
127 <!--IL value of motor gains.-->
128 <il>16000</il>
129 <!--OL value of motor gains.-->
130 <ol>255</ol>
131 <!--CL value of motor gains.-->
132 <cl>0</cl>
133 <!--EL value of motor gains.-->
134 <el>32767</el>
135 <!--SR value of motor gains.-->
136 <sr>1</sr>
137 <!--DB value of motor gains.-->
138 <db>0</db>
139 <!--Ticks per second.-->
140 <ticksPerSecond>1953.125</ticksPerSecond>
141 </motor>
142 <motor>
143 <name>motor3</name>
144 <!--Address of the motor.-->
145 <address>4</address>
146 <!--Counts to move one unit of distance.-->
147 <countsPerDistanceUnit>17409.1142</countsPerDistanceUnit>
148 <!--Kp value of motor gains.-->
149 <kp>1800</kp>
150 <!--Kd value of motor gains.-->
151 <kd>16000</kd>
152 <!--Ki value of motor gains.-->
153 <ki>0</ki>
154 <!--IL value of motor gains.-->
155 <il>0</il>
156 <!--OL value of motor gains.-->
157 <ol>255</ol>
158 <!--CL value of motor gains.-->
159 <cl>0</cl>
160 <!--EL value of motor gains.-->
161 <el>32767</el>
162 <!--SR value of motor gains.-->
163 <sr>1</sr>
164 <!--DB value of motor gains.-->
165 <db>0</db>
166 <!--Ticks per second.-->
167 <ticksPerSecond>1953.125</ticksPerSecond>
168 </motor>
169 <motor>
170 <name>motor4</name>
171 <!--Address of the motor.-->
172 <address>5</address>
173 <!--Counts to move one unit of distance.-->
174 <countsPerDistanceUnit>17409.1142</countsPerDistanceUnit>
175 <!--Kp value of motor gains.-->
176 <kp>1800</kp>
177 <!--Kd value of motor gains.-->
178 <kd>16000</kd>
179 <!--Ki value of motor gains.-->
180 <ki>0</ki>
181 <!--IL value of motor gains.-->
182 <il>0</il>
183 <!--OL value of motor gains.-->
184 <ol>255</ol>
185 <!--CL value of motor gains.-->
186 <cl>0</cl>
187 <!--EL value of motor gains.-->
188 <el>32767</el>
189 <!--SR value of motor gains.-->
190 <sr>1</sr>
191 <!--DB value of motor gains.-->
192 <db>0</db>
193 <!--Ticks per second.-->
194 <ticksPerSecond>1953.125</ticksPerSecond>
195 </motor>
196 </electronics>
197</fabAtHomePrinter>
0\ No newline at end of file198\ No newline at end of file
1199
=== modified file 'software/FabInterpreter/.DS_Store'
2Binary files software/FabInterpreter/.DS_Store 2010-07-12 23:00:59 +0000 and software/FabInterpreter/.DS_Store 2010-08-07 00:08:43 +0000 differ200Binary 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
=== modified file 'software/FabInterpreter/FabAtHomePrinter.cpp'
--- software/FabInterpreter/FabAtHomePrinter.cpp 2010-07-23 20:12:14 +0000
+++ software/FabInterpreter/FabAtHomePrinter.cpp 2010-08-07 00:08:43 +0000
@@ -1,5 +1,4 @@
1#include "FabAtHomePrinter.h"1#include "FabAtHomePrinter.h"
2#include <QDebug>
32
4////////////////////////////////////////////////////////////////////////////////////////////////////////////////3////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5FabAtHomePrinter::FabAtHomePrinter():4FabAtHomePrinter::FabAtHomePrinter():
@@ -9,6 +8,7 @@
9 initialized(false),8 initialized(false),
10 printing(false),9 printing(false),
11 paused(false),10 paused(false),
11 pauseSemaphore(0),
12 displayText((string)"")12 displayText((string)"")
13{13{
14}14}
@@ -26,8 +26,6 @@
26 //Connect to printer.26 //Connect to printer.
27 stringstream ss;27 stringstream ss;
2828
29 //TODO: change this so you can read in from posix
30 //ss << "COM" << COM_PORT;
31 ss << portLocation;29 ss << portLocation;
32 unsigned int numModulesFound = NmcInit(const_cast<char*>(ss.str().c_str()), BAUD_RATE);30 unsigned int numModulesFound = NmcInit(const_cast<char*>(ss.str().c_str()), BAUD_RATE);
33 if(numModulesFound < NUM_MODULES)31 if(numModulesFound < NUM_MODULES)
@@ -52,7 +50,10 @@
52////////////////////////////////////////////////////////////////////////////////////////////////////////////////50////////////////////////////////////////////////////////////////////////////////////////////////////////////////
53void FabAtHomePrinter::pausePrint()51void FabAtHomePrinter::pausePrint()
54{52{
55 pausePrintFlag = true;53 if (this->state().compare("PAUSED") == 0)
54 pauseSemaphore.release();
55 else
56 pausePrintFlag = true;
56}57}
57////////////////////////////////////////////////////////////////////////////////////////////////////////////////58////////////////////////////////////////////////////////////////////////////////////////////////////////////////
58void FabAtHomePrinter::cancelPrint()59void FabAtHomePrinter::cancelPrint()
@@ -94,7 +95,6 @@
94 {95 {
95 i->second.resetPosition();96 i->second.resetPosition();
96 }97 }
97 qDebug() << "acceleration: " << (float) PRINT_ACCELERATION;
98 return98 return
99 axes["X"].motor->setGroup(X_Y_Z_GROUP_ADDRESS, true)99 axes["X"].motor->setGroup(X_Y_Z_GROUP_ADDRESS, true)
100 && axes["Y"].motor->setGroup(X_Y_Z_GROUP_ADDRESS, false)100 && axes["Y"].motor->setGroup(X_Y_Z_GROUP_ADDRESS, false)
@@ -165,11 +165,18 @@
165 string base = "fabAtHomePrinter 0\\axis "+Util::toString(i)+"\\";165 string base = "fabAtHomePrinter 0\\axis "+Util::toString(i)+"\\";
166 string name = parser.text(base+"name 0");166 string name = parser.text(base+"name 0");
167 string motorName = parser.text(base+"motorName 0");167 string motorName = parser.text(base+"motorName 0");
168 map<string, Motor, LessThanString>::iterator motor = motors.find(motorName);
168 if(motors.find(motorName) == motors.end())169 if(motors.find(motorName) == motors.end())
169 {170 {
170 return "Axis "+name+" references motor "+motorName+" which has not been loaded.";171 return "Axis "+name+" references motor "+motorName+" which has not been loaded.";
171 }172 }
172 axes[name] = Axis(name,&(motors.find(motorName)->second));173
174 //THIS IS WHERE YOU REVERSE THE AXIS
175 if(name.compare("Y") == 0 /*|| name.compare("Z") == 0 */) //CHANGE MADE in v0.1 z should now be pos for down neg for up
176 {
177 motor->second.setReversed(true);
178 }
179 axes[name] = Axis(name,&(motor->second));
173 }180 }
174181
175 //Check that axes named X, Y, and Z were loaded.182 //Check that axes named X, Y, and Z were loaded.
@@ -209,6 +216,10 @@
209 return "Must load at least one bay.";216 return "Must load at least one bay.";
210 }217 }
211218
219 //if the total number of axis motors and bay motors does not equal NUM_MODULES declared in the config file
220 if (tool.bays.size() + axes.size() != NUM_MODULES)
221 return "Invalid number of motors";
222
212 return "";223 return "";
213}224}
214////////////////////////////////////////////////////////////////////////////////////////////////////////////////225////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -241,66 +252,7 @@
241 PRINT_ACCELERATION = Util::assertType<double>(child->FirstChild()->Value());252 PRINT_ACCELERATION = Util::assertType<double>(child->FirstChild()->Value());
242 }253 }
243 }254 }
244
245 return "";255 return "";
246/*
247 XMLParser parser;
248 string result = parser.load(filePath);
249 if(result.compare("") != 0)
250 {
251 return result;
252 }
253
254 //Clear previously loaded data.
255 materialCalibrations.clear();
256 model.paths.clear();
257
258 PRINT_ACCELERATION = Util::assertType<double>(parser.text("fabAtHomePrinter 0\\printAcceleration 0"));
259
260 //Load material calibrations.
261 unsigned int count = parser.count("fabAtHomePrinter 0\\materialCalibration");
262 for(unsigned int i = 0; i < count; ++i)
263 {
264 string base = "fabAtHomePrinter 0\\materialCalibration "+Util::toString(i)+"\\";
265 string name = parser.text(base+"name 0");
266 double pathSpeed = Util::assertType<double>(parser.text(base+"pathSpeed 0"));
267 double pathWidth = Util::assertType<double>(parser.text(base+"pathWidth 0"));
268 double depositionRate = Util::assertType<double>(parser.text(base+"depositionRate 0"));
269 double pushout = Util::assertType<double>(parser.text(base+"pushout 0"));
270 double suckback = Util::assertType<double>(parser.text(base+"suckback 0"));
271 double suckbackDelay = Util::assertType<double>(parser.text(base+"suckbackDelay 0"));
272 double clearance = Util::assertType<double>(parser.text(base+"clearance 0"));
273 int pausePaths = Util::assertType<int>(parser.text(base+"pausePaths 0"));
274 double pitch = Util::assertType<double>(parser.text(base+"pitch 0"));
275 materialCalibrations[name] = MaterialCalibration(name,pathSpeed,pathWidth,depositionRate,pushout,suckback,suckbackDelay,clearance,pausePaths,pitch);
276 }
277
278 //Load paths.
279 unsigned int pathCount = parser.count("fabAtHomePrinter 0\\path");
280 for(unsigned int i = 0; i < pathCount; ++i)
281 {
282 string iBase = "fabAtHomePrinter 0\\path "+Util::toString(i)+"\\";
283 string materialCalibrationName = parser.text(iBase+"materialCalibrationName 0");
284 if(materialCalibrations.find(materialCalibrationName) == materialCalibrations.end())
285 {
286 return "A path references material calibration "+materialCalibrationName+" which has not been loaded.";
287 }
288 vector<Point> points;
289 unsigned int pointCount = parser.count(iBase+"point");
290 for(unsigned int j = 0; j < pointCount; ++j)
291 {
292 string jBase = iBase+"point "+Util::toString(j)+"\\";
293 double x = Util::assertType<double>(parser.text(jBase+"x 0"));
294 double y = Util::assertType<double>(parser.text(jBase+"y 0"));
295 double z = Util::assertType<double>(parser.text(jBase+"z 0"));
296 points.push_back(Point(x,y,z));
297 }
298 model.paths.push_back(Path(&(materialCalibrations[materialCalibrationName]),points));
299 }
300
301 return "";
302 */
303
304}256}
305string FabAtHomePrinter::state()257string FabAtHomePrinter::state()
306{258{
@@ -362,7 +314,7 @@
362 if(strcmp(child->Value(), "point") == 0)314 if(strcmp(child->Value(), "point") == 0)
363 {315 {
364 double x = Util::assertType<double>(child->FirstChild("x")->FirstChild()->Value());316 double x = Util::assertType<double>(child->FirstChild("x")->FirstChild()->Value());
365 double y = Util::assertType<double>(child->FirstChild("y")->FirstChild()->Value());317 double y = -Util::assertType<double>(child->FirstChild("y")->FirstChild()->Value());
366 double z = Util::assertType<double>(child->FirstChild("z")->FirstChild()->Value());318 double z = Util::assertType<double>(child->FirstChild("z")->FirstChild()->Value());
367 points.push_back(Point(x,y,z));319 points.push_back(Point(x,y,z));
368 }320 }
@@ -392,7 +344,10 @@
392 pausePathPoints.push_back(Point(start.x, start.y, start.z + PLATFORM_DELTA));344 pausePathPoints.push_back(Point(start.x, start.y, start.z + PLATFORM_DELTA));
393 executePath(Path(NULL,pausePathPoints),NULL,false);345 executePath(Path(NULL,pausePathPoints),NULL,false);
394 paused = true;346 paused = true;
347 printing = false;
395 callWarning("Execution has been paused. Press OK to resume execution.");348 callWarning("Execution has been paused. Press OK to resume execution.");
349 pauseSemaphore.acquire();
350 printing = true;
396 paused = false;351 paused = false;
397 //Move the platform up.352 //Move the platform up.
398 pausePathPoints.clear();353 pausePathPoints.clear();
@@ -415,21 +370,20 @@
415370
416void FabAtHomePrinter::print()371void FabAtHomePrinter::print()
417{372{
418 paused = false;373 //Timer t;
374 //t.start();
419 printing = true;375 printing = true;
420 pausePrintFlag = false;376 pausePrintFlag = false;
421 cancelPrintFlag = false;377 cancelPrintFlag = false;
422 redoPathFlag = false;378 redoPathFlag = false;
423 if (!initializePathMode())379 initializePathMode();
424 qDebug() << "failed to initialize path parameters";380 int currentPath = 0;
425 unsigned int i = 0;381 reportProgress(currentPath, displayText.c_str());
426 reportProgress(i, displayText.c_str());
427
428382
429 //Iterate through the loaded paths and execute them.383 //Iterate through the loaded paths and execute them.
430 while(i < model.paths.size())384 while(currentPath < model.paths.size())
431 {385 {
432 Path path = model.paths[i]; //Copy construct the path to be executed.386 Path path = model.paths[currentPath]; //Copy construct the path to be executed.
433387
434388
435 //Find a bay with the required material calibration.389 //Find a bay with the required material calibration.
@@ -454,7 +408,7 @@
454 //Update the display text.408 //Update the display text.
455409
456 displayText = "Executing setup path.";410 displayText = "Executing setup path.";
457 reportProgress(i, displayText.c_str());411 reportProgress(currentPath, displayText.c_str());
458412
459 //Move from the current position to the beginning of the current path.413 //Move from the current position to the beginning of the current path.
460 Point start(axes["X"].motor->getPosition(), axes["Y"].motor->getPosition(), axes["Z"].motor->getPosition()); //The current position.414 Point start(axes["X"].motor->getPosition(), axes["Y"].motor->getPosition(), axes["Z"].motor->getPosition()); //The current position.
@@ -463,8 +417,8 @@
463417
464 //Update the display text.418 //Update the display text.
465419
466 displayText = "Executing path "+Util::toString<int>(i+1)+" of "+Util::toString<int>(model.paths.size())+".";420 displayText = "Executing path "+Util::toString<int>(currentPath+1)+" of "+Util::toString<int>(model.paths.size())+".";
467 reportProgress(i, displayText.c_str());421 reportProgress(currentPath, displayText.c_str());
468422
469423
470 //Execute the current path.424 //Execute the current path.
@@ -496,8 +450,8 @@
496 else450 else
497 {451 {
498 //Move on to the next path.452 //Move on to the next path.
499 ++i;453 currentPath++;
500 reportProgress(i, displayText.c_str());454 reportProgress(currentPath, displayText.c_str());
501 }455 }
502 }456 }
503457
@@ -511,18 +465,22 @@
511 {465 {
512 displayText = "Fabrication successfully completed.";466 displayText = "Fabrication successfully completed.";
513 }467 }
514 reportProgress(i, displayText.c_str());468 reportProgress(currentPath, displayText.c_str());
515 //Execution has stopped. Move the platform down.469 //Execution has stopped. Move the platform down.
516 Point start(axes["X"].motor->getPosition(), axes["Y"].motor->getPosition(), axes["Z"].motor->getPosition()); //The current position.470 Point start(axes["X"].motor->getPosition(), axes["Y"].motor->getPosition(), axes["Z"].motor->getPosition()); //The current position.
517 Point end(start.x, start.y, start.z + PLATFORM_DELTA);471 Point end(start.x, start.y, start.z + PLATFORM_DELTA);
518 executeSetupPath(start,end,0);472 executeSetupPath(start,end,0);
519 printing = false;473 printing = false;
474 resetPos();
475 finishedPrinting();
476 //clock_t endTime = std::clock();
477 //t.stop();
478 //qDebug() << t.getTime() << " seconds";
520}479}
521480
522////////////////////////////////////////////////////////////////////////////////////////////////////////////////481////////////////////////////////////////////////////////////////////////////////////////////////////////////////
523void FabAtHomePrinter::executePath(const Path& path, Bay* bay, const bool flowDuringPath)482void FabAtHomePrinter::executePath(const Path& path, Bay* bay, const bool flowDuringPath)
524{483{
525 qDebug() << "executing path";
526 if(flowDuringPath)484 if(flowDuringPath)
527 {485 {
528 //Want to achieve a steady state during path execution so scale the path speed if necessary. Copied from model 1 code.486 //Want to achieve a steady state during path execution so scale the path speed if necessary. Copied from model 1 code.
@@ -588,12 +546,10 @@
588 axes["Y"].motor->waitMove();546 axes["Y"].motor->waitMove();
589 axes["Z"].motor->waitMove();547 axes["Z"].motor->waitMove();
590 }548 }
591 qDebug() << "done executing path";
592}549}
593////////////////////////////////////////////////////////////////////////////////////////////////////////////////550////////////////////////////////////////////////////////////////////////////////////////////////////////////////
594void 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)551void 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)
595{552{
596 qDebug() << "executing points";
597 int currIndex = 0;553 int currIndex = 0;
598 int res = -1;554 int res = -1;
599 bool flowStarted = false;555 bool flowStarted = false;
@@ -608,7 +564,6 @@
608 //The next index to be added to the segment list is the most recent index that was added to the segment list.564 //The next index to be added to the segment list is the most recent index that was added to the segment list.
609 currIndex = res;565 currIndex = res;
610 }566 }
611 qDebug() << "done executing points";
612}567}
613//////////////////////////////////////////////////////////////////////////////////////////////////////////////// 568////////////////////////////////////////////////////////////////////////////////////////////////////////////////
614int FabAtHomePrinter::fillSegmentList(const vector<Point>& points, const int startIndex)569int FabAtHomePrinter::fillSegmentList(const vector<Point>& points, const int startIndex)
@@ -637,40 +592,9 @@
637 return points.size()-1;592 return points.size()-1;
638}593}
639////////////////////////////////////////////////////////////////////////////////////////////////////////////////594////////////////////////////////////////////////////////////////////////////////////////////////////////////////
640//TODO: change mode so that the motor is set to "pathing" mode
641void FabAtHomePrinter::downloadSegmentList(Bay* bay, const bool startFlow, bool startSuckback, double pushoutDistance, double pushoutVelocity, double standardDistance, double standardVelocity, double suckbackDistance, double suckbackVelocity, const Point& suckbackPoint)595void FabAtHomePrinter::downloadSegmentList(Bay* bay, const bool startFlow, bool startSuckback, double pushoutDistance, double pushoutVelocity, double standardDistance, double standardVelocity, double suckbackDistance, double suckbackVelocity, const Point& suckbackPoint)
642{596{
643 qDebug() << "downloading seg list";597
644 /*
645 InitPath();
646 if(startFlow)
647 {
648 bay->motor->moveAbsolute(bay->motor->getCommandedPosition()-pushoutDistance,pushoutVelocity,PRINT_ACCELERATION); //Start pushout.
649 }
650 while(AddPathPoints() == -2) //Start movement.
651 {
652 }
653 if(startFlow)
654 {
655 bay->motor->waitMove(); //Wait for bay movement to finish.
656 bay->motor->moveAbsolute(bay->motor->getCommandedPosition()-standardDistance,standardVelocity,PRINT_ACCELERATION); //Start standard flow.
657 }
658 double xDiff, yDiff;
659 //Move points to the path pointer buffer while handling suckback.
660 while(AddPathPoints() != -1 || startSuckback)
661 {
662 if(startSuckback)
663 {
664 xDiff = suckbackPoint.x - axes["X"].motor->getPosition();
665 yDiff = suckbackPoint.y - axes["Y"].motor->getPosition();
666 if(xDiff*xDiff+yDiff*yDiff < 0.25)
667 {
668 bay->motor->moveAbsolute(bay->motor->getCommandedPosition()+suckbackDistance,suckbackVelocity,PRINT_ACCELERATION); //Start suckback.
669 startSuckback = false;
670 }
671 }
672 }
673 */
674 InitPath();598 InitPath();
675 if(startFlow)599 if(startFlow)
676 {600 {
@@ -687,13 +611,11 @@
687 //Move points to the path pointer buffer while handling suckback.611 //Move points to the path pointer buffer while handling suckback.
688 double currX, currY, xDiff, yDiff;612 double currX, currY, xDiff, yDiff;
689 bool doneAddingPoints = false;613 bool doneAddingPoints = false;
690 qDebug() << "adding points ";
691 while(!doneAddingPoints || startSuckback)614 while(!doneAddingPoints || startSuckback)
692 {615 {
693 if(!doneAddingPoints && AddPathPoints() == -1)616 if(!doneAddingPoints && AddPathPoints() == -1)
694 {617 {
695 doneAddingPoints = true;618 doneAddingPoints = true;
696 qDebug() << "done adding points";
697 }619 }
698 if(startSuckback)620 if(startSuckback)
699 {621 {
@@ -701,23 +623,22 @@
701 currY = axes["Y"].motor->getPosition();623 currY = axes["Y"].motor->getPosition();
702 xDiff = suckbackPoint.x - currX;624 xDiff = suckbackPoint.x - currX;
703 yDiff = suckbackPoint.y - currY;625 yDiff = suckbackPoint.y - currY;
626
704 if(xDiff*xDiff+yDiff*yDiff < 0.25)627 if(xDiff*xDiff+yDiff*yDiff < 0.25)
705 {628 {
706 bay->motor->moveAbsolute(bay->motor->getCommandedPosition()+suckbackDistance,suckbackVelocity,PRINT_ACCELERATION); //Start suckback.629 bay->motor->moveAbsolute(bay->motor->getCommandedPosition()+suckbackDistance,suckbackVelocity,PRINT_ACCELERATION); //Start suckback.
707 startSuckback = false;630 startSuckback = false;
708 qDebug() << "suckback done";
709 }631 }
632
710 }633 }
711 if(startSuckback && !axes["X"].motor->moving() && !axes["Y"].motor->moving() && !axes["Z"].motor->moving())634 if(startSuckback && !axes["X"].motor->moving() && !axes["Y"].motor->moving() && !axes["Z"].motor->moving())
712 {635 {
713 //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.636 //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.
714 bay->motor->moveAbsolute(bay->motor->getCommandedPosition()+suckbackDistance,suckbackVelocity,PRINT_ACCELERATION); //Start suckback.637 bay->motor->moveAbsolute(bay->motor->getCommandedPosition()+suckbackDistance,suckbackVelocity,PRINT_ACCELERATION); //Start suckback.
715 startSuckback = false;638 startSuckback = false;
716 qDebug() << "suckback done";
717 }639 }
718640
719 }641 }
720 qDebug() << "done download segment";
721}642}
722////////////////////////////////////////////////////////////////////////////////////////////////////////////////643////////////////////////////////////////////////////////////////////////////////////////////////////////////////
723bool FabAtHomePrinter::cleanUp()644bool FabAtHomePrinter::cleanUp()
@@ -733,6 +654,7 @@
733 }654 }
734 if(result)655 if(result)
735 {656 {
657 NmcShutdown();
736 initialized = false;658 initialized = false;
737 }659 }
738 }660 }
@@ -792,7 +714,7 @@
792}714}
793void FabAtHomePrinter::reset()715void FabAtHomePrinter::reset()
794{716{
795 NmcHardReset(0xFF);717 NmcHardReset(X_Y_Z_GROUP_ADDRESS);
796}718}
797719
798bool FabAtHomePrinter::isInitialized()720bool FabAtHomePrinter::isInitialized()
799721
=== modified file 'software/FabInterpreter/FabAtHomePrinter.h'
--- software/FabInterpreter/FabAtHomePrinter.h 2010-07-23 20:12:14 +0000
+++ software/FabInterpreter/FabAtHomePrinter.h 2010-08-07 00:08:43 +0000
@@ -8,10 +8,13 @@
8#include "Tool.h"8#include "Tool.h"
9//PIC-SERVO path header files9//PIC-SERVO path header files
10#include "path.h"10#include "path.h"
11#include "qdebug.h"
12#include <QSemaphore>
1113
12class FabAtHomePrinter : public QObject14class FabAtHomePrinter : public QObject
13{15{
14 Q_OBJECT16 Q_OBJECT
17
15 //CONSTANTS/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////18 //CONSTANTS/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
16private:19private:
17 byte X_Y_Z_GROUP_ADDRESS;20 byte X_Y_Z_GROUP_ADDRESS;
@@ -20,6 +23,7 @@
20 double PLATFORM_DELTA;23 double PLATFORM_DELTA;
21 double PRINT_ACCELERATION; //The acceleration that is used while printing. The unit of PRINT_ACCELERATION is U/(second^2).24 double PRINT_ACCELERATION; //The acceleration that is used while printing. The unit of PRINT_ACCELERATION is U/(second^2).
22 double OLD_MSPS; //Magic constant from line 58 of FabAtHomeParameters.h in model 1 code. Used to calculate values for pushout and suckback.25 double OLD_MSPS; //Magic constant from line 58 of FabAtHomeParameters.h in model 1 code. Used to calculate values for pushout and suckback.
26 QSemaphore pauseSemaphore; //A QSemaphore that is triggered once the current path has ended and the pause button was pressed
23 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////27 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
24private:28private:
25 Model model;29 Model model;
@@ -97,8 +101,12 @@
97 //Returns: "" iff successful or an error message.101 //Returns: "" iff successful or an error message.
98 string loadFabFile(string filePath);102 string loadFabFile(string filePath);
99103
104 /**
105 Returns the current state the printer is in out of "PRINTING," "IDLE," and "PAUSED"
106 */
100 string state();107 string state();
101108
109
102 //Initialize the printer.110 //Initialize the printer.
103 //Returns: "" if successful or an error message if failed.111 //Returns: "" if successful or an error message if failed.
104 string initialize(const string& configFilePath, string portLocation);112 string initialize(const string& configFilePath, string portLocation);
@@ -117,12 +125,19 @@
117 //Returns: True iff successful.125 //Returns: True iff successful.
118 bool cleanUp(void);126 bool cleanUp(void);
119127
128 /**
129 Performs a "hard reset" with the current motors under the XYZ group address
130 */
120 void reset();131 void reset();
121132
133 /**
134 Checks to see if the current printer configuration is initialized with a valid configuration
135 @return true if initialized, false otherwise
136 */
122 bool isInitialized();137 bool isInitialized();
123138
124 //The destructor.139 //The destructor.
125 ~FabAtHomePrinter(void);140 ~FabAtHomePrinter(void);
126141
127public slots:142public slots:
128143
@@ -141,17 +156,31 @@
141 //Force stops motors156 //Force stops motors
142 void stopMotors();157 void stopMotors();
143158
159 /**
160 Resets the positions of the axis motors
161 */
144 void resetPos();162 void resetPos();
145163
146signals:164signals:
147165
148 void GUI_reportProgress();166 /**
149167 A signal that is issued throughout the print job to update the status of the printer
150 void reportProgress(int, QString);168 @param i The current path
151169 @param str The current status of the printer to be printed to the screen
152 void callWarning(QString);170 */
153171 void reportProgress(int i, QString str);
154friend class GUIComponentsThread;172
173 /**
174 Triggers a signal to call a message box to the screen
175 @param str The text to be displayed in the message box
176 */
177 void callWarning(QString str);
178
179 /**
180 Issues a signal to mainwindow.cpp when done printing
181 */
182 void finishedPrinting();
183
155};184};
156185
157#endif //ndef FABATHOMEPRINTER_H186#endif //ndef FABATHOMEPRINTER_H
158187
=== added file 'software/FabInterpreter/Interpreter'
159Binary files software/FabInterpreter/Interpreter 1970-01-01 00:00:00 +0000 and software/FabInterpreter/Interpreter 2010-08-07 00:08:43 +0000 differ188Binary files software/FabInterpreter/Interpreter 1970-01-01 00:00:00 +0000 and software/FabInterpreter/Interpreter 2010-08-07 00:08:43 +0000 differ
=== modified file 'software/FabInterpreter/Interpreter.app/Contents/MacOS/Interpreter'
160Binary 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 differ189Binary 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
=== modified file 'software/FabInterpreter/Interpreter.pro'
--- software/FabInterpreter/Interpreter.pro 2010-07-23 20:12:14 +0000
+++ software/FabInterpreter/Interpreter.pro 2010-08-07 00:08:43 +0000
@@ -3,9 +3,10 @@
3# -------------------------------------------------3# -------------------------------------------------
4TARGET = Interpreter4TARGET = Interpreter
5TEMPLATE = app5TEMPLATE = app
6INCLUDEPATH += ../Common/JrKerr6INCLUDEPATH += ../Common/JrKerr \
7TARGETDEPS =7 ../Common/tinyxml
8#UI_DIR = ../8DESTDIR = .
9# UI_DIR = ../
9HEADERS += mainwindow.h \10HEADERS += mainwindow.h \
10 Point.h \11 Point.h \
11 InterpreterPath.h \12 InterpreterPath.h \
@@ -34,5 +35,6 @@
34 printthread.cpp \35 printthread.cpp \
35 guicomponentsthread.cpp36 guicomponentsthread.cpp
36FORMS += mainwindow.ui37FORMS += mainwindow.ui
38include("win_jrkerr.pro")
37include("jrkerr.pro")39include("jrkerr.pro")
38include("tinyxml.pro")40include("tinyxml.pro")
3941
=== modified file 'software/FabInterpreter/Interpreter.pro.user'
--- software/FabInterpreter/Interpreter.pro.user 2010-07-23 20:12:14 +0000
+++ software/FabInterpreter/Interpreter.pro.user 2010-08-07 00:08:43 +0000
@@ -1,20 +1,24 @@
1<!DOCTYPE QtCreatorProject>1<!DOCTYPE QtCreatorProject>
2<qtcreator>2<qtcreator>
3 <data>3 <data>
4 <variable>RunConfiguration0-Arguments</variable>
5 <valuelist type="QVariantList"/>
6 </data>
7 <data>
8 <variable>RunConfiguration0-BaseEnvironmentBase</variable>4 <variable>RunConfiguration0-BaseEnvironmentBase</variable>
9 <value type="int">1</value>5 <value type="int">2</value>
10 </data>6 </data>
11 <data>7 <data>
12 <variable>RunConfiguration0-Executable</variable>8 <variable>RunConfiguration0-CommandLineArguments</variable>
13 <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter/Interpreter.app</value>9 <valuelist type="QVariantList"/>
10 </data>
11 <data>
12 <variable>RunConfiguration0-ProFile</variable>
13 <value type="QString">Interpreter.pro</value>
14 </data>14 </data>
15 <data>15 <data>
16 <variable>RunConfiguration0-RunConfiguration.name</variable>16 <variable>RunConfiguration0-RunConfiguration.name</variable>
17 <value type="QString">Run /Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter/Interpreter.app</value>17 <value type="QString">Interpreter</value>
18 </data>
19 <data>
20 <variable>RunConfiguration0-UseDyldImageSuffix</variable>
21 <value type="bool">false</value>
18 </data>22 </data>
19 <data>23 <data>
20 <variable>RunConfiguration0-UseTerminal</variable>24 <variable>RunConfiguration0-UseTerminal</variable>
@@ -23,69 +27,23 @@
23 <data>27 <data>
24 <variable>RunConfiguration0-UserEnvironmentChanges</variable>28 <variable>RunConfiguration0-UserEnvironmentChanges</variable>
25 <valuelist type="QVariantList">29 <valuelist type="QVariantList">
26 <value type="QString">DYLD_LIBRARY_PATH=/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src/build/</value>30 <value type="QString">DYLD_LIBRARY_PATH=/Users/jcman912/Documents/Fab@Home/Interpreter/software/Common/JrKerr/src/build/</value>
27 </valuelist>31 </valuelist>
28 </data>32 </data>
29 <data>33 <data>
30 <variable>RunConfiguration0-UserName</variable>
31 <value type="QString"></value>
32 </data>
33 <data>
34 <variable>RunConfiguration0-UserSetName</variable>34 <variable>RunConfiguration0-UserSetName</variable>
35 <value type="bool">false</value>35 <value type="bool">false</value>
36 </data>36 </data>
37 <data>37 <data>
38 <variable>RunConfiguration0-WorkingDirectory</variable>38 <variable>RunConfiguration0-UserSetWorkingDirectory</variable>
39 <value type="QString">$BUILDDIR</value>39 <value type="bool">false</value>
40 </data>
41 <data>
42 <variable>RunConfiguration0-UserWorkingDirectory</variable>
43 <value type="QString"></value>
40 </data>44 </data>
41 <data>45 <data>
42 <variable>RunConfiguration0-type</variable>46 <variable>RunConfiguration0-type</variable>
43 <value type="QString">ProjectExplorer.CustomExecutableRunConfiguration</value>
44 </data>
45 <data>
46 <variable>RunConfiguration1-BaseEnvironmentBase</variable>
47 <value type="int">2</value>
48 </data>
49 <data>
50 <variable>RunConfiguration1-CommandLineArguments</variable>
51 <valuelist type="QVariantList"/>
52 </data>
53 <data>
54 <variable>RunConfiguration1-ProFile</variable>
55 <value type="QString">Interpreter.pro</value>
56 </data>
57 <data>
58 <variable>RunConfiguration1-RunConfiguration.name</variable>
59 <value type="QString">Interpreter</value>
60 </data>
61 <data>
62 <variable>RunConfiguration1-UseDyldImageSuffix</variable>
63 <value type="bool">false</value>
64 </data>
65 <data>
66 <variable>RunConfiguration1-UseTerminal</variable>
67 <value type="bool">false</value>
68 </data>
69 <data>
70 <variable>RunConfiguration1-UserEnvironmentChanges</variable>
71 <valuelist type="QVariantList">
72 <value type="QString">DYLD_LIBRARY_PATH=/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src/build</value>
73 </valuelist>
74 </data>
75 <data>
76 <variable>RunConfiguration1-UserSetName</variable>
77 <value type="bool">false</value>
78 </data>
79 <data>
80 <variable>RunConfiguration1-UserSetWorkingDirectory</variable>
81 <value type="bool">false</value>
82 </data>
83 <data>
84 <variable>RunConfiguration1-UserWorkingDirectory</variable>
85 <value type="QString"></value>
86 </data>
87 <data>
88 <variable>RunConfiguration1-type</variable>
89 <value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>47 <value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
90 </data>48 </data>
91 <data>49 <data>
@@ -122,28 +80,28 @@
122 <valuemap type="QVariantMap">80 <valuemap type="QVariantMap">
123 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>81 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
124 <valuelist key="abstractProcess.Environment" type="QVariantList">82 <valuelist key="abstractProcess.Environment" type="QVariantList">
125 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-Qfrwoi/Render</value>83 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
126 <value type="QString">COMMAND_MODE=unix2003</value>84 <value type="QString">COMMAND_MODE=unix2003</value>
127 <value type="QString">DISPLAY=/tmp/launch-KgZP25/:0</value>85 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
128 <value type="QString">HOME=/Users/jcman912</value>86 <value type="QString">HOME=/Users/jcman912</value>
129 <value type="QString">LOGNAME=jcman912</value>87 <value type="QString">LOGNAME=jcman912</value>
130 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>88 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
131 <value type="QString">QTDIR=/usr/local/Qt4.6</value>89 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
132 <value type="QString">SHELL=/bin/bash</value>90 <value type="QString">SHELL=/bin/bash</value>
133 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-baFiI1/Listeners</value>91 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
134 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>92 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
135 <value type="QString">USER=jcman912</value>93 <value type="QString">USER=jcman912</value>
136 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>94 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
137 </valuelist>95 </valuelist>
138 <valuelist key="abstractProcess.arguments" type="QVariantList">96 <valuelist key="abstractProcess.arguments" type="QVariantList">
139 <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter/Interpreter.pro</value>97 <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter/Interpreter.pro</value>
140 <value type="QString">-spec</value>98 <value type="QString">-spec</value>
141 <value type="QString">macx-g++</value>99 <value type="QString">macx-g++</value>
142 <value type="QString">-r</value>100 <value type="QString">-r</value>
143 </valuelist>101 </valuelist>
144 <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value>102 <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value>
145 <value key="abstractProcess.enabled" type="bool">false</value>103 <value key="abstractProcess.enabled" type="bool">false</value>
146 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter</value>104 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value>
147 <valuelist key="qmakeArgs" type="QVariantList"/>105 <valuelist key="qmakeArgs" type="QVariantList"/>
148 </valuemap>106 </valuemap>
149 </data>107 </data>
@@ -152,15 +110,15 @@
152 <valuemap type="QVariantMap">110 <valuemap type="QVariantMap">
153 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>111 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
154 <valuelist key="abstractProcess.Environment" type="QVariantList">112 <valuelist key="abstractProcess.Environment" type="QVariantList">
155 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-Qfrwoi/Render</value>113 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
156 <value type="QString">COMMAND_MODE=unix2003</value>114 <value type="QString">COMMAND_MODE=unix2003</value>
157 <value type="QString">DISPLAY=/tmp/launch-KgZP25/:0</value>115 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
158 <value type="QString">HOME=/Users/jcman912</value>116 <value type="QString">HOME=/Users/jcman912</value>
159 <value type="QString">LOGNAME=jcman912</value>117 <value type="QString">LOGNAME=jcman912</value>
160 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>118 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
161 <value type="QString">QTDIR=/usr/local/Qt4.6</value>119 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
162 <value type="QString">SHELL=/bin/bash</value>120 <value type="QString">SHELL=/bin/bash</value>
163 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-baFiI1/Listeners</value>121 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
164 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>122 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
165 <value type="QString">USER=jcman912</value>123 <value type="QString">USER=jcman912</value>
166 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>124 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
@@ -172,7 +130,7 @@
172 </valuelist>130 </valuelist>
173 <value key="abstractProcess.command" type="QString">/Developer/Tools/Qt/uic</value>131 <value key="abstractProcess.command" type="QString">/Developer/Tools/Qt/uic</value>
174 <value key="abstractProcess.enabled" type="bool">true</value>132 <value key="abstractProcess.enabled" type="bool">true</value>
175 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter</value>133 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value>
176 <value key="workingDirectory" type="QString">$BUILDDIR</value>134 <value key="workingDirectory" type="QString">$BUILDDIR</value>
177 </valuemap>135 </valuemap>
178 </data>136 </data>
@@ -181,15 +139,15 @@
181 <valuemap type="QVariantMap">139 <valuemap type="QVariantMap">
182 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>140 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
183 <valuelist key="abstractProcess.Environment" type="QVariantList">141 <valuelist key="abstractProcess.Environment" type="QVariantList">
184 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-Qfrwoi/Render</value>142 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
185 <value type="QString">COMMAND_MODE=unix2003</value>143 <value type="QString">COMMAND_MODE=unix2003</value>
186 <value type="QString">DISPLAY=/tmp/launch-KgZP25/:0</value>144 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
187 <value type="QString">HOME=/Users/jcman912</value>145 <value type="QString">HOME=/Users/jcman912</value>
188 <value type="QString">LOGNAME=jcman912</value>146 <value type="QString">LOGNAME=jcman912</value>
189 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>147 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
190 <value type="QString">QTDIR=/usr/local/Qt4.6</value>148 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
191 <value type="QString">SHELL=/bin/bash</value>149 <value type="QString">SHELL=/bin/bash</value>
192 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-baFiI1/Listeners</value>150 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
193 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>151 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
194 <value type="QString">USER=jcman912</value>152 <value type="QString">USER=jcman912</value>
195 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>153 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
@@ -200,7 +158,7 @@
200 </valuelist>158 </valuelist>
201 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>159 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
202 <value key="abstractProcess.enabled" type="bool">true</value>160 <value key="abstractProcess.enabled" type="bool">true</value>
203 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter</value>161 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value>
204 <valuelist key="makeargs" type="QVariantList"/>162 <valuelist key="makeargs" type="QVariantList"/>
205 </valuemap>163 </valuemap>
206 </data>164 </data>
@@ -209,15 +167,15 @@
209 <valuemap type="QVariantMap">167 <valuemap type="QVariantMap">
210 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>168 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
211 <valuelist key="abstractProcess.Environment" type="QVariantList">169 <valuelist key="abstractProcess.Environment" type="QVariantList">
212 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-Qfrwoi/Render</value>170 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
213 <value type="QString">COMMAND_MODE=unix2003</value>171 <value type="QString">COMMAND_MODE=unix2003</value>
214 <value type="QString">DISPLAY=/tmp/launch-KgZP25/:0</value>172 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
215 <value type="QString">HOME=/Users/jcman912</value>173 <value type="QString">HOME=/Users/jcman912</value>
216 <value type="QString">LOGNAME=jcman912</value>174 <value type="QString">LOGNAME=jcman912</value>
217 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>175 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
218 <value type="QString">QTDIR=/usr/local/Qt4.6</value>176 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
219 <value type="QString">SHELL=/bin/bash</value>177 <value type="QString">SHELL=/bin/bash</value>
220 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-baFiI1/Listeners</value>178 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
221 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>179 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
222 <value type="QString">USER=jcman912</value>180 <value type="QString">USER=jcman912</value>
223 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>181 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
@@ -229,7 +187,7 @@
229 </valuelist>187 </valuelist>
230 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>188 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
231 <value key="abstractProcess.enabled" type="bool">true</value>189 <value key="abstractProcess.enabled" type="bool">true</value>
232 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/FabInterpreter</value>190 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value>
233 <value key="makeCmd" type="QString"></value>191 <value key="makeCmd" type="QString"></value>
234 <valuelist key="makeargs" type="QVariantList">192 <valuelist key="makeargs" type="QVariantList">
235 <value type="QString">clean</value>193 <value type="QString">clean</value>
@@ -237,61 +195,121 @@
237 </valuemap>195 </valuemap>
238 </data>196 </data>
239 <data>197 <data>
240 <variable>buildconfiguration-Debug-cleanstep1</variable>
241 <valuemap type="QVariantMap">
242 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
243 <valuelist key="abstractProcess.Environment" type="QVariantList">
244 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-Qfrwoi/Render</value>
245 <value type="QString">COMMAND_MODE=unix2003</value>
246 <value type="QString">DISPLAY=/tmp/launch-KgZP25/:0</value>
247 <value type="QString">HOME=/Users/jcman912</value>
248 <value type="QString">LOGNAME=jcman912</value>
249 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
250 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
251 <value type="QString">SHELL=/bin/bash</value>
252 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-baFiI1/Listeners</value>
253 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
254 <value type="QString">USER=jcman912</value>
255 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
256 </valuelist>
257 <valuelist key="abstractProcess.arguments" type="QVariantList">
258 <value type="QString">-f</value>
259 <value type="QString">*</value>
260 </valuelist>
261 <value key="abstractProcess.command" type="QString">/bin/rm</value>
262 <value key="abstractProcess.enabled" type="bool">true</value>
263 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src/build</value>
264 <value key="workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Updated/Interpreter/software/Common/JrKerr/src/build</value>
265 </valuemap>
266 </data>
267 <data>
268 <variable>buildconfiguration-Release-buildstep0</variable>198 <variable>buildconfiguration-Release-buildstep0</variable>
269 <valuemap type="QVariantMap">199 <valuemap type="QVariantMap">
270 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>200 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
201 <valuelist key="abstractProcess.Environment" type="QVariantList">
202 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
203 <value type="QString">COMMAND_MODE=unix2003</value>
204 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
205 <value type="QString">HOME=/Users/jcman912</value>
206 <value type="QString">LOGNAME=jcman912</value>
207 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
208 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
209 <value type="QString">SHELL=/bin/bash</value>
210 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
211 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
212 <value type="QString">USER=jcman912</value>
213 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
214 </valuelist>
215 <valuelist key="abstractProcess.arguments" type="QVariantList">
216 <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter/Interpreter.pro</value>
217 <value type="QString">-spec</value>
218 <value type="QString">macx-g++</value>
219 <value type="QString">-r</value>
220 <value type="QString">CONFIG+=release</value>
221 </valuelist>
222 <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value>
223 <value key="abstractProcess.enabled" type="bool">false</value>
224 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value>
271 </valuemap>225 </valuemap>
272 </data>226 </data>
273 <data>227 <data>
274 <variable>buildconfiguration-Release-buildstep1</variable>228 <variable>buildconfiguration-Release-buildstep1</variable>
275 <valuemap type="QVariantMap">229 <valuemap type="QVariantMap">
276 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>230 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
231 <valuelist key="abstractProcess.Environment" type="QVariantList">
232 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
233 <value type="QString">COMMAND_MODE=unix2003</value>
234 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
235 <value type="QString">HOME=/Users/jcman912</value>
236 <value type="QString">LOGNAME=jcman912</value>
237 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
238 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
239 <value type="QString">SHELL=/bin/bash</value>
240 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
241 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
242 <value type="QString">USER=jcman912</value>
243 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
244 </valuelist>
245 <valuelist key="abstractProcess.arguments" type="QVariantList">
246 <value type="QString">mainwindow.ui</value>
247 <value type="QString">-o</value>
248 <value type="QString">ui_mainwindow.h</value>
249 </valuelist>
250 <value key="abstractProcess.command" type="QString">/Developer/Tools/Qt/uic</value>
251 <value key="abstractProcess.enabled" type="bool">true</value>
252 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value>
253 <value key="workingDirectory" type="QString">$BUILDDIR</value>
277 </valuemap>254 </valuemap>
278 </data>255 </data>
279 <data>256 <data>
280 <variable>buildconfiguration-Release-buildstep2</variable>257 <variable>buildconfiguration-Release-buildstep2</variable>
281 <valuemap type="QVariantMap">258 <valuemap type="QVariantMap">
282 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>259 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
260 <valuelist key="abstractProcess.Environment" type="QVariantList">
261 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-2ujASn/Render</value>
262 <value type="QString">COMMAND_MODE=unix2003</value>
263 <value type="QString">DISPLAY=/tmp/launch-G50hon/:0</value>
264 <value type="QString">HOME=/Users/jcman912</value>
265 <value type="QString">LOGNAME=jcman912</value>
266 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
267 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
268 <value type="QString">SHELL=/bin/bash</value>
269 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-tnIbII/Listeners</value>
270 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
271 <value type="QString">USER=jcman912</value>
272 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
273 </valuelist>
274 <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
275 <valuelist key="abstractProcess.arguments" type="QVariantList">
276 <value type="QString">-w</value>
277 </valuelist>
278 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
279 <value key="abstractProcess.enabled" type="bool">true</value>
280 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value>
283 </valuemap>281 </valuemap>
284 </data>282 </data>
285 <data>283 <data>
286 <variable>buildconfiguration-Release-cleanstep0</variable>284 <variable>buildconfiguration-Release-cleanstep0</variable>
287 <valuemap type="QVariantMap">285 <valuemap type="QVariantMap">
288 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>286 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
289 </valuemap>287 <valuelist key="abstractProcess.Environment" type="QVariantList">
290 </data>288 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-yszs7Y/Render</value>
291 <data>289 <value type="QString">COMMAND_MODE=unix2003</value>
292 <variable>buildconfiguration-Release-cleanstep1</variable>290 <value type="QString">DISPLAY=/tmp/launch-KnoFzX/:0</value>
293 <valuemap type="QVariantMap">291 <value type="QString">HOME=/Users/jcman912</value>
294 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>292 <value type="QString">LOGNAME=jcman912</value>
293 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
294 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
295 <value type="QString">SHELL=/bin/bash</value>
296 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-qLeScv/Listeners</value>
297 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
298 <value type="QString">USER=jcman912</value>
299 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
300 </valuelist>
301 <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
302 <valuelist key="abstractProcess.arguments" type="QVariantList">
303 <value type="QString">clean</value>
304 <value type="QString">-w</value>
305 </valuelist>
306 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
307 <value key="abstractProcess.enabled" type="bool">true</value>
308 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter/software/FabInterpreter</value>
309 <value key="makeCmd" type="QString"></value>
310 <valuelist key="makeargs" type="QVariantList">
311 <value type="QString">clean</value>
312 </valuelist>
295 </valuemap>313 </valuemap>
296 </data>314 </data>
297 <data>315 <data>
@@ -336,16 +354,9 @@
336 </valuemap>354 </valuemap>
337 </data>355 </data>
338 <data>356 <data>
339 <variable>cleanstep1</variable>
340 <valuemap type="QVariantMap">
341 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
342 </valuemap>
343 </data>
344 <data>
345 <variable>cleansteps</variable>357 <variable>cleansteps</variable>
346 <valuelist type="QVariantList">358 <valuelist type="QVariantList">
347 <value type="QString">trolltech.qt4projectmanager.make</value>359 <value type="QString">trolltech.qt4projectmanager.make</value>
348 <value type="QString">projectexplorer.processstep</value>
349 </valuelist>360 </valuelist>
350 </data>361 </data>
351 <data>362 <data>
352363
=== modified file 'software/FabInterpreter/Makefile'
--- software/FabInterpreter/Makefile 2010-07-23 20:12:14 +0000
+++ software/FabInterpreter/Makefile 2010-08-07 00:08:43 +0000
@@ -1,6 +1,6 @@
1#############################################################################1#############################################################################
2# Makefile for building: Interpreter.app/Contents/MacOS/Interpreter2# Makefile for building: Interpreter.app/Contents/MacOS/Interpreter
3# Generated by qmake (2.01a) (Qt 4.6.3) on: Fri Jul 23 10:28:33 20103# Generated by qmake (2.01a) (Qt 4.6.3) on: Thu Aug 5 14:50:42 2010
4# Project: Interpreter.pro4# Project: Interpreter.pro
5# Template: app5# Template: app
6# Command: /usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile Interpreter.pro6# Command: /usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile Interpreter.pro
@@ -13,7 +13,7 @@
13DEFINES = -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED13DEFINES = -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
14CFLAGS = -pipe -g -gdwarf-2 -arch i386 -Wall -W $(DEFINES)14CFLAGS = -pipe -g -gdwarf-2 -arch i386 -Wall -W $(DEFINES)
15CXXFLAGS = -pipe -g -gdwarf-2 -arch i386 -Wall -W $(DEFINES)15CXXFLAGS = -pipe -g -gdwarf-2 -arch i386 -Wall -W $(DEFINES)
16INCPATH = -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/Frameworks16INCPATH = -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
17LINK = g++17LINK = g++
18LFLAGS = -headerpad_max_install_names -arch i38618LFLAGS = -headerpad_max_install_names -arch i386
19LIBS = $(SUBLIBS) -F/Library/Frameworks -L../Common/JrKerr/src/build -L/Library/Frameworks -lqextserialportd -framework QtGui -framework QtCore 19LIBS = $(SUBLIBS) -F/Library/Frameworks -L../Common/JrKerr/src/build -L/Library/Frameworks -lqextserialportd -framework QtGui -framework QtCore
@@ -66,7 +66,8 @@
66 ../Common/tinyxml/tinyxml.cpp \66 ../Common/tinyxml/tinyxml.cpp \
67 ../Common/tinyxml/tinyxmlerror.cpp \67 ../Common/tinyxml/tinyxmlerror.cpp \
68 ../Common/tinyxml/tinyxmlparser.cpp moc_mainwindow.cpp \68 ../Common/tinyxml/tinyxmlparser.cpp moc_mainwindow.cpp \
69 moc_FabAtHomePrinter.cpp69 moc_FabAtHomePrinter.cpp \
70 moc_guicomponentsthread.cpp
70OBJECTS = main.o \71OBJECTS = main.o \
71 Point.o \72 Point.o \
72 InterpreterPath.o \73 InterpreterPath.o \
@@ -90,7 +91,8 @@
90 tinyxmlerror.o \91 tinyxmlerror.o \
91 tinyxmlparser.o \92 tinyxmlparser.o \
92 moc_mainwindow.o \93 moc_mainwindow.o \
93 moc_FabAtHomePrinter.o94 moc_FabAtHomePrinter.o \
95 moc_guicomponentsthread.o
94DIST = /usr/local/Qt4.6/mkspecs/common/unix.conf \96DIST = /usr/local/Qt4.6/mkspecs/common/unix.conf \
95 /usr/local/Qt4.6/mkspecs/common/mac.conf \97 /usr/local/Qt4.6/mkspecs/common/mac.conf \
96 /usr/local/Qt4.6/mkspecs/common/mac-g++.conf \98 /usr/local/Qt4.6/mkspecs/common/mac-g++.conf \
@@ -263,13 +265,11 @@
263265
264compiler_objective_c_make_all:266compiler_objective_c_make_all:
265compiler_objective_c_clean:267compiler_objective_c_clean:
266compiler_moc_header_make_all: moc_mainwindow.cpp moc_FabAtHomePrinter.cpp268compiler_moc_header_make_all: moc_mainwindow.cpp moc_FabAtHomePrinter.cpp moc_guicomponentsthread.cpp
267compiler_moc_header_clean:269compiler_moc_header_clean:
268 -$(DEL_FILE) moc_mainwindow.cpp moc_FabAtHomePrinter.cpp270 -$(DEL_FILE) moc_mainwindow.cpp moc_FabAtHomePrinter.cpp moc_guicomponentsthread.cpp
269moc_mainwindow.cpp: Util.h \271moc_mainwindow.cpp: Util.h \
270 ../Common/JrKerr/nmccom.h \272 ../Common/JrKerr/nmccom.h \
271 ../Common/tinyxml/tinyxml.h \
272 ../Common/tinyxml/tinystr.h \
273 Axis.h \273 Axis.h \
274 Motor.h \274 Motor.h \
275 ../Common/JrKerr/path.h \275 ../Common/JrKerr/path.h \
@@ -291,8 +291,6 @@
291 Motor.h \291 Motor.h \
292 Util.h \292 Util.h \
293 ../Common/JrKerr/nmccom.h \293 ../Common/JrKerr/nmccom.h \
294 ../Common/tinyxml/tinyxml.h \
295 ../Common/tinyxml/tinystr.h \
296 ../Common/JrKerr/path.h \294 ../Common/JrKerr/path.h \
297 ../Common/JrKerr/picservo.h \295 ../Common/JrKerr/picservo.h \
298 Model.h \296 Model.h \
@@ -304,6 +302,22 @@
304 FabAtHomePrinter.h302 FabAtHomePrinter.h
305 /Developer/Tools/Qt/moc $(DEFINES) $(INCPATH) -D__APPLE__ -D__GNUC__ FabAtHomePrinter.h -o moc_FabAtHomePrinter.cpp303 /Developer/Tools/Qt/moc $(DEFINES) $(INCPATH) -D__APPLE__ -D__GNUC__ FabAtHomePrinter.h -o moc_FabAtHomePrinter.cpp
306304
305moc_guicomponentsthread.cpp: FabAtHomePrinter.h \
306 Axis.h \
307 Motor.h \
308 Util.h \
309 ../Common/JrKerr/nmccom.h \
310 ../Common/JrKerr/path.h \
311 ../Common/JrKerr/picservo.h \
312 Model.h \
313 InterpreterPath.h \
314 Point.h \
315 Tool.h \
316 Bay.h \
317 MaterialCalibration.h \
318 guicomponentsthread.h
319 /Developer/Tools/Qt/moc $(DEFINES) $(INCPATH) -D__APPLE__ -D__GNUC__ guicomponentsthread.h -o moc_guicomponentsthread.cpp
320
307compiler_rcc_make_all:321compiler_rcc_make_all:
308compiler_rcc_clean:322compiler_rcc_clean:
309compiler_image_collection_make_all: qmake_image_collection.cpp323compiler_image_collection_make_all: qmake_image_collection.cpp
@@ -332,8 +346,6 @@
332main.o: main.cpp mainwindow.h \346main.o: main.cpp mainwindow.h \
333 Util.h \347 Util.h \
334 ../Common/JrKerr/nmccom.h \348 ../Common/JrKerr/nmccom.h \
335 ../Common/tinyxml/tinyxml.h \
336 ../Common/tinyxml/tinystr.h \
337 Axis.h \349 Axis.h \
338 Motor.h \350 Motor.h \
339 ../Common/JrKerr/path.h \351 ../Common/JrKerr/path.h \
@@ -352,16 +364,12 @@
352364
353Point.o: Point.cpp Point.h \365Point.o: Point.cpp Point.h \
354 Util.h \366 Util.h \
355 ../Common/JrKerr/nmccom.h \367 ../Common/JrKerr/nmccom.h
356 ../Common/tinyxml/tinyxml.h \
357 ../Common/tinyxml/tinystr.h
358 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Point.o Point.cpp368 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Point.o Point.cpp
359369
360InterpreterPath.o: InterpreterPath.cpp InterpreterPath.h \370InterpreterPath.o: InterpreterPath.cpp InterpreterPath.h \
361 Util.h \371 Util.h \
362 ../Common/JrKerr/nmccom.h \372 ../Common/JrKerr/nmccom.h \
363 ../Common/tinyxml/tinyxml.h \
364 ../Common/tinyxml/tinystr.h \
365 Point.h \373 Point.h \
366 Tool.h \374 Tool.h \
367 Bay.h \375 Bay.h \
@@ -374,8 +382,6 @@
374Motor.o: Motor.cpp Motor.h \382Motor.o: Motor.cpp Motor.h \
375 Util.h \383 Util.h \
376 ../Common/JrKerr/nmccom.h \384 ../Common/JrKerr/nmccom.h \
377 ../Common/tinyxml/tinyxml.h \
378 ../Common/tinyxml/tinystr.h \
379 ../Common/JrKerr/path.h \385 ../Common/JrKerr/path.h \
380 ../Common/JrKerr/picservo.h386 ../Common/JrKerr/picservo.h
381 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Motor.o Motor.cpp387 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Motor.o Motor.cpp
@@ -383,8 +389,6 @@
383Model.o: Model.cpp Model.h \389Model.o: Model.cpp Model.h \
384 Util.h \390 Util.h \
385 ../Common/JrKerr/nmccom.h \391 ../Common/JrKerr/nmccom.h \
386 ../Common/tinyxml/tinyxml.h \
387 ../Common/tinyxml/tinystr.h \
388 InterpreterPath.h \392 InterpreterPath.h \
389 Point.h \393 Point.h \
390 Tool.h \394 Tool.h \
@@ -397,9 +401,7 @@
397401
398MaterialCalibration.o: MaterialCalibration.cpp MaterialCalibration.h \402MaterialCalibration.o: MaterialCalibration.cpp MaterialCalibration.h \
399 Util.h \403 Util.h \
400 ../Common/JrKerr/nmccom.h \404 ../Common/JrKerr/nmccom.h
401 ../Common/tinyxml/tinyxml.h \
402 ../Common/tinyxml/tinystr.h
403 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o MaterialCalibration.o MaterialCalibration.cpp405 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o MaterialCalibration.o MaterialCalibration.cpp
404406
405FabAtHomePrinter.o: FabAtHomePrinter.cpp FabAtHomePrinter.h \407FabAtHomePrinter.o: FabAtHomePrinter.cpp FabAtHomePrinter.h \
@@ -407,8 +409,6 @@
407 Motor.h \409 Motor.h \
408 Util.h \410 Util.h \
409 ../Common/JrKerr/nmccom.h \411 ../Common/JrKerr/nmccom.h \
410 ../Common/tinyxml/tinyxml.h \
411 ../Common/tinyxml/tinystr.h \
412 ../Common/JrKerr/path.h \412 ../Common/JrKerr/path.h \
413 ../Common/JrKerr/picservo.h \413 ../Common/JrKerr/picservo.h \
414 Model.h \414 Model.h \
@@ -423,8 +423,6 @@
423 Motor.h \423 Motor.h \
424 Util.h \424 Util.h \
425 ../Common/JrKerr/nmccom.h \425 ../Common/JrKerr/nmccom.h \
426 ../Common/tinyxml/tinyxml.h \
427 ../Common/tinyxml/tinystr.h \
428 ../Common/JrKerr/path.h \426 ../Common/JrKerr/path.h \
429 ../Common/JrKerr/picservo.h \427 ../Common/JrKerr/picservo.h \
430 Point.h \428 Point.h \
@@ -435,8 +433,6 @@
435 Motor.h \433 Motor.h \
436 Util.h \434 Util.h \
437 ../Common/JrKerr/nmccom.h \435 ../Common/JrKerr/nmccom.h \
438 ../Common/tinyxml/tinyxml.h \
439 ../Common/tinyxml/tinystr.h \
440 ../Common/JrKerr/path.h \436 ../Common/JrKerr/path.h \
441 ../Common/JrKerr/picservo.h437 ../Common/JrKerr/picservo.h
442 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Axis.o Axis.cpp438 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Axis.o Axis.cpp
@@ -444,8 +440,6 @@
444Tool.o: Tool.cpp Tool.h \440Tool.o: Tool.cpp Tool.h \
445 Util.h \441 Util.h \
446 ../Common/JrKerr/nmccom.h \442 ../Common/JrKerr/nmccom.h \
447 ../Common/tinyxml/tinyxml.h \
448 ../Common/tinyxml/tinystr.h \
449 Bay.h \443 Bay.h \
450 Motor.h \444 Motor.h \
451 ../Common/JrKerr/path.h \445 ../Common/JrKerr/path.h \
@@ -457,8 +451,6 @@
457mainwindow.o: mainwindow.cpp mainwindow.h \451mainwindow.o: mainwindow.cpp mainwindow.h \
458 Util.h \452 Util.h \
459 ../Common/JrKerr/nmccom.h \453 ../Common/JrKerr/nmccom.h \
460 ../Common/tinyxml/tinyxml.h \
461 ../Common/tinyxml/tinystr.h \
462 Axis.h \454 Axis.h \
463 Motor.h \455 Motor.h \
464 ../Common/JrKerr/path.h \456 ../Common/JrKerr/path.h \
@@ -481,8 +473,6 @@
481 Motor.h \473 Motor.h \
482 Util.h \474 Util.h \
483 ../Common/JrKerr/nmccom.h \475 ../Common/JrKerr/nmccom.h \
484 ../Common/tinyxml/tinyxml.h \
485 ../Common/tinyxml/tinystr.h \
486 ../Common/JrKerr/path.h \476 ../Common/JrKerr/path.h \
487 ../Common/JrKerr/picservo.h \477 ../Common/JrKerr/picservo.h \
488 Model.h \478 Model.h \
@@ -499,8 +489,6 @@
499 Motor.h \489 Motor.h \
500 Util.h \490 Util.h \
501 ../Common/JrKerr/nmccom.h \491 ../Common/JrKerr/nmccom.h \
502 ../Common/tinyxml/tinyxml.h \
503 ../Common/tinyxml/tinystr.h \
504 ../Common/JrKerr/path.h \492 ../Common/JrKerr/path.h \
505 ../Common/JrKerr/picservo.h \493 ../Common/JrKerr/picservo.h \
506 Model.h \494 Model.h \
@@ -555,6 +543,9 @@
555moc_FabAtHomePrinter.o: moc_FabAtHomePrinter.cpp 543moc_FabAtHomePrinter.o: moc_FabAtHomePrinter.cpp
556 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_FabAtHomePrinter.o moc_FabAtHomePrinter.cpp544 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_FabAtHomePrinter.o moc_FabAtHomePrinter.cpp
557545
546moc_guicomponentsthread.o: moc_guicomponentsthread.cpp
547 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_guicomponentsthread.o moc_guicomponentsthread.cpp
548
558####### Install549####### Install
559550
560install: FORCE551install: FORCE
561552
=== modified file 'software/FabInterpreter/Motor.cpp'
--- software/FabInterpreter/Motor.cpp 2010-07-23 20:12:14 +0000
+++ software/FabInterpreter/Motor.cpp 2010-08-07 00:08:43 +0000
@@ -1,194 +1,192 @@
1#include "Motor.h"1#include "Motor.h"
2////////////////////////////////////////////////////////////////////////////////////////////////////////////////2////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3Motor::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):3Motor::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):
4initialized(false),4 initialized(false),
5commandedPosition(0.0),5 commandedPosition(0.0),
6isReversed(false),6 isReversed(false),
7NAME(name),7 NAME(name),
8ADDRESS(address),8 ADDRESS(address),
9COUNTS_PER_U(countsPerU),9 COUNTS_PER_U(countsPerU),
10TICKS_PER_SECOND(ticksPerSecond),10 TICKS_PER_SECOND(ticksPerSecond),
11KP(kp),11 KP(kp),
12KD(kd),12 KD(kd),
13KI(ki),13 KI(ki),
14IL(il),14 IL(il),
15OL(ol),15 OL(ol),
16CL(cl),16 CL(cl),
17EL(el),17 EL(el),
18SR(sr),18 SR(sr),
19DB(db),19 DB(db),
20MIN_COMMANDED_POSITION(-2147483648.0/countsPerU),20 MIN_COMMANDED_POSITION(-2147483648.0/countsPerU),
21MAX_COMMANDED_POSITION(2147483647.0/countsPerU),21 MAX_COMMANDED_POSITION(2147483647.0/countsPerU),
22MIN_COMMANDED_VELOCITY(0.0),22 MIN_COMMANDED_VELOCITY(0.0),
23MAX_COMMANDED_VELOCITY(2500000.0/countsPerU),23 MAX_COMMANDED_VELOCITY(2500000.0/countsPerU),
24MIN_COMMANDED_ACCELERATION(0.0),24 MIN_COMMANDED_ACCELERATION(0.0),
25MAX_COMMANDED_ACCELERATION(125000000000.0/countsPerU)25 MAX_COMMANDED_ACCELERATION(125000000000.0/countsPerU)
26{26{
27}27}
28////////////////////////////////////////////////////////////////////////////////////////////////////////////////28////////////////////////////////////////////////////////////////////////////////////////////////////////////////
29Motor::Motor():29Motor::Motor():
30initialized(false)30 initialized(false)
31{31{
32}32}
33////////////////////////////////////////////////////////////////////////////////////////////////////////////////33////////////////////////////////////////////////////////////////////////////////////////////////////////////////
34void Motor::updateData()34void Motor::updateData()
35{35{
36 NmcNoOp(ADDRESS);36 NmcNoOp(ADDRESS);
37}37}
38////////////////////////////////////////////////////////////////////////////////////////////////////////////////38////////////////////////////////////////////////////////////////////////////////////////////////////////////////
39void Motor::setReversed(bool isReversed)39void Motor::setReversed(bool isReversed)
40{40{
41 this->isReversed = isReversed;41 this->isReversed = isReversed;
42}42}
43////////////////////////////////////////////////////////////////////////////////////////////////////////////////43////////////////////////////////////////////////////////////////////////////////////////////////////////////////
44double Motor::getPosition()44double Motor::getPosition()
45{45{
46 updateData();46 updateData();
47 return (isReversed ? -1 : 1) * ServoGetPos(ADDRESS) / COUNTS_PER_U; //Translate count to U.47 return (isReversed ? -1 : 1) * ServoGetPos(ADDRESS) / COUNTS_PER_U; //Translate count to U.
48}48}
49////////////////////////////////////////////////////////////////////////////////////////////////////////////////49////////////////////////////////////////////////////////////////////////////////////////////////////////////////
50double Motor::getCommandedPosition()50double Motor::getCommandedPosition()
51{51{
52 return commandedPosition;52 return commandedPosition;
53}53}
54////////////////////////////////////////////////////////////////////////////////////////////////////////////////54////////////////////////////////////////////////////////////////////////////////////////////////////////////////
55bool Motor::moveAbsolute(double position, double velocity, double acceleration)55bool Motor::moveAbsolute(double position, double velocity, double acceleration)
56{56{
57 //if reversed then switches position57 //if reversed then switches position
58 if(isReversed)58 if(isReversed)
59 {59 {
60 position *= -1;60 position *= -1;
61 }61 }
6262
63 //Checks command againsts given constraints63 //Checks command againsts given constraints
64 Util::assertTrue64 Util::assertTrue
65 (65 (
66 position >= MIN_COMMANDED_POSITION66 position >= MIN_COMMANDED_POSITION
67 && position <= MAX_COMMANDED_POSITION67 && position <= MAX_COMMANDED_POSITION
68 && velocity >= MIN_COMMANDED_VELOCITY68 && velocity >= MIN_COMMANDED_VELOCITY
69 && velocity <= MAX_COMMANDED_VELOCITY69 && velocity <= MAX_COMMANDED_VELOCITY
70 && acceleration >= MIN_COMMANDED_ACCELERATION70 && acceleration >= MIN_COMMANDED_ACCELERATION
71 && acceleration <= MAX_COMMANDED_ACCELERATION,71 && acceleration <= MAX_COMMANDED_ACCELERATION,
72 "Tried to issue a movement command with arguments that are out of bounds.",72 "Tried to issue a movement command with arguments that are out of bounds.",
73 __LINE__,__FILE__73 __LINE__,__FILE__
74 );74 );
7575
76 //sets the commanded position to the given position76 //sets the commanded position to the given position
77 commandedPosition = position;77 commandedPosition = position;
7878
79 return ServoLoadTraj79 return ServoLoadTraj
80 (80 (
81 ADDRESS,81 ADDRESS,
82 LOAD_POS | LOAD_VEL | LOAD_ACC | ENABLE_SERVO | START_NOW,82 LOAD_POS | LOAD_VEL | LOAD_ACC | ENABLE_SERVO | START_NOW,
83 (long)(position * COUNTS_PER_U), //Translate U to count.83 (int)(position * COUNTS_PER_U), //Translate U to count.
84 (long)(velocity * COUNTS_PER_U / TICKS_PER_SECOND * 65536), //Translate U/second to count/tick * 2^16.84 (int)(velocity * COUNTS_PER_U / TICKS_PER_SECOND * 65536), //Translate U/second to count/tick * 2^16.
85 (long)(acceleration * COUNTS_PER_U / (TICKS_PER_SECOND * TICKS_PER_SECOND) * 65536), //Translate U/(second^2) to count/(ticks^2) * 2^16.85 (int)(acceleration * COUNTS_PER_U / (TICKS_PER_SECOND * TICKS_PER_SECOND) * 65536), //Translate U/(second^2) to count/(ticks^2) * 2^16.
86 0 //pwm (no effect if not in pwm mode)86 0 //pwm (no effect if not in pwm mode)
87 ) == 1;87 ) == 1;
88}88}
89////////////////////////////////////////////////////////////////////////////////////////////////////////////////89////////////////////////////////////////////////////////////////////////////////////////////////////////////////
90bool Motor::moveRelative(double positionDelta, double velocity, double acceleration)90bool Motor::moveRelative(double positionDelta, double velocity, double acceleration)
91{91{
92 return moveAbsolute(getPosition()+positionDelta, velocity, acceleration);92 return moveAbsolute(getPosition()+positionDelta, velocity, acceleration);
93}93}
94////////////////////////////////////////////////////////////////////////////////////////////////////////////////94////////////////////////////////////////////////////////////////////////////////////////////////////////////////
95bool Motor::stop()95bool Motor::stop()
96{96{
97 return cleanUp();97 return cleanUp();
98}98}
99////////////////////////////////////////////////////////////////////////////////////////////////////////////////99////////////////////////////////////////////////////////////////////////////////////////////////////////////////
100bool Motor::setGroup(byte groupAddress, bool isLeader)100bool Motor::setGroup(byte groupAddress, bool isLeader)
101{101{
102 return NmcSetGroupAddr(ADDRESS, groupAddress, isLeader) == 1;102 return NmcSetGroupAddr(ADDRESS, groupAddress, isLeader) == 1;
103}103}
104////////////////////////////////////////////////////////////////////////////////////////////////////////////////104////////////////////////////////////////////////////////////////////////////////////////////////////////////////
105bool Motor::resetPosition()105bool Motor::resetPosition()
106{106{
107 ServoResetPos(ADDRESS);107 ServoResetPos(ADDRESS);
108 commandedPosition = 0.0;108 commandedPosition = 0.0;
109 return true;109 return true;
110}110}
111////////////////////////////////////////////////////////////////////////////////////////////////////////////////111////////////////////////////////////////////////////////////////////////////////////////////////////////////////
112bool Motor::moving()112bool Motor::moving()
113{113{
114 updateData(); //updates the motor info114 updateData(); //updates the motor info
115 byte auxByte = ServoGetAux(ADDRESS);115 byte auxByte = ServoGetAux(ADDRESS);
116 bool pathMoving = (auxByte & PATH_MODE) != (char)0;116 bool pathMoving = (auxByte & PATH_MODE) != 0;
117 byte statbyte = NmcGetStat(ADDRESS);117 byte statbyte = NmcGetStat(ADDRESS);
118 bool nonPathMoving = !(statbyte & MOVE_DONE);118 bool nonPathMoving = !(statbyte & MOVE_DONE);
119 return pathMoving || nonPathMoving;119 return pathMoving || nonPathMoving;
120}120}
121////////////////////////////////////////////////////////////////////////////////////////////////////////////////121////////////////////////////////////////////////////////////////////////////////////////////////////////////////
122void Motor::waitMove()122void Motor::waitMove()
123{123{
124 qDebug() << "waiting on " << ADDRESS;124 while(moving())
125 while(moving())125 {
126 {126 }
127 }
128}127}
129////////////////////////////////////////////////////////////////////////////////////////////////////////////////128////////////////////////////////////////////////////////////////////////////////////////////////////////////////
130string Motor::initialize()129string Motor::initialize()
131{130{
132131
133 if(!initialized)132 if(!initialized)
134 {133 {
135 stringstream ss;134 stringstream ss;
136 if(NmcGetModType(ADDRESS) != SERVOMODTYPE)135 if(NmcGetModType(ADDRESS) != SERVOMODTYPE)
137 {136 {
138 ss << "Motor with address " << ADDRESS << " is not a PIC-SERVO motor.";137 ss << "Motor with address " << ADDRESS << " is not a PIC-SERVO motor.";
139 return ss.str();138 return ss.str();
140 }139 }
141 usleep(51000);140 if(ServoSetGain(ADDRESS,KP,KD,KI,IL,OL,CL,EL,SR,DB) != 1)
142 if(ServoSetGain(ADDRESS,KP,KD,KI,IL,OL,CL,EL,SR,DB) != 1)141 {
143 {142 ss << "Failed to set gains for motor with address " << ADDRESS << ".";
144 ss << "Failed to set gains for motor with address " << ADDRESS << ".";143 return ss.str();
145 return ss.str();144 }
146 }145
147146 ServoStopMotor(ADDRESS, AMP_ENABLE | STOP_ABRUPT | ADV_FEATURE);
148 ServoStopMotor(ADDRESS, AMP_ENABLE | STOP_ABRUPT | ADV_FEATURE);147 NmcDefineStatus(ADDRESS, SEND_POS | SEND_NPOINTS | SEND_PERROR | SEND_AUX);
149 NmcDefineStatus(ADDRESS, SEND_POS | SEND_NPOINTS | SEND_PERROR | SEND_AUX);148
150149 if(!resetPosition())
151 if(!resetPosition())150 {
152 {151 ss << "Could not reset position for motor with address " << ADDRESS << ".";
153 ss << "Could not reset position for motor with address " << ADDRESS << ".";152 return ss.str();
154 return ss.str();153 }
155 }154 initialized = true;
156 initialized = true;155 }
157 }156 return "";
158 return "";
159}157}
160////////////////////////////////////////////////////////////////////////////////////////////////////////////////158////////////////////////////////////////////////////////////////////////////////////////////////////////////////
161bool Motor::cleanUp()159bool Motor::cleanUp()
162{160{
163 bool result;161 bool result;
164 if(initialized)162 if(initialized)
165 {163 {
166 result = ServoStopMotor(ADDRESS, STOP_ABRUPT | MOTOR_OFF) == 1 && NmcHardReset(ADDRESS) == 1;164 result = ServoStopMotor(ADDRESS, STOP_ABRUPT | MOTOR_OFF) == 1 && NmcHardReset(ADDRESS) == 1;
167 if(result)165 if(result)
168 {166 {
169 initialized = false;167 initialized = false;
170 }168 }
171 }169 }
172 else170 else
173 {171 {
174 result = true;172 result = true;
175 }173 }
176 return result;174 return result;
177}175}
178////////////////////////////////////////////////////////////////////////////////////////////////////////////////176////////////////////////////////////////////////////////////////////////////////////////////////////////////////
179byte Motor::getAddress(void)177byte Motor::getAddress(void)
180{178{
181 return ADDRESS;179 return ADDRESS;
182}180}
183////////////////////////////////////////////////////////////////////////////////////////////////////////////////181////////////////////////////////////////////////////////////////////////////////////////////////////////////////
184double Motor::getCountsPerU(void)182double Motor::getCountsPerU(void)
185{183{
186 return (isReversed ? -1 : 1) * COUNTS_PER_U;184 return (isReversed ? -1 : 1) * COUNTS_PER_U;
187}185}
188////////////////////////////////////////////////////////////////////////////////////////////////////////////////186////////////////////////////////////////////////////////////////////////////////////////////////////////////////
189Motor::~Motor()187Motor::~Motor()
190{188{
191 cleanUp();189 cleanUp();
192}190}
193////////////////////////////////////////////////////////////////////////////////////////////////////////////////191////////////////////////////////////////////////////////////////////////////////////////////////////////////////
194double Motor::getMinPosition()192double Motor::getMinPosition()
195193
=== modified file 'software/FabInterpreter/Motor.h'
--- software/FabInterpreter/Motor.h 2010-07-23 20:12:14 +0000
+++ software/FabInterpreter/Motor.h 2010-08-07 00:08:43 +0000
@@ -6,94 +6,92 @@
6#include "path.h"6#include "path.h"
7#include "picservo.h"7#include "picservo.h"
88
9#include <QDebug>
10
119
12class Motor10class Motor
13{11{
14//CONSTANTS/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////12 //CONSTANTS/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
15private:13private:
16 string NAME;14 string NAME;
17 byte ADDRESS; //The number of the motor port that this motor is plugged in.15 byte ADDRESS; //The number of the motor port that this motor is plugged in.
18 double COUNTS_PER_U; //Number of counts for 1 U of motion.16 double COUNTS_PER_U; //Number of counts for 1 U of motion.
19 double TICKS_PER_SECOND; //Number of ticks that a motor makes per second.17 double TICKS_PER_SECOND; //Number of ticks that a motor makes per second.
20 double MIN_COMMANDED_POSITION; //The minimum position that the motor can go to18 double MIN_COMMANDED_POSITION; //The minimum position that the motor can go to
21 double MAX_COMMANDED_POSITION; //The maxiumum position that the motor can go to19 double MAX_COMMANDED_POSITION; //The maxiumum position that the motor can go to
22 double MIN_COMMANDED_VELOCITY; //The minumum velocity the motor can travel at20 double MIN_COMMANDED_VELOCITY; //The minumum velocity the motor can travel at
23 double MAX_COMMANDED_VELOCITY; //The maximum velocity the motor can travel at21 double MAX_COMMANDED_VELOCITY; //The maximum velocity the motor can travel at
24 double MIN_COMMANDED_ACCELERATION; //The minimum acceleration of the motor22 double MIN_COMMANDED_ACCELERATION; //The minimum acceleration of the motor
25 double MAX_COMMANDED_ACCELERATION; //The maxiumum acceleration of the motor23 double MAX_COMMANDED_ACCELERATION; //The maxiumum acceleration of the motor
26 short KP, KD, KI, IL, EL; //Damping contraints (look up procedure for critically damping motors for more details, also JKerr has documentation)24 short KP, KD, KI, IL, EL; //Damping contraints (look up procedure for critically damping motors for more details, also JKerr has documentation)
27 byte OL, CL, SR, DB; //See JKerr's Document for more details on his motor bytes25 byte OL, CL, SR, DB; //See JKerr's Document for more details on his motor bytes
28//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////26 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
29private:27private:
30 double commandedPosition; //desired position of the motor28 double commandedPosition; //desired position of the motor
31 bool initialized; //true is motor is initialized and ready for us, false otherwise29 bool initialized; //true is motor is initialized and ready for us, false otherwise
32 bool isReversed; //true if motor direction is to be reversed from default values on controller board30 bool isReversed; //true if motor direction is to be reversed from default values on controller board
3331
34 //Tell hardware to send updated data for this motor to the DLL.32 //Tell hardware to send updated data for this motor to the DLL.
35 void updateData(void);33 void updateData(void);
3634
37public:35public:
38 Motor(void);36 Motor(void);
3937
40 //Creates a motor with all of the given values (described above)38 //Creates a motor with all of the given values (described above)
41 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);39 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);
4240
43 //Returns: The current position of the motor. The unit of position is U.41 //Returns: The current position of the motor. The unit of position is U.
44 double getPosition(void);42 double getPosition(void);
4543
46 double getMinPosition();44 double getMinPosition();
4745
48 double getMaxPosition();46 double getMaxPosition();
4947
50 //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.48 //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.
51 double getCommandedPosition(void);49 double getCommandedPosition(void);
5250
53 //Move to a position at a specified velocity and acceleration.51 //Move to a position at a specified velocity and acceleration.
54 //The unit of position is U, the unit of velocity is U/second, and the unit of acceleration is U/(second^2).52 //The unit of position is U, the unit of velocity is U/second, and the unit of acceleration is U/(second^2).
55 //Requires MIN_COMMANDED_POSITION <= position <= MAX_COMMANDED_POSITION, MIN_COMMANDED_VELOCITY <= velocity <= MAX_COMMANDED_VELOCITY, MIN_COMMANDED_ACCELERATION <= acceleration <= MAX_COMMANDED_ACCELERATION53 //Requires MIN_COMMANDED_POSITION <= position <= MAX_COMMANDED_POSITION, MIN_COMMANDED_VELOCITY <= velocity <= MAX_COMMANDED_VELOCITY, MIN_COMMANDED_ACCELERATION <= acceleration <= MAX_COMMANDED_ACCELERATION
56 //Returns true iff command was issued successfully.54 //Returns true iff command was issued successfully.
57 bool moveAbsolute(double position, double velocity, double acceleration);55 bool moveAbsolute(double position, double velocity, double acceleration);
5856
59 //Move relative to the current position at a specified velocity and acceleration.57 //Move relative to the current position at a specified velocity and acceleration.
60 //Returns true iff command was issued successfully.58 //Returns true iff command was issued successfully.
61 bool moveRelative(double positionDelta, double velocity, double acceleration);59 bool moveRelative(double positionDelta, double velocity, double acceleration);
6260
63 //Returns: True iff motor is currently moving.61 //Returns: True iff motor is currently moving.
64 bool moving(void);62 bool moving(void);
6563
66 //This function returns as soon as possible after the motor has finished moving.64 //This function returns as soon as possible after the motor has finished moving.
67 void waitMove(void);65 void waitMove(void);
6866
69 //Stops the motor67 //Stops the motor
70 bool stop(void);68 bool stop(void);
7169
72 //Set whether this motor is reversed. If a motor is reversed, movement commands will cause the motor to move in the opposite direction.70 //Set whether this motor is reversed. If a motor is reversed, movement commands will cause the motor to move in the opposite direction.
73 void setReversed(bool);71 void setReversed(bool);
7472
75 //sets the address of the motor on the controller board, see JKerr documentation for more details73 //sets the address of the motor on the controller board, see JKerr documentation for more details
76 bool setGroup(byte groupAddress, bool isLeader);74 bool setGroup(byte groupAddress, bool isLeader);
7775
78 //The motors current position is considered to be 0 and the motors commanded position is set to 0.76 //The motors current position is considered to be 0 and the motors commanded position is set to 0.
79 bool resetPosition(void);77 bool resetPosition(void);
8078
81 //Initialize the motor.79 //Initialize the motor.
82 //Returns: "" if successful or an error message if failed.80 //Returns: "" if successful or an error message if failed.
83 string initialize(void);81 string initialize(void);
8482
85 //gets the motor address from the controller board83 //gets the motor address from the controller board
86 byte getAddress(void);84 byte getAddress(void);
8785
88 //gets the ratio of counts of motor movement per real unit of measurement86 //gets the ratio of counts of motor movement per real unit of measurement
89 double getCountsPerU(void);87 double getCountsPerU(void);
9088
91 //Perform cleanup when done using motor.89 //Perform cleanup when done using motor.
92 //Returns: True iff successful.90 //Returns: True iff successful.
93 bool cleanUp(void);91 bool cleanUp(void);
9492
95 //The destructor.93 //The destructor.
96 ~Motor(void);94 ~Motor(void);
9795
98};96};
9997
10098
=== added directory 'software/FabInterpreter/Path_Tester'
=== added file 'software/FabInterpreter/Path_Tester/.DS_Store'
101Binary 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 differ99Binary 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
=== added file 'software/FabInterpreter/Path_Tester/Makefile'
--- software/FabInterpreter/Path_Tester/Makefile 1970-01-01 00:00:00 +0000
+++ software/FabInterpreter/Path_Tester/Makefile 2010-08-07 00:08:43 +0000
@@ -0,0 +1,271 @@
1#############################################################################
2# Makefile for building: Path_Tester
3# Generated by qmake (2.01a) (Qt 4.6.3) on: Wed Jul 28 14:08:54 2010
4# Project: Path_Tester.pro
5# Template: app
6# Command: /usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile Path_Tester.pro
7#############################################################################
8
9####### Compiler, tools and options
10
11CC = gcc
12CXX = g++
13DEFINES = -DQT_CORE_LIB -DQT_SHARED
14CFLAGS = -pipe -g -gdwarf-2 -arch i386 -Wall -W $(DEFINES)
15CXXFLAGS = -pipe -g -gdwarf-2 -arch i386 -Wall -W $(DEFINES)
16INCPATH = -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
17LINK = g++
18LFLAGS = -headerpad_max_install_names -arch i386
19LIBS = $(SUBLIBS) -F/Library/Frameworks -L../../Common/JrKerr/src/build -L/Library/Frameworks -lqextserialportd -framework QtCore
20AR = ar cq
21RANLIB = ranlib -s
22QMAKE = /usr/bin/qmake
23TAR = tar -cf
24COMPRESS = gzip -9f
25COPY = cp -f
26SED = sed
27COPY_FILE = cp -f
28COPY_DIR = cp -f -R
29STRIP =
30INSTALL_FILE = $(COPY_FILE)
31INSTALL_DIR = $(COPY_DIR)
32INSTALL_PROGRAM = $(COPY_FILE)
33DEL_FILE = rm -f
34SYMLINK = ln -f -s
35DEL_DIR = rmdir
36MOVE = mv -f
37CHK_DIR_EXISTS= test -d
38MKDIR = mkdir -p
39export MACOSX_DEPLOYMENT_TARGET = 10.4
40
41####### Output directory
42
43OBJECTS_DIR = ./
44
45####### Files
46
47SOURCES = main.cpp \
48 ../../Common/JrKerr/nmccom.cpp \
49 ../../Common/JrKerr/picio.cpp \
50 ../../Common/JrKerr/picservo.cpp \
51 ../../Common/JrKerr/picstep.cpp \
52 ../../Common/JrKerr/path.cpp
53OBJECTS = main.o \
54 nmccom.o \
55 picio.o \
56 picservo.o \
57 picstep.o \
58 path.o
59DIST = /usr/local/Qt4.6/mkspecs/common/unix.conf \
60 /usr/local/Qt4.6/mkspecs/common/mac.conf \
61 /usr/local/Qt4.6/mkspecs/common/mac-g++.conf \
62 /usr/local/Qt4.6/mkspecs/qconfig.pri \
63 /usr/local/Qt4.6/mkspecs/features/qt_functions.prf \
64 /usr/local/Qt4.6/mkspecs/features/qt_config.prf \
65 /usr/local/Qt4.6/mkspecs/features/exclusive_builds.prf \
66 /usr/local/Qt4.6/mkspecs/features/default_pre.prf \
67 /usr/local/Qt4.6/mkspecs/features/mac/default_pre.prf \
68 jrkerr.pro \
69 /usr/local/Qt4.6/mkspecs/features/mac/dwarf2.prf \
70 /usr/local/Qt4.6/mkspecs/features/debug.prf \
71 /usr/local/Qt4.6/mkspecs/features/default_post.prf \
72 /usr/local/Qt4.6/mkspecs/features/mac/default_post.prf \
73 /usr/local/Qt4.6/mkspecs/features/mac/x86.prf \
74 /usr/local/Qt4.6/mkspecs/features/mac/objective_c.prf \
75 /usr/local/Qt4.6/mkspecs/features/warn_on.prf \
76 /usr/local/Qt4.6/mkspecs/features/qt.prf \
77 /usr/local/Qt4.6/mkspecs/features/unix/thread.prf \
78 /usr/local/Qt4.6/mkspecs/features/moc.prf \
79 /usr/local/Qt4.6/mkspecs/features/mac/rez.prf \
80 /usr/local/Qt4.6/mkspecs/features/mac/sdk.prf \
81 /usr/local/Qt4.6/mkspecs/features/resources.prf \
82 /usr/local/Qt4.6/mkspecs/features/uic.prf \
83 /usr/local/Qt4.6/mkspecs/features/yacc.prf \
84 /usr/local/Qt4.6/mkspecs/features/lex.prf \
85 /usr/local/Qt4.6/mkspecs/features/include_source_dir.prf \
86 Path_Tester.pro
87QMAKE_TARGET = Path_Tester
88DESTDIR =
89TARGET = Path_Tester
90
91####### Custom Compiler Variables
92QMAKE_COMP_QMAKE_OBJECTIVE_CFLAGS = -pipe \
93 -g \
94 -gdwarf-2 \
95 -arch \
96 i386 \
97 -Wall \
98 -W
99
100
101first: all
102####### Implicit rules
103
104.SUFFIXES: .o .c .cpp .cc .cxx .C
105
106.cpp.o:
107 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
108
109.cc.o:
110 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
111
112.cxx.o:
113 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
114
115.C.o:
116 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
117
118.c.o:
119 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
120
121####### Build rules
122
123all: Makefile $(TARGET)
124
125$(TARGET): $(OBJECTS)
126 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
127
128Makefile: Path_Tester.pro /usr/local/Qt4.6/mkspecs/macx-g++/qmake.conf /usr/local/Qt4.6/mkspecs/common/unix.conf \
129 /usr/local/Qt4.6/mkspecs/common/mac.conf \
130 /usr/local/Qt4.6/mkspecs/common/mac-g++.conf \
131 /usr/local/Qt4.6/mkspecs/qconfig.pri \
132 /usr/local/Qt4.6/mkspecs/features/qt_functions.prf \
133 /usr/local/Qt4.6/mkspecs/features/qt_config.prf \
134 /usr/local/Qt4.6/mkspecs/features/exclusive_builds.prf \
135 /usr/local/Qt4.6/mkspecs/features/default_pre.prf \
136 /usr/local/Qt4.6/mkspecs/features/mac/default_pre.prf \
137 jrkerr.pro \
138 /usr/local/Qt4.6/mkspecs/features/mac/dwarf2.prf \
139 /usr/local/Qt4.6/mkspecs/features/debug.prf \
140 /usr/local/Qt4.6/mkspecs/features/default_post.prf \
141 /usr/local/Qt4.6/mkspecs/features/mac/default_post.prf \
142 /usr/local/Qt4.6/mkspecs/features/mac/x86.prf \
143 /usr/local/Qt4.6/mkspecs/features/mac/objective_c.prf \
144 /usr/local/Qt4.6/mkspecs/features/warn_on.prf \
145 /usr/local/Qt4.6/mkspecs/features/qt.prf \
146 /usr/local/Qt4.6/mkspecs/features/unix/thread.prf \
147 /usr/local/Qt4.6/mkspecs/features/moc.prf \
148 /usr/local/Qt4.6/mkspecs/features/mac/rez.prf \
149 /usr/local/Qt4.6/mkspecs/features/mac/sdk.prf \
150 /usr/local/Qt4.6/mkspecs/features/resources.prf \
151 /usr/local/Qt4.6/mkspecs/features/uic.prf \
152 /usr/local/Qt4.6/mkspecs/features/yacc.prf \
153 /usr/local/Qt4.6/mkspecs/features/lex.prf \
154 /usr/local/Qt4.6/mkspecs/features/include_source_dir.prf \
155 /Library/Frameworks/QtCore.framework/QtCore.prl
156 $(QMAKE) -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile Path_Tester.pro
157/usr/local/Qt4.6/mkspecs/common/unix.conf:
158/usr/local/Qt4.6/mkspecs/common/mac.conf:
159/usr/local/Qt4.6/mkspecs/common/mac-g++.conf:
160/usr/local/Qt4.6/mkspecs/qconfig.pri:
161/usr/local/Qt4.6/mkspecs/features/qt_functions.prf:
162/usr/local/Qt4.6/mkspecs/features/qt_config.prf:
163/usr/local/Qt4.6/mkspecs/features/exclusive_builds.prf:
164/usr/local/Qt4.6/mkspecs/features/default_pre.prf:
165/usr/local/Qt4.6/mkspecs/features/mac/default_pre.prf:
166jrkerr.pro:
167/usr/local/Qt4.6/mkspecs/features/mac/dwarf2.prf:
168/usr/local/Qt4.6/mkspecs/features/debug.prf:
169/usr/local/Qt4.6/mkspecs/features/default_post.prf:
170/usr/local/Qt4.6/mkspecs/features/mac/default_post.prf:
171/usr/local/Qt4.6/mkspecs/features/mac/x86.prf:
172/usr/local/Qt4.6/mkspecs/features/mac/objective_c.prf:
173/usr/local/Qt4.6/mkspecs/features/warn_on.prf:
174/usr/local/Qt4.6/mkspecs/features/qt.prf:
175/usr/local/Qt4.6/mkspecs/features/unix/thread.prf:
176/usr/local/Qt4.6/mkspecs/features/moc.prf:
177/usr/local/Qt4.6/mkspecs/features/mac/rez.prf:
178/usr/local/Qt4.6/mkspecs/features/mac/sdk.prf:
179/usr/local/Qt4.6/mkspecs/features/resources.prf:
180/usr/local/Qt4.6/mkspecs/features/uic.prf:
181/usr/local/Qt4.6/mkspecs/features/yacc.prf:
182/usr/local/Qt4.6/mkspecs/features/lex.prf:
183/usr/local/Qt4.6/mkspecs/features/include_source_dir.prf:
184/Library/Frameworks/QtCore.framework/QtCore.prl:
185qmake: FORCE
186 @$(QMAKE) -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile Path_Tester.pro
187
188dist:
189 @$(CHK_DIR_EXISTS) .tmp/Path_Tester1.0.0 || $(MKDIR) .tmp/Path_Tester1.0.0
190 $(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
191
192
193clean:compiler_clean
194 -$(DEL_FILE) $(OBJECTS)
195 -$(DEL_FILE) *~ core *.core
196
197
198####### Sub-libraries
199
200distclean: clean
201 -$(DEL_FILE) $(TARGET)
202 -$(DEL_FILE) Makefile
203
204
205check: first
206
207mocclean: compiler_moc_header_clean compiler_moc_source_clean
208
209mocables: compiler_moc_header_make_all compiler_moc_source_make_all
210
211compiler_objective_c_make_all:
212compiler_objective_c_clean:
213compiler_moc_header_make_all:
214compiler_moc_header_clean:
215compiler_rcc_make_all:
216compiler_rcc_clean:
217compiler_image_collection_make_all: qmake_image_collection.cpp
218compiler_image_collection_clean:
219 -$(DEL_FILE) qmake_image_collection.cpp
220compiler_moc_source_make_all:
221compiler_moc_source_clean:
222compiler_rez_source_make_all:
223compiler_rez_source_clean:
224compiler_uic_make_all:
225compiler_uic_clean:
226compiler_yacc_decl_make_all:
227compiler_yacc_decl_clean:
228compiler_yacc_impl_make_all:
229compiler_yacc_impl_clean:
230compiler_lex_make_all:
231compiler_lex_clean:
232compiler_clean:
233
234####### Compile
235
236main.o: main.cpp ../../Common/JrKerr/path.h \
237 ../../Common/JrKerr/picservo.h \
238 ../../Common/JrKerr/nmccom.h
239 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
240
241nmccom.o: ../../Common/JrKerr/nmccom.cpp ../../Common/JrKerr/nmccom.h \
242 ../../Common/JrKerr/picio.h \
243 ../../Common/JrKerr/picservo.h \
244 ../../Common/JrKerr/picstep.h
245 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o nmccom.o ../../Common/JrKerr/nmccom.cpp
246
247picio.o: ../../Common/JrKerr/picio.cpp ../../Common/JrKerr/nmccom.h \
248 ../../Common/JrKerr/picio.h
249 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o picio.o ../../Common/JrKerr/picio.cpp
250
251picservo.o: ../../Common/JrKerr/picservo.cpp ../../Common/JrKerr/nmccom.h \
252 ../../Common/JrKerr/picservo.h
253 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o picservo.o ../../Common/JrKerr/picservo.cpp
254
255picstep.o: ../../Common/JrKerr/picstep.cpp ../../Common/JrKerr/nmccom.h \
256 ../../Common/JrKerr/picstep.h
257 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o picstep.o ../../Common/JrKerr/picstep.cpp
258
259path.o: ../../Common/JrKerr/path.cpp ../../Common/JrKerr/path.h \
260 ../../Common/JrKerr/nmccom.h \
261 ../../Common/JrKerr/picservo.h
262 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o path.o ../../Common/JrKerr/path.cpp
263
264####### Install
265
266install: FORCE
267
268uninstall: FORCE
269
270FORCE:
271
0272
=== added file 'software/FabInterpreter/Path_Tester/Path_Tester'
1Binary 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 differ273Binary 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
=== added file 'software/FabInterpreter/Path_Tester/Path_Tester.pro'
--- software/FabInterpreter/Path_Tester/Path_Tester.pro 1970-01-01 00:00:00 +0000
+++ software/FabInterpreter/Path_Tester/Path_Tester.pro 2010-08-07 00:08:43 +0000
@@ -0,0 +1,21 @@
1#-------------------------------------------------
2#
3# Project created by QtCreator 2010-07-28T12:10:08
4#
5#-------------------------------------------------
6
7QT -= gui
8
9TARGET = Path_Tester
10CONFIG += console
11CONFIG -= app_bundle
12
13INCLUDEPATH += ../../Common/JrKerr
14
15
16TEMPLATE = app
17
18
19SOURCES += main.cpp
20
21include("jrkerr.pro")
022
=== added file 'software/FabInterpreter/Path_Tester/Path_Tester.pro.user'
--- software/FabInterpreter/Path_Tester/Path_Tester.pro.user 1970-01-01 00:00:00 +0000
+++ software/FabInterpreter/Path_Tester/Path_Tester.pro.user 2010-08-07 00:08:43 +0000
@@ -0,0 +1,228 @@
1<!DOCTYPE QtCreatorProject>
2<qtcreator>
3 <data>
4 <variable>RunConfiguration0-BaseEnvironmentBase</variable>
5 <value type="int">2</value>
6 </data>
7 <data>
8 <variable>RunConfiguration0-CommandLineArguments</variable>
9 <valuelist type="QVariantList"/>
10 </data>
11 <data>
12 <variable>RunConfiguration0-ProFile</variable>
13 <value type="QString">Path_Tester.pro</value>
14 </data>
15 <data>
16 <variable>RunConfiguration0-RunConfiguration.name</variable>
17 <value type="QString">Path_Tester</value>
18 </data>
19 <data>
20 <variable>RunConfiguration0-UseDyldImageSuffix</variable>
21 <value type="bool">false</value>
22 </data>
23 <data>
24 <variable>RunConfiguration0-UseTerminal</variable>
25 <value type="bool">false</value>
26 </data>
27 <data>
28 <variable>RunConfiguration0-UserEnvironmentChanges</variable>
29 <valuelist type="QVariantList">
30 <value type="QString">DYLD_LIBRARY_PATH=/Users/jcman912/Documents/Fab@Home/Interpreter_Experimental/software/Common/JrKerr/src/build/</value>
31 </valuelist>
32 </data>
33 <data>
34 <variable>RunConfiguration0-UserSetName</variable>
35 <value type="bool">false</value>
36 </data>
37 <data>
38 <variable>RunConfiguration0-UserSetWorkingDirectory</variable>
39 <value type="bool">false</value>
40 </data>
41 <data>
42 <variable>RunConfiguration0-UserWorkingDirectory</variable>
43 <value type="QString"></value>
44 </data>
45 <data>
46 <variable>RunConfiguration0-type</variable>
47 <value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
48 </data>
49 <data>
50 <variable>activeRunConfiguration</variable>
51 <value type="int">0</value>
52 </data>
53 <data>
54 <variable>activebuildconfiguration</variable>
55 <value type="QString">Debug</value>
56 </data>
57 <data>
58 <variable>buildConfiguration-Debug</variable>
59 <valuemap type="QVariantMap">
60 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
61 <value key="QtVersionId" type="int">0</value>
62 <value key="ToolChain" type="int">0</value>
63 <value key="buildConfiguration" type="int">2</value>
64 </valuemap>
65 </data>
66 <data>
67 <variable>buildConfiguration-Release</variable>
68 <valuemap type="QVariantMap">
69 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
70 <value key="QtVersionId" type="int">0</value>
71 <value key="buildConfiguration" type="int">0</value>
72 </valuemap>
73 </data>
74 <data>
75 <variable>buildconfiguration-Debug-buildstep0</variable>
76 <valuemap type="QVariantMap">
77 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
78 <valuelist key="abstractProcess.Environment" type="QVariantList">
79 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-4YVcSb/Render</value>
80 <value type="QString">COMMAND_MODE=unix2003</value>
81 <value type="QString">DISPLAY=/tmp/launch-2sCJnY/:0</value>
82 <value type="QString">HOME=/Users/jcman912</value>
83 <value type="QString">LOGNAME=jcman912</value>
84 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
85 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
86 <value type="QString">SHELL=/bin/bash</value>
87 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-CtydgP/Listeners</value>
88 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
89 <value type="QString">USER=jcman912</value>
90 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
91 </valuelist>
92 <valuelist key="abstractProcess.arguments" type="QVariantList">
93 <value type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Experimental/software/FabInterpreter/Path_Tester/Path_Tester.pro</value>
94 <value type="QString">-spec</value>
95 <value type="QString">macx-g++</value>
96 <value type="QString">-r</value>
97 </valuelist>
98 <value key="abstractProcess.command" type="QString">/usr/bin/qmake</value>
99 <value key="abstractProcess.enabled" type="bool">false</value>
100 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Experimental/software/FabInterpreter/Path_Tester</value>
101 </valuemap>
102 </data>
103 <data>
104 <variable>buildconfiguration-Debug-buildstep1</variable>
105 <valuemap type="QVariantMap">
106 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
107 <valuelist key="abstractProcess.Environment" type="QVariantList">
108 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-4YVcSb/Render</value>
109 <value type="QString">COMMAND_MODE=unix2003</value>
110 <value type="QString">DISPLAY=/tmp/launch-2sCJnY/:0</value>
111 <value type="QString">HOME=/Users/jcman912</value>
112 <value type="QString">LOGNAME=jcman912</value>
113 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
114 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
115 <value type="QString">SHELL=/bin/bash</value>
116 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-CtydgP/Listeners</value>
117 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
118 <value type="QString">USER=jcman912</value>
119 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
120 </valuelist>
121 <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
122 <valuelist key="abstractProcess.arguments" type="QVariantList">
123 <value type="QString">-w</value>
124 </valuelist>
125 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
126 <value key="abstractProcess.enabled" type="bool">true</value>
127 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Experimental/software/FabInterpreter/Path_Tester</value>
128 </valuemap>
129 </data>
130 <data>
131 <variable>buildconfiguration-Debug-cleanstep0</variable>
132 <valuemap type="QVariantMap">
133 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
134 <valuelist key="abstractProcess.Environment" type="QVariantList">
135 <value type="QString">Apple_PubSub_Socket_Render=/tmp/launch-4YVcSb/Render</value>
136 <value type="QString">COMMAND_MODE=unix2003</value>
137 <value type="QString">DISPLAY=/tmp/launch-2sCJnY/:0</value>
138 <value type="QString">HOME=/Users/jcman912</value>
139 <value type="QString">LOGNAME=jcman912</value>
140 <value type="QString">PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin</value>
141 <value type="QString">QTDIR=/usr/local/Qt4.6</value>
142 <value type="QString">SHELL=/bin/bash</value>
143 <value type="QString">SSH_AUTH_SOCK=/tmp/launch-CtydgP/Listeners</value>
144 <value type="QString">TMPDIR=/var/folders/8P/8PQFGUtFGT8ZgHC7XbQ0r++++TI/-Tmp-/</value>
145 <value type="QString">USER=jcman912</value>
146 <value type="QString">__CF_USER_TEXT_ENCODING=0x1F5:0:0</value>
147 </valuelist>
148 <value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
149 <valuelist key="abstractProcess.arguments" type="QVariantList">
150 <value type="QString">clean</value>
151 <value type="QString">-w</value>
152 </valuelist>
153 <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
154 <value key="abstractProcess.enabled" type="bool">true</value>
155 <value key="abstractProcess.workingDirectory" type="QString">/Users/jcman912/Documents/Fab@Home/Interpreter_Experimental/software/FabInterpreter/Path_Tester</value>
156 <value key="cleanConfig" type="bool">true</value>
157 <valuelist key="makeargs" type="QVariantList">
158 <value type="QString">clean</value>
159 </valuelist>
160 </valuemap>
161 </data>
162 <data>
163 <variable>buildconfiguration-Release-buildstep0</variable>
164 <valuemap type="QVariantMap">
165 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
166 </valuemap>
167 </data>
168 <data>
169 <variable>buildconfiguration-Release-buildstep1</variable>
170 <valuemap type="QVariantMap">
171 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
172 </valuemap>
173 </data>
174 <data>
175 <variable>buildconfiguration-Release-cleanstep0</variable>
176 <valuemap type="QVariantMap">
177 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
178 </valuemap>
179 </data>
180 <data>
181 <variable>buildconfigurations</variable>
182 <valuelist type="QVariantList">
183 <value type="QString">Debug</value>
184 <value type="QString">Release</value>
185 </valuelist>
186 </data>
187 <data>
188 <variable>buildstep0</variable>
189 <valuemap type="QVariantMap">
190 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
191 <value key="mkspec" type="QString"></value>
192 </valuemap>
193 </data>
194 <data>
195 <variable>buildstep1</variable>
196 <valuemap type="QVariantMap">
197 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
198 </valuemap>
199 </data>
200 <data>
201 <variable>buildsteps</variable>
202 <valuelist type="QVariantList">
203 <value type="QString">trolltech.qt4projectmanager.qmake</value>
204 <value type="QString">trolltech.qt4projectmanager.make</value>
205 </valuelist>
206 </data>
207 <data>
208 <variable>cleanstep0</variable>
209 <valuemap type="QVariantMap">
210 <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
211 <value key="clean" type="bool">true</value>
212 </valuemap>
213 </data>
214 <data>
215 <variable>cleansteps</variable>
216 <valuelist type="QVariantList">
217 <value type="QString">trolltech.qt4projectmanager.make</value>
218 </valuelist>
219 </data>
220 <data>
221 <variable>defaultFileEncoding</variable>
222 <value type="QByteArray">System</value>
223 </data>
224 <data>
225 <variable>project</variable>
226 <valuemap type="QVariantMap"/>
227 </data>
228</qtcreator>
0229
=== added file 'software/FabInterpreter/Path_Tester/jrkerr.pro'
--- software/FabInterpreter/Path_Tester/jrkerr.pro 1970-01-01 00:00:00 +0000
+++ software/FabInterpreter/Path_Tester/jrkerr.pro 2010-08-07 00:08:43 +0000
@@ -0,0 +1,18 @@
1DEPENDPATH += ../../Common/JrKerr
2INCLUDEPATH += ../../Common/JrKerr/src
3QMAKE_LIBDIR += ../../Common/JrKerr/src/build
4
5HEADERS += ../../Common/JrKerr/nmccom.h \
6 ../../Common/JrKerr/picio.h \
7 ../../Common/JrKerr/picservo.h\
8 ../../Common/JrKerr/picstep.h \
9 ../../Common/JrKerr/path.h
10
11SOURCES += ../../Common/JrKerr/nmccom.cpp \
12 ../../Common/JrKerr/picio.cpp \
13 ../../Common/JrKerr/picservo.cpp\
14 ../../Common/JrKerr/picstep.cpp \
15 ../../Common/JrKerr/path.cpp
16
17CONFIG(debug, debug|release):LIBS += -lqextserialportd
18else:LIBS += -lqextserialport
019
=== added file 'software/FabInterpreter/Path_Tester/main.cpp'
--- software/FabInterpreter/Path_Tester/main.cpp 1970-01-01 00:00:00 +0000
+++ software/FabInterpreter/Path_Tester/main.cpp 2010-08-07 00:08:43 +0000
@@ -0,0 +1,177 @@
1#include <QtCore/QCoreApplication>
2#include "path.h"
3#include "picservo.h"
4#include "nmccom.h"
5#include <unistd.h>
6#include <qdebug.h>
7
8void initialize();
9void execute();
10void ExecutePath();
11void ReportError(int);
12
13void initialize()
14{
15 qDebug() << "Please turn on Servo Controller Power";
16
17 int nummod = NmcInit("/dev/tty.usbserial-A9003UF2", 19200); //Controllers on COM1, use 115200 baud
18
19 if (nummod < 2)
20 {
21 qDebug() << "2 servos not found";
22 qDebug() << "exiting...";
23 }
24
25 //Set the group address for both controllers to 128
26 NmcSetGroupAddr(1, 128, true); //x axis is the group leader
27 NmcSetGroupAddr(2, 128, false); //y axis is a group member
28
29 ServoSetGain(2, //Axis = 2
30 100, //Kp = 100
31 1000, //Kd = 1000
32 0, //Ki = 0
33 0, //IL = 0
34 255, //OL = 255
35 0, //CL = 0
36 2000, //EL = 2000
37 1, //SR = 1
38 0); //DC = 0;
39
40 //Initialize the servos
41 ServoStopMotor(1, AMP_ENABLE | STOP_ABRUPT | ADV_FEATURE);
42 ServoStopMotor(2, AMP_ENABLE | STOP_ABRUPT | ADV_FEATURE);
43
44 //Reset the current motor positions to zero
45 ServoResetPos(1);
46 ServoResetPos(2);
47
48 //Set the required status items for the path control module
49 NmcDefineStatus(1, SEND_POS | SEND_NPOINTS | SEND_PERROR | SEND_AUX);
50 NmcDefineStatus(2, SEND_POS | SEND_NPOINTS | SEND_PERROR | SEND_AUX);
51
52 ServoSetIoCtrl(1, THREE_PHASE);
53 ServoSetIoCtrl(2, THREE_PHASE);
54
55 //Initialize path control module parameters
56 SetPathParams2(P_30HZ, //path frequency = 30 Hz
57 10, //Store a minimum of 45 points in the path point buffer
58 1, //X axis is module address 1
59 2, //Y axis is module address 2
60 0, //Z axis not used = set address to 0
61 128, //group address = 128
62 1, //x axis is group leader
63 20000.0, //X scale - 20000.0 counts per inch
64 20000.0, //Y scale - 20000.0 counts per inch
65 1.0, //Z scale - 1.0 counts per inch - not used
66 1.0); //acceleration = 1.0 inch/second/second
67
68 SetOrigin(0.0, 0.0, 0.0); //set the origin to X = 0, Y = 0, Z = 0
69 SetFeedrate(1.0); //feedrate = 1.0 inches/second
70 SetTangentTolerance(10.0); //continuous path tangent tolerence = 10 degrees
71
72}
73void ExecutePath()
74{
75 //
76 //Initialize the path just before execution
77 //
78 InitPath();
79
80 //
81 //Download path points to the PIC-SERVO CMC modules until all points are
82 // downloaded. Motion will begin automatically when the minimum number
83 // of path points have been loaded.
84 //
85 while ( AddPathPoints() != -1 ) ;
86
87 //
88 //Poll the X axis module to detect when the path is complete
89 //
90 do
91 {
92 NmcNoOp(1); //retrieve current status data
93 }
94 while ( ServoGetAux(1) & PATH_MODE ); //poll while still in path mode
95}
96
97void execute()
98{
99 //
100 //Clear the segment list and initialize the starting point for the path
101 //
102 ClearSegList(0.0, 0.0, 0.0); //Clear the segment list and set the
103 // starting point for the path
104 // at X = 0, Y = 1, Z = 0
105
106 //
107 //Add line and arc segments to the path module's segment list for first move
108 //
109 int res = AddLineSeg(0.0, 2.0, 0.0); //Add a segment to move to x=0, y=2, z=0
110 if (res<0) ReportError(res);
111
112 res = AddArcSeg( 1.0, 3.0, 0.0, //end point of arc: x=1, y=3, z=0
113 1.0, 2.0, 0.0, //center point of arc: x=1, y=2, z = 0
114 0.0, 0.0, -1.0 ); //normal vector to arc plane: x = 0, y = 0, z = -1
115 if (res<0) ReportError(res);
116
117 res = AddLineSeg(4.0, 3.0, 0.0); //line segment endpoint: x=4, y=3, z=0
118 if (res<0) ReportError(res);
119
120
121 res = AddArcSeg( 5.0, 2.0, 0.0, //end point of arc: x=5, y=2, z=0
122 4.0, 2.0, 0.0, //center point of arc: x=4, y=2, z = 0
123 0.0, 0.0, -1.0 ); //normal vector to arc plane: x = 0, y = 0, z = -1
124 if (res<0) ReportError(res);
125
126 res = AddLineSeg(5.0, 0.0, 0.0); //line segment endpoint: x=5, y=0, z=0
127 if (res<0) ReportError(res);
128
129 //
130 //Run path and wait for completion
131 //
132 ExecutePath();
133
134 //
135 //Clear the segment list and initialize the starting point for the second path
136 //back to the origin
137 //
138 ClearSegList(5.0, 0.0, 0.0); //Clear the segment list and set the
139 // starting point for the path
140 // at X = 5, Y = 0, Z = 0
141
142 //
143 //Add line segment to move back to the origin
144 //
145 res = AddLineSeg(0.0, 0.0, 0.0); //Add a segment to move to x=0, y=0, z=0
146 if (res<0) ReportError(res);
147
148 ExecutePath(); //Runs path and waits for completion
149}
150
151void ReportError(int errnum)
152{
153 switch (errnum)
154 {
155 case -1: qDebug() << "Segment added is not tangent to the previous segment";
156 break;
157 case -2: qDebug() << "Too many segments in the segment list";
158 break;
159 case -3: qDebug() << "Values given do not define a correct arc";
160 break;
161 }
162 qDebug() << "Exit now";
163}
164
165int main(int argc, char *argv[])
166{
167 QCoreApplication a(argc, argv);
168
169 initialize();
170
171 sleep(1);
172
173 execute();
174
175
176 return a.exec();
177}
0178
=== modified file 'software/FabInterpreter/Util.h'
--- software/FabInterpreter/Util.h 2010-07-22 15:32:37 +0000
+++ software/FabInterpreter/Util.h 2010-08-07 00:08:43 +0000
@@ -12,7 +12,7 @@
12#include <time.h>12#include <time.h>
13#include <algorithm>13#include <algorithm>
14#include <QMessageBox>14#include <QMessageBox>
15#include "../Common/tinyxml/tinyxml.h"15#include "tinyxml.h"
16using namespace std;16using namespace std;
1717
1818
@@ -109,12 +109,7 @@
109109
110 public: static void messageBox(const string& message)110 public: static void messageBox(const string& message)
111 {111 {
112 /*112 QMessageBox::warning(0, "", message.c_str());
113 QMessageBox:;
114 QString str(message.c_str());
115 msgBox.setText(str);
116 msgBox.exec();
117 */
118 printf(message.c_str());113 printf(message.c_str());
119 printf("\n");114 printf("\n");
120 }115 }
121116
=== modified file 'software/FabInterpreter/guicomponentsthread.cpp'
--- software/FabInterpreter/guicomponentsthread.cpp 2010-07-22 15:32:37 +0000
+++ software/FabInterpreter/guicomponentsthread.cpp 2010-08-07 00:08:43 +0000
@@ -1,24 +1,27 @@
1#include "guicomponentsthread.h"1#include "guicomponentsthread.h"
22
3GUIComponentsThread::GUIComponentsThread()3
4GUIComponentsThread::GUIComponentsThread(QObject* parent) : QThread(parent)
4{5{
5}6}
67
7GUIComponentsThread::GUIComponentsThread(FabAtHomePrinter* newPrinter) : printer(newPrinter) {}8int posDisplayPeriod = 1; //Number of seconds between position updates in user interface.
8
9long posDisplayPeriod = 1; //Number of seconds between position updates in user interface.
10bool enablePosDisplay;9bool enablePosDisplay;
1110
11GUIComponentsThread::~GUIComponentsThread()
12{
13}
14
15
12void GUIComponentsThread::run()16void GUIComponentsThread::run()
13{17{
14 int c = 0;
15 //updates position display18 //updates position display
16 while (enablePosDisplay)19 while (enablePosDisplay)
17 {20 {
18 c = (c == 0 ? 1 : 0);21 reportProgress();
19 printer->GUI_reportProgress();22 sleep(posDisplayPeriod);
20 sleep(posDisplayPeriod * 1000);
21 }23 }
24 finished();
22}25}
2326
24void GUIComponentsThread::enablePositionDisplay()27void GUIComponentsThread::enablePositionDisplay()
@@ -31,3 +34,8 @@
31{34{
32 enablePosDisplay = false;35 enablePosDisplay = false;
33}36}
37
38bool GUIComponentsThread::isEnabled()
39{
40 return enablePosDisplay;
41}
3442
=== modified file 'software/FabInterpreter/guicomponentsthread.h'
--- software/FabInterpreter/guicomponentsthread.h 2010-07-22 15:32:37 +0000
+++ software/FabInterpreter/guicomponentsthread.h 2010-08-07 00:08:43 +0000
@@ -1,28 +1,35 @@
1#ifndef GUICOMPONENTSTHREAD_H1#ifndef GUICOMPONENTSTHREAD_H
2#define GUICOMPONENTSTHREAD_H2#define GUICOMPONENTSTHREAD_H
33
4#include <QThread>4#include <qthread.h>
5#include "FabAtHomePrinter.h"5#include "FabAtHomePrinter.h"
66
7
7class GUIComponentsThread : public QThread8class GUIComponentsThread : public QThread
8{9 {
910
10public:11 Q_OBJECT
11 GUIComponentsThread();12
1213 public:
13 GUIComponentsThread(FabAtHomePrinter* newPrinter);14 GUIComponentsThread(QObject* parent = 0);
1415
15 void enablePositionDisplay();16 ~GUIComponentsThread();
1617
17 void disablePositionDisplay();18 void enablePositionDisplay();
1819
19 void run();20 void run();
2021
21private:22 bool isEnabled();
2223
23 FabAtHomePrinter* printer;24 public slots:
2425
25};26 void disablePositionDisplay();
2627
28 signals:
29
30 void reportProgress();
31 void finished();
32
33 };
2734
28#endif // GUICOMPONENTSTHREAD_H35#endif // GUICOMPONENTSTHREAD_H
2936
=== modified file 'software/FabInterpreter/mainwindow.cpp'
--- software/FabInterpreter/mainwindow.cpp 2010-07-23 20:12:14 +0000
+++ software/FabInterpreter/mainwindow.cpp 2010-08-07 00:08:43 +0000
@@ -4,6 +4,7 @@
4MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)4MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
5{5{
6 setupUi(this);6 setupUi(this);
7 initialized = false;
7 this->connectFunctions();8 this->connectFunctions();
8}9}
910
@@ -15,7 +16,6 @@
15void MainWindow::connectFunctions()16void MainWindow::connectFunctions()
16{17{
17 connect(LoadConfigButton, SIGNAL(clicked()), this, SLOT(loadConfig()));18 connect(LoadConfigButton, SIGNAL(clicked()), this, SLOT(loadConfig()));
18 connect(MoveButton, SIGNAL(clicked()), this, SLOT(move()));
19 connect(ResetPosButton, SIGNAL(clicked()), this, SLOT(resetValues()));19 connect(ResetPosButton, SIGNAL(clicked()), this, SLOT(resetValues()));
20 connect(LoadModelButton, SIGNAL(clicked()), this, SLOT(loadModel()));20 connect(LoadModelButton, SIGNAL(clicked()), this, SLOT(loadModel()));
21 connect(this, SIGNAL(destroyed()), this, SLOT(closeProgram()));21 connect(this, SIGNAL(destroyed()), this, SLOT(closeProgram()));
@@ -25,68 +25,73 @@
25 connect(bayCommandedPosition0, SIGNAL(editingFinished()), this, SLOT(bayCommandedPosition0_valueChanged()));25 connect(bayCommandedPosition0, SIGNAL(editingFinished()), this, SLOT(bayCommandedPosition0_valueChanged()));
26 connect(bayCommandedPosition1, SIGNAL(editingFinished()), this, SLOT(bayCommandedPosition1_valueChanged()));26 connect(bayCommandedPosition1, SIGNAL(editingFinished()), this, SLOT(bayCommandedPosition1_valueChanged()));
27 connect(bayCommandedPosition2, SIGNAL(editingFinished()), this, SLOT(bayCommandedPosition2_valueChanged()));27 connect(bayCommandedPosition2, SIGNAL(editingFinished()), this, SLOT(bayCommandedPosition2_valueChanged()));
28 connect( bayMaterialCalibration0, SIGNAL(currentIndexChanged(int)), this, SLOT( bayMaterialCalibration0_SelectedIndexChanged(int) ) );28 connect(bayMaterialCalibration0, SIGNAL(currentIndexChanged(int)), this, SLOT(bayMaterialCalibration0_SelectedIndexChanged(int) ) );
29 connect( bayMaterialCalibration1, SIGNAL(currentIndexChanged(int)), this, SLOT( bayMaterialCalibration1_SelectedIndexChanged(int) ) );29 connect(bayMaterialCalibration1, SIGNAL(currentIndexChanged(int)), this, SLOT(bayMaterialCalibration1_SelectedIndexChanged(int) ) );
30 connect( bayMaterialCalibration2, SIGNAL(currentIndexChanged(int)), this, SLOT( bayMaterialCalibration2_SelectedIndexChanged(int) ) );30 connect(bayMaterialCalibration2, SIGNAL(currentIndexChanged(int)), this, SLOT(bayMaterialCalibration2_SelectedIndexChanged(int) ) );
31 connect(ExecuteButton, SIGNAL(clicked()), this, SLOT(print()));31 connect(ExecuteButton, SIGNAL(clicked()), this, SLOT(print()));
32 initializePrinter();32 connect(LoadModelButton, SIGNAL(clicked()), this, SLOT(resetProgressBar()));
33 connect(PauseFabButton, SIGNAL(clicked()), this, SLOT(pausePrintHandler()));
33 //add move changes34 //add move changes
34 //connect(XCommandedField, SIGNAL())35
35 //connect(printer, SIGNAL(progressChanged()), printThread, SLOT(update()))
36
37
38 //connect(XCommandedField, SIGNAL(valueChanged(double), printer, SLOT()
39 //TO_DO: add signal/slots for position boxes
40}36}
4137
42void MainWindow::initializePrinter()38void MainWindow::initializePrinter()
43{39{
40 //NOTE: for every connect added here you must add a disconnect to the slot
44 printer = new FabAtHomePrinter();41 printer = new FabAtHomePrinter();
45 pThread = new PrintThread(printer);42 pThread = new PrintThread(printer);
46 gcThread = new GUIComponentsThread(printer);43 gcThread = new GUIComponentsThread();
47 connect(PauseFabButton, SIGNAL(clicked()), printer, SLOT(pausePrint()));44 connect(PauseFabButton, SIGNAL(clicked()), printer, SLOT(pausePrint()));
48 connect(CancelFabButton, SIGNAL(clicked()), printer, SLOT(cancelPrint()));45 connect(CancelFabButton, SIGNAL(clicked()), printer, SLOT(cancelPrint()));
49 connect(RedoPathButton, SIGNAL(clicked()), printer, SLOT(redoPath()));46 connect(RedoPathButton, SIGNAL(clicked()), printer, SLOT(redoPath()));
50 connect(ForceStopButton, SIGNAL(clicked()), printer, SLOT(stopMotors()));47 connect(ForceStopButton, SIGNAL(clicked()), printer, SLOT(stopMotors()));
51 connect(ResetPosButton, SIGNAL(clicked()), printer, SLOT(resetPos()));48 connect(ResetPosButton, SIGNAL(clicked()), printer, SLOT(resetPos()));
52 connect(printer, SIGNAL(reportProgress(int, QString)), this, SLOT(printer_reportProgress(int, QString)));49 connect(printer, SIGNAL(reportProgress(int, QString)), this, SLOT(printer_reportProgress(int, QString)));
53 connect(printer, SIGNAL(GUI_reportProgress()), this, SLOT(GUI_reportProgress()));50 connect(gcThread, SIGNAL(reportProgress()), this, SLOT(GUI_reportProgress()));
51 connect(gcThread, SIGNAL(finished()), this, SLOT(GUI_disabled()));
54 connect(printer, SIGNAL(callWarning(QString)), this, SLOT(callWarning(QString)));52 connect(printer, SIGNAL(callWarning(QString)), this, SLOT(callWarning(QString)));
53 connect(printer, SIGNAL(finishedPrinting()), this, SLOT(resetValues()));
54 connect(DeletePrinterConfig, SIGNAL(clicked()), gcThread, SLOT(disablePositionDisplay()));
55}55}
5656
57void MainWindow::reconnectPrinterFunctions()57void MainWindow::disconnectPrinterFunctions()
58{58{
59 disconnect(PauseFabButton, SIGNAL(clicked()), printer, SLOT(pausePrint()));59 disconnect(printer, 0, 0, 0);
60 disconnect(CancelFabButton, SIGNAL(clicked()), printer, SLOT(cancelPrint()));60 disconnect(gcThread, 0, 0, 0);
61 disconnect(RedoPathButton, SIGNAL(clicked()), printer, SLOT(redoPath()));61 disconnect(printer, SLOT(cancelPrint()));
62 disconnect(ForceStopButton, SIGNAL(clicked()), printer, SLOT(stopMotors()));62 disconnect(printer, SLOT(deleteLater()));
63 disconnect(ResetPosButton, SIGNAL(clicked()), printer, SLOT(resetPos()));63 disconnect(printer, SLOT(pausePrint()));
64 disconnect(printer, SIGNAL(GUI_reportProgress()), this, SLOT(GUI_reportProgress()));64 disconnect(printer, SLOT(redoPath()));
65 disconnect(printer, SIGNAL(reportProgress(int, QString)), this, SLOT(printer_reportProgress(int, QString)));65 disconnect(printer, SLOT(resetPos()));
66 disconnect(printer, SLOT(stopMotors()));
67 disconnect(gcThread, SLOT(disablePositionDisplay()));
68 if (gcThread != NULL)
69 {
70 gcThread->disablePositionDisplay();
71 while (gcThread->isRunning());
72 delete gcThread;
73 }
74 if (pThread != NULL)
75 {
76 delete pThread;
77 }
66 if (printer != NULL)78 if (printer != NULL)
67 {79 {
68 printer->cancelPrint();80 previousPrinter = printer;
69 while (!printer->cleanUp());81 if (printer->isInitialized())
70 //if (printer->isInitialized())82 while (!printer->cleanUp());
71 //printer->reset();
72 delete printer;83 delete printer;
73 }84 }
74 if (pThread != NULL)
75 {
76 delete pThread;
77 }
78 if (gcThread != NULL)
79 {
80 delete gcThread;
81 }
82 initializePrinter();
83}85}
8486
85void MainWindow::loadConfig()87void MainWindow::loadConfig()
86{88{
87 //Open file dialog89 //Open file dialog
88 reconnectPrinterFunctions();90 QString str = QFileDialog::getOpenFileName(this,"Config File Loader", "/Users/jcman912/Documents/Fab@Home/Interpreter_Experimental/software", "*.config");
89 QString str = QFileDialog::getOpenFileName(this,"Config File Loader", "../../media/Printer Configs/", "*.config");91
92 if (!initialized)
93 initialized = true;
94 initializePrinter();
90 string result = printer->initialize(str.toStdString(), PortName->text().toStdString());95 string result = printer->initialize(str.toStdString(), PortName->text().toStdString());
91 if(result.compare("") == 0)96 if(result.compare("") == 0)
92 {97 {
@@ -109,6 +114,12 @@
109 XCommandedField->setValue(0);114 XCommandedField->setValue(0);
110 YCommandedField->setValue(0);115 YCommandedField->setValue(0);
111 ZCommandedField->setValue(0);116 ZCommandedField->setValue(0);
117 XCommandedField->setSingleStep(XIncrementField->text().toDouble());
118 YCommandedField->setSingleStep(YIncrementField->text().toDouble());
119 ZCommandedField->setSingleStep(ZIncrementField->text().toDouble());
120 bayCommandedPosition0->setSingleStep(bayIncrementField0->text().toDouble());
121 bayCommandedPosition1->setSingleStep(bayIncrementField1->text().toDouble());
122 bayCommandedPosition2->setSingleStep(bayIncrementField2->text().toDouble());
112 int numLoadedBays = printer->numLoadedBays();123 int numLoadedBays = printer->numLoadedBays();
113 if(numLoadedBays >= 1)124 if(numLoadedBays >= 1)
114 {125 {
@@ -135,22 +146,17 @@
135146
136 //FabAtHomePrinter::savePreviousConfigName(filePath);147 //FabAtHomePrinter::savePreviousConfigName(filePath);
137148
138
139 //Modify buttons.
140
141 //LoadConfigButton->setEnabled(false);
142
143 //LoadModelButton->focusWidget();
144 //LoadModelButton->Focus();
145
146 //Start live position display149 //Start live position display
150 LoadConfigButton->setEnabled(false);
147 gcThread->enablePositionDisplay();151 gcThread->enablePositionDisplay();
148 }152 }
149 else153 else
150 {154 {
155 disconnectPrinterFunctions();
151 callWarning(result.c_str());156 callWarning(result.c_str());
152 }157 }
153158
159 previousPrinter = printer;
154160
155}161}
156162
@@ -163,7 +169,7 @@
163 int numLoadedBays = printer->numLoadedBays();169 int numLoadedBays = printer->numLoadedBays();
164 if(numLoadedBays >= 1)170 if(numLoadedBays >= 1)
165 {171 {
166 bayCommandedPosition0->setValue(0.00000);172 bayCommandedPosition0->setValue(0.000000);
167 }173 }
168 if(numLoadedBays >= 2)174 if(numLoadedBays >= 2)
169 {175 {
@@ -236,11 +242,6 @@
236 }242 }
237}243}
238244
239void MainWindow::disablePositionDisplay()
240{
241 enablePosDisplay = false;
242}
243
244void MainWindow::toggleAxes(bool enabled)245void MainWindow::toggleAxes(bool enabled)
245{246{
246 XVelocityField->setEnabled(enabled);247 XVelocityField->setEnabled(enabled);
@@ -269,7 +270,7 @@
269 {270 {
270 bayVelocity0->setEnabled(enabled);271 bayVelocity0->setEnabled(enabled);
271 bayAcceleration0->setEnabled(enabled);272 bayAcceleration0->setEnabled(enabled);
272 bayPositionIncrement0->setEnabled(enabled);273 bayIncrementField0->setEnabled(enabled);
273 bayMotorPosition0->setEnabled(enabled);274 bayMotorPosition0->setEnabled(enabled);
274 bayCommandedPosition0->setEnabled(enabled);275 bayCommandedPosition0->setEnabled(enabled);
275 bayMaterialCalibration0->setEnabled(enabled);276 bayMaterialCalibration0->setEnabled(enabled);
@@ -280,7 +281,7 @@
280 {281 {
281 bayVelocity1->setEnabled(enabled);282 bayVelocity1->setEnabled(enabled);
282 bayAcceleration1->setEnabled(enabled);283 bayAcceleration1->setEnabled(enabled);
283 bayPositionIncrement1->setEnabled(enabled);284 bayIncrementField1->setEnabled(enabled);
284 bayMotorPosition1->setEnabled(enabled);285 bayMotorPosition1->setEnabled(enabled);
285 bayCommandedPosition1->setEnabled(enabled);286 bayCommandedPosition1->setEnabled(enabled);
286 bayMaterialCalibration1->setEnabled(enabled);287 bayMaterialCalibration1->setEnabled(enabled);
@@ -291,7 +292,7 @@
291 {292 {
292 bayVelocity2->setEnabled(enabled);293 bayVelocity2->setEnabled(enabled);
293 bayAcceleration2->setEnabled(enabled);294 bayAcceleration2->setEnabled(enabled);
294 bayPositionIncrement2->setEnabled(enabled);295 bayIncrementField2->setEnabled(enabled);
295 bayMotorPosition2->setEnabled(enabled);296 bayMotorPosition2->setEnabled(enabled);
296 bayCommandedPosition2->setEnabled(enabled);297 bayCommandedPosition2->setEnabled(enabled);
297 bayMaterialCalibration2->setEnabled(enabled);298 bayMaterialCalibration2->setEnabled(enabled);
@@ -312,6 +313,7 @@
312 if(numLoadedBays >= 1)313 if(numLoadedBays >= 1)
313 {314 {
314 temp = Util::toString<double>(printer->tool.bays["Bay 0"].motor->getPosition());315 temp = Util::toString<double>(printer->tool.bays["Bay 0"].motor->getPosition());
316 bayMotorPosition0->setText(temp.c_str());
315 }317 }
316 if(numLoadedBays >= 2)318 if(numLoadedBays >= 2)
317 {319 {
@@ -337,8 +339,6 @@
337 PathProgressBar->update();339 PathProgressBar->update();
338}340}
339341
340//TODO: implement this
341
342void MainWindow::GUI_reportProgress()342void MainWindow::GUI_reportProgress()
343{343{
344 static string prevState;344 static string prevState;
@@ -356,11 +356,11 @@
356 ZCommandedField->setValue(ZDisplay->text().toDouble());356 ZCommandedField->setValue(ZDisplay->text().toDouble());
357 bayCommandedPosition0->setValue(bayMotorPosition0->text().toDouble());357 bayCommandedPosition0->setValue(bayMotorPosition0->text().toDouble());
358 bayCommandedPosition1->setValue(bayMotorPosition1->text().toDouble());358 bayCommandedPosition1->setValue(bayMotorPosition1->text().toDouble());
359 bayCommandedPosition2->setValue(bayMotorPosition2->text().toDouble());
359 }360 }
360 toggleBays(true);361 toggleBays(true);
361 toggleAxes(false);362 toggleAxes(false);
362 ResetPosButton->setEnabled(false);363 ResetPosButton->setEnabled(false);
363 MoveButton->setEnabled(false);
364 LoadModelButton->setEnabled(false);364 LoadModelButton->setEnabled(false);
365 ExecuteButton->setEnabled(false);365 ExecuteButton->setEnabled(false);
366 PauseFabButton->setEnabled(true);366 PauseFabButton->setEnabled(true);
@@ -373,9 +373,9 @@
373 toggleBays(false);373 toggleBays(false);
374 toggleAxes(false);374 toggleAxes(false);
375 ResetPosButton->setEnabled(false);375 ResetPosButton->setEnabled(false);
376 MoveButton->setEnabled(false);
377 LoadModelButton->setEnabled(false);376 LoadModelButton->setEnabled(false);
378 ExecuteButton->setEnabled(false);377 ExecuteButton->setEnabled(false);
378 DeletePrinterConfig->setEnabled(false);
379 PauseFabButton->setEnabled(true);379 PauseFabButton->setEnabled(true);
380 CancelFabButton->setEnabled(true);380 CancelFabButton->setEnabled(true);
381 ForceStopButton->setEnabled(true);381 ForceStopButton->setEnabled(true);
@@ -391,12 +391,13 @@
391 XCommandedField->setValue(XDisplay->text().toDouble());391 XCommandedField->setValue(XDisplay->text().toDouble());
392 bayCommandedPosition0->setValue(bayMotorPosition0->text().toDouble());392 bayCommandedPosition0->setValue(bayMotorPosition0->text().toDouble());
393 bayCommandedPosition1->setValue(bayMotorPosition1->text().toDouble());393 bayCommandedPosition1->setValue(bayMotorPosition1->text().toDouble());
394 bayCommandedPosition2->setValue(bayMotorPosition2->text().toDouble());
394 }395 }
395 toggleBays(true);396 toggleBays(true);
396 toggleAxes(true);397 toggleAxes(true);
397 ResetPosButton->setEnabled(true);398 ResetPosButton->setEnabled(true);
398 MoveButton->setEnabled(true);
399 LoadModelButton->setEnabled(true);399 LoadModelButton->setEnabled(true);
400 DeletePrinterConfig->setEnabled(true);
400 PauseFabButton->setEnabled(false);401 PauseFabButton->setEnabled(false);
401 CancelFabButton->setEnabled(false);402 CancelFabButton->setEnabled(false);
402 ForceStopButton->setEnabled(false);403 ForceStopButton->setEnabled(false);
@@ -406,6 +407,34 @@
406}407}
407408
408409
410void MainWindow::GUI_disabled()
411{
412 toggleBays(false);
413 toggleAxes(false);
414 ResetPosButton->setEnabled(false);
415 LoadModelButton->setEnabled(false);
416 ExecuteButton->setEnabled(false);
417 DeletePrinterConfig->setEnabled(false);
418 PauseFabButton->setEnabled(false);
419 CancelFabButton->setEnabled(false);
420 ForceStopButton->setEnabled(false);
421 RedoPathButton->setEnabled(false);
422 LoadConfigButton->setEnabled(true);
423 XLabel->setText("Not Loaded");
424 YLabel->setText("Not Loaded");
425 ZLabel->setText("Not Loaded");
426 bayLabel0->setText("Not Loaded");
427 bayLabel1->setText("Not Loaded");
428 bayLabel2->setText("Not Loaded");
429 resetValues();
430 if (printer->isInitialized())
431 printer->resetPos();
432 bayMaterialCalibration0->clear();
433 bayMaterialCalibration1->clear();
434 bayMaterialCalibration2->clear();
435 disconnectPrinterFunctions();
436}
437
409void MainWindow::print()438void MainWindow::print()
410{439{
411440
@@ -416,65 +445,70 @@
416445
417void MainWindow::bayMaterialCalibration1_SelectedIndexChanged(int i)446void MainWindow::bayMaterialCalibration1_SelectedIndexChanged(int i)
418{447{
419 string materialCalibrationName = bayMaterialCalibration1->currentText().toStdString();448 if (bayMaterialCalibration1->isEnabled())
420 string bayName = bayLabel1->text().toStdString();449 {
421 printer->equipBay(bayName, materialCalibrationName);450 string materialCalibrationName = bayMaterialCalibration1->currentText().toStdString();
451 string bayName = bayLabel1->text().toStdString();
452 printer->equipBay(bayName, materialCalibrationName);
453 }
422}454}
423void MainWindow::bayMaterialCalibration2_SelectedIndexChanged(int i) {455void MainWindow::bayMaterialCalibration2_SelectedIndexChanged(int i) {
424 string materialCalibrationName = bayMaterialCalibration2->currentText().toStdString();456 if (bayMaterialCalibration2->isEnabled())
425 string bayName = bayLabel2->text().toStdString();457 {
426 printer->equipBay(bayName, materialCalibrationName);458 string materialCalibrationName = bayMaterialCalibration2->currentText().toStdString();
459 string bayName = bayLabel2->text().toStdString();
460 printer->equipBay(bayName, materialCalibrationName);
461 }
427}462}
428463
429void MainWindow::bayMaterialCalibration0_SelectedIndexChanged(int i)464void MainWindow::bayMaterialCalibration0_SelectedIndexChanged(int i)
430{465{
431 string materialCalibrationName = bayMaterialCalibration0->currentText().toStdString();466 if (bayMaterialCalibration0->isEnabled())
432 string bayName = bayLabel0->text().toStdString();467 {
433 printer->equipBay(bayName, materialCalibrationName);468 string materialCalibrationName = bayMaterialCalibration0->currentText().toStdString();
469 string bayName = bayLabel0->text().toStdString();
470 printer->equipBay(bayName, materialCalibrationName);
471 }
434}472}
435473
436void MainWindow::closeProgram()474void MainWindow::closeProgram()
437{475{
438 gcThread->disablePositionDisplay();476 gcThread->disablePositionDisplay();
439 printer->cleanUp();
440 delete pThread;
441 delete gcThread;
442 delete printer;
443}477}
444478
445void MainWindow::XCommandedField_valueChanged()479void MainWindow::XCommandedField_valueChanged()
446{480{
447 if (printer->isInitialized())481 if (printer->isInitialized() && printer->state().compare("PRINTING") != 0)
448 printer->axes["X"].motor->moveAbsolute(XCommandedField->value(), XVelocityField->text().toDouble(), XAccelerationField->text().toDouble());482 printer->axes["X"].motor->moveAbsolute(XCommandedField->value(), XVelocityField->text().toDouble(), XAccelerationField->text().toDouble());
449}483}
450484
451void MainWindow::YCommandedField_valueChanged()485void MainWindow::YCommandedField_valueChanged()
452{486{
453 if (printer->isInitialized())487 if (printer->isInitialized() && printer->state().compare("PRINTING") != 0)
454 printer->axes["Y"].motor->moveAbsolute(YCommandedField->value(), YVelocityField->text().toDouble(), YAccelerationField->text().toDouble());488 printer->axes["Y"].motor->moveAbsolute(YCommandedField->value(), YVelocityField->text().toDouble(), YAccelerationField->text().toDouble());
455}489}
456490
457void MainWindow::ZCommandedField_valueChanged()491void MainWindow::ZCommandedField_valueChanged()
458{492{
459 if (printer->isInitialized())493 if (printer->isInitialized() && printer->state().compare("PRINTING") != 0)
460 printer->axes["Z"].motor->moveAbsolute(ZCommandedField->value(), ZVelocityField->text().toDouble(), ZAccelerationField->text().toDouble());494 printer->axes["Z"].motor->moveAbsolute(ZCommandedField->value(), ZVelocityField->text().toDouble(), ZAccelerationField->text().toDouble());
461}495}
462496
463void MainWindow::bayCommandedPosition0_valueChanged()497void MainWindow::bayCommandedPosition0_valueChanged()
464{498{
465 if (printer->isInitialized())499 if (printer->isInitialized() && printer->state().compare("PRINTING") != 0)
466 printer->tool.bays["Bay 0"].motor->moveAbsolute(bayCommandedPosition0->value(), bayVelocity0->text().toDouble(), bayAcceleration0->text().toDouble());500 printer->tool.bays["Bay 0"].motor->moveAbsolute(bayCommandedPosition0->value(), bayVelocity0->text().toDouble(), bayAcceleration0->text().toDouble());
467}501}
468502
469void MainWindow::bayCommandedPosition1_valueChanged()503void MainWindow::bayCommandedPosition1_valueChanged()
470{504{
471 if (printer->isInitialized())505 if (printer->isInitialized() && printer->state().compare("PRINTING") != 0)
472 printer->tool.bays["Bay 1"].motor->moveAbsolute(bayCommandedPosition1->value(), bayVelocity1->text().toDouble(), bayAcceleration1->text().toDouble());506 printer->tool.bays["Bay 1"].motor->moveAbsolute(bayCommandedPosition1->value(), bayVelocity1->text().toDouble(), bayAcceleration1->text().toDouble());
473}507}
474508
475void MainWindow::bayCommandedPosition2_valueChanged()509void MainWindow::bayCommandedPosition2_valueChanged()
476{510{
477 if (printer->isInitialized())511 if (printer->isInitialized() && printer->state().compare("PRINTING") != 0)
478 printer->tool.bays["Bay 2"].motor->moveAbsolute(bayCommandedPosition2->value(), bayVelocity2->text().toDouble(), bayAcceleration2->text().toDouble());512 printer->tool.bays["Bay 2"].motor->moveAbsolute(bayCommandedPosition2->value(), bayVelocity2->text().toDouble(), bayAcceleration2->text().toDouble());
479}513}
480514
@@ -482,3 +516,32 @@
482{516{
483 QMessageBox::warning(this, "Warning", msg);517 QMessageBox::warning(this, "Warning", msg);
484}518}
519
520void MainWindow::resetProgressBar()
521{
522 PathProgressBar->setValue(0);
523}
524
525void MainWindow::closeEvent(QCloseEvent *event)
526{
527 if (!initialized || !printer->isInitialized())
528 event->accept();
529 else if (printer->state().compare("PRINTING") == 0)
530 {
531 callWarning("Cannot close during a print job.");
532 event->ignore();
533 }
534 else
535 {
536 closeProgram();
537 event->accept();
538 }
539}
540
541void MainWindow::pausePrintHandler()
542{
543 if (printer->state().compare("PRINTING") == 0)
544 PauseFabButton->setText("Resume");
545 else
546 PauseFabButton->setText("Pause");
547}
485548
=== modified file 'software/FabInterpreter/mainwindow.h'
--- software/FabInterpreter/mainwindow.h 2010-07-22 15:32:37 +0000
+++ software/FabInterpreter/mainwindow.h 2010-08-07 00:08:43 +0000
@@ -11,7 +11,8 @@
11#include "guicomponentsthread.h"11#include "guicomponentsthread.h"
12#include <vector>12#include <vector>
13#include <QFileDialog>13#include <QFileDialog>
1414#include <QMessageBox>
15#include <QCloseEvent>
1516
1617
17namespace Ui18namespace Ui
@@ -19,8 +20,6 @@
19 class MainWindow;20 class MainWindow;
20}21}
2122
22
23
24class MainWindow :23class MainWindow :
25 public QMainWindow, public Ui::MainWindow24 public QMainWindow, public Ui::MainWindow
26{25{
@@ -31,17 +30,16 @@
31 ~MainWindow();30 ~MainWindow();
32 31
33private:32private:
33
34 bool initialized;34 bool initialized;
35 FabAtHomePrinter* printer; //The printer.35 FabAtHomePrinter* printer; //The printer.
36 FabAtHomePrinter* previousPrinter;36 FabAtHomePrinter* previousPrinter;
37 GUIComponentsThread *gcThread;37 GUIComponentsThread *gcThread;
38 PrintThread *pThread;38 PrintThread *pThread;
39 void disablePositionDisplay();
40 void toggleAxes(bool);39 void toggleAxes(bool);
41 void toggleBays(bool);40 void toggleBays(bool);
42 void updatePosDisplay();41 void updatePosDisplay();
43 void connectFunctions();42 void connectFunctions();
44 void reconnectPrinterFunctions();
45 void initializePrinter();43 void initializePrinter();
4644
47 //variables for controller45 //variables for controller
@@ -56,12 +54,12 @@
56 //timer variables54 //timer variables
57 int numTicks;55 int numTicks;
58 //TODO: initialize above in constructor56 //TODO: initialize above in constructor
5957
60public slots:58private slots:
59 void disconnectPrinterFunctions();
61 void printer_reportProgress(int, QString);60 void printer_reportProgress(int, QString);
62 void GUI_reportProgress();61 void GUI_reportProgress();
63 62 void GUI_disabled();
64private slots:
65 void loadConfig();63 void loadConfig();
66 void loadModel();64 void loadModel();
67 void resetValues();65 void resetValues();
@@ -78,6 +76,11 @@
78 void bayCommandedPosition1_valueChanged();76 void bayCommandedPosition1_valueChanged();
79 void bayCommandedPosition2_valueChanged();77 void bayCommandedPosition2_valueChanged();
80 void callWarning(QString);78 void callWarning(QString);
79 void resetProgressBar();
80 void pausePrintHandler();
81
82protected:
83 void closeEvent(QCloseEvent *event);
81};84};
8285
83#endif // MAINWINDOW_H86#endif // MAINWINDOW_H
8487
=== modified file 'software/FabInterpreter/mainwindow.ui'
--- software/FabInterpreter/mainwindow.ui 2010-07-23 20:12:14 +0000
+++ software/FabInterpreter/mainwindow.ui 2010-08-07 00:08:43 +0000
@@ -6,12 +6,24 @@
6 <rect>6 <rect>
7 <x>0</x>7 <x>0</x>
8 <y>0</y>8 <y>0</y>
9 <width>910</width>9 <width>932</width>
10 <height>461</height>10 <height>467</height>
11 </rect>11 </rect>
12 </property>12 </property>
13 <property name="windowTitle">13 <property name="windowTitle">
14 <string>FAB@Home Interpreter</string>14 <string>Fab@Home Interpreter</string>
15 </property>
16 <property name="autoFillBackground">
17 <bool>false</bool>
18 </property>
19 <property name="animated">
20 <bool>true</bool>
21 </property>
22 <property name="dockNestingEnabled">
23 <bool>false</bool>
24 </property>
25 <property name="unifiedTitleAndToolBarOnMac">
26 <bool>false</bool>
15 </property>27 </property>
16 <widget class="QWidget" name="centralWidget">28 <widget class="QWidget" name="centralWidget">
17 <widget class="QGroupBox" name="gridGroupBox">29 <widget class="QGroupBox" name="gridGroupBox">
@@ -19,10 +31,16 @@
19 <rect>31 <rect>
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: