Skip to content
Snippets Groups Projects
Commit a94174a9 authored by zhang's avatar zhang
Browse files

23/03/2011

1) Add "PrintCODFlag"
parent 6c9df245
No related branches found
No related tags found
No related merge requests found
......@@ -34,8 +34,7 @@ int main(int argc, char *argv[]) {
// globval.pathlength = false;
// globval.bpm = 0;
// const double x_max_FMA = 10e-3, delta_FMA = 10e-2;
// const int n_x = 801, n_dp = 80, n_tr = 2048;
long i=0L; //initilize the for loop to read command string
char CommandStr[max_str];
double nux = 0, nuy = 0, ksix = 0, ksiy = 0;
......@@ -68,11 +67,11 @@ int main(int argc, char *argv[]) {
}
/************************************************************************
writes flat file with all the design values of the lattice, very important file for debug
print files, very important file for debug
*************************************************************************/
//print flat file with all the design values of the lattice,
prtmfile("flat_file.dat");
// print cod
// print close orbit to a file
getcod(dP, lastpos);
prt_cod("cod.out", globval.bpm, true);
......@@ -97,6 +96,14 @@ int main(int argc, char *argv[]) {
cout << "print the twiss parameters to file: "<< twiss_file << "\n";
printlatt(twiss_file);
}
//print the close orbit
else if(strcmp(CommandStr,"PrintCODFlag") == 0) {
cout << "\n";
cout << "print the close orbit to file: "<< cod_file << "\n";
getcod(dP, lastpos);
prt_cod(cod_file, globval.bpm, true);
}
//turn on flag for quadrupole fringe field
else if(strcmp(CommandStr,"QuadFringeOnFlag") == 0) {
......
......@@ -113,6 +113,6 @@
extern char chamber_file[max_str];
extern char twiss_file[max_str];
extern char cod_file[max_str];
// function
void read_script(const char *param_file_name, bool rd_lat,long& CommNo, UserCommand UserCommandFlag[]);
......@@ -30,6 +30,8 @@
/* files */
//twiss file
char twiss_file[max_str];
// cod file
char cod_file[max_str];
//chamber file
char chamber_file[max_str];
// multipole files
......@@ -150,10 +152,15 @@ void read_script(const char *param_file_name, bool rd_lat, long& CommNo, UserCom
}
/* read in bool flags */
//print twiss parameters flag flag
//print twiss parameters flag
else if (strcmp("PrintTwissFlag", name) == 0){
sscanf(line, "%*s %s", twiss_file);
strcpy(UserCommandFlag[CommNo].CommandStr,name);
}
//print close orbit(COD) flag
else if (strcmp("PrintCODFlag", name) == 0){
sscanf(line, "%*s %s", cod_file);
strcpy(UserCommandFlag[CommNo].CommandStr,name);
}
//read chamber file flat
else if (strcmp("ReadChamberFlag", name) == 0){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment