Feature: resize window width/height option
parent
eb09dee8c3
commit
6c7fa97a96
24
skymap.c
24
skymap.c
|
@ -42,7 +42,7 @@ struct map
|
||||||
int level, grid, site_id, plotstars, plotapex;
|
int level, grid, site_id, plotstars, plotapex;
|
||||||
int leoflag, iodflag, iodpoint, visflag, planar, pssatno, psnr, xyzflag,
|
int leoflag, iodflag, iodpoint, visflag, planar, pssatno, psnr, xyzflag,
|
||||||
pflag, graves;
|
pflag, graves;
|
||||||
float psrmin, psrmax, rvis;
|
float psrmin, psrmax, rvis, width, height;
|
||||||
} m;
|
} m;
|
||||||
struct sat
|
struct sat
|
||||||
{
|
{
|
||||||
|
@ -146,6 +146,8 @@ usage ()
|
||||||
printf ("-D, --decl Decl. [+dd:mm:ss.ss]\n");
|
printf ("-D, --decl Decl. [+dd:mm:ss.ss]\n");
|
||||||
printf ("-A, --azimuth Azimuth (deg)\n");
|
printf ("-A, --azimuth Azimuth (deg)\n");
|
||||||
printf ("-E, --elevation Elevation (deg)\n");
|
printf ("-E, --elevation Elevation (deg)\n");
|
||||||
|
printf ("-w, --width Screen width\n");
|
||||||
|
printf ("-g, --height Screen height\n");
|
||||||
printf ("-S, --all-night All night\n");
|
printf ("-S, --all-night All night\n");
|
||||||
printf ("-Q, --no-stars No stars\n");
|
printf ("-Q, --no-stars No stars\n");
|
||||||
printf
|
printf
|
||||||
|
@ -255,6 +257,8 @@ init_skymap (void)
|
||||||
m.graves = 0;
|
m.graves = 0;
|
||||||
m.plotstars = 1;
|
m.plotstars = 1;
|
||||||
m.plotapex = 1;
|
m.plotapex = 1;
|
||||||
|
m.width=800;
|
||||||
|
m.height=600;
|
||||||
|
|
||||||
// Default settings
|
// Default settings
|
||||||
strcpy (m.observer, "Unknown");
|
strcpy (m.observer, "Unknown");
|
||||||
|
@ -692,6 +696,8 @@ main (int argc, char *argv[])
|
||||||
{"azimuth", required_argument, 0, 'A'},
|
{"azimuth", required_argument, 0, 'A'},
|
||||||
{"elevation", required_argument, 0, 'E'},
|
{"elevation", required_argument, 0, 'E'},
|
||||||
{"site", required_argument, 0, 's'},
|
{"site", required_argument, 0, 's'},
|
||||||
|
{"width", required_argument, 0, 'w'},
|
||||||
|
{"height", required_argument, 0, 'g'},
|
||||||
{"length", required_argument, 0, 'l'},
|
{"length", required_argument, 0, 'l'},
|
||||||
{"planar-id", required_argument, 0, 'P'},
|
{"planar-id", required_argument, 0, 'P'},
|
||||||
{"planar-alt", required_argument, 0, 'r'},
|
{"planar-alt", required_argument, 0, 'r'},
|
||||||
|
@ -709,7 +715,7 @@ main (int argc, char *argv[])
|
||||||
};
|
};
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
|
|
||||||
c = getopt_long (argc, argv, "t:c:i:R:D:A:E:s:l:P:r:V:p:L:B:H:d:SQah",
|
c = getopt_long (argc, argv, "t:c:i:R:D:A:E:s:w:g:l:P:r:V:p:L:B:H:d:SQah",
|
||||||
long_options, &option_index);
|
long_options, &option_index);
|
||||||
|
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
|
@ -828,6 +834,14 @@ main (int argc, char *argv[])
|
||||||
m.level = 3;
|
m.level = 3;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'w':
|
||||||
|
m.width = atof (optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'g':
|
||||||
|
m.height = atof (optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'Q':
|
case 'Q':
|
||||||
m.plotstars = 0;
|
m.plotstars = 0;
|
||||||
break;
|
break;
|
||||||
|
@ -867,7 +881,7 @@ main (int argc, char *argv[])
|
||||||
strcpy (m.observer, "Manual observer");
|
strcpy (m.observer, "Manual observer");
|
||||||
}
|
}
|
||||||
|
|
||||||
init_plot ("/xs", 0, 0.75);
|
init_plot ("/xs", m.width, m.height);
|
||||||
|
|
||||||
plot_skymap ();
|
plot_skymap ();
|
||||||
|
|
||||||
|
@ -1123,12 +1137,12 @@ plot_visibility (float h)
|
||||||
|
|
||||||
// Initialize plot
|
// Initialize plot
|
||||||
void
|
void
|
||||||
init_plot (char *psfile, float width, float aspect)
|
init_plot (char *psfile, float width, float height)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Initialize plot
|
// Initialize plot
|
||||||
giza_open_device_size_float ("/xs", "skymap", 1920, 1020, 3);
|
giza_open_device_size_float ("/xs", "skymap", width, height, 3);
|
||||||
cpgslw (1);
|
cpgslw (1);
|
||||||
|
|
||||||
skymap_plot_renew ();
|
skymap_plot_renew ();
|
||||||
|
|
Loading…
Reference in New Issue