Changeset 13404
- Timestamp:
- May 16, 2007, 4:00:06 PM (19 years ago)
- Location:
- branches/kapa-mods-2007-05/Ohana/src
- Files:
-
- 17 edited
-
addstar/src/SEDops.c (modified) (2 diffs)
-
gastro/src/plotstuff.c (modified) (2 diffs)
-
gastro2/src/plotstuff.c (modified) (2 diffs)
-
kapa2/include/prototypes.h (modified) (1 diff)
-
kapa2/src/CheckPipe.c (modified) (1 diff)
-
kapa2/src/Sections.c (modified) (1 diff)
-
libkapa/doc/api.txt (modified) (1 diff)
-
libkapa/include/kapa.h (modified) (1 diff)
-
libkapa/src/KapaWindow.c (modified) (1 diff)
-
opihi/cmd.astro/region.c (modified) (1 diff)
-
opihi/cmd.data/clear.c (modified) (2 diffs)
-
opihi/cmd.data/section.c (modified) (5 diffs)
-
opihi/dvo/fitcolors.c (modified) (2 diffs)
-
opihi/dvo/fitsed.c (modified) (2 diffs)
-
relastro/src/plotstuff.c (modified) (1 diff)
-
relphot/src/plotstuff.c (modified) (1 diff)
-
uniphot/src/plotstuff.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/kapa-mods-2007-05/Ohana/src/addstar/src/SEDops.c
r8361 r13404 111 111 graphdata.style = 2; 112 112 graphdata.ptype = 2; 113 KapaClear (Xgraph, TRUE);113 KapaClearSections (Xgraph); 114 114 magSection.name = strcreate ("mag"); 115 115 magSection.x = 0; … … 156 156 SWAP (graphdata.ymin, graphdata.ymax); 157 157 158 KapaClear (Xgraph, TRUE);158 KapaClearSections (Xgraph); 159 159 KapaSetSection (Xgraph, &magSection); 160 160 KapaSetLimits (Xgraph, &graphdata); -
branches/kapa-mods-2007-05/Ohana/src/gastro/src/plotstuff.c
r13402 r13404 36 36 void PrepPlotting (int Npts, Graphdata *graphmode, int N) { 37 37 38 if (Xgraph[N] == 0) return; 39 38 40 active = N; 39 41 if (Npts < 1) return; … … 63 65 64 66 if (Xgraph[N] < 1) if (!open_graph(N)) return; 65 KapaClear (Xgraph[N], TRUE);67 KapaClearSections (Xgraph[N]); 66 68 } 67 69 -
branches/kapa-mods-2007-05/Ohana/src/gastro2/src/plotstuff.c
r13402 r13404 28 28 29 29 void DonePlotting (Graphdata *graphmode, int N) { 30 char buffer[65], buffer2[65];31 30 31 if (Xgraph[N] == 0) return; 32 32 KapaBox (Xgraph[N], graphmode); 33 return; 33 34 } 34 35 35 36 void PrepPlotting (int Npts, Graphdata *graphmode, int N) { 36 37 37 int i, status; 38 char buffer[128], buffer2[128]; 38 if (Xgraph[N] == 0) return; 39 39 40 40 active = N; … … 65 65 66 66 if (Xgraph[N] < 1) if (!open_graph(N)) return; 67 KapaClear (Xgraph[N], TRUE);67 KapaClearSections (Xgraph[N]); 68 68 } 69 69 -
branches/kapa-mods-2007-05/Ohana/src/kapa2/include/prototypes.h
r13402 r13404 56 56 int SetSection PROTO((int sock)); 57 57 int ListSection PROTO((int sock)); 58 int MoveSection PROTO((int sock)); 58 59 int DefineSection PROTO((int sock)); 59 60 int SetFont PROTO((int sock)); -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/CheckPipe.c
r13402 r13404 142 142 } 143 143 144 if (!strcmp (word, "MSEC")) { 145 status = MoveSection (sock); 146 KiiSendCommand (sock, 4, "DONE"); 147 return (TRUE); 148 } 149 144 150 if (!strcmp (word, "FONT")) { 145 151 status = SetFont (sock); -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/Sections.c
r13401 r13404 154 154 return; 155 155 } 156 157 // return TRUE even for nonsense cases to avoid quitting kapa 158 int MoveSection (int sock) { 159 160 char name[128]; 161 char direction[16]; 162 Section *tmpSection = NULL; 163 164 KiiScanMessage (sock, "%s %s", name, direction); 165 166 N = GetSectionByName (name); 167 if (N < 0) { 168 fprintf (stderr, "section %s not found\n", name); 169 return (TRUE); 170 } 171 172 if (!strcasecmp (direction, "up")) { 173 if (N < 0) return (TRUE); 174 if (N > Nsections - 2) return (TRUE); 175 tmpSection = sections[N]; 176 sections[N] = sections[N+1]; 177 sections[N] = tmpSection; 178 Refresh (1); 179 return (TRUE); 180 } 181 182 if (!strcasecmp (direction, "down")) { 183 if (N < 1) return (TRUE); 184 if (N > Nsections - 1) return (TRUE); 185 tmpSection = sections[N]; 186 sections[N] = sections[N-1]; 187 sections[N] = tmpSection; 188 Refresh (1); 189 return (TRUE); 190 } 191 192 if (!strcasecmp (direction, "top")) { 193 if (N < 0) return (TRUE); 194 if (N > Nsections - 2) return (TRUE); 195 tmpSection = sections[N]; 196 for (i = N; i < Nsections - 1; i++) { 197 sections[i] = sections[i+1]; 198 } 199 sections[i] = tmpSection; 200 Refresh (1); 201 return (TRUE); 202 } 203 204 if (!strcasecmp (direction, "bottom")) { 205 if (N < 1) return (TRUE); 206 if (N > Nsections - 1) return (TRUE); 207 tmpSection = sections[N]; 208 for (i = N; i >= 1; i--) { 209 sections[i] = sections[i-1]; 210 } 211 sections[i] = tmpSection; 212 Refresh (1); 213 return (TRUE); 214 } 215 fprintf (stderr, "unknown direction %s for MoveSection\n", direction); 216 return (TRUE); 217 } -
branches/kapa-mods-2007-05/Ohana/src/libkapa/doc/api.txt
r13402 r13404 17 17 SLIM | SetLimits | KapaWindow.c | KapaSetLimits 18 18 DSEC | DefineSection | KapaWindow.c | KapaSetSection 19 MSEC | MoveSection | KapaWindow.c | KapaMoveSection 19 20 CENT | Center | KapaWindow.c | KiiCenter 20 21 QUIT | Quit | KiiOpen.c | KiiClose -
branches/kapa-mods-2007-05/Ohana/src/libkapa/include/kapa.h
r13402 r13404 154 154 int KapaSelectSection (int fd, char *name); 155 155 int KapaGetSection (int fd, char *name); 156 int KapaMoveSection (int fd, KapaSection *section, char *direction); 156 157 157 158 /* KapaColors */ -
branches/kapa-mods-2007-05/Ohana/src/libkapa/src/KapaWindow.c
r13402 r13404 240 240 } 241 241 242 int KapaMoveSection (int fd, char *name, char *direction) { 243 244 if (!strcasecmp(direction, "up")) goto valid; 245 if (!strcasecmp(direction, "down")) goto valid; 246 if (!strcasecmp(direction, "top")) goto valid; 247 if (!strcasecmp(direction, "bottom")) goto valid; 248 249 fprintf (stderr, "unexpected direction %s\n", direction); 250 return (FALSE); 251 252 valid: 253 KiiSendCommand (fd, 4, "MSEC"); 254 KiiSendMessage (fd, "%s %s", name, direction); 255 KiiScanCommand (fd, 4, "%s", word); 256 if (strcmp (word, "DONE")) { 257 fprintf (stderr, "unexpected response %s\n", word); 258 return (FALSE); 259 } 260 261 return (TRUE); 262 } 263 242 264 int KapaSelectSection (int fd, char *name) { 243 265 -
branches/kapa-mods-2007-05/Ohana/src/opihi/cmd.astro/region.c
r13402 r13404 107 107 graphmode.coords.cdelt1 = graphmode.coords.cdelt2 = 1.0; 108 108 109 KapaClear (kapa, TRUE);109 KapaClearSections (kapa); 110 110 KapaSetLimits (kapa, &graphmode); 111 111 -
branches/kapa-mods-2007-05/Ohana/src/opihi/cmd.data/clear.c
r13391 r13404 1 1 # include "data.h" 2 2 3 // default is to clear all plots, but not the sections or the images 3 4 int clear (int argc, char **argv) { 4 5 5 int N , ClearSection;6 int N; 6 7 int kapa; 7 8 char *name; … … 16 17 FREE (name); 17 18 18 /* XXX need to distinguish between Plot, AllPlots, Image, AllSections */ 19 ClearSection = FALSE; 20 if ((N = get_argument (argc, argv, "-s"))) { 21 remove_argument (N, &argc, argv); 22 ClearSection = TRUE; 19 // clear all sections 20 if ((N = get_argument (argc, argv, "-s")) || 21 (N = get_argument (argc, argv, "-section"))) { 22 KapaClearSections (kapa); 23 return (TRUE); 24 } 25 26 // clear all sections 27 if ((N = get_argument (argc, argv, "-graph"))) { 28 KapaClearCurrentPlot (kapa); 29 return (TRUE); 30 } 31 32 // clear image 33 if ((N = get_argument (argc, argv, "-image"))) { 34 KapaClearImage (kapa); 35 return (TRUE); 23 36 } 24 37 25 38 if (argc != 1) { 26 gprint (GP_ERR, "USAGE: clear [-n Xgraph]\n"); 39 gprint (GP_ERR, "USAGE: clear [-n Xgraph] [-s|-section] [-image] [-graph]\n"); 40 gprint (GP_ERR, " [-s|-section] : clear all sections\n"); 41 gprint (GP_ERR, " [-graph] : clear current graph\n"); 42 gprint (GP_ERR, " [-image] : clear current image\n"); 27 43 return (FALSE); 28 44 } 29 45 30 KapaClear (kapa, ClearSection);46 KapaClearPlots (kapa); 31 47 return (TRUE); 32 48 } -
branches/kapa-mods-2007-05/Ohana/src/opihi/cmd.data/section.c
r13391 r13404 1 1 # include "data.h" 2 3 enum {NONE, LIST, UP, DOWN, TOP, BOTTOM}; 2 4 3 5 int section (int argc, char **argv) { 4 6 5 int N, List;7 int N, action; 6 8 int kapa; 7 9 char *name; … … 9 11 KapaSection section; 10 12 11 List = FALSE;13 action = NONE; 12 14 if ((N = get_argument (argc, argv, "-list"))) { 13 15 remove_argument (N, &argc, argv); 14 List = TRUE; 16 action = LIST; 17 } 18 if ((N = get_argument (argc, argv, "-up"))) { 19 remove_argument (N, &argc, argv); 20 action = UP; 21 } 22 if ((N = get_argument (argc, argv, "-down"))) { 23 remove_argument (N, &argc, argv); 24 action = DOWN; 25 } 26 if ((N = get_argument (argc, argv, "-top"))) { 27 remove_argument (N, &argc, argv); 28 action = TOP; 29 } 30 if ((N = get_argument (argc, argv, "-bottom"))) { 31 remove_argument (N, &argc, argv); 32 action = BOTTOM; 15 33 } 16 34 … … 28 46 KapaGetSection (kapa, "*"); 29 47 gprint (GP_ERR, "USAGE: section name [x y dx dy]\n"); 48 gprint (GP_ERR, "USAGE: section name [-list] [-up] [-down] [-top] [-bottom]\n"); 30 49 return (TRUE); 31 50 } … … 33 52 if (argc == 2) { 34 53 /* select / show section */ 35 if (List) { 36 KapaGetSection (kapa, argv[1]); 37 } else { 38 KapaSelectSection (kapa, argv[1]); 54 switch (action) { 55 case NONE: 56 KapaSelectSection (kapa, argv[1]); 57 break; 58 59 case UP: 60 KapaMoveSection (kapa, argv[1], "up"); 61 break; 62 case DOWN: 63 KapaMoveSection (kapa, argv[1], "down"); 64 break; 65 case TOP: 66 KapaMoveSection (kapa, argv[1], "top"); 67 break; 68 case BOTTOM: 69 KapaMoveSection (kapa, argv[1], "bottom"); 70 break; 71 72 case LIST: 73 KapaGetSection (kapa, argv[1]); 74 break; 39 75 } 40 76 return (TRUE); … … 52 88 } 53 89 gprint (GP_ERR, "USAGE: section name [x y dx dy]\n"); 90 gprint (GP_ERR, "USAGE: section name [-list] [-up] [-down] [-top] [-bottom]\n"); 54 91 return (FALSE); 55 92 } -
branches/kapa-mods-2007-05/Ohana/src/opihi/dvo/fitcolors.c
r13391 r13404 95 95 graphdata.style = 2; 96 96 graphdata.ptype = 2; 97 KapaClear (kapa, TRUE);97 KapaClearSections (kapa); 98 98 KapaSetFont (kapa, "helvetica", 14); 99 99 … … 337 337 sprintf (filename, "%s.%02d.png", plotname, Nplot); 338 338 KapaPNG (kapa, filename); 339 KapaClear (kapa, TRUE);339 KapaClearSections (kapa); 340 340 Nplot++; 341 341 } -
branches/kapa-mods-2007-05/Ohana/src/opihi/dvo/fitsed.c
r13391 r13404 161 161 graphdata.style = 2; 162 162 graphdata.ptype = 2; 163 KapaClear (kapa, TRUE);163 KapaClearSections (kapa); 164 164 magSection.name = strcreate ("mag"); 165 165 magSection.x = 0; … … 261 261 SWAP (graphdata.ymin, graphdata.ymax); 262 262 263 KapaClear (kapa, TRUE);263 KapaClearSections (kapa); 264 264 KapaSetSection (kapa, &magSection); 265 265 KapaSetLimits (kapa, &graphdata); -
branches/kapa-mods-2007-05/Ohana/src/relastro/src/plotstuff.c
r13402 r13404 63 63 if (Xgraph[N] < 1) if (!open_graph(N)) return; 64 64 65 KapaClear (Xgraph[N], TRUE);65 KapaClearSections (Xgraph[N]); 66 66 67 67 KapaPrepPlot (Xgraph[N], Npts, graphmode); -
branches/kapa-mods-2007-05/Ohana/src/relphot/src/plotstuff.c
r13402 r13404 63 63 if (Xgraph[N] < 1) if (!open_graph(N)) return; 64 64 65 KapaClear (Xgraph[N], TRUE);65 KapaClearSections (Xgraph[N]); 66 66 67 67 KapaPrepPlot (Xgraph[N], Npts, graphmode); -
branches/kapa-mods-2007-05/Ohana/src/uniphot/src/plotstuff.c
r13402 r13404 72 72 73 73 if (Xgraph[N] < 1) if (!open_graph(N)) return; 74 KapaClear (Xgraph[N], TRUE);74 KapaClearSections (Xgraph[N]); 75 75 } 76 76
Note:
See TracChangeset
for help on using the changeset viewer.
