/* ============== Includes ============== */ # include /* ============ Definitions ============= */ # define HELP_SCREEN_SIZE 20 # define MAX_HELP_LINES 9 # define MAX_FLAG_VALUE 16 typedef enum { False=0, True=1 } BOOLEAN; /* ======== Function Prototypes ========= */ void PrintHelpScreen(void); /* ============== Functions ============= */ void PrintHelpScreen(void) { int line; char *HelpScreen[MAX_HELP_LINES] = { "---------------------------------------------", "QFdecode Decodes UVI KPGS gap flag values", "", "Usage: GAPdecode flag" , "", "Params: flag -> Gap Flag from UVI KPGS", "", "Examples: GAPdecode 10", "---------------------------------------------" }; for (line=0; line < MAX_HELP_LINES; ) { printf("%s\n", HelpScreen[line++]); if ( !(line % HELP_SCREEN_SIZE) ) { printf("Press ENTER to continue: "); getchar(); } } } /* PrintHelpScreen */ int main( int argc, char *argv[] ) { int i; int GAPcode=-1; /* check for input arguments */ if(argc < 2) { PrintHelpScreen(); exit(1); } sscanf(argv[1],"%d", &GAPcode); printf("\nGap Flag: %d\n\n",GAPcode); if(GAPcode == 0) { printf("No gap condition was flagged.\n"); } else { switch (GAPcode) { case 1: printf("UVI in wrong mode.\n"); break; case 2: printf("Missing data.\n"); break; case 3: printf("Data too noisy to process.\n"); break; case 10: printf("UVI HVPS not enabled.\n"); break; case 11: printf("UVI gain set to zero.\n"); break; case 12: printf("Desired image was missing frame 1 hsk.\n"); break; case 13: printf("UVI KPGS was unable to find telemetry sync.\n"); break; case 14: printf("No background images were available\n"); break; case 15: printf("Desired image was not present.\n"); break; case 16: printf("Spacecraft was at low altitudes.\n"); break; case 17: printf("Despun platform was pointed away from the earth.\n"); break; case 18: printf("Data was outside processing time period.\n"); break; case 19: printf("Unknown cause for gap.\n"); break; default: printf("UNDEFINED GAP EVENT.\n"); break; } } printf("\n"); } /* main */