« GPVehicle » : différence entre les versions

De GENOPUS
Aller à la navigation Aller à la recherche
(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... »)
 
Aucun résumé des modifications
Ligne 15 : Ligne 15 :
</syntaxhighlight>
</syntaxhighlight>


In future [[https://logiciels.cnes.fr/en/node/62?type=desc PATRIUS]] versions (since 3.4), there is a <font color=#4169E1>Vehicle</font> class so, it will be possible to search in [[https://logiciels.cnes.fr/en/node/62?type=desc PATRIUS]] documentation how it is possible to initialize such an object. But, up to now, it is mandatory to use the <font color=#556B2F>'''GENOPUS'''</font> <font color=#4169E1>CustomVehicle</font> class as in the following paragraphs.
In future [[https://logiciels.cnes.fr/en/node/62?type=desc PATRIUS]] versions (since 3.4), there is a <font color=#4169E1>Vehicle</font> class so, it will be possible to search in [[https://logiciels.cnes.fr/en/node/62?type=desc PATRIUS]] documentation how it is possible to initialize such an object. But, up to now, it is mandatory to use the <font color=#556B2F>'''GENOPUS'''</font> <font color=#4169E1>CustomVehicle</font> class. We have then to instantiate this class using all the previous sub-objects described 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 initialization ===
Ligne 38 : Ligne 36 :
fuelTankList.add(new CustomFuelTank("Tank1", 500.));
fuelTankList.add(new CustomFuelTank("Tank1", 500.));
</syntaxhighlight>
</syntaxhighlight>
=== Shape characteristics initializaton ===
 
<syntaxhighlight lang="java">
// SHAPE (HERE PARALLELEPIPED + SOLAR PANELS)
final CustomParallelepiped parall =
  new CustomParallelepiped(4.0, 1.0, 2.0);
final CustomParallelepiped solarPanels =
  new CustomParallelepiped(10., 0., 0.);
vehicleRefSurface = new CustomVehicleSurfaceModel(parall, solarPanels);
</syntaxhighlight>
=== Aerodynamic properties initialization === 
<syntaxhighlight lang="java">
// AERODYNAMIC PROPERTIES (CONSTANT COEFFICIENTS)
final double cd = 2.0;
final double cl = 0.;
final CustomAerodynamicProperties aerodynamicProperties =
  new CustomAerodynamicProperties(vehicleRefSurface, cd, cl);
</syntaxhighlight>
''<font color=#FF0000>Note: we need the shape model previously defined</font>''
=== Radiative properties initialization ===
<syntaxhighlight lang="java">
// RADIATIVE PROPERTIES
final double ka = 1.0;
final double ks = 0.0;
final double kd = 0.0;
final RadiativeProperty rp = new RadiativeProperty(ka, ks, kd);
final double absorptionCoef = 1.0;
final double specularCoef = 0.0;
final double diffuseCoef = 0.0;
final RadiativeIRProperty rpIr =
  new RadiativeIRProperty(absorptionCoef, specularCoef, diffuseCoef);
final CustomRadiativeProperties radiativeProperties =
  new CustomRadiativeProperties(rp, rpIr, vehicleRefSurface);
</syntaxhighlight>
''<font color=#FF0000>Note: we need the shape model previously defined</font>''
=== vehicle initialization ===
At last, when all sub-objects are available, we have just to write this:
<syntaxhighlight lang="java">
final CustomVehicle vehicle =
  new CustomVehicle(dryMassProperty, aerodynamicProperties,
                    radiativeProperties, enginesList, fuelTankList);
</syntaxhighlight>
''<font color=#FF0000>Note: of course, possible to put null to some of them except for dry mass properties.</font>''

Version du 28 juillet 2017 à 15:28

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. We have then to instantiate this class using all the previous sub-objects described in the following paragraphs.

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.));

Shape characteristics initializaton

// SHAPE (HERE PARALLELEPIPED + SOLAR PANELS)
final CustomParallelepiped parall =
   new CustomParallelepiped(4.0, 1.0, 2.0);
final CustomParallelepiped solarPanels =
   new CustomParallelepiped(10., 0., 0.);
vehicleRefSurface = new CustomVehicleSurfaceModel(parall, solarPanels);

Aerodynamic properties initialization

// AERODYNAMIC PROPERTIES (CONSTANT COEFFICIENTS)
final double cd = 2.0;
final double cl = 0.;
final CustomAerodynamicProperties aerodynamicProperties =
   new CustomAerodynamicProperties(vehicleRefSurface, cd, cl);

Note: we need the shape model previously defined

Radiative properties initialization

// RADIATIVE PROPERTIES
final double ka = 1.0;
final double ks = 0.0;
final double kd = 0.0;
final RadiativeProperty rp = new RadiativeProperty(ka, ks, kd);

final double absorptionCoef = 1.0;
final double specularCoef = 0.0;
final double diffuseCoef = 0.0;
final RadiativeIRProperty rpIr =
   new RadiativeIRProperty(absorptionCoef, specularCoef, diffuseCoef);

final CustomRadiativeProperties radiativeProperties =
   new CustomRadiativeProperties(rp, rpIr, vehicleRefSurface);

Note: we need the shape model previously defined

vehicle initialization

At last, when all sub-objects are available, we have just to write this:

final CustomVehicle vehicle =
   new CustomVehicle(dryMassProperty, aerodynamicProperties,
                     radiativeProperties, enginesList, fuelTankList);

Note: of course, possible to put null to some of them except for dry mass properties.