// Needed to work without devices /* #ifndef DUMMY_DEVICES #define DUMMY_DEVICES #endif */ // moving parameters structure struct move_param { unsigned short int axis; unsigned short int num_steps; double step_size; // In motor revolutions double vel; double accel; double init_angle[5]; int motor_dir[5]; int angle_dir[5]; double pot_zero[5]; double pot_range[5]; unsigned short int num_cams; double cam_offset[5]; double cam_coord[5]; double cam_angle[5]; double time_int; double distance; int log_data; }; // Directions for the cam_coord array #define X_CIND 0 #define Y_CIND 1 #define ROLL_CIND 2 #define PITCH_CIND 3 #define YAW_CIND 4 // communication parameters structure struct com_param { int gpib_addr; int cm6k6_com_port; int cm6k6_addr; int hp34970_addr; }; /* Public Functions Declaration */ // Common functions int danger_operation_message(char* message); void cam_move_error_handling(int err, char descr[]); void file_open(char f_name[], int *f_handle, int mode); void cam_fill_param_struct(struct move_param *m_param, struct com_param *c_param); void cam_move_go(struct com_param *cm_param, struct move_param *mv_param, int mode); void write_to_log(char f_name[], char message[]); void cam_move_log_motion_data(char txt[], struct move_param *mv_param); void cam_move_get_coordinates(struct move_param *mv_param, struct com_param *cm_param); void cam_move_exit(void); // working with devices int cam_move_device_init(char log_file_in[], struct com_param *param); void move_cam_motor(struct move_param *param, double distance[]); void cam_go_zero(struct move_param *m_param, struct com_param c_param); double cam_move_read_cam_angles(struct move_param *m_param, struct com_param *cm_param, int pot); void cam_move_read_position(void); // Calculations void cam_move_vertex_coord(struct move_param *m_param, double cam_angle[], double v_coord[], double *alpha); void cam_move_cam_angles(struct move_param *m_param, double cam_angle[], double crd[]); void cam_move_angles_to_coord(struct move_param *m_param, double angles[]); void cam_move_coord_to_angles(struct move_param *m_param, double angles[]); void cam_move_calculate_angles(double coord[], double angle[]); void cam_move_zero_coord(struct move_param *param); void cam_move_save_coord(struct move_param param); void cam_move_position_zero(void);