=1737700241) { $timestamp = $cols[0]; $line[$l][1] = $cols[2]; // timestamp $line[$l][2] = date("H:i",$cols[2]); // time $line[$l][3] = round($cols[3],1); // temp if ($line[$l][3]==85) $line[$l][3] = $line[$l-1][3]; if ($line[$l][0] == 'nit') $licznik++; echo "insert into nitownica (timestamp, entry_type, temperature, pulse_length, nit_count) values ( // print_r ($line[$l]); $wydajnosc = 0; if ($line[$l][0] == 'nit') { for ($p=$l-1; $p>=0; $p--) { if ($line[$p][1] < $line[$l][1] - 180) { $prev_wydajnosc = 0; break; } if ($line[$p][0] == 'nit') { $ts = $line[$l][1]; $wydajnosc = round(3600/($line[$l][1] - $line[$p][1])/4); break; } } } else { $wydajnosc = $prev_wydajnosc; } if ($wydajnosc > 60) $wydajnosc = 40; $line[$l][4] = $wydajnosc; $prev_wydajnosc = $wydajnosc; if ($l !=0) $line[$l][5] = round($licznik/($line[$l][1] - $line[0][1])*3600*0.2,1); else $line[$l][5] = 0; if ($line[$l][0] == 'nit') $line[$l][6] = 10; else $line[$l][6] = 0; if ($line[$l][0]=='nit' || $line[$l][0]=='nithb') { $data .= "['".$line[$l][2]."', ".$line[$l][6].", ".$line[$l][4].", ".$line[$l][5].", ".$line[$l][3]."],"; } $l++; } } ?>