0 Members and 1 Guest are viewing this topic.
Cool ! Je suis curieux de savoir comment tu récupéreras ces infos... ça m'intéresse !
<span id="FlowRate0"></span>
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8">. <title>Example</title> <script type="text/javascript" src="jquery-1.10.2.js"></script> <script type="text/javascript" src="orbiterclient.js"></script> <script type="text/javascript" src="gauge.min.radial.js"></script> <script type="text/javascript" src="gauge.min.linear.js"></script> <style> body { padding: 20px; margin: 0; background: #000; color: #64a0c8; } table { border-collapse: collapse; border-spacing: 0; table-layout: fixed; font-family: sans-serif; font-weight: bold; color: #64a0c8; font-size: 20px; border-bottom: 3px solid #64a0c8; } .table { position: absolute; right: 200px ; top: 20px } td:nth-child(1) { text-align: right; color: #04ff00; } td:nth-child(2) { text-align: center; font-size: 15px; } td:nth-child(3) { text-align: left; color: #04ff00; } .vl { border-left: 3px solid #64a0c8; height: 1100px; position: absolute; top: 20px; left: 420px; } </style></head><body><!--Main engines status--><table> <tr> <th colspan="3">MAIN</th> </tr> <tr> <td colspan="3"><canvas id="gauge-eng0"></canvas><canvas id="gauge-eng1"></canvas></td> <tr> <tr> <td><span id="Thrust0"></span></td> <td>THRUST kN</td> <td><span id="Thrust1"></span></td> </tr> <tr> <td><span id="TSFC0"></span></td> <td>TSFC kg/kNs</td> <td><span id="TSFC1"></span></td> </tr> <tr> <td><span id="FlowRate0"></span></td> <td>FLOW kg/s</td> <td><span id="FlowRate1"></span></td> </tr> <tr> <td><span id="FuelLevelQ0"></span></td> <td>QTY kg</td> <td><span id="FuelLevelQ1"></span></td> </tr></table>
XCTL:<"FOCUS", vessel name or index>:Engine Reference API method GetEngineState Additional Arguments engineId (int) Return Type engineId (int), throttle level (double), pitch gimbal position (double), yaw gimbal position (double), balance position (double), pitch centering mode engaged (bool), yaw centering mode engaged (bool), balance centering mode engaged (bool), auto mode engaged (bool), divergent mode engaged (bool), tsfc (double), flow rate (double), thrust (double), fuel level (double), max fuel level (double), diffuser temp (double), burner temp (double), exhaust temp (double)
0,0,0,0,0,0,0,0,0,0,0.0385173,0,0,0.615,230880,-1,-1,-1,0
<script type="text/javascript" src="gauge.min.radial.js"></script> <script type="text/javascript" src="gauge.min.linear.js"></script>
<script> var oc = new OrbiterClient(); oc.start(200); // Update interval (ms) //DATA DEFINITION //Main engine 1 oc.subscribe("XCTL:FOCUS:Engine:0", function(data) { var chars = data.split(','); var Throttle0 = chars[1]*100; var TSFC0 = chars[10]*1000; var FlowRate0 = chars[11]; var Thrust0 = chars[12]/1000; var FuelLevel0 = chars[13]*100; var FuelLevelQ0 = chars[14]*chars[13]; $("#FlowRate0").text(Throttle0); $("#Thrust0").text(Thrust0.toFixed(1)); $("#TSFC0").text(TSFC0.toFixed(3)); $("#FuelLevelQ0").text(FuelLevelQ0.toFixed(0)); gaugeEng0.value = Throttle0; });//GAUGES DEFINITION //Main engine 1 gauge var gaugeEng0 = new LinearGauge({ renderTo: 'gauge-eng0', width: 200, height: 200, minValue: 0, startAngle: 90, ticksAngle: 180, valueBox: false, maxValue: 100, majorTicks: [ "0", "", "20", "", "40", "", "60", "", "80", "", "100" ], minorTicks: 2, strokeTicks: true, highlights: [ { "from": 100, "to": 110, "color": "rgba(200, 50, 50, .75)" } ], colorPlate: "#000", barBeginCircle: 0, borderShadowWidth: 0, borderMiddleWidth: 30, borders: false, needleType: "arrow", needleWidth: 10, needleCircleSize: 7, needleCircleOuter: true, needleCircleInner: true, tickSide: "left", needleSide: "left", numberSide: "left", colorBarProgress: "#64a0c8", colorBar: "000", colorNumbers: "#64a0c8", colorMajorTicks: "#64a0c8", colorMinorTicks: "#64a0c8", borders: 0, valueInt: 1, valueDec: 0, animationDuration: 1500, animationRule: "dequint", barWidth: 10, animatedValue: true }); gaugeEng0.draw();//Attitude oc.subscribe("SHIP:FOCUS:Attitude", function(data) { var att = data; var chars = att.split(','); var pi = Math.PI; var aoa = chars[0]*(180/pi); $("#AoA").text(aoa.toFixed(1)); }); //Angle of Attack gauge var gaugeAoA = new RadialGauge({ renderTo: 'gauge-AoA', width: 100, height: 100, minValue: 0, startAngle: 90, ticksAngle: 180, valueBox: false, maxValue: 100, majorTicks: [ "0", "", "20", "", "40", "", "60", "", "80", "", "100" ], minorTicks: 2, strokeTicks: true, highlights: [ { "from": 100, "to": 110, "color": "rgba(200, 50, 50, .75)" } ], colorPlate: "#000", barBeginCircle: 0, borderShadowWidth: 0, borderMiddleWidth: 30, borders: false, needleType: "arrow", needleWidth: 10, needleCircleSize: 7, needleCircleOuter: true, needleCircleInner: true, tickSide: "right", needleSide: "right", numberSide: "right", colorBarProgress: "#64a0c8", colorBar: "000", colorNumbers: "#64a0c8", colorMajorTicks: "#64a0c8", colorMinorTicks: "#64a0c8", borders: 0, valueInt: 1, valueDec: 0, animationDuration: 1500, animationRule: "dequint", barWidth: 10, animatedValue: true }); gaugeEng3.draw(); </script></body></html>
Trop cool !
Quote from: antoo on 23 October 2019, 20:08:35Trop cool !As tu vu les details de la programmation que j'ai poste plus haut? j'ai eu peur que ca se perde dans mes derniers messages.
[...] L'autre problème est que rien n'a vraiment été fait pour extraire les températures de carlingue. Le seul truc que j'ai trouvé se base sur XRVesselCtrlDemo 3.1 qui ne fonctionne pas sur Orbiter 2010. Je suis déçu.
Bonjour,Quote from: hysot on 22 October 2019, 01:35:50[...] L'autre problème est que rien n'a vraiment été fait pour extraire les températures de carlingue. Le seul truc que j'ai trouvé se base sur XRVesselCtrlDemo 3.1 qui ne fonctionne pas sur Orbiter 2010. Je suis déçu.En fouillant dans l'Internet Archive, on peut y trouver une ancienne v3.0 qui d'après le Readme fonctionne avec Orbiter 2010.https://web.archive.org/web/20160704233715/http://www.alteaaerospace.com/downloads/releases/XRVesselCtrlDemo-3.0.zipBon courage pour ce projet ! Milouse
//Engines Definition------------------- var engId = new Array(8); var throttle = new Array(8); var pitchGimb = new Array(8); var yawGimb = new Array(8); var balancePos = new Array(8); var pitchCtrMd = new Array(8); var yawCtrMd = new Array(8); var balanceCtrMd = new Array(8); var autoMd = new Array(8); var divergentMd = new Array(8); var tsfc = new Array(8); var flowRate = new Array(8); var thrust = new Array(8); var fuelLvl = new Array(8); var maxFuelLvl = new Array(8); var fuelLvlKg = new Array(8) var diffTemp = new Array(8); var burnerTemp = new Array(8); var exhaustTemp = new Array(8); var gaugeEng = new Array(8); oc.subscribe("XCTL:FOCUS:Engines", function(data) { var chars = data.split(','); for (i=0; i<8; i++) { engId[i] = chars[0+(i*18)]; throttle[i] = chars[1+(i*18)]*100; pitchGimb[i] = chars[2+(i*18)]; yawGimb[i] = chars[3+(i*18)]; balancePos[i] = chars[4+(i*18)]; pitchCtrMd[i] = chars[5+(i*18)]; yawCtrMd[i] = chars[6+(i*18)]; balanceCtrMd[i] = chars[7+(i*18)]; autoMd[i] = chars[8+(i*18)]; divergentMd[i] = chars[9+(i*18)]; tsfc[i] = chars[10+(i*18)]*1; flowRate[i] = chars[11+(i*18)]*1; thrust[i] = chars[12+(i*18)]/1000; fuelLvl[i] = chars[13+(i*18)]; maxFuelLvl[i] = chars[14+(i*18)]; fuelLvlKg[i] = fuelLvl[i]*maxFuelLvl[i]; diffTemp[i] = chars[15+(i*18)]/10; burnerTemp[i] = chars[16+(i*18)]/10; exhaustTemp[i] = chars[17+(i*18)]/10; $("#Throttle"+i).text(throttle[i].toFixed(0)); $("#FlowRate"+i).text(flowRate[i].toFixed(0)); $("#Thrust"+i).text(thrust[i].toFixed(1)); $("#TSFC"+i).text(tsfc[i].toFixed(3)); $("#FuelLevelQ"+i).text(fuelLvlKg[i].toFixed(0)); $("#DiffTemp"+i).text(diffTemp[i].toFixed(1)); $("#BurnTemp"+i).text(burnerTemp[i].toFixed(1)); $("#ExhTemp"+i).text(exhaustTemp[i].toFixed(1)); } gaugeEng0.value = throttle[0]; gaugeEng1.value = throttle[1]; gaugeEng2.value = throttle[2]; gaugeEng3.value = throttle[3]; gaugeEng4.value = throttle[4]; gaugeEng5.value = throttle[5]; });