Skip to content. | Skip to navigation

Personal tools




//  Last updated: 5/21/1998
//  Part of the source code for the Vane End Actuator Control System
//  This file contains the flags for the program

// Flag value definitions

// Global quit flag
int Quit = 0; // Set to 1 to quit

// Tension display flags
#define TDPounds 0 	// Tensions are displayed in pounds
#define TDmV 1      // Tensions are displayed in mV

// Status flags
#define SFMoveInProgress 1		// Motors are in motion
#define SFHostUp 2						// Host computer is up

// Fatal flags
#define FFINIFile 1						// VANE.INI was nonexistent or corrupted
#define FFHome 2              // Homing operation failed
#define FFOverheat 4					// Motors overheating
#define FFEmergencyStop 8			// Emergency stop card has triggered
#define FFTensions 16         // Error reading tensions
#define FFNoMotorResponse 32 	// Encoders not changing with move commands
#define FFCheckFatal 64				// Error checking for fatal errors
#define FFEncoders 128				// Error reading encoders
#define FFEncoderLimit 256		// Encoders past soft limits
#define FFTensionLimit 512    // Tensions past soft limits

// Movement stage flag
#define MSIdle 0						// No movement
#define MSMacroMove 1				// Large moves towards final destination
#define MSMicroMove 2				// Delicate movements to ultimate destination
#define MSBacklash 3				// Backlash removal

// CFlags Class Definition

class CFlags
	int TensionDisplay; // Flag: see the tension display definitions
	int Status; 				// Flag: see the status flag definitons above
	int Fatal;					// Flag: see the fatal flag definitions above
	int MoveStage;			// Flag: see the movement stage definitions
	int DumpLogOnFatal;	// Flag: 1 means dump the log on a fatal error (set in INI)

	void Init(); // Sets all flags to their default values
	void DisplayAll(); // Displays all status flag information onscreen
	void ToggleTensionDisplay(); // Switches tensions between pounds/mV
	void SetStatus(int SF); // Sets the specified status flag
	void ClearStatus(int SF); // Sets the specified status flag
	int CheckStatus(int SF); // Sets the specified status flag
	void SetFatal(int FF); // Sets the specified fatal flag
	// Note that if this is the first fatal flag to be set, a
	// time-stamped log file is automatically generated.
	void ClearFatal(int FF); // Clears the specified fatal flag
	int CheckFatal(int FF); // Returns the specified fatal flag
	void SetMoveStage(int MS); // Sets the current movement stage
} Flags;

Generated by GNU Enscript
Document Actions