void LoadOverridenSQLData()
{
    GameObjectInfo *goInfo;

    // Sunwell Plateau : Kalecgos : Spectral Rift
    if (goInfo = GOBJECT(187055))
        if (goInfo->type == GAMEOBJECT_TYPE_GOOBER)
            goInfo->goober.lockId = 57; // need LOCKTYPE_QUICK_OPEN

    // Naxxramas : Sapphiron Birth
    if (goInfo = GOBJECT(181356))
        if (goInfo->type == GAMEOBJECT_TYPE_TRAP)
            goInfo->trap.radius = 50;
}
void LoadOverridenSQLData()
{
    GameObjectInfo* goInfo;

    // Sunwell Plateau : Kalecgos : Spectral Rift
    goInfo = GOBJECT(187055);
    if (goInfo)
        if (goInfo->type == GAMEOBJECT_TYPE_GOOBER)
            goInfo->type = GAMEOBJECT_TYPE_SPELLCASTER;

    // Naxxramas : Sapphiron Birth
    goInfo = GOBJECT(181356);
    if (goInfo)
        if (goInfo->type == GAMEOBJECT_TYPE_TRAP)
            goInfo->trap.radius = 50;
}
Exemple #3
0
void PaintWidget::group()
{
	if( !canGroup() ) return;

	GContainer *c = new GContainer;
	c->QObject::setObjectName( "New group" );

	int count = painter.layers[painter.currentLayer]->countObjects();
	for( int i = count - 1; i >= 0; i-- )
	{
		if( painter.selection.isInside( painter.layers[painter.currentLayer]->object( i ) ) )
			c->add( painter.layers[painter.currentLayer]->object( i ), true );
	}

	count = painter.selection.countSelected();
	for( int i = 0; i < count; i++ )
	{
		painter.layers[painter.currentLayer]->remove(
				painter.layers[painter.currentLayer]->objectIndex(
					GOBJECT(painter.selection.selected( i )) ) );
	}

	painter.selection.setSelected( c );
	painter.layers[painter.currentLayer]->add( c, true );
	emit allLayersChanged();
	painter.update();
	emit StateChanged("Group");
}
Exemple #4
0
int PaintWidget::selectedFigure()
{
	if( painter.selection.countSelected() != 1 )
		return -1;

	return painter.layers[painter.currentLayer]->objectIndex( GOBJECT(painter.selection.selected( 0 )));
}
Exemple #5
0
void PaintWidget::deleteSelected()
{
	if( !canDeleteSelected() )
		return;

	int count = painter.selection.countSelected();

	for( int i = 0; i < count; i++ )
	{
		delete painter.layers[painter.currentLayer]->remove(
				painter.layers[painter.currentLayer]->objectIndex(
						GOBJECT(painter.selection.selected( i ))) );
	}

	painter.selection.reset();
	update();

	emit figureSelected( painter.currentLayer , -1);
	emit allLayersChanged();
	emit countFramesChanged( countFrames() );
	emit StateChanged("Delete");
}
Exemple #6
0
void PaintWidget::ungroup()
{
	if( !canUngroup() ) return;

	GContainer *c = GCONTAINER( painter.selection.selected( 0 ) );

	painter.selection.reset();
	painter.layers[painter.currentLayer]->remove( painter.layers[painter.currentLayer]->objectIndex( c ) );

	QVector< GObject* > ungrouped = c->removeAll();
	int countUngrouped = ungrouped.size();

	for( int i = countUngrouped - 1; i >= 0; i-- )
	{
		painter.layers[painter.currentLayer]->add( GOBJECT(ungrouped[ i ]), true );
		painter.selection.addSelected( ungrouped[ i ] );
	}

	delete c;
	emit allLayersChanged();
	painter.update();
	emit StateChanged("Ungroup");
}
Exemple #7
0
    // @Increment: 0.1
    // @User: Standard
	GSCALAR(waypoint_radius,        "WP_RADIUS",        2.0f),

    // @Param: TURN_MAX_G
    // @DisplayName: Turning maximum G force
    // @Description: The maximum turning acceleration (in units of gravities) that the rover can handle while remaining stable. The navigation code will keep the lateral acceleration below this level to avoid rolling over or slipping the wheels in turns
    // @Units: gravities
    // @Range: 0.2 10
    // @Increment: 0.1
    // @User: Standard
	GSCALAR(turn_max_g,             "TURN_MAX_G",      2.0f),

    // @Group: STEER2SRV_
    // @Path: ../libraries/APM_Control/AP_SteerController.cpp
	GOBJECT(steerController,        "STEER2SRV_",   AP_SteerController),

	GGROUP(pidSpeedThrottle,        "SPEED2THR_", PID),

	// variables not in the g class which contain EEPROM saved variables

    // @Group: COMPASS_
    // @Path: ../libraries/AP_Compass/Compass.cpp
	GOBJECT(compass,                "COMPASS_",	Compass),

    // @Group: SCHED_
    // @Path: ../libraries/AP_Scheduler/AP_Scheduler.cpp
    GOBJECT(scheduler, "SCHED_", AP_Scheduler),

    // barometer ground calibration. The GND_ prefix is chosen for
    // compatibility with previous releases of ArduPlane
