File indexing completed on 2025-01-18 10:02:04
0001 #ifndef MAD_NODE_H
0002 #define MAD_NODE_H
0003
0004
0005
0006 struct element;
0007 struct command;
0008 struct sequence;
0009 struct expression;
0010 struct constraint_list;
0011 struct double_array;
0012 struct name_list;
0013
0014 struct align_info
0015 {
0016 struct expression* dx_expr;
0017 double dx_value;
0018 struct expression* dy_expr;
0019 double dy_value;
0020 struct expression* ds_expr;
0021 double ds_value;
0022 struct expression* dtheta_expr;
0023 double dtheta_value;
0024 struct expression* dphi_expr;
0025 double dphi_value;
0026 struct expression* dpsi_expr;
0027 double dpsi_value;
0028 };
0029 struct node
0030 {
0031 char name[200];
0032 char* base_name;
0033 struct node* previous;
0034 struct node* next;
0035 struct node* master;
0036 int occ_cnt;
0037 int obs_point;
0038 int sel_err;
0039 int sel_sector;
0040 int con_cnt;
0041 int enable;
0042 int moved;
0043 int stamp;
0044 double pass_flag;
0045 double position;
0046 double at_value;
0047 double length;
0048 double dipole_bv;
0049 double other_bv;
0050 double chkick;
0051 double cvkick;
0052 double surv_data[7];
0053 struct expression* at_expr;
0054 char* from_name;
0055 struct element* p_elem;
0056 struct sequence* p_sequ;
0057 struct double_array* p_al_err;
0058 struct double_array* p_fd_err;
0059 struct command* savebeta;
0060 struct constraint_list* cl;
0061 struct double_array* obs_orbit;
0062 struct double_array* orbit_ref;
0063
0064 struct double_array* interp_at;
0065 struct double_array* closed_orbit;
0066
0067 struct double_array* p_ph_err;
0068
0069 double rfm_volt;
0070 double rfm_freq;
0071 int rfm_harmon;
0072 double rfm_lag;
0073 int perm_misalign;
0074 struct align_info* perm_align;
0075 };
0076 struct node_list
0077 {
0078 int stamp;
0079 char name[NAME_L];
0080 int max,
0081 curr;
0082 struct name_list* list;
0083
0084 struct node** nodes;
0085 };
0086
0087
0088
0089 struct node* new_node(char* name);
0090 struct node* clone_node(struct node*, int flag);
0091 struct node* delete_node(struct node*);
0092 struct node* expand_node(struct node*, struct sequence* top, struct sequence* seq, double position);
0093 void dump_node(struct node*);
0094 int advance_node(void);
0095 void node_name(char* name, int* l);
0096 void node_name_f_lower(char* name, int* l);
0097 double node_value(const char* par);
0098
0099 struct node_list* new_node_list(int length);
0100 struct node_list* delete_node_list(struct node_list*);
0101 struct node* delete_node_ring(struct node*);
0102
0103 void add_to_node_list(struct node*, int inf, struct node_list*);
0104
0105 struct node* find_node_by_name(const char* name, struct node_list*, struct node* fst, struct node* lst);
0106 double get_node_pos(struct node*, struct sequence*);
0107 double get_refpos(struct sequence* sequ);
0108 double hidden_node_pos(char* name, struct sequence*);
0109 void link_in_front(struct node*, struct node* el);
0110 void resequence_nodes(struct sequence*);
0111 void store_node_value(const char* par, double* value);
0112 void store_node_vector(char* par, int* length, double* vector);
0113 int store_no_fd_err(double* errors, int* curr);
0114 int count_nodes(struct sequence*);
0115 void current_node_name(char* name, int* lg);
0116 int get_node_count(struct node*);
0117 double line_nodes(struct char_p_array* flat);
0118 void node_string(const char* key, char* string, int* l);
0119 int remove_one(struct node*);
0120 void replace_one(struct node*, struct element*);
0121 int retreat_node(void);
0122 void set_node_bv(struct sequence*);
0123 void set_new_position(struct sequence*);
0124 int advance_to_pos(char* table, int* t_pos);
0125 int node_apertype(void);
0126 int inside_userdefined_geometry(double *x, double *y);
0127 int get_userdefined_geometry(double* x, double *y, int* maxlen);
0128 int get_userdefined_geometry_len(void);
0129 int is_permalign(void);
0130 double get_length_(void);
0131 void node_aperture_vector(double * vec);
0132 void node_aperture_offset(double * vec);
0133 void alloc_tt_attrib(int *length);
0134 void set_tt_attrib(int *index, double *value);
0135 double get_tt_attrib(int *index);
0136 void set_tt_multipoles(int *maxmul);
0137 void get_tt_multipoles(int *nn, double *knl, int *ns, double *ksl);
0138 double node_obs_point(void);
0139 void store_orbit_correctors(void);
0140 double get_closed_orb_node(int *index);
0141 void set_closed_orb_node(int *index, double *pos);
0142
0143 #endif
0144