~jil26/fabinterpreter/Qt_version

« back to all changes in this revision

Viewing changes to software/FabInterpreter/picServoPath.h

  • Committer: Jeffrey Lipton
  • Date: 2010-07-10 00:48:14 UTC
  • Revision ID: jil26@cornell.edu-20100710004814-x6y9jkv81x9p8vzy
Set up a Qt version of the FabInterpeter as a seperate branch. this is non functional. PRO file needs to be updated. DLL imports fail

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//---------------------------------------------------------------------------
 
2
#ifndef PIC_SERVO_PATH_H
 
3
#define PIC_SERVO_PATH_H
 
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
 
 
28
typedef float fp[3];     //floating point 3x1 vector
 
29
 
 
30
typedef long int ip[3];  //integer 3x1 vector
 
31
 
 
32
typedef 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
 
 
42
typedef struct {         //data type for a coordinate frame
 
43
                        fp      x;
 
44
            fp  y;
 
45
            fp  z;
 
46
            fp  p;
 
47
            } frame;
 
48
 
 
49
//---------------------------------------------------------------------------
 
50
 
 
51
 
 
52
//Load functions from DLL.
 
53
/*
 
54
static void (*SetTangentTolerance)(float) = reinterpret_cast<void(*)(float)>(DLL::loadFunction("PATHLIB4.dll","SetTangentTolerance"));  
 
55
static void (*ClearSegList)(float,float,float) = reinterpret_cast<void(*)(float,float,float)>(DLL::loadFunction("PATHLIB4.dll","ClearSegList"));  
 
56
static int (*AddLineSeg)(float,float,float) = reinterpret_cast<int(*)(float,float,float)>(DLL::loadFunction("PATHLIB4.dll","AddLineSeg"));  
 
57
static int (*AddArcSeg)(float,float,float,float,float,float,float,float,float) = reinterpret_cast<int(*)(float,float,float,float,float,float,float,float,float)>(DLL::loadFunction("PATHLIB4.dll","AddArcSeg"));  
 
58
static void (*SetFeedrate)(float) = reinterpret_cast<void(*)(float)>(DLL::loadFunction("PATHLIB4.dll","SetFeedrate"));
 
59
static void (*SetOrigin)(float,float,float) = reinterpret_cast<void(*)(float,float,float)>(DLL::loadFunction("PATHLIB4.dll","SetOrigin"));
 
60
static int (*SetPathParams)(int,int,int,int,int,int,int,float,float,float,float) = reinterpret_cast<int(*)(int,int,int,int,int,int,int,float,float,float,float)>(DLL::loadFunction("PATHLIB4.dll","SetPathParams"));
 
61
static int (*SetPathParams2)(int,int,int,int,int,int,int,float,float,float,float) = reinterpret_cast<int(*)(int,int,int,int,int,int,int,float,float,float,float)>(DLL::loadFunction("PATHLIB4.dll","SetPathParams2"));
 
62
static float (*InitPath)(void) = reinterpret_cast<float(*)(void)>(DLL::loadFunction("PATHLIB4.dll","InitPath"));
 
63
static int (*AddPathPoints)(void) = reinterpret_cast<int(*)(void)>(DLL::loadFunction("PATHLIB4.dll","AddPathPoints"));
 
64
*/
 
65
 
 
66
[DllImport("PATHLIB4.dll", EntryPoint = "SetTangentTolerance", CharSet = Unicode)]
 
67
void SetTangentTolerance(float);
 
68
 
 
69
[DllImport("PATHLIB4.dll", EntryPoint = "ClearSegList", CharSet = Unicode)]
 
70
void ClearSegList(float,float,float);
 
71
 
 
72
[DllImport("PATHLIB4.dll", EntryPoint = "AddLineSeg", CharSet = Unicode)]
 
73
int AddLineSeg(float,float,float);
 
74
 
 
75
[DllImport("PATHLIB4.dll", EntryPoint = "AddArcSeg", CharSet = Unicode)]
 
76
int AddArcSeg(float,float,float,float,float,float,float,float,float);
 
77
 
 
78
[DllImport("PATHLIB4.dll", EntryPoint = "SetFeedrate", CharSet = Unicode)]
 
79
void SetFeedrate(float);
 
80
 
 
81
[DllImport("PATHLIB4.dll", EntryPoint = "SetOrigin", CharSet = Unicode)]
 
82
void SetOrigin(float,float,float);
 
83
 
 
84
[DllImport("PATHLIB4.dll", EntryPoint = "SetPathParams", CharSet = Unicode)]
 
85
int SetPathParams(int,int,int,int,int,int,int,float,float,float,float);
 
86
 
 
87
[DllImport("PATHLIB4.dll", EntryPoint = "SetPathParams2", CharSet = Unicode)]
 
88
int SetPathParams2(int,int,int,int,int,int,int,float,float,float,float);
 
89
 
 
90
[DllImport("PATHLIB4.dll", EntryPoint = "InitPath", CharSet = Unicode)]
 
91
float InitPath(void);
 
92
 
 
93
[DllImport("PATHLIB4.dll", EntryPoint = "AddPathPoints", CharSet = Unicode)]
 
94
int AddPathPoints(void);
 
95
 
 
96
#endif //ndef PIC_SERVO_PATH_H
 
 
b'\\ No newline at end of file'