source: PSPA/madxPSPA/src/mad_seq.h @ 489

Last change on this file since 489 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 3.7 KB
Line 
1#ifndef MAD_SEQ_H
2#define MAD_SEQ_H
3
4// types
5
6struct el_list;
7struct name_list;
8struct vector_list;
9struct constraint_list;
10struct node;
11struct node_list;
12struct expression;
13struct command;
14struct table;
15struct in_cmd;
16
17struct sequence
18{
19  /* original sequence */
20  char name[NAME_L];
21  char export_name[NAME_L];
22  char* refpos;                 /* reference position for insertion */
23  char* next_sequ;              /* name of following sequence (only survey) */
24  int ref_flag;                 /* -1 for exit, 0 for centre, 1 for entry */
25  int share;                    /* 0 normal, 1 if shared */
26  int nested;                   /* 0 flat, 1 if nested */
27  int con_cnt;                  /* constraint counter */
28  int stamp;
29  int line;                     /* set to 1 if origin is a line */
30  int add_pass;                 /* number of additional passes */
31  double length;                /* length as in declaration */
32  struct expression* l_expr;    /* length expression as in declaration */
33  struct node* start;           /* first node in sequence */
34  struct node* end;             /* last node in sequence */
35  struct node_list* nodes;      /* alphabetic list of nodes */
36  struct el_list* cavities;     /* alphabetic list of cavities */
37  struct el_list* crabcavities;     /* alphabetic list of crab cavities */
38  struct command* beam;         /* pointer to beam attached */
39  /* expanded sequence */
40  int n_nodes;                  /* number of nodes when expanded */
41  int start_node;               /* first node of current range in all_nodes */
42  int pass_count;               /* number of executed passes */
43  struct node* ex_start;        /* first node in expanded sequence */
44  struct node* ex_end;          /* last node in expanded sequence */
45  struct node* range_start;     /* first node of current range in sequence */
46  struct node* range_end;       /* last node of current range in sequence */
47  struct node** all_nodes;      /* sequential list of all nodes */
48  struct node_list* ex_nodes;   /* alphabetic list of nodes (no drifts) */
49  struct table* tw_table;       /* pointer to latest twiss table created */
50  int           tw_valid;       /* true if current tw_table is valid */
51  struct constraint_list* cl;   /* pointer to constraint list during match */
52  struct vector_list* orbits;   /* pointer to list of stored orbits */
53};
54
55struct sequence_list /* contains list of sequence pointers sorted by name */
56{
57  char name[NAME_L];
58  int  max,                     /* max. pointer array size */
59       curr;                    /* current occupation */
60  struct name_list* list;       /* index list of names */
61  struct sequence** sequs;      /* sequence pointer list */
62  int stamp;
63};
64
65// interface
66
67struct node*     new_sequ_node(struct sequence*, int occ_cnt);
68struct sequence* new_sequence(char* name, int ref);
69struct sequence* delete_sequence(struct sequence*);
70struct sequence_list* new_sequence_list(int length);
71
72void    use_sequ(struct in_cmd*);
73void    remove_from_sequ_list(struct sequence*, struct sequence_list*);
74double  sequence_length(struct sequence*);
75void    enter_sequence(struct in_cmd*);
76int     aperture_count(struct sequence*);
77void    enter_sequ_reference(struct in_cmd*, struct sequence*);
78void    exec_dumpsequ(struct in_cmd*);
79void    exec_save(struct in_cmd*);
80void    exec_extract(struct in_cmd*);
81void    expand_curr_sequ(int flag);
82void    add_to_sequ_list(struct sequence*, struct sequence_list*);
83void    reset_errors(struct sequence*);
84void    reset_sector(struct sequence*, int val);
85int     restart_sequ(void);
86void    seq_edit_main(struct in_cmd*);
87int     set_enable(char* type, struct in_cmd*);
88void    set_sequence(char* name);
89int     set_cont_sequence(void);
90int     sequ_check_valid_twiss(struct sequence*);
91
92#endif // MAD_SEQ_H
93
Note: See TracBrowser for help on using the repository browser.