Beispiel #1
0
/**
 * Hides the current window. 
 * An input of screen height is taken and divided by a constant value to determine how many times to press the down arrow.
 **/
void HideCurWindow(int screenHeight) {
    Alt(KEY_SPACE);
    PressKey(KEY_M, 1);
    PressKey(KEY_DOWN, ((int)(screenHeight/7.2)));
    Mouse.click();
    delay(delayAm);
}
Beispiel #2
0
void test_calls_wptr_chans (Workspace p, Channel *in0, Channel *in1, Channel *out)
{
    int data, timeo;
    Channel local;

    ChanInit (p, &local);
    ChanOut (p, out, &data, sizeof (data));
    ChanIn (p, in0, &data, sizeof (data));

    Alt (p);
    AltEnableChannel (p, 1, in0);
    AltEnableChannel (p, 1, in1);
    AltWait (p);
    AltDisableChannel (p, 1, in0);
    AltDisableChannel (p, 1, in1);
    AltEnd (p);

    timeo = TimerRead (p);
    TAlt (p);
    AltEnableTimeout (p, 1, timeo);
    TAltWait (p);
    AltDisableTimeout (p, 1, timeo);
    AltEnd (p);

    ProcAlt (p, in0, in1, NULL);
    ProcPriAlt (p, in0, in1, NULL);
    ProcPriAltSkip (p, in0, in1, NULL);

    TestChan (p, &local);
}
void CPictureWidget::Draw(CGraphicsContext &aGc) const
{
	if(iActive)
	{
		aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
		aGc.SetPenStyle(CGraphicsContext::ESolidPen);
		aGc.SetPenColor(KRgbBlack);
		TRect rect(point,iSize);
		rect.Move(TPoint(0,-iTextHeight));
		rect.Shrink(-1,-1);
		aGc.DrawRect(rect);
	}

	if(iBitmap)
	{
		aGc.DrawBitmap(TRect(point - TPoint(0,iTextHeight),iSize),iBitmap,TRect(iSize));
	}
	else
	{
		const TDesC& text = /*((CPictureWidget&)element).*/Alt();
		int width = CCoeEnv::Static()->NormalFont()->MeasureText(text);
		TRect rect(point,TSize(width,iTextHeight));
		rect.Move(TPoint(0,-iTextHeight));
		aGc.SetPenStyle(CGraphicsContext::ESolidPen);
		aGc.SetPenColor(KRgbYellow);
		aGc.DrawRect(rect);

		aGc.SetPenColor(KRgbBlue);
		aGc.DrawText(text,point);
	}
}
xyz geolocation::toxyz() const
{
    // Approach developed by:
    //
    // (Olson, D.K. (1996).
    // "Converting earth-Centered, Earth-Fixed Coordinates to Geodetic Coordinates,"
    // IEEE Transactions on Aerospace and Electronic Systems, Vol. 32, No. 1, January 1996, pp. 473 - 476).
    //
    //
    // Java implementation:
    //
    // D. Rose (2014).
    // "Converting between Earth-Centered, Earth Fixed and Geodetic Coordinates"
    //

    //Convert Lat, Lon, Altitude to Earth-Centered-Earth-Fixed (ECEF)
    //Input is a three element array containing lat, lon (rads) and alt (m)
    //Returned array contains x, y, z in meters
    static const double  a = 6378137.0;                  //WGS-84 semi-major axis
    static const double e2 = 6.6943799901377997e-3;      //WGS-84 first eccentricity squared

    double lat = degreestoradians(Lat());
    double lon = degreestoradians(Long());
    double alt = Alt();
    double n = a / sqrt(1 - e2*sin(lat)*sin(lat));
    double dx = ((n + alt)*cos(lat)*cos(lon));           //ECEF x
    double dy = ((n + alt)*cos(lat)*sin(lon));           //ECEF y
    double dz = ((n*(1 - e2) + alt)*sin(lat));           //ECEF z
    return(xyz(dx, dy, dz));                             //Return x, y, z in ECEF
}
Beispiel #5
0
KeyAcceleratorCode::KeyAcceleratorCode( const wxKeyEvent& evt )
{
	val32 = 0;

	keycode = evt.GetKeyCode();

	if( evt.AltDown() ) Alt();
	if( evt.CmdDown() ) Cmd();
	if( evt.ShiftDown() ) Shift();
}