Exemple #8
0
    GSCALAR(pitch_range,            "PITCH_RANGE", PITCH_RANGE_DEFAULT),

    // @Param: DISTANCE_MIN
    // @DisplayName: Distance minimum to target
    // @Description: Tracker will track targets at least this distance away
    // @Units: meters
    // @Increment: 1
    // @Range: 0 100
    // @User: Standard
    GSCALAR(distance_min,           "DISTANCE_MIN", DISTANCE_MIN_DEFAULT),

    // barometer ground calibration. The GND_ prefix is chosen for
    // compatibility with previous releases of ArduPlane
    // @Group: GND_
    // @Path: ../libraries/AP_Baro/AP_Baro.cpp
    GOBJECT(barometer, "GND_", AP_Baro),

    // @Group: COMPASS_
    // @Path: ../libraries/AP_Compass/AP_Compass.cpp
    GOBJECT(compass,                "COMPASS_",     Compass),

    // @Group: SCHED_
    // @Path: ../libraries/AP_Scheduler/AP_Scheduler.cpp
    GOBJECT(scheduler, "SCHED_", AP_Scheduler),

    // @Group: SR0_
    // @Path: GCS_Mavlink.cpp
    GOBJECTN(gcs[0], gcs0,        "SR0_",     GCS_MAVLINK),

    // @Group: SR1_
    // @Path: GCS_Mavlink.cpp
Exemple #9
0
    // @Description: Offset from mid stick at which takeoff is triggered
    // @User: Standard
    // @Range: 0.0 500.0
    // @Increment: 10
    GSCALAR(takeoff_trigger_dz, "PILOT_TKOFF_DZ", THR_DZ_DEFAULT),

    // @Param: PILOT_THR_BHV
    // @DisplayName: Throttle stick behavior
    // @Description: Bits for: Feedback starts from mid stick
    // @User: Standard
    // @Values: 0:None,1:FeedbackFromMid
    GSCALAR(throttle_behavior, "PILOT_THR_BHV", 0),

    // @Group: SERIAL
    // @Path: ../libraries/AP_SerialManager/AP_SerialManager.cpp
    GOBJECT(serial_manager, "SERIAL",   AP_SerialManager),

    // @Param: TELEM_DELAY
    // @DisplayName: Telemetry startup delay
    // @Description: The amount of time (in seconds) to delay radio telemetry to prevent an Xbee bricking on power up
    // @User: Advanced
    // @Units: seconds
    // @Range: 0 10
    // @Increment: 1
    GSCALAR(telem_delay,            "TELEM_DELAY",     0),

    // @Param: GCS_PID_MASK
    // @DisplayName: GCS PID tuning mask
    // @Description: bitmask of PIDs to send MAVLink PID_TUNING messages for
    // @User: Advanced
    // @Values: 0:None,1:Roll,2:Pitch,4:Yaw
Exemple #10
0
    // @Description: Allows restricting radio overrides to only come from my ground station
    // @User: Advanced
    GSCALAR(sysid_my_gcs,   "SYSID_MYGCS",     255),

    // @Param: PILOT_THR_FILT
    // @DisplayName: Throttle filter cutoff
    // @Description: Throttle filter cutoff (Hz) - active whenever altitude control is inactive - 0 to disable
    // @User: Advanced
    // @Units: Hz
    // @Range: 0 10
    // @Increment: .5
    GSCALAR(throttle_filt,  "PILOT_THR_FILT",     0),

    // @Group: SERIAL
    // @Path: ../libraries/AP_SerialManager/AP_SerialManager.cpp
    GOBJECT(serial_manager, "SERIAL",   AP_SerialManager),

    // @Param: GCS_PID_MASK
    // @DisplayName: GCS PID tuning mask
    // @Description: bitmask of PIDs to send MAVLink PID_TUNING messages for
    // @User: Advanced
    // @Values: 0:None,1:Roll,2:Pitch,4:Yaw
    // @Bitmask: 0:Roll,1:Pitch,2:Yaw
    GSCALAR(gcs_pid_mask,           "GCS_PID_MASK",     0),

    // @Param: RNGFND_GAIN
    // @DisplayName: Rangefinder gain
    // @Description: Used to adjust the speed with which the target altitude is changed when objects are sensed below the sub
    // @Range: 0.01 2.0
    // @Increment: 0.01
    // @User: Standard
Exemple #11
0
ReplayVehicle replayvehicle;

struct globals globals;

