Skip to content

Commit

Permalink
Hitting '.' brings up the splash screen, which now gives you info on …
Browse files Browse the repository at this point in the history
…which JPL DE ephemeris you're using, Earth orientation parameters, and debiasing. The 'hint' text now tells you which hotkey corresponds to a given action.
  • Loading branch information
Bill-Gray committed Aug 25, 2023
1 parent 32e7c19 commit 1ca9ac6
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 30 deletions.
6 changes: 3 additions & 3 deletions command.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ w Worst
| MonteCarlo
[ CovarData
` CmtMags
Ctrl-W ToggUp
F2 ToggDn
Shift-Up ToggUp
Shift-Dn ToggDn
Ctrl-Y BanObs
Ctrl-X SaveOrbs
) ReadFile
Expand Down Expand Up @@ -88,7 +88,7 @@ r Enter dist to object at start and end of arc
q Quit Find_Orb
o Open a file of astrometry
n Select a different object from the file
F16 (shift-F4) Add astrometry for a different object
Shift-F4 Add astrometry for a different object
m Generate ephemerides
f Do a full least-squares improvement of the orbit
h Compute an orbit using the method of Herget
Expand Down
46 changes: 39 additions & 7 deletions findorb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,29 @@ static int get_character_code( const char *buff)
rval = atoi( buff + 2);
else if( !memcmp( buff, "Ctrl-", 5))
rval = buff[5] - 64;
else if( !memcmp( buff, "Shift-", 6))
{
if( !memcmp( buff + 6, "Up", 2))
#ifdef __PDCURSES__
rval = KEY_SUP;
#else
rval = KEY_SR;
#endif
else if( !memcmp( buff + 6, "Dn", 2))
#ifdef __PDCURSES__
rval = KEY_SDOWN;
#else
rval = KEY_SF;
#endif
else if( buff[6] == 'F')
rval = KEY_F( 12 + atoi( buff + 7));
else /* shouldn't happen */
{
rval = 0;
fprintf( stderr, "Buff '%s'\n", buff);
assert( 0);
}
}
else
rval = *buff;
return( rval);
Expand Down Expand Up @@ -3674,14 +3697,16 @@ static void show_splash_screen( void)
if( ifile)
{
char buff[200], eop_line_1[200], *eop_line_2;
char debias_text[100];
char debias_text[100], jpl_ephem_text[250];
bool show_it = false;

debias_info_text( debias_text, sizeof( debias_text));
eop_info_text( eop_line_1, sizeof( eop_line_1));
eop_line_2 = strchr( eop_line_1, '\n');
if( eop_line_2)
*eop_line_2++ = '\0';
if( !format_jpl_ephemeris_info( jpl_ephem_text))
strlcpy_error( jpl_ephem_text, " No JPL DE ephemeris set up");
clear( );
while( !show_it && fgets( buff, sizeof( buff), ifile))
{
Expand All @@ -3696,6 +3721,7 @@ static void show_splash_screen( void)
text_search_and_replace( buff, "$d", debias_text);
text_search_and_replace( buff, "$e1", eop_line_1);
text_search_and_replace( buff, "$e2", (eop_line_2 ? eop_line_2 : ""));
text_search_and_replace( buff, "$j", jpl_ephem_text + 1);
put_colored_text( buff, (LINES - lines) / 2 + i, 0, -1, COLOR_BACKGROUND);
}
}
Expand Down Expand Up @@ -3766,10 +3792,19 @@ static int show_hint( const unsigned mouse_x, const unsigned mouse_y, size_t *in
&& memcmp( buff, "Start h", 7))
; /* just skip lines until we get to the section we want */
while( !got_it && fgets_trimmed( buff, sizeof( buff), ifile))
got_it = (get_character_code( buff) == cmd);
if( *buff > ' ')
got_it = (get_character_code( buff) == cmd);
fclose( ifile);
if( got_it)
{
char hotkey[15];

memcpy( hotkey, buff, 15);
*strchr( hotkey, ' ') = '\0';
memmove( buff, buff + 15, strlen( buff + 14));
if( hotkey[1] != '+') /* skip the U+nnnn cases */
snprintf_append( buff, sizeof( buff), "\nHotkey for this is %s", hotkey);
}
else
*buff = '\0';
if( *buff) /* yes, we have a hint to show */
Expand Down Expand Up @@ -5911,17 +5946,14 @@ int main( int argc, const char **argv)
case ',':
show_a_file( "debug.txt", 0);
break;
case '.':
case KEY_F( 15): /* shift-f3 : show Curses info */
{
snprintf_err( tbuff, sizeof( tbuff), "%s\n%s\n%s\n",
longname( ), termname( ), curses_version( ));
snprintf_append( tbuff, sizeof( tbuff),
"%d pairs of %d colors\n", COLOR_PAIRS, COLORS);
if( can_change_color( ))
strlcat_error( tbuff, "Colors are changeable\n");
snprintf_append( tbuff, sizeof( tbuff), "Find_Orb version %s\n",
find_orb_version_jd( NULL));
format_jpl_ephemeris_info( tbuff + strlen( tbuff) - 1);
inquire( tbuff, NULL, 0, COLOR_DEFAULT_INQUIRY);
}
break;
Expand Down Expand Up @@ -6346,7 +6378,7 @@ int main( int argc, const char **argv)
case 'c': case 'C':
show_calendar( );
break;
case KEY_F( 15): /* shift-f3 */
case '.':
show_splash_screen( ); /* just to test */
extended_getch( );
break;
Expand Down
40 changes: 20 additions & 20 deletions splash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,33 @@ ______________________
| | $e2
| |
| | $d
| | /|
| | /| $j
| |________________/ |
/ |
/_________________________|
14 62
______________
\ \
| +-------\ \
| | \ \
| | ) ) Project Pluto
| | / / Software for the discriminating astronomer
| +-------/ /
| __________/ Find_Orb orbit determination software
| | Version $v
| | https://www.projectpluto.com/find_orb.htm
| +-------\ \ Project Pluto
| | \ \ Software for the discriminating astronomer
| | ) )
| | / / Find_Orb orbit determination software
| +-------/ / Version $v
| __________/ https://www.projectpluto.com/find_orb.htm
| |
| | /| $e1
| +---------/ | $e2
/_______________| $d
| | $e1
| | $e2
| | /| $d
| +---------/ | $j
/_______________|
10 45
__________
\ ______ \
\ ______ \ Project Pluto
| | \ \
| | ) ) Project Pluto
| |_____/ /
| _______/ Find_Orb orbit determination software
| | Version $v
| | www.projectpluto.com/find_orb.htm
| |_______/| $e1
/___________| $e2
| | ) ) Find_Orb orbit determination software
| |_____/ / Version $v
| _______/ www.projectpluto.com/find_orb.htm
| | $e1
| | $e2
| |_______/| $d
/___________| $j

0 comments on commit 1ca9ac6

Please sign in to comment.