Skip to content. | Skip to navigation

Personal tools

edslog.h

edslog.h

edslog.h

/////////////////////////////////////////////////////////////////////////////
// EDSLOG.H
//
//  Last updated: 7/10/2004
//
//  This file contains code to implement the Engineering Data Stream (EDS)
//  log.
/////////////////////////////////////////////////////////////////////////////

#include <stdarg.h>
#include <time.h>

unsigned EDSTime; // Time in ms of last periodic EDS Update
unsigned EDSTimeIR; // Time in ms of last EDS Update for non-enabled IRs

/////////////////////////////////////////////////////////////////////////////
// CEDSLog Class Definition
//
//  The CEDSLog class implements a circular log in memory.
//  The class is capable of adding to the log, and reporting log entried
//  to a host computer.
//  Call the Init member function before using any of the other functions.

typedef char edsstr[120]; // All log entries are ~99 character strings

class CEDSLog
{
	public:
	void Init(int logSize);
	// Init initializes the log.  Pass it:
	// logSize: number of lines in the log
	void Add(int messagenum,char* data,...);
	// Add adds a log entry to the log. Pass it the string to add in data
	void SendNextMessage();
	// Sends the oldest message in the queue to the host computer
	void RepeatLastMessage();
	// Re-sends the oldest message in the queue to the host computer

	private:
	int First; 				// Stores the array index of the oldest log entry
	int Index; 				// Stores the array index of the next message to send
	int LastIndex;		// Stores the array index of the last message sent
	int Last;  				// Stores the array index of the newest log entry
	int LogSize; 			// Stores the maximum number of lines in the log
	edsstr * Data; 		// Array of strings for the log
} EDSLog;

/////////////////////////////////////////////////////////////////////////////
// UpdateEDS - Add periodic EDS entries
void UpdateEDS();

Generated by GNU Enscript 1.6.5.2.
Document Actions