Added base handled for job decode and watcher start/top
This commit is contained in:
26
electron/ipc-main-handler.js
Normal file
26
electron/ipc-main-handler.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const { ipcMain, dialog } = require("electron");
|
||||
const { mainWindow } = require("./main");
|
||||
const settings = require("electron-settings");
|
||||
const { DecodeEstimate } = require("./decoder/decoder");
|
||||
const ipcTypes = require("../src/ipc.types");
|
||||
//Import Ipc Handlers
|
||||
require("./file-watcher/file-watcher-ipc");
|
||||
|
||||
console.log("*** Added IPC Handlers ***");
|
||||
|
||||
ipcMain.on(
|
||||
ipcTypes.default.fileWatcher.toMain.filepathsGet,
|
||||
async (event, object) => {
|
||||
const filePaths = await settings.get("filePaths");
|
||||
event.reply(
|
||||
ipcTypes.default.fileWatcher.toRenderer.filepathsList,
|
||||
filePaths
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
ipcMain.on("test", async (event, object) => {
|
||||
console.log("Received test IPC Command");
|
||||
const job = await DecodeEstimate("C:\\VPS\\EMS\\687_3_A.AD1");
|
||||
event.reply("test-success", { status: 0, message: null, data: job });
|
||||
});
|
||||
Reference in New Issue
Block a user