-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstage.h
73 lines (63 loc) · 2.56 KB
/
stage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <windows.h>
#include "acscontroller.h"
// SPiiPlus MMI ACS buffer commands dictionary
#define MOVE_CMD "S_P"
// SPiiPlus MMI ACS buffer programs dictionary
#define MOVE_BUFFER_ID 7
// SPiiPlus MMI ACS buffer variables dictionary
#define VEL_VAR "velACS"
#define ACCEL_VAR "accelACS"
#define SHIFT_DISTANCE_VAR "distACS"
// Movement timeout
#define TIMEOUT_CONSTANT 100000 // ms
class Stage
{
public:
typedef struct Stage_system_s
{
void *handle;
int FAULT_X;
int FAULT_Y;
int FAULT_A;
double FPOS_X;
double FPOS_Y;
double FPOS_A;
ACS_Controller *ACSCptr;
} Stage_system_t;
struct fpos3
{
double x;
double y;
double a; // Assuming 'a' represents the third dimension
};
Stage::Stage_system_t S_system;
static Stage *Stage_getInstance();
int stage_connect(Stage_system_t *stage);
int stage_disconnect(Stage_system_t *stage);
int stage_simulator_connect(Stage_system_t *stage);
int clear_fault_axes_xya(Stage_system_t *stage);
int enable_axes_xya(Stage_system_t *stage);
int commute_axes_xya(Stage_system_t *stage, int pause);
int get_fault_axes_xya(Stage_system_t *stage);
int get_pos_axes_xya(Stage_system_t *stage);
int set_accel_axes_xya(Stage_system_t *stage, double acceleration);
int set_decel_axes_xya(Stage_system_t *stage, double deceleration);
int set_kill_decel_axes_xya(Stage_system_t *stage, double kill_deceleration);
int set_vel_axes_xya(Stage_system_t *stage, double velocity);
int move_stage_mm(Stage_system_t *stage, double abs_point_mm, double vel, double endvel);
int move_stage_smooth_mm(Stage_system_t *stage, double abs_point_mm, double vel);
int halt_stage(Stage_system_t *stage);
bool is_target_position_reached(double abs_point_mm, double target_tolerance, double position);
int run_move_stage_program(Stage_system_t *stage);
int set_vel_stage(Stage_system_t *stage, double vel);
int set_shift_dist_stage(Stage_system_t *stage, double shiftdist);
int to_point_stage(Stage_system_t *stage, double shiftx_mm, double shifty_mm, double shifta_mm); int createDirectory(const std::wstring &path);
void writeToFile(double FPOS_X, double FPOS_Y, double FPOS_A);
void readFromFile(const std::wstring &fileName);
int recover_stage_position_reference(Stage_system_t *stage);
int update_stage_position(Stage_system_t *stage, double x, double y, double a);
int query_stage_pos(Stage_system_t *stage, fpos3 *abspos);
Stage();
private:
static Stage *ControllerPtr;
};