#define GSCALAR(v, name, def) { replayvehicle.g.v.vtype, name, Parameters::k_param_ ## v, &replayvehicle.g.v, {def_value : def} }
#define GOBJECT(v, name, class) { AP_PARAM_GROUP, name, Parameters::k_param_ ## v, &replayvehicle.v, {group_info : class::var_info} }
#define GOBJECTN(v, pname, name, class) { AP_PARAM_GROUP, name, Parameters::k_param_ ## pname, &replayvehicle.v, {group_info : class::var_info} }

const AP_Param::Info ReplayVehicle::var_info[] = {
    GSCALAR(dummy,         "_DUMMY", 0),

    // barometer ground calibration. The GND_ prefix is chosen for
    // compatibility with previous releases of ArduPlane
    // @Group: GND_
    // @Path: ../libraries/AP_Baro/AP_Baro.cpp
    GOBJECT(barometer, "GND_", AP_Baro),

    // @Group: INS_
    // @Path: ../libraries/AP_InertialSensor/AP_InertialSensor.cpp
    GOBJECT(ins,                    "INS_", AP_InertialSensor),

    // @Group: AHRS_
    // @Path: ../libraries/AP_AHRS/AP_AHRS.cpp
    GOBJECT(ahrs,                   "AHRS_",    AP_AHRS),

    // @Group: ARSPD_
    // @Path: ../libraries/AP_Airspeed/AP_Airspeed.cpp
    GOBJECT(airspeed,                               "ARSPD_",   AP_Airspeed),

    // @Group: EKF_
    // @Path: ../libraries/AP_NavEKF/AP_NavEKF.cpp
Exemple #12
0
    GSCALAR(waypoint_overshoot,     "WP_OVERSHOOT", 2.0f),

    // @Param: TURN_MAX_G
    // @DisplayName: Turning maximum G force
    // @Description: The maximum turning acceleration (in units of gravities) that the rover can handle while remaining stable. The navigation code will keep the lateral acceleration below this level to avoid rolling over or slipping the wheels in turns
    // @Units: gravities
    // @Range: 0.2 10
    // @Increment: 0.1
    // @User: Standard
    GSCALAR(turn_max_g,             "TURN_MAX_G",      1.0f),

    // variables not in the g class which contain EEPROM saved variables

    // @Group: COMPASS_
    // @Path: ../libraries/AP_Compass/AP_Compass.cpp
    GOBJECT(compass,                "COMPASS_", Compass),

    // @Group: SCHED_
    // @Path: ../libraries/AP_Scheduler/AP_Scheduler.cpp
    GOBJECT(scheduler, "SCHED_", AP_Scheduler),

    // barometer ground calibration. The GND_ prefix is chosen for
    // compatibility with previous releases of ArduPlane
    // @Group: GND_
    // @Path: ../libraries/AP_Baro/AP_Baro.cpp
    GOBJECT(barometer, "GND_", AP_Baro),

    // @Group: RELAY_
    // @Path: ../libraries/AP_Relay/AP_Relay.cpp
    GOBJECT(relay,                  "RELAY_", AP_Relay),
Exemple #13
0
void RealPaintWidget::mouseReleaseEvent( QMouseEvent * event )
{
	QPoint pos = event->pos();
	int button = event->button();

	if(button == Qt::RightButton)
	{
		return;
	}

	if( fixedSize )
	{
		QSize sz = rect().size() - size;
		pos -= QPoint( sz.width() / 2, sz.height() / 2 );
	}

	if( inSelectionMode )
	{
		inSelectionMode = false;
			int countObjects = layers[currentLayer]->countObjects();
			selection.reset();
			for( int i = 0; i < countObjects; i++ )
			{
				if( !layers[currentLayer]->object( i )->isVisible() || layers[currentLayer]->object( i )->isBlocked() )
					continue;

				if( layers[currentLayer]->object( i )->boundingRect().intersects( selectionRect ) )
					selection.addSelected( layers[currentLayer]->object( i ) );
			}
			if( selection.countSelected() != 1 )
			{
				//emit figureSelected( currentLayer, -1 );
				update();
				return;
			}
			else
				emit figureSelected(currentLayer, layers[currentLayer]->objectIndex( GOBJECT(selection.selected( 0 )) ) );
			update();
			return;
	}

	if( currentTool != 0 )
	{
		GObjectInterface *s = layers[currentLayer]->object( 0 );
		if( s != 0 )
			s->cloneFrameToAll(currentFrame);

		int countFrames = layers[currentLayer]->countFrames();
		for( int i = 0; i < countFrames; i++ )
		{
			if( layers[currentLayer]->getPositionFrame(i) != currentFrame )
			{
				s->setFrame( layers[currentLayer]->getPositionFrame(i) );
				s->setVisible( false );
				s->setBlocked( false );
			}
		}
		s->setFrame( currentFrame );

		//emit StateChanged("Create object");

        isMousePress = false;
		if( currentTool->createStyle() == FigureToolInterface::paint )
		{
			selection.setSelected( s );
			update();
			return;
		}
	}

	selection.mouseRelease( event->button(), pos, event->modifiers() );
}
Exemple #14
0
void RealPaintWidget::mousePressEvent( QMouseEvent *event )
{
	QPoint pos = event->pos();
	int button = event->button();

	if(button == Qt::LeftButton || selection.isInAddPointMode())
	{
		if( fixedSize )
		{
			QSize sz = rect().size() - size;
			pos -= QPoint( sz.width() / 2, sz.height() / 2 );
		}

		if( currentTool != 0 )
		{
            isMousePress = true;
			GObjectInterface * o = GObject::create( currentTool, pos,
								currentTool->figureName(), currentFrame);

			layers[currentLayer]->add( GOBJECT(o), true );

			selection.setSelected( o );
			selection.setIsNewFigure(true);

			emit objectCreated();
			emit figureSelected( currentLayer, layers[currentLayer]->objectIndex( GOBJECT(o) ) );

			if( currentTool->createStyle() != FigureToolInterface::paint )
			{
				selection.mousePress( event->button(), pos, event->modifiers() );
				selection.setCreateFigureMode( true );
			}
			else
				selection.reset();

			QVector <int> frames = layers[currentLayer]->getFrames();
			for( int i = 0; i < frames.size(); i++ )
			{
				if( frames[i] != currentFrame )
					o->addFrame(frames[i], false);
			}
			return;
		}

		if( selection.mousePress( event->button(), pos, event->modifiers() ) )
			return;

		if(button == Qt::RightButton && !selection.isInAddPointMode())
		{
			paintConMenu->exec(QWidget::mapToGlobal(pos),0);
			return;
		}

		GContainer * cont = GCONTAINER(selection.getSelected());
		if(button != Qt::RightButton && cont != 0 && selection.isInAddPointMode() && cont->countObjects()==1)
		{
			cont->addPointToEnd(pos);
			emit StateChanged("Add point");
			return;
		}

		GObjectInterface* o = 0;
		for(int i=0;i<layers.size();i++)
		{
			o = layers[i]->contains( pos );
			if(o != 0)
			{
				currentLayer = i;
				break;
			}
		}

		if( o == 0 )
		{
			selection.reset();
			emit figureSelected( currentLayer, -1 );

			inSelectionMode = true;
			selectionRect = QRect( pos, QSize( 0, 0 ) );
			update();
			return;
		}



		if( ( ( event->modifiers() & Qt::ControlModifier ) == 0 ) ||
			( selection.countSelected() <= 0 ) )
		{
			selection.setSelected( o );
			emit figureSelected(currentLayer, layers[currentLayer]->objectIndex( GOBJECT(o) ) );
		}
		else
		{
			selection.addSelected( o );
			inKeyPressedHandler = true;
			emit figureSelected( currentLayer, -1 );
			inKeyPressedHandler = false;

		}


		selection.mousePress( event->button(), pos, event->modifiers() );
	}

	if(button == Qt::RightButton && !(selection.isInAddPointMode()))
	{
		if(selection.countSelected() != 1)
			propertiesAct->setEnabled(false);
		else
			propertiesAct->setEnabled(true);
		paintConMenu->exec(QWidget::mapToGlobal(pos),0);
	}


}
Exemple #15
0
    GSCALAR(pitch_min,               "PITCH_MIN",	PITCH_MIN_DEFAULT),

    // @Param: PITCH_MAX
    // @DisplayName: Maximum Pitch Angle
    // @Description: The highest angle the pitch can reach
    // @Units: deg
    // @Increment: 1
    // @Range: 0 90
    // @User: Standard
    GSCALAR(pitch_max,               "PITCH_MAX",	PITCH_MAX_DEFAULT),

    // barometer ground calibration. The GND_ prefix is chosen for
    // compatibility with previous releases of ArduPlane
    // @Group: GND_
    // @Path: ../libraries/AP_Baro/AP_Baro.cpp
    GOBJECT(barometer, "GND_", AP_Baro),

    // @Group: COMPASS_
    // @Path: ../libraries/AP_Compass/AP_Compass.cpp
    GOBJECT(compass,                "COMPASS_",     Compass),

    // @Group: SCHED_
    // @Path: ../libraries/AP_Scheduler/AP_Scheduler.cpp
    GOBJECT(scheduler, "SCHED_", AP_Scheduler),

    // @Group: SR0_
    // @Path: GCS_Mavlink.cpp
    GOBJECTN(gcs().chan(0), gcs0,        "SR0_",     GCS_MAVLINK),

    // @Group: SR1_
    // @Path: GCS_Mavlink.cpp