Add in AD2 decode.
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import log from "electron-log/main";
|
||||
import path from "path";
|
||||
import errorTypeCheck from "../../util/errorTypeCheck";
|
||||
import DecodeAD1 from "./decode-ad1";
|
||||
import { ParsedAD1 } from "./decode-ad1.interface";
|
||||
import DecodeAD2 from "./decode-ad2";
|
||||
import { ParsedAD2 } from "./decode-ad2.interface";
|
||||
import DecodeVeh from "./decode-veh";
|
||||
import { ParsedVeh } from "./decode-veh.interface";
|
||||
|
||||
async function ImportJob(filepath: string): Promise<void> {
|
||||
const parsedFilePath = path.parse(filepath);
|
||||
@@ -10,10 +16,14 @@ async function ImportJob(filepath: string): Promise<void> {
|
||||
);
|
||||
log.debug("Importing Job", extensionlessFilePath);
|
||||
|
||||
const decodedJob = {};
|
||||
|
||||
const ad1: ParsedAD1 = await DecodeAD1(extensionlessFilePath);
|
||||
log.debug("AD1", ad1);
|
||||
try {
|
||||
const ad1: ParsedAD1 = await DecodeAD1(extensionlessFilePath);
|
||||
const ad2: ParsedAD2 = await DecodeAD2(extensionlessFilePath);
|
||||
const veh: ParsedVeh = await DecodeVeh(extensionlessFilePath);
|
||||
log.debug("EMS Object", { ad1, ad2, veh });
|
||||
} catch (error) {
|
||||
log.error("Error encountered while decoding job. ", errorTypeCheck(error));
|
||||
}
|
||||
}
|
||||
|
||||
export default ImportJob;
|
||||
|
||||
Reference in New Issue
Block a user