Add parsing of AD1 files. Memorize window size and location.

This commit is contained in:
Patrick Fic
2025-03-17 14:27:33 -07:00
parent 10368f8f9e
commit c1949eb5f9
33 changed files with 524 additions and 20 deletions

View File

@@ -1,6 +1,8 @@
import { ipcMain } from "electron";
import { app, ipcMain } from "electron";
import log from "electron-log/main";
import path from "path";
import ipcTypes from "../../util/ipcTypes.json";
import ImportJob from "../decoder/decoder";
import { StartWatcher } from "../watcher/watcher";
import {
SettingsWatchedFilePathsAdd,
@@ -10,7 +12,7 @@ import {
import { ipcMainHandleAuthStateChanged } from "./ipcMainHandler.user";
// Log all IPC messages and their payloads
const logIpcMessages = () => {
const logIpcMessages = (): void => {
// Get all message types from ipcTypes.toMain
Object.keys(ipcTypes.toMain).forEach((key) => {
const messageType = ipcTypes.toMain[key];
@@ -42,6 +44,24 @@ ipcMain.on(ipcTypes.toMain.test, (payload: any) =>
//Auth handler
ipcMain.on(ipcTypes.toMain.authStateChanged, ipcMainHandleAuthStateChanged);
//Add debug handlers if in development
if (import.meta.env.DEV) {
log.debug("[IPC Debug Functions] Adding Debug Handlers");
ipcMain.on(
ipcTypes.toMain.debug.decodeEstimate,
async (event, payload): Promise<void> => {
const relativeEmsFilepath = `_reference/ems/MPI_1/3698420.ENV`;
// Get the app's root directory and create an absolute path
const rootDir = app.getAppPath();
const absoluteFilepath = path.join(rootDir, relativeEmsFilepath);
log.debug("[IPC Debug Function] Decode test Estimate", absoluteFilepath);
await ImportJob(absoluteFilepath);
}
);
}
//Settings Handlers
ipcMain.handle(
ipcTypes.toMain.settings.filepaths.get,