How to use the tar.distance function in tar

To help you get started, we’ve selected a few tar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TheTacoScott / GoAtThrottleUp / ServerRelay / static / js / main.js View on Github external
$(".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));
  }
github TheTacoScott / GoAtThrottleUp / ServerRelay / static / js / main.js View on Github external
}
    else if ($globaldata["v.geeForce"] >= 8)
    {
       $("#gforce-light").removeClass("status-light-warning").addClass("status-light-danger");
    }
    else
    {
      $("#gforce-light").removeClass("status-light-warning status-light-danger");
    }
  }
  
  if ('tar.distance' in $globaldata && 'tar.name' in $globaldata)
  {
    try
    {
      if ($globaldata['tar.distance']-SPHERES[$globaldata['tar.name']] < 500000)
      {
         $("#sphere-light").addClass("status-light-info");
      }
      else
      {
        $("#sphere-light").removeClass("status-light-info");
      }
    }
    catch(err)
    {
      $("#sphere-light").removeClass("status-light-info");
      console.log(err);
    }
  }
github TheTacoScott / GoAtThrottleUp / ServerRelay / static / js / main.js View on Github external
$(".eccentricity-readout").text($globaldata['o.eccentricity'].toFixed(4));
		$("#gauge-eccentricity").val($globaldata['o.eccentricity']);
		$(".inclination-readout").text($globaldata['o.inclination'].toFixed(4));
		$("#gauge-inclination").val($globaldata['o.inclination']);
	}
	
	var $datafound = false;
	var $incdelta = -1;
	var $eccdelta = -1;
  
  
	if ('tar.distance' in $globaldata && 'o.ApA' in $globaldata)
	{

    $(".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));
github TheTacoScott / GoAtThrottleUp / ServerRelay / static / js / main.js View on Github external
{
		$(".eccentricity-readout").text($globaldata['o.eccentricity'].toFixed(4));
		$("#gauge-eccentricity").val($globaldata['o.eccentricity']);
		$(".inclination-readout").text($globaldata['o.inclination'].toFixed(4));
		$("#gauge-inclination").val($globaldata['o.inclination']);
	}
	
	var $datafound = false;
	var $incdelta = -1;
	var $eccdelta = -1;
  
  
	if ('tar.distance' in $globaldata && 'o.ApA' in $globaldata)
	{

    $(".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']);