GPVehicle

De GENOPUS
Révision datée du 28 juillet 2017 à 15:21 par Admin (discussion | contributions) (Page créée avec « == How to call it == For using the GPVehicle class, the developer has only to create such an object with these two possibilities: * With no vehicle initialization <synta... »)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Aller à la navigation Aller à la recherche

How to call it

For using the GPVehicle class, the developer has only to create such an object with these two possibilities:

  • With no vehicle initialization
veh = new GPVehicle("My Vehicle");
  • Or, if we want to initialize the widget with a predefined vehicle:
final CustomVehicle vehicle = new CustomVehicle();
veh = new GPVehicle("My Vehicle", vehicle);

In future [PATRIUS] versions (since 3.4), there is a Vehicle class so, it will be possible to search in [PATRIUS] documentation how it is possible to initialize such an object. But, up to now, it is mandatory to use the GENOPUS CustomVehicle class as in the following paragraphs.

We have just to initialize the vehicle using all the previous sub-objects. Note that is, of course, possible to put null to some of them except for dry mass properties.

Dry mass initialization

// DRY MASS
final double dryMass = 1000.;
MassProperty dryMassProperty = new MassProperty(dryMass);

Propulsive properties initialization

// PROPULSION
final ArrayList<CustomEngine> enginesList = new ArrayList<CustomEngine>();
enginesList.add(new CustomEngine("OCS", 320., 1000.));
enginesList.add(new CustomEngine("ACS", 150., 270.));

final ArrayList<CustomFuelTank> fuelTankList = new ArrayList<CustomFuelTank>();
fuelTankList.add(new CustomFuelTank("Tank1", 500.));