Commit 17d6fe92 by Joe Holden

junk delta, makes no sense atm

parent 69a57cde
......@@ -22,7 +22,7 @@ while(true) {
$old = $json;
if ($count == 3) {
$json = json_decode(file_get_contents($url));
file_put_contents($json, 'live-feed.json');
file_put_contents('live-feed.json', json_encode($json, JSON_PRETTY_PRINT));
$count = 1;
}
if (json_last_error()) {
......@@ -91,8 +91,6 @@ function draw($json, $old, $climate, $duration, $refresh) {
$carcount = count($cars);
foreach ($cars as $k => $v) {
$driver = $v['driver'];
if ($v['delta'] == 0.000000)
$v['delta'] = 'leader';
switch ($v['is_on_track']) {
case true:
$state = 'on-track';
......@@ -118,7 +116,7 @@ function draw($json, $old, $climate, $duration, $refresh) {
$status = 'unknown';
break;
}
$entry = ['number' => $v['vehicle_number'], 'manu' => $v['vehicle_manufacturer'], 'driver' => $driver['full_name'], 'delta' => $v['delta'], 'started' => $v['starting_position'], 'state' => $state, 'laps' => $v['laps_completed'], 'status' => $status, 'sponsor' => $v['sponsor_name'], 'lap_speed' => $v['last_lap_speed'], 'lap_time' => $v['last_lap_time'], 'vehicle_ontrack_time' => $v['vehicle_elapsed_time']];
$entry = ['number' => $v['vehicle_number'], 'manu' => $v['vehicle_manufacturer'], 'driver' => $driver['full_name'], 'started' => $v['starting_position'], 'state' => $state, 'laps' => $v['laps_completed'], 'status' => $status, 'sponsor' => $v['sponsor_name'], 'lap_speed' => $v['last_lap_speed'], 'lap_time' => $v['last_lap_time'], 'vehicle_ontrack_time' => $v['vehicle_elapsed_time']];
if ($state == 'on-track')
$table[$v['running_position']] = $entry;
else
......@@ -163,7 +161,7 @@ function draw($json, $old, $climate, $duration, $refresh) {
while ($car <= $carcount) {
if (isset($table[$car])) {
$entry = $table[$car];
$climate->lightGreen(sprintf("%d: #%s %s (%s), delta: %f, started: %d, laps: %d, last lap: %s (%smph), driven by %s (%s) - %s", $car, $entry['number'], $entry['sponsor'], fullmanu($entry['manu']), round($entry['delta']), $entry['started'], $entry['laps'], $entry['lap_time'], $entry['lap_speed'], $entry['driver'], $entry['status'], $duration->humanize($entry['vehicle_ontrack_time'])));
$climate->lightGreen(sprintf("%d: #%s %s (%s), started: %d, laps: %d, last lap: %s (%smph), driven by %s (%s) - %s", $car, $entry['number'], $entry['sponsor'], fullmanu($entry['manu']), $entry['started'], $entry['laps'], $entry['lap_time'], $entry['lap_speed'], $entry['driver'], $entry['status'], $duration->humanize($entry['vehicle_ontrack_time'])));
unset($entry);
}
$car++;
......@@ -175,7 +173,7 @@ function draw($json, $old, $climate, $duration, $refresh) {
while ($car <= $carcount) {
if (isset($out[$car])) {
$entry = $out[$car];
$climate->lightRed(sprintf("%d: #%s %s (%s), delta: %f, started: %d, laps: %d, last lap: %s (%smph), driven by %s (%s) - %s", $car, $entry['number'], $entry['sponsor'], fullmanu($entry['manu']), round($entry['delta']), $entry['started'], $entry['laps'], $entry['lap_time'], $entry['lap_speed'], $entry['driver'], $entry['status'], $duration->humanize($entry['vehicle_ontrack_time'])));
$climate->lightRed(sprintf("%d: #%s %s (%s), started: %d, laps: %d, last lap: %s (%smph), driven by %s (%s) - %s", $car, $entry['number'], $entry['sponsor'], fullmanu($entry['manu']), $entry['started'], $entry['laps'], $entry['lap_time'], $entry['lap_speed'], $entry['driver'], $entry['status'], $duration->humanize($entry['vehicle_ontrack_time'])));
unset($entry);
}
$car++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment