Took 1 hour 29 minutes
This commit is contained in:
2023-01-31 14:07:08 +01:00
parent e677e41e40
commit 8766961c7b
7 changed files with 119 additions and 23 deletions

View File

@ -14,6 +14,7 @@ import {SensorHelper} from "../../SensorHelper";
import {IContainer} from "../../database/IContainer";
import {Mixer} from "../../Mixer";
import {ArduinoProxy} from "../../ArduinoProxy";
import {ContainerHelper} from "../../ContainerHelper";
const express = require('express');
const router = express.Router();
@ -95,6 +96,7 @@ router.ws('/', async (ws, req, next) => {
await container.save();
await ContainerHelper.measureContainers();
await iTender.refreshDrinks();
break;
}
@ -124,6 +126,10 @@ router.ws('/', async (ws, req, next) => {
break;
}
case WebSocketEvent.CANCEL: {
await Mixer.cancelFill();
}
case WebSocketEvent.REQUEST: {
log("Request to " + msg.data["type"]);
@ -143,7 +149,7 @@ router.ws('/', async (ws, req, next) => {
case RequestType.STARTFILL: {
let job: IJob | null = null;
try {
job = await iTender.onReceiveFill(msg.data["content"]);
job = await iTender.onReceiveFill(msg.data.data);
} catch (e: any) {
console.error(e);
}