fixed bug display on before running and remove console

This commit is contained in:
Muhammad Izza Alfiansyah 2024-07-09 14:54:53 +07:00
parent fcf1173ced
commit cad5e9d287
3 changed files with 12 additions and 11 deletions

View File

@ -329,6 +329,7 @@ void loop(){
if (tickDiffSecond == (order / 4.0 * 4)) {
lcd.clear();
lcd.setCursor(cursorPositions[i][0], cursorPositions[i][1]);
lcd.print("Aku siap!");
}
}
}
@ -477,16 +478,18 @@ void runFermentasi() {
int waktuAkhirHistori = dataHistori[0]["waktu_akhir"];
int waktuAwal = dataPengujianAwal["created_time"];
if (waktuAwal <= waktuAkhirHistori) {
bool historiTerakhirBerhasil = (bool) dataHistori[0]["berhasil"];
if (dataPengujian.length() > 0) {
if (waktuAwal <= waktuAkhirHistori) {
bool historiTerakhirBerhasil = (bool) dataHistori[0]["berhasil"];
if (historiTerakhirBerhasil) {
status = "Matang";
if (historiTerakhirBerhasil) {
status = "Matang";
} else {
status = "Gagal";
}
} else {
status = "Gagal";
cekKematangan();
}
} else {
cekKematangan();
}
insertKondisiTapai();

View File

@ -139,8 +139,6 @@ export default function (props: JSX.HTMLAttributes<HTMLDivElement>) {
// .order("created_time", { ascending: false })
// .limit(1);
console.log(lastData1![0], lastData2![0]);
if (lastData1![0] == lastData2![0]) {
alert("Device offline!");
} else if (lastData1![0].created_time == lastData2![0].created_time) {

View File

@ -80,7 +80,7 @@ export default function () {
data.forEach((item) => {
setKadarGas((val) => {
val.push(item.kadar_gas.toString().slice(0, 4));
val.push(item.kadar_gas);
return val;
});
@ -177,7 +177,7 @@ export default function () {
tooltip: {
callbacks: {
label(tooltipItem) {
return "Kadar Gas: " + tooltipItem.parsed.y + "%";
return "Kadar Gas: " + tooltipItem.parsed.y.toFixed(2) + "%";
},
},
},