diff --git a/controllers/modbus.controller.js b/controllers/modbus.controller.js index 7eaffe2..a521f5f 100644 --- a/controllers/modbus.controller.js +++ b/controllers/modbus.controller.js @@ -60,7 +60,7 @@ export const modbusController = { */ async createDevice(req, res, next) { try { - const { id, name, g_display_reg_addr, g_display_reg_format, g_display_reg_type, g_y_label, is_logging } = + const { id, name, g_display_reg_addr, g_display_reg_format, g_display_reg_type, g_y_label } = req.body; await db.run( `INSERT INTO "modbus_slaves" ( @@ -69,10 +69,9 @@ export const modbusController = { "g_display_reg_addr", "g_display_reg_format", "g_display_reg_type", - "g_y_label", - "is_logging") + "g_y_label") VALUES (?, ?, ?, ?, ?, ?, ?)`, - [id, name, g_display_reg_addr, g_display_reg_format, g_display_reg_type, g_y_label, is_logging], + [id, name, g_display_reg_addr, g_display_reg_format, g_display_reg_type, g_y_label], ); return res.status(200).json({ message: "Device created." }); } catch (error) { diff --git a/data.db b/data.db index bdf8a2f..44fe851 100644 Binary files a/data.db and b/data.db differ diff --git a/getslaves.sql b/getslaves.sql index 4e96fed..86b0b2d 100644 --- a/getslaves.sql +++ b/getslaves.sql @@ -4,7 +4,6 @@ SELECT g_display_reg_addr, g_display_reg_format, g_y_label, - is_logging, CASE WHEN COUNT(dv.id) = 0 THEN '[]' ELSE '[' || GROUP_CONCAT( diff --git a/index.d.ts b/index.d.ts index 369ca53..47f4d9b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -30,7 +30,6 @@ export type ModbusDevice = { g_display_reg_format: NumberType | null; g_display_reg_type: "HR" | "IR"; g_y_label: string | null; - is_logging: boolean; display_values?: DisplayValue[] } diff --git a/migrations/001-init.sql b/migrations/001-init.sql index 08f6fa3..dc2da23 100644 --- a/migrations/001-init.sql +++ b/migrations/001-init.sql @@ -25,7 +25,6 @@ CREATE TABLE IF NOT EXISTS "modbus_slaves" ( "g_display_reg_type" VARCHAR(3) CHECK(g_display_reg_type IN("HR", "IR")) DEFAULT "IR", "g_display_reg_format" VARCHAR(5) CHECK(g_display_reg_format IN("UI16", "I16", "UI32", "I32", "FP32")) DEFAULT "UI16", "g_y_label" VARCHAR(40) DEFAULT "Label", - "is_logging" BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY("id") ); @@ -56,12 +55,12 @@ CREATE TABLE IF NOT EXISTS "display_values" ( -- ) INSERT INTO "modbus_slaves" ( - "id", "name", "g_display_reg_addr", "g_display_reg_type", "g_display_reg_format", "g_y_label", "is_logging" + "id", "name", "g_display_reg_addr", "g_display_reg_type", "g_display_reg_format", "g_y_label" ) VALUES - (1, "Device #1", 0, "IR", "UI16", "Label 1", 1), - (2, "Device #2", 1, "IR", "UI32", "Label 2", 1), - (3, "Device #3", 3, "IR", "UI16", "Label 3", 0), - (4, "Device #4", NULL, NULL, NULL, "Label 4", 0); + (1, "Device #1", 0, "IR", "UI16", "Label 1"), + (2, "Device #2", 1, "IR", "UI32", "Label 2"), + (3, "Device #3", 3, "IR", "UI16", "Label 3"), + (4, "Device #4", NULL, NULL, NULL, "Label 4"); INSERT INTO "display_values" ( "id", "name", "slave_id", "reg_addr", "reg_format", "reg_type" diff --git a/public/index.html b/public/index.html index f0da556..0933531 100644 --- a/public/index.html +++ b/public/index.html @@ -66,7 +66,7 @@