Vous n'êtes pas identifié(e).
Futur nouvel inscrit, tu dois au préalable lire l'intégralité des 10 articles des règles, s'il te plaît. Tout nouveau compte qui ne respecte pas les règles sera supprimé par l'administration.
Pages : 1
Je m'explique en prenant pour exemple l'Aerostar-700 sur lequel je travaille actuellement auquel j'ajoute deux indicateurs de pression/température d'huile sur chacun des 2 moteurs.
Pour cela j'ai défini leurs emplacements dans" /Models/cabin.xml". Ils s'appellent "Oil-left.xml" et "Oil-right.xml". Ils utilisent tous deux le même fichier "OilGauge.ac".
Comme ces deux fichiers sont quasiment identiques (à part la référence à chacun des moteurs), je me posais la question de savoir s'il était possible de les regrouper dans un même fichier appelé par exemple "Oil.xml".
J'ai déjà essayé de plusieurs manières, par exemple en utilisant des paramètres comme décrits dans le "Howto:Model with parameters" mais sans succès.
Fg 2020.4.0 - Linux Mint 21.3 Victoria - Cinnamon et Mate en dual boot - CM Asus P8H67 MLE - CPU i7 3770K - 12 Go Ram - Nvidia Geforce GTX 1660TI - Driver Nvidia 525
+ Hp notebook-15 - Linux Mint 21.3 Victoria - CPU i3-7020u - Ram 4Go - Intel Graphics 620.
Hors ligne
Quel est le problème ? L'animation respective des aiguilles ?
Même fichier .ac ==> mêmes noms pour les aiguilles P et T gauches et droites ? En donnant un nom différent aux aiguilles G et D ?
Déjà, est-ce que cela fonctionne avec des fichiers "left" et "right" séparés ?
Avec des "conditions" ?
As-tu regardé l'agencement de n'importe quel indicateur pour d'autres multimoteurs ?
FG 2020.4.0, Linux Mint 20.3, Intel Core i7-11700F @ 2.50GHz, RAM 32 GB DDR4, NVIDIA GeForce RTX 3060 (12 GB)
Boeing 787-8 (YASim, avec nickyivyca, aco)
Hangar avions Patten (PAF) Robin DR400 JSBSim, Douglas DC3 JSBSim, CAP10B, Tecnam P92 JSBSim.
Hors ligne
Peux tu montrer ce que tu as fait rn XML avec ce <overlay>
J'ai déjà utilisé cette fonctionnalité sans souci donc y'a pas de raison ;-)
OS: Linux Mint 17.1 | RAM: 12Go | GPU: GTX460SE | CPU: Intel I5 | FG: GIT
POIs: DR400-dauphin | FGCom | Jenkins | download_and_compile.sh
Hors ligne
Dans le fichier "Cabin.xml" qui gère les emplacements des instruments :
<!-- Temp/Press Oil -->
<model>
<path>Aircraft/Aerostar-700/Models/Instruments/Gauges/oil.xml</path>
<overlay>
<params>>
<n1>engines/engine[0]/n1</n1>
</params>
<overlay>
<offsets>
<x-m>-0.735</x-m>
<y-m>-0.055</y-m>
<z-m>-0.041</z-m>
<pitch-deg>-45</pitch-deg>
</offsets>
</model>
<model>
<path>Aircraft/Aerostar-700/Models/Instruments/Gauges/oil.xml</path>
<overlay>
<params>>
<n1>engines/engine[1]/n1</n1>
</params>
<overlay>
<offsets>
<x-m>-0.735</x-m>
<y-m>0.010</y-m>
<z-m>-0.041</z-m>
<pitch-deg>-45</pitch-deg>
</offsets>
</model>
Le fichier "Oil.xml" :
<?xml version="1.0"?>
<PropertyList>
<path>OilGauge.ac</path>
<animation>
<type>material</type>
<object-name>Oil.face</object-name>
<object-name>Oil.LHneedle</object-name>
<object-name>Oil.RHneedle</object-name>
<emission>
<red>0.8</red>
<green>0.4</green>
<blue>0.2</blue>
<factor-prop>systems/electrical/outputs/instrument-lights-norm</factor-prop>
</emission>
</animation>
<effect>
<inherits-from>Aircraft/Aerostar-700/Models/Effects/test_reflect</inherits-from>
<object-name>Oil.bezel</object-name>
</effect>
<!-- Left Gauge -->
<!--Temperature -->
<params>
<n1>engines/engine[0]/n1</n1>
</params>
<animation>
<type>rotate</type>
<object-name>Oil.LHneedle</object-name>
<property>engines/engine[0]/rpm</property>
<and>
<property>controls/electric/battery-switch</property>
</and>
<interpolation>
<entry><ind>0</ind><dep>5</dep></entry>
<entry><ind>500</ind><dep>45</dep></entry>
<entry><ind>3000</ind><dep>80</dep></entry>
</interpolation>
<center>
<x-m>0</x-m>
<y-m>0</y-m>
<z-m>0.0</z-m>
</center>
<axis>
<x>-1.0</x>
<y>0.0</y>
<z>0.0</z>
</axis>
</animation>
<!-- Pressure -->
<params>
<n1>engines/engine[0]/n1</n1>
</params>
<animation>
<type>rotate</type>
<object-name>Oil.RHneedle</object-name>
<property>engines/engine[0]/rpm</property>
<and>
<property>controls/electric/battery-switch</property>
</and>
<interpolation>
<entry><ind>0</ind><dep>0</dep></entry>
<entry><ind>500</ind><dep>55</dep></entry>
<entry><ind>3000</ind><dep>68</dep></entry>
</interpolation>
<center>
<x-m>0</x-m>
<y-m>0</y-m>
<z-m>0.0</z-m>
</center>
<axis>
<x>1.0</x>
<y>0.0</y>
<z>0.0</z>
</axis>
</animation>
<!-- Right Gauge -->
<!--Temperature -->
<params>
<n1>engines/engine[1]/n1</n1>
</params>
<animation>
<type>rotate</type>
<object-name>Oil.LHneedle</object-name>
<property>engines/engine[1]/rpm</property>
<and>
<property>controls/electric/battery-switch</property>
</and>
<interpolation>
<entry><ind>0</ind><dep>5</dep></entry>
<entry><ind>500</ind><dep>45</dep></entry>
<entry><ind>3000</ind><dep>80</dep></entry>
</interpolation>
<center>
<x-m>0</x-m>
<y-m>0</y-m>
<z-m>0.0</z-m>
</center>
<axis>
<x>-1.0</x>
<y>0.0</y>
<z>0.0</z>
</axis>
</animation>
<!--Pressure -->
<params>
<n1>engines/engine[1]/n1</n1>
</params>
<animation>
<type>rotate</type>
<object-name>Oil.RHneedle</object-name>
<property>engines/engine[1]/rpm</property>
<and>
<property>controls/electric/battery-switch</property>
</and>
<interpolation>
<entry><ind>0</ind><dep>0</dep></entry>
<entry><ind>500</ind><dep>55</dep></entry>
<entry><ind>3000</ind><dep>68</dep></entry>
</interpolation>
<center>
<x-m>0</x-m>
<y-m>0</y-m>
<z-m>0.0</z-m>
</center>
<axis>
<x>1.0</x>
<y>0.0</y>
<z>0.0</z>
</axis>
</animation>
</PropertyList>
Fg 2020.4.0 - Linux Mint 21.3 Victoria - Cinnamon et Mate en dual boot - CM Asus P8H67 MLE - CPU i7 3770K - 12 Go Ram - Nvidia Geforce GTX 1660TI - Driver Nvidia 525
+ Hp notebook-15 - Linux Mint 21.3 Victoria - CPU i3-7020u - Ram 4Go - Intel Graphics 620.
Hors ligne
Hmmm un peu bizarre tout ça, j'ai l'impression que ton fichier .ac contient 2 instruments, c'est le cas ? si oui alors c'est pas la bonne solution.
Je te propose ceci:
* Tu fais 1 fichier .ac qui contient 1 instrument (1 fond, 1 aiguille...)
* Dans ton "cabine.xml" tu appelles:
<!-- Temp/Press Oil -->
<model>
<path>Aircraft/Aerostar-700/Models/Instruments/Gauges/oil.xml</path>
<overlay>
<params>
<n1>engines/engine[0]/n1</n1>
</params>
<overlay>
<offsets>
<x-m>-0.735</x-m>
<y-m>-0.055</y-m>
<z-m>-0.041</z-m>
<pitch-deg>-45</pitch-deg>
</offsets>
</model>
<model>
<path>Aircraft/Aerostar-700/Models/Instruments/Gauges/oil.xml</path>
<overlay>
<params>
<n1>engines/engine[1]/n1</n1>
</params>
<overlay>
<offsets>
<x-m>-0.735</x-m>
<y-m>0.010</y-m>
<z-m>-0.041</z-m>
<pitch-deg>-45</pitch-deg>
</offsets>
</model>
* Dans ton "oil.xml":
<PropertyList>
<path>OilGauge.ac</path>
<params>
<n1>engines/engine[0]/n1</n1>
</params>
<animation>
<type>material</type>
<object-name>Oil.face</object-name>
<object-name>Oil.temp.needle</object-name>
<object-name>Oil.press.needle</object-name>
<emission>
<red>0.8</red>
<green>0.4</green>
<blue>0.2</blue>
<factor-prop>systems/electrical/outputs/instrument-lights-norm</factor-prop>
</emission>
</animation>
<effect>
<inherits-from>Aircraft/Aerostar-700/Models/Effects/test_reflect</inherits-from>
<object-name>Oil.bezel</object-name>
</effect>
<!-- Left Gauge -->
<!--Temperature -->
<animation>
<type>rotate</type>
<object-name>Oil.temp.needle</object-name>
<property alias="../../params/n1" />
<and>
<property>controls/electric/battery-switch</property>
</and>
<interpolation>
<entry><ind>0</ind><dep>5</dep></entry>
<entry><ind>500</ind><dep>45</dep></entry>
<entry><ind>3000</ind><dep>80</dep></entry>
</interpolation>
<center>
<x-m>0</x-m>
<y-m>0</y-m>
<z-m>0.0</z-m>
</center>
<axis>
<x>-1.0</x>
<y>0.0</y>
<z>0.0</z>
</axis>
</animation>
<!-- Pressure -->
<animation>
<type>rotate</type>
<object-name>Oil.press.needle</object-name>
<property>engines/engine[0]/rpm</property>
<and>
<property>controls/electric/battery-switch</property>
</and>
<interpolation>
<entry><ind>0</ind><dep>0</dep></entry>
<entry><ind>500</ind><dep>55</dep></entry>
<entry><ind>3000</ind><dep>68</dep></entry>
</interpolation>
<center>
<x-m>0</x-m>
<y-m>0</y-m>
<z-m>0.0</z-m>
</center>
<axis>
<x>1.0</x>
<y>0.0</y>
<z>0.0</z>
</axis>
</animation>
</PropertyList>
Voilà j'ai pas testé mais ça doit pas être loin de la vérité.
PS: y'a du clean à faire dans les indentations
OS: Linux Mint 17.1 | RAM: 12Go | GPU: GTX460SE | CPU: Intel I5 | FG: GIT
POIs: DR400-dauphin | FGCom | Jenkins | download_and_compile.sh
Hors ligne
Ci-joint une image des indicateurs:
Effectivement chaque indicateur a 2 fonctions : aiguille de gauche = température d'huile, aiguille de droite = pression.
Indicateur de gauche pour le moteur gauche et celui de droite pour le moteur droit.
Question subsidiaire : Existe t'il un bon livre pour apprendre à programmer en xml ? J'ai pas mal zoné sur tous les tutoriaux sur internet (beaucoup sur les Howto et wiki de fg). J'y ai appris pas mal de choses mais il me manque les structures du langage ainsi que tous les mots qu'on peut utiliser et comment les utiliser.
Fg 2020.4.0 - Linux Mint 21.3 Victoria - Cinnamon et Mate en dual boot - CM Asus P8H67 MLE - CPU i7 3770K - 12 Go Ram - Nvidia Geforce GTX 1660TI - Driver Nvidia 525
+ Hp notebook-15 - Linux Mint 21.3 Victoria - CPU i3-7020u - Ram 4Go - Intel Graphics 620.
Hors ligne
Fg 2020.4.0 - Linux Mint 21.3 Victoria - Cinnamon et Mate en dual boot - CM Asus P8H67 MLE - CPU i7 3770K - 12 Go Ram - Nvidia Geforce GTX 1660TI - Driver Nvidia 525
+ Hp notebook-15 - Linux Mint 21.3 Victoria - CPU i3-7020u - Ram 4Go - Intel Graphics 620.
Hors ligne
Voilà j'ai pas testé mais ça doit pas être loin de la vérité.
J'ai testé mais, dans le journal des propriétés internes, on trouve "engines/engine/n1 = "none" et ... ça ne fonctionne pas.
Maintenant dodo !...
Bonsoir à tout le monde
Fg 2020.4.0 - Linux Mint 21.3 Victoria - Cinnamon et Mate en dual boot - CM Asus P8H67 MLE - CPU i7 3770K - 12 Go Ram - Nvidia Geforce GTX 1660TI - Driver Nvidia 525
+ Hp notebook-15 - Linux Mint 21.3 Victoria - CPU i3-7020u - Ram 4Go - Intel Graphics 620.
Hors ligne
Pages : 1