Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$(".tar-distance-readout").text($globaldata['tar.distance'].toFixed(0).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
$(".tar-distance-apa-delta-readout").text(($globaldata['o.ApA'] - $globaldata['tar.distance']).toFixed(0).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
}
//console.log($targetid);
if ('tar.phaseAngle' in $globaldata && 'tar.eccentricity' in $globaldata && 'tar.inclination' in $globaldata && 'tar.name' in $globaldata)
{
if ($globaldata['tar.name'] != "No Target")
{
//console.log("Heat?" + $globaldata["v.overheatRatio"]);
//console.log($globaldata["v.geeForce"]);
$(".tar-phase-readout").text($globaldata['tar.phaseAngle'].toFixed(3));
$("#gauge-phaseangle").val($globaldata['tar.phaseAngle']);
$(".tar-sphere-readout").text(SPHERES[$globaldata['tar.name']].toFixed(0).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
$(".tar-distance2sphere-readout").text(($globaldata['tar.distance']-SPHERES[$globaldata['tar.name']]).toFixed(0).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
$(".tar-eccentricity-readout").text($globaldata['tar.eccentricity'].toFixed(4));
$("#gauge-target-eccentricity").val($globaldata['tar.eccentricity']);
$(".tar-inclination-readout").text($globaldata['tar.inclination'].toFixed(4));
$("#gauge-target-inclination").val($globaldata['tar.inclination']);
}
}
if ('o.inclination' in $globaldata && 'tar.inclination' in $globaldata && 'o.eccentricity' in $globaldata && 'tar.eccentricity' in $globaldata)
{
$incdelta = $globaldata['o.inclination'] - $globaldata['tar.inclination'];
$("#gauge-inclination-delta").val($incdelta);
$(".inclination-delta-readout").text($incdelta.toFixed(4));
$eccdelta = $globaldata['o.eccentricity'] - $globaldata['tar.eccentricity'];
$("#gauge-eccentricity-delta").val($eccdelta);
$(".eccentricity-delta-readout").text($eccdelta.toFixed(4));
}
$(".tar-distance-apa-delta-readout").text(($globaldata['o.ApA'] - $globaldata['tar.distance']).toFixed(0).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
}
//console.log($targetid);
if ('tar.phaseAngle' in $globaldata && 'tar.eccentricity' in $globaldata && 'tar.inclination' in $globaldata && 'tar.name' in $globaldata)
{
if ($globaldata['tar.name'] != "No Target")
{
//console.log("Heat?" + $globaldata["v.overheatRatio"]);
//console.log($globaldata["v.geeForce"]);
$(".tar-phase-readout").text($globaldata['tar.phaseAngle'].toFixed(3));
$("#gauge-phaseangle").val($globaldata['tar.phaseAngle']);
$(".tar-sphere-readout").text(SPHERES[$globaldata['tar.name']].toFixed(0).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
$(".tar-distance2sphere-readout").text(($globaldata['tar.distance']-SPHERES[$globaldata['tar.name']]).toFixed(0).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
$(".tar-eccentricity-readout").text($globaldata['tar.eccentricity'].toFixed(4));
$("#gauge-target-eccentricity").val($globaldata['tar.eccentricity']);
$(".tar-inclination-readout").text($globaldata['tar.inclination'].toFixed(4));
$("#gauge-target-inclination").val($globaldata['tar.inclination']);
}
}
if ('o.inclination' in $globaldata && 'tar.inclination' in $globaldata && 'o.eccentricity' in $globaldata && 'tar.eccentricity' in $globaldata)
{
$incdelta = $globaldata['o.inclination'] - $globaldata['tar.inclination'];
$("#gauge-inclination-delta").val($incdelta);
$(".inclination-delta-readout").text($incdelta.toFixed(4));
$eccdelta = $globaldata['o.eccentricity'] - $globaldata['tar.eccentricity'];
$("#gauge-eccentricity-delta").val($eccdelta);
$(".eccentricity-delta-readout").text($eccdelta.toFixed(4));
}
if ('tar.name' in $globaldata)
$("#gauge-phaseangle").val($globaldata['tar.phaseAngle']);
$(".tar-sphere-readout").text(SPHERES[$globaldata['tar.name']].toFixed(0).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
$(".tar-distance2sphere-readout").text(($globaldata['tar.distance']-SPHERES[$globaldata['tar.name']]).toFixed(0).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
$(".tar-eccentricity-readout").text($globaldata['tar.eccentricity'].toFixed(4));
$("#gauge-target-eccentricity").val($globaldata['tar.eccentricity']);
$(".tar-inclination-readout").text($globaldata['tar.inclination'].toFixed(4));
$("#gauge-target-inclination").val($globaldata['tar.inclination']);
}
}
if ('o.inclination' in $globaldata && 'tar.inclination' in $globaldata && 'o.eccentricity' in $globaldata && 'tar.eccentricity' in $globaldata)
{
$incdelta = $globaldata['o.inclination'] - $globaldata['tar.inclination'];
$("#gauge-inclination-delta").val($incdelta);
$(".inclination-delta-readout").text($incdelta.toFixed(4));
$eccdelta = $globaldata['o.eccentricity'] - $globaldata['tar.eccentricity'];
$("#gauge-eccentricity-delta").val($eccdelta);
$(".eccentricity-delta-readout").text($eccdelta.toFixed(4));
}
if ('tar.name' in $globaldata)
{
if ($globaldata['tar.name']=="No Target")
{
$(".tar-distance-readout").text("ERR");
$(".tar-distance-apa-delta-readout").text("ERR");
$(".tar-phase-readout").text("ERR");
$("#gauge-phaseangle").val(0);
$(".tar-sphere-readout").text("ERR");
$(".tar-distance2sphere-readout").text("ERR");
$(".tar-eccentricity-readout").text("ERR");
$("#gauge-target-eccentricity").val(0);