Commit 3c0bb003 authored by Thomas White's avatar Thomas White
Browse files

hdfsee: Set ring size on command line

parent 522bdf29
......@@ -1686,7 +1686,7 @@ DisplayWindow *displaywindow_open(const char *filename, const char *peaks,
int boost, int binning, int cmfilter,
int noisefilter, int colscale,
const char *element, const char *geometry,
int show_rings)
int show_rings, double ring_size)
{
DisplayWindow *dw;
char *title;
......@@ -1714,7 +1714,7 @@ DisplayWindow *displaywindow_open(const char *filename, const char *peaks,
dw->noisefilter = noisefilter;
dw->not_ready_yet = 1;
dw->surf = NULL;
dw->ring_radius = 5.0;
dw->ring_radius = ring_size;
/* Open the file, if any */
if ( filename != NULL ) {
......
......@@ -100,7 +100,8 @@ extern DisplayWindow *displaywindow_open(const char *filename,
int binning, int cmfilter,
int noisefilter, int colscale,
const char *element,
const char *geometry, int show_rings);
const char *geometry, int show_rings,
double ring_size);
#endif /* DISPLAYWINDOW_H */
......@@ -36,6 +36,7 @@ static void show_help(const char *s)
" -h, --help Display this help message.\n"
"\n"
" -p, --peak-overlay=<filename> Draw circles in positions listed in file.\n"
" --ring-size=<n> Set the size for those circles.\n"
" -i, --int-boost=<n> Multiply intensity by <n>.\n"
" -b, --binning=<n> Set display binning to <n>.\n"
" --filter-cm Perform common-mode noise subtraction.\n"
......@@ -97,6 +98,7 @@ int main(int argc, char *argv[])
char *cscale = NULL;
char *element = NULL;
char *geometry = NULL;
double ring_size = 5.0;
/* Long options */
const struct option longopts[] = {
......@@ -110,15 +112,18 @@ int main(int argc, char *argv[])
{"image", 1, NULL, 'e'},
{"geometry", 1, NULL, 'g'},
{"show-rings", 0, &config_showrings, 1},
{"ring-size", 1, NULL, 2},
{0, 0, NULL, 0}
};
gtk_init(&argc, &argv);
/* Short options */
while ((c = getopt_long(argc, argv, "hp:b:i:c:e:g:",
while ((c = getopt_long(argc, argv, "hp:b:i:c:e:g:2:",
longopts, NULL)) != -1) {
char *test;
switch (c) {
case 'h' :
show_help(argv[0]);
......@@ -133,13 +138,15 @@ int main(int argc, char *argv[])
if ( boost < 1 ) {
ERROR("Intensity boost must be a positive"
" integer.\n");
return 1;
}
break;
case 'b' :
binning = atoi(optarg);
if ( boost < 1 ) {
if ( binning < 1 ) {
ERROR("Binning must be a positive integer.\n");
return 1;
}
break;
......@@ -155,6 +162,13 @@ int main(int argc, char *argv[])
geometry = strdup(optarg);
break;
case 2 :
ring_size = strtod(optarg, &test);
if ( test == optarg ) {
ERROR("Ring size must be numerical.\n");
return 1;
}
case 0 :
break;
......@@ -193,7 +207,8 @@ int main(int argc, char *argv[])
config_noisefilter,
colscale, element,
geometry,
config_showrings);
config_showrings,
ring_size);
if ( main_window_list[i] == NULL ) {
ERROR("Couldn't open display window\n");
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment