Skip to content. | Skip to navigation

Personal tools




//  Last updated: 10/30/2003
//  Part of the source code for the M3 Program
//  Contains routines for locking and unlocking the M3 turret pin

// M3 Turret pin motions
#define MTPMStop 		0
#define MTPMLock 		1
#define MTPMUnlock	2

// M3 Turret pin limits
#define MTPLNone 		0
#define MTPLLock 		1
#define MTPLUnlock  2
#define MTPLBoth 		3

// M3 Turret Pin Motion Step
#define MTPSNoLimit      0
#define MTPSGoLLimit     1 // Go hit lock limit
#define MTPSWaitLoosePin 2 // Wait till main pin is completely retracted
#define MTPSLoosenPin    3 // Move M3 Turret to retrack dog pin
#define MTPSGoULimit     4 // Go hit unlock limit
#define MTPSHitLimit     5 // Limit hitted (any)

#define StepsToUnlock -150
#define TimePinUnlock 4000

// CM3TurretPin - An object representing the M3 Turret Lock Pin
class CM3TurretPin {
	int Motion;								// Current lock motion
  int OldMotion;
  int Moving;								// Flag, 1 if there's any motion
	int Command;              // Current commanded status
	int Limit;      					// Current lock limit status
	int MotionStep;						// Current step in motion
	dword MotionTimer;    		// Time since motion began in ms
	dword MotionTimeout;			// Time in ms before motion w/o a limit flags an error, set in M3.INI
	void Init();							// Initialize object
	void Update();						// Update lock pin motion, status
	void DisplayAll();				// Display motion and limit status
	void DisplayMotion();			// Display motion
	void DisplayLimit();			// Display limits
	void Lock(int MotionOK);	// Start the pin locking
	void Unlock(int MotionOK);// Start the pin unlocking
  void ForcedUnlock();      // Forced unlock of M3 Turret pin
} M3TurretPin;

Generated by GNU Enscript
Document Actions