Radar360Class::Radar360Class( int type, SimMoverClass* parentPlatform ) : RadarClass(type, parentPlatform)
{
	wantMode = mode = AA;
	wantRange = 20.0f;
	wantLock = lockCmd = NOCHANGE;

	SetSeekerPos( 0.0f, 0.0f );
	NewRange( wantRange );

	cursorX = 0.0f;
	cursorY = 0.5f;
	flags = 0;

	maxRangeNM = 40.0; // JB 011213
	AWACSMode = false; // JB 011213
}
Exemple #2
0
////////////////////////////////////////////////////////////////////////////////
// SetChannelProperty()
//
// Called by the engine when a channel property is set
// An interface to the property, the new value and as a link to the channel are passed 
// to the method
////////////////////////////////////////////////////////////////////////////////
STDMETHODIMP CetfarduinoAin::SetChannelProperty(long UserVal, tagNESTABLEPROP* pChan, VARIANT* NewValue)
{
    int Index = pChan->Index-1;  // we use 0 based index
	variant_t& vtNewValue = reinterpret_cast<variant_t&>(*NewValue);
	
	// Input Range property
	if(UserVal == USER_INPUTRANGE) {
		TSafeArrayAccess<double> NewRange(NewValue);
		Range* range = 0;
		RETURN_HRESULT(FindRange(NewRange[0], NewRange[1], range));
		NewRange[0] = range->minVal;
		NewRange[1] = range->maxVal;
		_updateChildren = true;
	}
	_updateChildren = true;
    return S_OK;
}
// NOTE:  Right now AUTO mode is functional, BUT THERE IS NOT WAY TO GET INTO IT.  
//        I'm considering removing it.  SCR 9/2/98
void Radar360Class::ExecModes( int newDesignate, int newDrop )
{
	// Stick in AUTO mode until we are commaned out or get a lock
	if ((lockCmd == AUTO) && (lockedTarget == NULL)) {
		wantLock = AUTO;
	}

	// Change modes if such has been requested
	if (mode != wantMode) {
		mode = wantMode;
		wantLock = NOCHANGE;

		// Drop our current target, if any
		ClearSensorTarget();
	}

	// Change ranges if such has been requested
	if (wantRange != rangeNM) {
		if ((wantRange >= 5.0f) && (wantRange <= max(40.0, maxRangeNM * 1.5))) {
         if (!(flags & CursorMoving)) {
            cursorY = 0.0F;
         }
			NewRange( wantRange );
		}
	}

	// Handle targeting commands
	if (newDrop) {
		lockCmd = NOCHANGE;
		ClearSensorTarget();
	} else if (newDesignate) {
		// Designate a new target
		lockCmd = CURSOR;
	} else {
		lockCmd = wantLock;
	}

	wantLock = NOCHANGE;
}