From: mark@virtech.uucp (Mark Smith)
Subject: Re: Computerized LogBook
Reply-To: mark@vti.com
Organization: Virtual Technologies, Inc.
X-Newsreader: Tin 1.1 PL5
Date: Wed, 9 Sep 1992 18:17:44 GMT

fsbgf@acad3.alaska.edu wrote:
: Is there any good shareware/freeware program available to track freefall
: time. I'm looking for something like a computer logbook for a MS-DOS or
: windows environment.

Okay, so it's not windows... hey, it's not even mine.  I grabbed it
ages ago from r.s.  I don't even remember ever typing in my data to
it; goodness knows why I've kept it so long.  No guarantees.

========================= jumplog.c ==================================
/* Logbook program - Joe Peterson */
#include <stdio.h>
 
#define MAX_JUMPS 1000
 
int		jump_chart[(MAX_JUMPS-1)/10+1][5], total[5];
 
main()
{
	FILE	*in;
	int		jumps, freefalls, hours, mins, secs;
	int		altitude[MAX_JUMPS], time[MAX_JUMPS];
	int		i, group, num_groups;
	
	in= fopen("logbook.dat", "r");
	
	jumps= 0;
	hours= mins= secs= 0;
	while (1)
	{
		fscanf(in, "%d %d", &altitude[jumps], &time[jumps]);
		if (altitude[jumps] == 0)
			break;
		++jumps;
	}
 
	fclose(in);
	
	for (group=0; group<(MAX_JUMPS/10); ++group)
		for (i=0; i<5; ++i)
			jump_chart[group][i]= 0;
	for (i=0; i<5; ++i)
		total[i]= 0;
		
	freefalls= 0;
	for (i=0; i<jumps; ++i)
	{
		group= i / 10;
		if (time[i] == 0)
		{
			++jump_chart[group][0];
			++total[0];
		}
		else
			if (time[i] <= 39)
			{
				++jump_chart[group][1];
				++total[1];
				++freefalls;
			}
			else
				if (time[i] <= 44)
				{
					++jump_chart[group][2];
					++total[2];
					++freefalls;
				}
				else
					if (time[i] <= 59)
					{
						++jump_chart[group][3];
						++total[3];
						++freefalls;
					}
					else
					{
						++jump_chart[group][4];
						++total[4];
						++freefalls;
					}
 
		secs += time[i];
		while (secs >= 60)
		{
			++mins;
			if (mins == 60)
			{
				++hours;
				mins= 0;
			}
			
			secs -= 60;
		}
	}
	
	num_groups= (jumps - 1) / 10 + 1;
	
	printf("                 ");
	for (group=0; group<num_groups; ++group)
		printf("%2d ", group + 1);
	printf(" Total\n");
	
	printf("                -");
	for (group=0; group<num_groups; ++group)
		printf("---");
	printf("------\n");
	
	printf("Static lines:    ");
	for (group=0; group<num_groups; ++group)
		printf("%2d ", jump_chart[group][0]);
	printf(" %4d\n", total[0]);
	
	printf("1 to 39 secs:    ");
	for (group=0; group<num_groups; ++group)
		printf("%2d ", jump_chart[group][1]);
	printf(" %4d\n", total[1]);
	
	printf("40 to 44 secs:   ");
	for (group=0; group<num_groups; ++group)
		printf("%2d ", jump_chart[group][2]);
	printf(" %4d\n", total[2]);
	
	printf("45 to 59 secs:   ");
	for (group=0; group<num_groups; ++group)
		printf("%2d ", jump_chart[group][3]);
	printf(" %4d\n", total[3]);
	
	printf("60 or more secs: ");
	for (group=0; group<num_groups; ++group)
		printf("%2d ", jump_chart[group][4]);
	printf(" %4d\n\n", total[4]);
	
	printf("Total jumps:         %d\n", jumps);
	printf("Total freefalls:     %d\n", freefalls);
	printf("Total freefall time: %d:%02d:%02d\n", hours, mins, secs);
}
======================================================================
-- 
      /_\   Virtual                  Mark Smith          USPA D-13761
    /-~_  \    Technologies          mark@vti.com
  /      ~-_\     Incorporated       703-430-9247,   FAX 703-450-4560
/_____________\      46030 Manekin Plaza, Suite 160, Dulles, VA 20166
Newsgroups: rec.skydiving