From a46580a0a3c3223e3bc31fa3c6b92ecf24707cce Mon Sep 17 00:00:00 2001 From: OrenMice Date: Mon, 20 Apr 2026 12:21:34 +0300 Subject: [PATCH 01/11] branch commit --- src/shared/log/Log.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/log/Log.ts b/src/shared/log/Log.ts index b19a8e55f..9c3c24ac0 100644 --- a/src/shared/log/Log.ts +++ b/src/shared/log/Log.ts @@ -104,6 +104,7 @@ export default class Log { }); } + /** Adjusts the timestamp range based on a known timestamp. */ updateRangeWithTimestamp(timestamp: number) { if (this.timestampRange === null) { From c6ebd8543b9f0af682c338155ea08c917a1fa748 Mon Sep 17 00:00:00 2001 From: OrenMice Date: Wed, 22 Apr 2026 16:43:25 +0300 Subject: [PATCH 02/11] added button --- rollup.config.mjs | 50 ++++++++--- .../controllers/LineGraphController_Config.ts | 29 +++++++ src/main/electron/main.ts | 86 ++++++++++++------- 3 files changed, 122 insertions(+), 43 deletions(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index 84074cfe0..9120a5522 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -132,6 +132,7 @@ const mainBundles = isLite ]; const largeRendererBundles = [ bundle("hub/hub.ts", "hub.js", false, false), + bundle("hub/controllers/LineGraphController.ts", "LineGraphController.js", false, false), ...(isLite ? [] : [bundle("satellite.ts", "satellite.js", false, false)]) ]; const smallRendererBundles = [ @@ -182,17 +183,44 @@ const runOwletDownload = { }; export default (cliArgs) => { - if (cliArgs.configMain === true) return mainBundles; - if (cliArgs.configLargeRenderers === true) return largeRendererBundles; - if (cliArgs.configSmallRenderers === true) return smallRendererBundles; - if (cliArgs.configWorkers === true) return workerBundles; - if (cliArgs.configXR === true) { - if (isLite) process.exit(); - return xrBundles; + let bundles = []; + + if (cliArgs.configMain) { + bundles.push(...mainBundles); + } + + if (cliArgs.oren) { + bundles.push(...oren); + } + + if (cliArgs.configLargeRenderers) { + bundles.push(...largeRendererBundles); + } + + if (cliArgs.configSmallRenderers) { + bundles.push(...smallRendererBundles); + } + + if (cliArgs.configWorkers) { + bundles.push(...workerBundles); + } + + if (cliArgs.configXR) { + if (!isLite) { + bundles.push(...xrBundles); + } + } + + if (cliArgs.configRunOwletDownload) { + return runOwletDownload; // assuming this should stay exclusive + } + + // If no flags were passed, return default behavior + if (bundles.length === 0) { + return isLite + ? [...mainBundles, ...largeRendererBundles, ...smallRendererBundles, ...workerBundles] + : [...mainBundles, ...largeRendererBundles, ...smallRendererBundles, ...workerBundles, ...xrBundles]; } - if (cliArgs.configRunOwletDownload === true) return runOwletDownload; - return isLite - ? [...mainBundles, ...largeRendererBundles, ...smallRendererBundles, ...workerBundles] - : [...mainBundles, ...largeRendererBundles, ...smallRendererBundles, ...workerBundles, ...xrBundles]; + return bundles; }; diff --git a/src/hub/controllers/LineGraphController_Config.ts b/src/hub/controllers/LineGraphController_Config.ts index ef472be54..681347013 100644 --- a/src/hub/controllers/LineGraphController_Config.ts +++ b/src/hub/controllers/LineGraphController_Config.ts @@ -37,6 +37,15 @@ export const LineGraphController_NumericConfig: SourceListConfig = { { key: "bold", display: "Bold" }, { key: "verybold", display: "Very Bold" } ] + }, + { + key: "AddFromLogs", + display: "Add from all logs ", + showInTypeName: false, + values: [ + { key: "off", display: "Off" }, + { key: "on", display: "On" } + ] } ] }, @@ -64,6 +73,16 @@ export const LineGraphController_NumericConfig: SourceListConfig = { { key: "bold", display: "Bold" }, { key: "verybold", display: "Very Bold" } ] + }, + + { + key: "AddFromLogs", + display: "Add from all logs ", + showInTypeName: false, + values: [ + { key: "off", display: "Off" }, + { key: "on", display: "On" } + ] } ] }, @@ -90,6 +109,16 @@ export const LineGraphController_NumericConfig: SourceListConfig = { { key: "normal", display: "Normal" }, { key: "bold", display: "Large" } ] + }, + + { + key: "AddFromLogs", + display: "Add from all logs ", + showInTypeName: false, + values: [ + { key: "off", display: "Off" }, + { key: "on", display: "On" } + ] } ] } diff --git a/src/main/electron/main.ts b/src/main/electron/main.ts index 65d5df932..62b33c44a 100644 --- a/src/main/electron/main.ts +++ b/src/main/electron/main.ts @@ -556,7 +556,7 @@ async function handleHubMessage(window: BrowserWindow, message: NamedMessage) { rlogDataArrays[windowId] = new Uint8Array(); rlogSockets[windowId].on("data", (data) => { - appendArray(data); + appendArray(data); if (rlogSocketTimeouts[windowId] !== null) clearTimeout(rlogSocketTimeouts[windowId]); rlogSocketTimeouts[windowId] = setTimeout(() => { rlogSockets[windowId]?.destroy(); @@ -734,41 +734,63 @@ async function handleHubMessage(window: BrowserWindow, message: NamedMessage) { // Add options let currentTypeConfig = config.types.find((typeConfig) => typeConfig.key === state.type)!; + let addLogsOptionConfig = currentTypeConfig.options.find((optionConfig) => optionConfig.key === "AddFromLogs"); + if (addLogsOptionConfig !== undefined && addLogsOptionConfig.values.length > 0) { + menu.append( + new MenuItem({ + label: "Add from all logs", + click() { + respond(); + } + }) + ); + menu.append( + new MenuItem({ + type: "separator" + }) + ); + } + let appendOptionItem = (optionConfig: SourceListConfig["types"][number]["options"][number]) => { + if (optionConfig.key === "AddFromLogs") { + return; + } + menu.append( + new MenuItem({ + label: optionConfig.display, + submenu: optionConfig.values.map((optionValue) => { + return { + label: optionValue.display, + type: "checkbox", + checked: optionValue.key === state.options[optionConfig.key], + icon: getIcon(optionValue.key), + click() { + state.options[optionConfig.key] = optionValue.key; + respond(); + } + }; + }) + }) + ); + }; if (currentTypeConfig.options.length === 1) { let optionConfig = currentTypeConfig.options[0]; - optionConfig.values.forEach((optionValue) => { - menu.append( - new MenuItem({ - label: optionValue.display, - type: "checkbox", - checked: optionValue.key === state.options[optionConfig.key], - icon: getIcon(optionValue.key), - click() { - state.options[optionConfig.key] = optionValue.key; - respond(); - } - }) - ); - }); + optionConfig.values.forEach((optionValue) => { + menu.append( + new MenuItem({ + label: optionValue.display, + type: "checkbox", + checked: optionValue.key === state.options[optionConfig.key], + icon: getIcon(optionValue.key), + click() { + state.options[optionConfig.key] = optionValue.key; + respond(); + } + }) + ); + }); } else { currentTypeConfig.options.forEach((optionConfig) => { - menu.append( - new MenuItem({ - label: optionConfig.display, - submenu: optionConfig.values.map((optionValue) => { - return { - label: optionValue.display, - type: "checkbox", - checked: optionValue.key === state.options[optionConfig.key], - icon: getIcon(optionValue.key), - click() { - state.options[optionConfig.key] = optionValue.key; - respond(); - } - }; - }) - }) - ); + appendOptionItem(optionConfig); }); } From a4aeb1cb89ba1bcca413109214dd2997bead774f Mon Sep 17 00:00:00 2001 From: OrenMice Date: Thu, 23 Apr 2026 11:17:43 +0300 Subject: [PATCH 03/11] added button to district fileds --- .../controllers/LineGraphController_Config.ts | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/hub/controllers/LineGraphController_Config.ts b/src/hub/controllers/LineGraphController_Config.ts index 681347013..50746554c 100644 --- a/src/hub/controllers/LineGraphController_Config.ts +++ b/src/hub/controllers/LineGraphController_Config.ts @@ -144,8 +144,17 @@ export const LineGraphController_DiscreteConfig: SourceListConfig = { display: "Color", showInTypeName: false, values: GraphColors + }, + { + key: "AddFromLogs", + display: "Add from all logs ", + showInTypeName: false, + values: [ + { key: "off", display: "Off" }, + { key: "on", display: "On" } + ] } - ] + ], }, { key: "graph", @@ -161,6 +170,15 @@ export const LineGraphController_DiscreteConfig: SourceListConfig = { display: "Color", showInTypeName: false, values: GraphColors + }, + { + key: "AddFromLogs", + display: "Add from all logs ", + showInTypeName: false, + values: [ + { key: "off", display: "Off" }, + { key: "on", display: "On" } + ] } ] }, From b58cf339b5b74a36888c169dbbd6ca0ffeb11de3 Mon Sep 17 00:00:00 2001 From: OrenMice Date: Thu, 23 Apr 2026 12:14:44 +0300 Subject: [PATCH 04/11] made button print hello world --- src/hub/Tabs.ts | 7 +++++++ src/hub/controllers/LineGraphController.ts | 5 +++++ src/hub/hub.ts | 4 ++++ src/main/electron/main.ts | 1 + src/main/lite/main.ts | 14 ++++++++++++++ 5 files changed, 31 insertions(+) diff --git a/src/hub/Tabs.ts b/src/hub/Tabs.ts index 702b9b4b4..86d30b81b 100644 --- a/src/hub/Tabs.ts +++ b/src/hub/Tabs.ts @@ -693,6 +693,13 @@ export default class Tabs { } } + /** Runs the "Add from all logs" action on the selected line graph. */ + addFromAllLogs() { + if (this.tabList[this.selectedTab].type === TabType.LineGraph) { + (this.tabList[this.selectedTab].controller as LineGraphController).addFromAllLogs(); + } + } + /** Switches the selected camera for the selected 3D field. */ set3DCamera(index: number) { if (this.tabList[this.selectedTab].type === TabType.Field3d) { diff --git a/src/hub/controllers/LineGraphController.ts b/src/hub/controllers/LineGraphController.ts index 9c22437aa..0cb209e40 100644 --- a/src/hub/controllers/LineGraphController.ts +++ b/src/hub/controllers/LineGraphController.ts @@ -340,6 +340,11 @@ export default class LineGraphController implements TabController { return false; } + /** Temporary handler for the "Add from all logs" action. */ + addFromAllLogs() { + console.log("hello world"); + } + private getPreview( key: string, time: number, diff --git a/src/hub/hub.ts b/src/hub/hub.ts index 006c11c2a..b7ca7a0cd 100644 --- a/src/hub/hub.ts +++ b/src/hub/hub.ts @@ -882,6 +882,10 @@ async function handleMainMessage(message: NamedMessage) { window.tabs.addDiscreteEnabled(); break; + case "add-from-all-logs": + window.tabs.addFromAllLogs(); + break; + case "edit-axis": window.tabs.editAxis( message.data.legend, diff --git a/src/main/electron/main.ts b/src/main/electron/main.ts index 62b33c44a..2c368e3ba 100644 --- a/src/main/electron/main.ts +++ b/src/main/electron/main.ts @@ -740,6 +740,7 @@ async function handleHubMessage(window: BrowserWindow, message: NamedMessage) { new MenuItem({ label: "Add from all logs", click() { + sendMessage(window, "add-from-all-logs"); respond(); } }) diff --git a/src/main/lite/main.ts b/src/main/lite/main.ts index 3529417ea..db61404f3 100644 --- a/src/main/lite/main.ts +++ b/src/main/lite/main.ts @@ -655,6 +655,17 @@ async function handleHubMessage(message: NamedMessage) { // Add options let currentTypeConfig = config.types.find((typeConfig) => typeConfig.key === state.type)!; + let addLogsOptionConfig = currentTypeConfig.options.find((optionConfig) => optionConfig.key === "AddFromLogs"); + if (addLogsOptionConfig !== undefined && addLogsOptionConfig.values.length > 0) { + menuItems.push({ + content: "Add from all logs", + callback() { + sendMessage(hubPort, "add-from-all-logs"); + respond(); + } + }); + menuItems.push("-"); + } if (currentTypeConfig.options.length === 1) { let optionConfig = currentTypeConfig.options[0]; optionConfig.values.forEach((optionValue) => { @@ -669,6 +680,9 @@ async function handleHubMessage(message: NamedMessage) { }); } else { currentTypeConfig.options.forEach((optionConfig) => { + if (optionConfig.key === "AddFromLogs") { + return; + } menuItems.push({ content: optionConfig.display, items: optionConfig.values.map((optionValue) => { From 3bc8ba713bcd64eeb28e54fbba3a5d6b80b1b8a8 Mon Sep 17 00:00:00 2001 From: OrenMice Date: Thu, 23 Apr 2026 12:49:56 +0300 Subject: [PATCH 05/11] made button print the data name --- src/hub/Tabs.ts | 5 +++-- src/hub/controllers/LineGraphController.ts | 4 ++-- src/hub/hub.ts | 2 +- src/main/electron/main.ts | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hub/Tabs.ts b/src/hub/Tabs.ts index 86d30b81b..80a2f18ea 100644 --- a/src/hub/Tabs.ts +++ b/src/hub/Tabs.ts @@ -694,11 +694,12 @@ export default class Tabs { } /** Runs the "Add from all logs" action on the selected line graph. */ - addFromAllLogs() { + addFromAllLogs(data?: any) { if (this.tabList[this.selectedTab].type === TabType.LineGraph) { - (this.tabList[this.selectedTab].controller as LineGraphController).addFromAllLogs(); + (this.tabList[this.selectedTab].controller as LineGraphController).addFromAllLogs(data); } } + /** Switches the selected camera for the selected 3D field. */ set3DCamera(index: number) { diff --git a/src/hub/controllers/LineGraphController.ts b/src/hub/controllers/LineGraphController.ts index 0cb209e40..6555166c9 100644 --- a/src/hub/controllers/LineGraphController.ts +++ b/src/hub/controllers/LineGraphController.ts @@ -341,8 +341,8 @@ export default class LineGraphController implements TabController { } /** Temporary handler for the "Add from all logs" action. */ - addFromAllLogs() { - console.log("hello world"); + addFromAllLogs(data?: any) { + console.log("data:",data); } private getPreview( diff --git a/src/hub/hub.ts b/src/hub/hub.ts index b7ca7a0cd..2c9791a3f 100644 --- a/src/hub/hub.ts +++ b/src/hub/hub.ts @@ -883,7 +883,7 @@ async function handleMainMessage(message: NamedMessage) { break; case "add-from-all-logs": - window.tabs.addFromAllLogs(); + window.tabs.addFromAllLogs(message.data); break; case "edit-axis": diff --git a/src/main/electron/main.ts b/src/main/electron/main.ts index 2c368e3ba..f5f2f2d13 100644 --- a/src/main/electron/main.ts +++ b/src/main/electron/main.ts @@ -740,7 +740,7 @@ async function handleHubMessage(window: BrowserWindow, message: NamedMessage) { new MenuItem({ label: "Add from all logs", click() { - sendMessage(window, "add-from-all-logs"); + sendMessage(window, "add-from-all-logs",state.logKey); respond(); } }) From 2a7f138908fde28a8259e25bf61ff421021e9452 Mon Sep 17 00:00:00 2001 From: OrenMice Date: Thu, 23 Apr 2026 15:06:37 +0300 Subject: [PATCH 06/11] half works, only for right --- src/hub/controllers/LineGraphController.ts | 14 +++++++++++-- src/shared/log/LogUtil.ts | 23 ++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/hub/controllers/LineGraphController.ts b/src/hub/controllers/LineGraphController.ts index 6555166c9..1a8df1952 100644 --- a/src/hub/controllers/LineGraphController.ts +++ b/src/hub/controllers/LineGraphController.ts @@ -9,7 +9,7 @@ import { ensureThemeContrast } from "../../shared/Colors"; import LineGraphFilter from "../../shared/LineGraphFilter"; import { SelectionMode } from "../../shared/Selection"; import { SourceListState } from "../../shared/SourceListConfig"; -import { AKIT_TIMESTAMP_KEYS, getEnabledKey, getLogValueText } from "../../shared/log/LogUtil"; +import { AKIT_TIMESTAMP_KEYS, getEnabledKey, getLogValueText, findKey, keyPresent } from "../../shared/log/LogUtil"; import { LogValueSetNumber } from "../../shared/log/LogValueSets"; import { LineGraphRendererCommand, @@ -342,7 +342,17 @@ export default class LineGraphController implements TabController { /** Temporary handler for the "Add from all logs" action. */ addFromAllLogs(data?: any) { - console.log("data:",data); + let logKey = typeof data === "string" ? data : ""; + let newLogKey = logKey; + let logNum = 1; + newLogKey = "/Log" + logNum + logKey; + console.log("keyPresent",keyPresent(window.log, [newLogKey])); + while (keyPresent(window.log, [newLogKey])) { + console.log("data:", newLogKey); + this.rightSourceList.addField(newLogKey); + logNum++; + newLogKey = "/Log" + logNum + logKey; + } } private getPreview( diff --git a/src/shared/log/LogUtil.ts b/src/shared/log/LogUtil.ts index 874fcf6c7..f10108a20 100644 --- a/src/shared/log/LogUtil.ts +++ b/src/shared/log/LogUtil.ts @@ -112,6 +112,29 @@ export function findKey(log: Log, search: string[]): string | undefined { return bestKey; } +export function keyPresent(log: Log, search: string[]): boolean { + console.log("search",search); + + let fieldKeys = log.getFieldKeys(); + console.log("fieldKeys",fieldKeys); + let found = false; + for (const key of search) { + found = fieldKeys.includes(key); + if (found) + break; + } + // for (let i = 0; i < fieldKeys.length && found != true; i++) { + // let unmerged = removeMergePrefix(fieldKeys[i]); + // let searchIndex: number; + // if ((searchIndex = search.indexOf(unmerged)) !== -1) { + // found = true; + // } else if (unmerged.startsWith("/") && (searchIndex = search.indexOf(unmerged.slice(1))) !== -1) { + // found = true; + // } + // } + return found; +} + /** Adds a prefix to a log key. */ export function applyKeyPrefix(prefix: string, key: string): string { if (prefix.length === 0) { From 5cd2dc178285a791e858ca7d3c6c8544ce553247 Mon Sep 17 00:00:00 2001 From: OrenMice Date: Thu, 23 Apr 2026 15:35:53 +0300 Subject: [PATCH 07/11] made it not add already exising fields --- src/hub/controllers/LineGraphController.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hub/controllers/LineGraphController.ts b/src/hub/controllers/LineGraphController.ts index 1a8df1952..878b88ae6 100644 --- a/src/hub/controllers/LineGraphController.ts +++ b/src/hub/controllers/LineGraphController.ts @@ -343,12 +343,14 @@ export default class LineGraphController implements TabController { /** Temporary handler for the "Add from all logs" action. */ addFromAllLogs(data?: any) { let logKey = typeof data === "string" ? data : ""; + logKey = logKey.replace(/^\/Log[^/]+/, ""); let newLogKey = logKey; + let existingKeys = this.rightSourceList.getState().filter((source) => source.logKey.includes(logKey)).map((source)=> source.logKey); let logNum = 1; newLogKey = "/Log" + logNum + logKey; - console.log("keyPresent",keyPresent(window.log, [newLogKey])); while (keyPresent(window.log, [newLogKey])) { console.log("data:", newLogKey); + if(!existingKeys.includes(newLogKey)) this.rightSourceList.addField(newLogKey); logNum++; newLogKey = "/Log" + logNum + logKey; From a4a51f31b24047bac442f76d51a74041ee0e4736 Mon Sep 17 00:00:00 2001 From: OrenMice Date: Thu, 23 Apr 2026 17:07:52 +0300 Subject: [PATCH 08/11] button works --- src/hub/SourceList.ts | 4 +++ src/hub/controllers/LineGraphController.ts | 32 +++++++++++++++++++--- src/main/electron/main.ts | 6 +++- src/shared/log/LogUtil.ts | 4 +-- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/src/hub/SourceList.ts b/src/hub/SourceList.ts index b320053a4..d419ca49d 100644 --- a/src/hub/SourceList.ts +++ b/src/hub/SourceList.ts @@ -1267,4 +1267,8 @@ export default class SourceList { valueText.innerText = text; } } + + public getUUID() { + return this.UUID; + } } diff --git a/src/hub/controllers/LineGraphController.ts b/src/hub/controllers/LineGraphController.ts index 878b88ae6..4fb291173 100644 --- a/src/hub/controllers/LineGraphController.ts +++ b/src/hub/controllers/LineGraphController.ts @@ -5,6 +5,7 @@ // license that can be found in the LICENSE file // at the root directory of this project. +import { string } from "mathjs"; import { ensureThemeContrast } from "../../shared/Colors"; import LineGraphFilter from "../../shared/LineGraphFilter"; import { SelectionMode } from "../../shared/Selection"; @@ -342,16 +343,39 @@ export default class LineGraphController implements TabController { /** Temporary handler for the "Add from all logs" action. */ addFromAllLogs(data?: any) { - let logKey = typeof data === "string" ? data : ""; + let uuid = typeof data.uuid === "string" ? data.uuid as string : ""; + let sourceList: SourceList; + console.log("UUID/org",uuid); + console.log("UUID/right",this.rightSourceList.getUUID()); + console.log("UUID/left",this.leftSourceList.getUUID()); + + if (uuid.match(this.rightSourceList.getUUID())) { + sourceList = this.rightSourceList; + console.log("right"); + } + else if(uuid.match(this.leftSourceList.getUUID())){ + sourceList = this.leftSourceList; + console.log("left"); + } + else if(uuid.match(this.discreteSourceList.getUUID())){ + sourceList = this.discreteSourceList; + console.log("middle"); + } + else { + console.log("nooo") + return; + } + + let logKey = typeof data.logKey === "string" ? data.logKey : ""; logKey = logKey.replace(/^\/Log[^/]+/, ""); let newLogKey = logKey; - let existingKeys = this.rightSourceList.getState().filter((source) => source.logKey.includes(logKey)).map((source)=> source.logKey); + let existingKeys = sourceList.getState().filter((source) => source.logKey.includes(logKey)).map((source)=> source.logKey); let logNum = 1; newLogKey = "/Log" + logNum + logKey; while (keyPresent(window.log, [newLogKey])) { - console.log("data:", newLogKey); + // console.log("data:", newLogKey); if(!existingKeys.includes(newLogKey)) - this.rightSourceList.addField(newLogKey); + sourceList.addField(newLogKey); logNum++; newLogKey = "/Log" + logNum + logKey; } diff --git a/src/main/electron/main.ts b/src/main/electron/main.ts index f5f2f2d13..ce35cf7e1 100644 --- a/src/main/electron/main.ts +++ b/src/main/electron/main.ts @@ -740,7 +740,11 @@ async function handleHubMessage(window: BrowserWindow, message: NamedMessage) { new MenuItem({ label: "Add from all logs", click() { - sendMessage(window, "add-from-all-logs",state.logKey); + // console.log("legend:",message); + sendMessage(window, "add-from-all-logs", { + logKey: state.logKey, + uuid:message.data.uuid + }); respond(); } }) diff --git a/src/shared/log/LogUtil.ts b/src/shared/log/LogUtil.ts index f10108a20..efbfa603f 100644 --- a/src/shared/log/LogUtil.ts +++ b/src/shared/log/LogUtil.ts @@ -113,10 +113,10 @@ export function findKey(log: Log, search: string[]): string | undefined { } export function keyPresent(log: Log, search: string[]): boolean { - console.log("search",search); + // console.log("search",search); let fieldKeys = log.getFieldKeys(); - console.log("fieldKeys",fieldKeys); + // console.log("fieldKeys",fieldKeys); let found = false; for (const key of search) { found = fieldKeys.includes(key); From 6168a27950fdf6f9912e017c2dfdbb8b696500de Mon Sep 17 00:00:00 2001 From: OrenMice Date: Thu, 23 Apr 2026 17:22:13 +0300 Subject: [PATCH 09/11] removed prints --- src/hub/controllers/LineGraphController.ts | 9 --------- src/main/electron/main.ts | 1 - src/shared/log/LogUtil.ts | 11 ----------- 3 files changed, 21 deletions(-) diff --git a/src/hub/controllers/LineGraphController.ts b/src/hub/controllers/LineGraphController.ts index 4fb291173..cd1b5f55a 100644 --- a/src/hub/controllers/LineGraphController.ts +++ b/src/hub/controllers/LineGraphController.ts @@ -345,24 +345,16 @@ export default class LineGraphController implements TabController { addFromAllLogs(data?: any) { let uuid = typeof data.uuid === "string" ? data.uuid as string : ""; let sourceList: SourceList; - console.log("UUID/org",uuid); - console.log("UUID/right",this.rightSourceList.getUUID()); - console.log("UUID/left",this.leftSourceList.getUUID()); - if (uuid.match(this.rightSourceList.getUUID())) { sourceList = this.rightSourceList; - console.log("right"); } else if(uuid.match(this.leftSourceList.getUUID())){ sourceList = this.leftSourceList; - console.log("left"); } else if(uuid.match(this.discreteSourceList.getUUID())){ sourceList = this.discreteSourceList; - console.log("middle"); } else { - console.log("nooo") return; } @@ -373,7 +365,6 @@ export default class LineGraphController implements TabController { let logNum = 1; newLogKey = "/Log" + logNum + logKey; while (keyPresent(window.log, [newLogKey])) { - // console.log("data:", newLogKey); if(!existingKeys.includes(newLogKey)) sourceList.addField(newLogKey); logNum++; diff --git a/src/main/electron/main.ts b/src/main/electron/main.ts index ce35cf7e1..20140eedf 100644 --- a/src/main/electron/main.ts +++ b/src/main/electron/main.ts @@ -740,7 +740,6 @@ async function handleHubMessage(window: BrowserWindow, message: NamedMessage) { new MenuItem({ label: "Add from all logs", click() { - // console.log("legend:",message); sendMessage(window, "add-from-all-logs", { logKey: state.logKey, uuid:message.data.uuid diff --git a/src/shared/log/LogUtil.ts b/src/shared/log/LogUtil.ts index efbfa603f..f81ce702e 100644 --- a/src/shared/log/LogUtil.ts +++ b/src/shared/log/LogUtil.ts @@ -113,25 +113,14 @@ export function findKey(log: Log, search: string[]): string | undefined { } export function keyPresent(log: Log, search: string[]): boolean { - // console.log("search",search); let fieldKeys = log.getFieldKeys(); - // console.log("fieldKeys",fieldKeys); let found = false; for (const key of search) { found = fieldKeys.includes(key); if (found) break; } - // for (let i = 0; i < fieldKeys.length && found != true; i++) { - // let unmerged = removeMergePrefix(fieldKeys[i]); - // let searchIndex: number; - // if ((searchIndex = search.indexOf(unmerged)) !== -1) { - // found = true; - // } else if (unmerged.startsWith("/") && (searchIndex = search.indexOf(unmerged.slice(1))) !== -1) { - // found = true; - // } - // } return found; } From ab7be90eb280d71b77e08c5cdf20f899dc2360aa Mon Sep 17 00:00:00 2001 From: OrenMice Date: Thu, 23 Apr 2026 17:38:03 +0300 Subject: [PATCH 10/11] cleaned up --- src/hub/controllers/LineGraphController.ts | 4 +--- src/shared/log/Log.ts | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/hub/controllers/LineGraphController.ts b/src/hub/controllers/LineGraphController.ts index cd1b5f55a..d8fb97a58 100644 --- a/src/hub/controllers/LineGraphController.ts +++ b/src/hub/controllers/LineGraphController.ts @@ -5,12 +5,11 @@ // license that can be found in the LICENSE file // at the root directory of this project. -import { string } from "mathjs"; import { ensureThemeContrast } from "../../shared/Colors"; import LineGraphFilter from "../../shared/LineGraphFilter"; import { SelectionMode } from "../../shared/Selection"; import { SourceListState } from "../../shared/SourceListConfig"; -import { AKIT_TIMESTAMP_KEYS, getEnabledKey, getLogValueText, findKey, keyPresent } from "../../shared/log/LogUtil"; +import { AKIT_TIMESTAMP_KEYS, getEnabledKey, getLogValueText, keyPresent } from "../../shared/log/LogUtil"; import { LogValueSetNumber } from "../../shared/log/LogValueSets"; import { LineGraphRendererCommand, @@ -341,7 +340,6 @@ export default class LineGraphController implements TabController { return false; } - /** Temporary handler for the "Add from all logs" action. */ addFromAllLogs(data?: any) { let uuid = typeof data.uuid === "string" ? data.uuid as string : ""; let sourceList: SourceList; diff --git a/src/shared/log/Log.ts b/src/shared/log/Log.ts index 9c3c24ac0..b19a8e55f 100644 --- a/src/shared/log/Log.ts +++ b/src/shared/log/Log.ts @@ -104,7 +104,6 @@ export default class Log { }); } - /** Adjusts the timestamp range based on a known timestamp. */ updateRangeWithTimestamp(timestamp: number) { if (this.timestampRange === null) { From f31d2b949eaa4a40b18882c81561e8d4e4820c60 Mon Sep 17 00:00:00 2001 From: OrenMice Date: Thu, 23 Apr 2026 17:50:03 +0300 Subject: [PATCH 11/11] formated --- src/hub/Tabs.ts | 1 - src/hub/controllers/LineGraphController.ts | 21 ++++++------ .../controllers/LineGraphController_Config.ts | 16 ++++----- src/main/electron/main.ts | 34 +++++++++---------- src/shared/log/LogUtil.ts | 4 +-- 5 files changed, 36 insertions(+), 40 deletions(-) diff --git a/src/hub/Tabs.ts b/src/hub/Tabs.ts index 80a2f18ea..d3159530f 100644 --- a/src/hub/Tabs.ts +++ b/src/hub/Tabs.ts @@ -699,7 +699,6 @@ export default class Tabs { (this.tabList[this.selectedTab].controller as LineGraphController).addFromAllLogs(data); } } - /** Switches the selected camera for the selected 3D field. */ set3DCamera(index: number) { diff --git a/src/hub/controllers/LineGraphController.ts b/src/hub/controllers/LineGraphController.ts index d8fb97a58..d8dcb100f 100644 --- a/src/hub/controllers/LineGraphController.ts +++ b/src/hub/controllers/LineGraphController.ts @@ -341,30 +341,29 @@ export default class LineGraphController implements TabController { } addFromAllLogs(data?: any) { - let uuid = typeof data.uuid === "string" ? data.uuid as string : ""; + let uuid = typeof data.uuid === "string" ? (data.uuid as string) : ""; let sourceList: SourceList; if (uuid.match(this.rightSourceList.getUUID())) { sourceList = this.rightSourceList; - } - else if(uuid.match(this.leftSourceList.getUUID())){ + } else if (uuid.match(this.leftSourceList.getUUID())) { sourceList = this.leftSourceList; - } - else if(uuid.match(this.discreteSourceList.getUUID())){ + } else if (uuid.match(this.discreteSourceList.getUUID())) { sourceList = this.discreteSourceList; - } - else { + } else { return; } - let logKey = typeof data.logKey === "string" ? data.logKey : ""; + let logKey = typeof data.logKey === "string" ? data.logKey : ""; logKey = logKey.replace(/^\/Log[^/]+/, ""); let newLogKey = logKey; - let existingKeys = sourceList.getState().filter((source) => source.logKey.includes(logKey)).map((source)=> source.logKey); + let existingKeys = sourceList + .getState() + .filter((source) => source.logKey.includes(logKey)) + .map((source) => source.logKey); let logNum = 1; newLogKey = "/Log" + logNum + logKey; while (keyPresent(window.log, [newLogKey])) { - if(!existingKeys.includes(newLogKey)) - sourceList.addField(newLogKey); + if (!existingKeys.includes(newLogKey)) sourceList.addField(newLogKey); logNum++; newLogKey = "/Log" + logNum + logKey; } diff --git a/src/hub/controllers/LineGraphController_Config.ts b/src/hub/controllers/LineGraphController_Config.ts index 50746554c..3bd4043c5 100644 --- a/src/hub/controllers/LineGraphController_Config.ts +++ b/src/hub/controllers/LineGraphController_Config.ts @@ -37,7 +37,7 @@ export const LineGraphController_NumericConfig: SourceListConfig = { { key: "bold", display: "Bold" }, { key: "verybold", display: "Very Bold" } ] - }, + }, { key: "AddFromLogs", display: "Add from all logs ", @@ -74,8 +74,8 @@ export const LineGraphController_NumericConfig: SourceListConfig = { { key: "verybold", display: "Very Bold" } ] }, - - { + + { key: "AddFromLogs", display: "Add from all logs ", showInTypeName: false, @@ -110,8 +110,8 @@ export const LineGraphController_NumericConfig: SourceListConfig = { { key: "bold", display: "Large" } ] }, - - { + + { key: "AddFromLogs", display: "Add from all logs ", showInTypeName: false, @@ -145,7 +145,7 @@ export const LineGraphController_DiscreteConfig: SourceListConfig = { showInTypeName: false, values: GraphColors }, - { + { key: "AddFromLogs", display: "Add from all logs ", showInTypeName: false, @@ -154,7 +154,7 @@ export const LineGraphController_DiscreteConfig: SourceListConfig = { { key: "on", display: "On" } ] } - ], + ] }, { key: "graph", @@ -171,7 +171,7 @@ export const LineGraphController_DiscreteConfig: SourceListConfig = { showInTypeName: false, values: GraphColors }, - { + { key: "AddFromLogs", display: "Add from all logs ", showInTypeName: false, diff --git a/src/main/electron/main.ts b/src/main/electron/main.ts index 20140eedf..4504ad1fc 100644 --- a/src/main/electron/main.ts +++ b/src/main/electron/main.ts @@ -556,7 +556,7 @@ async function handleHubMessage(window: BrowserWindow, message: NamedMessage) { rlogDataArrays[windowId] = new Uint8Array(); rlogSockets[windowId].on("data", (data) => { - appendArray(data); + appendArray(data); if (rlogSocketTimeouts[windowId] !== null) clearTimeout(rlogSocketTimeouts[windowId]); rlogSocketTimeouts[windowId] = setTimeout(() => { rlogSockets[windowId]?.destroy(); @@ -742,8 +742,8 @@ async function handleHubMessage(window: BrowserWindow, message: NamedMessage) { click() { sendMessage(window, "add-from-all-logs", { logKey: state.logKey, - uuid:message.data.uuid - }); + uuid: message.data.uuid + }); respond(); } }) @@ -778,20 +778,20 @@ async function handleHubMessage(window: BrowserWindow, message: NamedMessage) { }; if (currentTypeConfig.options.length === 1) { let optionConfig = currentTypeConfig.options[0]; - optionConfig.values.forEach((optionValue) => { - menu.append( - new MenuItem({ - label: optionValue.display, - type: "checkbox", - checked: optionValue.key === state.options[optionConfig.key], - icon: getIcon(optionValue.key), - click() { - state.options[optionConfig.key] = optionValue.key; - respond(); - } - }) - ); - }); + optionConfig.values.forEach((optionValue) => { + menu.append( + new MenuItem({ + label: optionValue.display, + type: "checkbox", + checked: optionValue.key === state.options[optionConfig.key], + icon: getIcon(optionValue.key), + click() { + state.options[optionConfig.key] = optionValue.key; + respond(); + } + }) + ); + }); } else { currentTypeConfig.options.forEach((optionConfig) => { appendOptionItem(optionConfig); diff --git a/src/shared/log/LogUtil.ts b/src/shared/log/LogUtil.ts index f81ce702e..3e5b2a89a 100644 --- a/src/shared/log/LogUtil.ts +++ b/src/shared/log/LogUtil.ts @@ -113,13 +113,11 @@ export function findKey(log: Log, search: string[]): string | undefined { } export function keyPresent(log: Log, search: string[]): boolean { - let fieldKeys = log.getFieldKeys(); let found = false; for (const key of search) { found = fieldKeys.includes(key); - if (found) - break; + if (found) break; } return found; }